[Bug ipa/103083] New: Wrong code due to ipa-cp's value range propagation

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 4 15:19:15 GMT 2021


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.


More information about the Gcc-bugs mailing list