https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110931
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2023-08-07 Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: ``` void foo(void); int l=1000; int main(void) { short t = l; unsigned t1 = t; if (t1 == 0) { #if 1 char b = t1; #else char b = l; #endif if (b != 1) __builtin_unreachable(); foo(); } } ``` Changing 1 to 0 in the #if, shows the missed optimization too.