This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/30787] New: [4.1 Regression] Strength reduction bug


struct S
{
  int *s;
};

void
test (int x, struct S *y)
{
  int i;
  for (i = 0; i < x; i++)
    {
      if (y)
        y->s[i] += 1;
    }
}

int
main ()
{
  test (1, (void *) 0);
  return 0;
}

is miscompiled at -O2 in 4.1.x, works with -O2 -fno-strength-reduction or
-O2 -floop-optimize2, works with 3.2.x, 3.4.x and 4.2.


-- 
           Summary: [4.1 Regression] Strength reduction bug
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
GCC target triplet: x86_64-linux, i?86-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30787


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]