Hello,

as we noticed there is an new optimization failure about user-defined sections
and loops.

The following code works for me with -O0, but fails with -O2.

extern void abort (void);

static long long start __attribute__ ((section (".my_sec$A"))) = 0;
static long long end __attribute__ ((section (".my_sec$Z"))) = 2;

int main()
{
  long long *p;
  for (p = (&start + 1); p != &end; p++)
    if (*p == 2)
      abort();
  return 0;
}


-- 
           Summary: Optimization failure about user-defined sections
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ktietz at gcc dot gnu dot org
GCC target triplet: x86_64-*-mingw*


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

Reply via email to