This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Machine-independent bug in cse, with analysis.
- To: Geoffrey KEATING <geoffk at discus dot anu dot edu dot au>
- Subject: Re: Machine-independent bug in cse, with analysis.
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 14 Jul 1998 02:38:36 -0600
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
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