diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-05-18 22:17:07 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-06-04 20:48:32 +0000 |
commit | 6cf856f873c1a2ab39d8fb0a93b5f4505a22feb6 (patch) | |
tree | a10999e359c049553819ea590c2b0ef22f5d450b /gcc/DATESTAMP | |
parent | 908e5ab5c11c64ce92f1aa6e12d571ff5eb9d72a (diff) | |
download | gcc-6cf856f873c1a2ab39d8fb0a93b5f4505a22feb6.zip gcc-6cf856f873c1a2ab39d8fb0a93b5f4505a22feb6.tar.gz gcc-6cf856f873c1a2ab39d8fb0a93b5f4505a22feb6.tar.bz2 |
Improve do_store_flag for comparing single bit against that bit
This is a case which I noticed while working on the previous patch.
Sometimes we end up with `a == CST` instead of comparing against 0.
This happens in the following code:
```
unsigned f(unsigned t)
{
if (t & ~(1<<30)) __builtin_unreachable();
t ^= (1<<30);
return t != 0;
}
```
We should handle the case where the nonzero bits is the same as the
comparison operand.
Changes from v1:
* v2: Updated for the bit extraction changes.
OK? Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* expr.cc (do_store_flag): Improve for single bit testing
not against zero but against that single bit.
Diffstat (limited to 'gcc/DATESTAMP')
0 files changed, 0 insertions, 0 deletions