diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-08-02 15:54:20 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-08-02 19:32:04 -0700 |
commit | ff36932e4d6638e475d5c343c3032728f9925d3f (patch) | |
tree | edecd8aae1d6d6fd5d8e88777ee3d07bf67004fd /gcc/range-op-float.cc | |
parent | 1b53748c61a8b6489ca9a56a25037131335d3cc6 (diff) | |
download | gcc-ff36932e4d6638e475d5c343c3032728f9925d3f.zip gcc-ff36932e4d6638e475d5c343c3032728f9925d3f.tar.gz gcc-ff36932e4d6638e475d5c343c3032728f9925d3f.tar.bz2 |
Fix `~X & X` and `~X | X` patterns
As Jakub noticed in https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626039.html
what I did was not totally correct because sometimes chosing the wrong type.
So to get back to what the original code but keeping around the use of bitwise_inverted_equal_p,
we just need to check if the types of the two catupures are the same type.
Also adds a testcase for the problem Jakub found.
Committed as obvious after a bootstrap and test.
gcc/ChangeLog:
* match.pd (`~X & X`): Check that the types match.
(`~x | x`, `~x ^ x`): Likewise.
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/20230802-1.c: New test.
Diffstat (limited to 'gcc/range-op-float.cc')
0 files changed, 0 insertions, 0 deletions