This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: patch [RFC] Simple loop runs out of stack at -O1
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Fariborz Jahanian <fjahanian at apple dot com>
- Cc: gcc at gcc dot gnu dot org, pop at cri dot ensmp dot fr
- Date: Fri, 25 Feb 2005 13:16:25 -0800
- Subject: Re: patch [RFC] Simple loop runs out of stack at -O1
- References: <1DB96378-876F-11D9-92E0-000393B9ED88@apple.com>
On Fri, Feb 25, 2005 at 12:52:09PM -0800, Fariborz Jahanian wrote:
> There gotta be a PR on this because it is so easy to reproduce.
...
>
> /* bad.c */
> static unsigned int *buffer;
>
> void FUNC (void)
> {
> unsigned int *base;
> int i, j;
>
> for (i = 0; i < 4; i++)
> for (j = 0; j < 1600000; j++)
> *base++ = buffer[j];
> }
>
> % mygccm5 -c -O1 bad.c
> Out of stack space.
> Try running 'limit stacksize unlimited' in the shell to raise its limit.
I duplicated this on a i686-pc-linux-gnu system: the compiler is built
from last night's trunk.
% /usr/localdisk/gcc-cvs/trunk/bin/gcc -c -O1 bad.c
gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Could you please file a PR and attach the proposed patch?