Re: [PATCH 2/2] Improve do_store_flag for comparing single bit against that bit

2023-05-19 Thread Jeff Law via Gcc-patches
On 5/18/23 20:14, Andrew Pinski via Gcc-patches wrote: 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_unreach

[PATCH 2/2] Improve do_store_flag for comparing single bit against that bit

2023-05-18 Thread Andrew Pinski via Gcc-patches
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 han