https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103083
Bug ID: 103083 Summary: Wrong code due to ipa-cp's value range propagation Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- struct b {int b;}; struct a {int a; struct b b;}; long i; __attribute__ ((noinline)) static void test2 (struct b *b) { if (((int)b)&4) __builtin_abort (); } __attribute__ ((noinline)) static void test (struct a *a) { test2(a? &a->b : 0); } void main() { test(0); } aborts when built with -O2.