Re: patch [RFC] Simple loop runs out of stack at -O1

2005-02-25 Thread Fariborz Jahanian
On Feb 25, 2005, at 1:16 PM, Joe Buck wrote: 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 http://gcc.gnu.

Re: patch [RFC] Simple loop runs out of stack at -O1

2005-02-25 Thread Joe Buck
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 < 1

patch [RFC] Simple loop runs out of stack at -O1

2005-02-25 Thread Fariborz Jahanian
Hi, There gotta be a PR on this because it is so easy to reproduce. Following test case runs out of stack space when gcc tries to compute factorial (159). I have a patch which does two simple things. 1) it rewrites tree_fold_factorial function into its non-recursive version, and 2) it sets a