https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95097
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|85316 | Severity|normal |enhancement --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The problem is if (f.x) gets lowered too early. This is not directly a VPR issue either. Changing the code slightly: #include <stdint.h> struct foo { uint32_t x:20; }; int bar(struct foo f) { uint32_t y = (uint32_t)f.x; if (y) { y *= 4096; if (y<200) return 1; else return 2; } return 3; } GCC is able to optimize it. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316 [Bug 85316] [meta-bug] VRP range propagation missed cases