optimization/10185: [3.3/3.4 regression] Wrong code with 3-int-structs & optimization
bangerth@dealii.org
bangerth@dealii.org
Fri Mar 21 16:56:00 GMT 2003
Old Synopsis: Wrong code with 3-int-structs & optimization
New Synopsis: [3.3/3.4 regression] Wrong code with 3-int-structs & optimization
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Mar 21 15:40:24 2003
State-Changed-Why:
Confirmed, a regression on 3.3 and mainline w.r.t. 3.2.2.
Here's a slightly simpler code:
--------------------
typedef struct {
int x1, dummy1, dummy2;
} X;
void barrier (int *dummy) {}
main ()
{
static X x[] = {{1}, {2}, {5}};
int i=3, flag=0;
barrier(&i);
while (i--)
if (x[i].x1 == 2) // should trigger for i==1
flag = 1;
if (flag != 1)
abort ();
}
-------------------------------
The abort() shouldn't be triggered, but is if compiled
with -O2 in 3.3 and mainline:
g/x> /home/bangerth/bin/gcc-3.2.2-pre/bin/gcc -O2 x.c ; ./a.out
g/x> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -O2 x.c ; ./a.out
Aborted
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -O2 x.c ; ./a.out
Aborted
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10185
More information about the Gcc-bugs
mailing list