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 tree-optimization/17252] New: [3.5 Regression] LIM can create wrong code because of aliasing


Compile the following with -O2 --param lim-expensive=1 and notice that the load of a is pulled out of 
the loop but we cannot do that because we are accessing what a points to inside the loop and since 
char can alias anything (in C) this is a bug.

char *a;
void g()
{
  int i;
  for(i=0;i<10;i++)a[i] = 0;
}
void h()
{
  a = (char*)&a;
}

-- 
           Summary: [3.5 Regression] LIM can create wrong code because of
                    aliasing
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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