Machine-independent bug in cse, with analysis.
Jeffrey A Law
law@cygnus.com
Tue Jul 14 04:28:00 GMT 1998
In message <199804180333.NAA04430@discus.anu.edu.au>you write:
>
> Jeff said:
> > Given time and appropriate incentive I could find bugs in every
> > optimization pass in the compiler.
>
> Here's one in CSE :-). It's the last egcs bug that causes the glibc
> test cases to fail on PowerPC. It may be a known bug.
>
> The following program, when compiled under (at least) egcs 1.0.2
> configured for powerpc-unknown-linux-gnu, and under gcc 2.8.1
> configured for sparc-sun-solaris2.6, with either gcc -O2 or
> gcc -O1 -frerun-cse-after-loop, fails with exit code 1. It should
> (and does under plain -O1) succeed. I would expect it appears under
> all configurations, and I seem to remember it being in 2.7.2.1.
>
> static int f(int) __attribute__((const));
> int main()
> {
> int f1, f2, x;
> x = 1; f1 = f(x);
> x = 2; f2 = f(x);
> return f1 == f2 ? 1 : 0;
> }
> static int f(int x) { return x; }
>
> Any const definition for f will do.
This has been fixed :-)
jeff
More information about the Gcc
mailing list