https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66980

            Bug ID: 66980
           Summary: [graphite] -floop-nest-optimize produces wrong code
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: spop at gcc dot gnu.org
  Target Milestone: ---

$ cat s.c
void foo(unsigned char *in, unsigned char *out, int w, int h)
{
  unsigned int i, j;
  for (i = 0; i < 3*w*h; i++)
    for (j = 0; j < 3*w*h; j++)
      out[i * w + j] = in[(i * w + j)*3] + in[(i * w + j)*3 + 1] + in[(i * w +
j)*3 + 2];
}

$ gcc -O3 -floop-nest-optimize -S s.c -o -
[...]
foo:
        ret
[...]

Reply via email to