This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -O2 -funroll-loops on LinuxPPC hangs gcc
- To: Andy Ritger <ritger at wolfram dot com>
- Subject: Re: -O2 -funroll-loops on LinuxPPC hangs gcc
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: 14 Aug 2000 00:47:02 -0700
- CC: gcc-bugs at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10005171519550.5159-200000@a.wolfram.com>
Andy Ritger <ritger@wolfram.com> writes:
Hi Andy,
> Given the following source file:
> agrippa.wolfram.com [35] linux-ppc> cat test.c
>
> #include <stdio.h>
>
> int main ()
> {
> long i = 1000000; // <--- number of loops
> double c0, c1;
>
> c0 = c1 = 1.0;
>
> while (--i)
> {
> c0 += c0 * c0;
> c1 += c1 * c1; // <--- this line
> }
>
> c0 = c0 + c1;
> printf ("c0 = %f\n", c0);
>
> return (0);
> }
>
>
> Compiled with:
>
> gcc -funroll-loops -O2 test.c -o test
>
> works fine.
>
> But if you comment out the line labeled "// <--- this line" and compile
> using the same command as above, then cc1 quickly consumes all system
> memory and eventually crashes the machine.
Tip for future bug reports: Always provide the code that actually
causes the problem. Providing some other code, plus instructions
on how to change it to create the code that causes the problem,
is not as useful. (At least you did provide preprocessed source
below.)
Anyway, I can reproduce your problem with gcc 2.95.2, but not with
the current development gcc, so I hope the problem has been fixed.
--
- Geoffrey Keating <geoffk@cygnus.com>