This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17252] New: [3.5 Regression] LIM can create wrong code because of aliasing
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2004 19:35:49 -0000
- Subject: [Bug tree-optimization/17252] New: [3.5 Regression] LIM can create wrong code because of aliasing
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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