This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -O2 -funroll-loops on LinuxPPC hangs gcc


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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]