Possible C compiler bug

Andrew Pinski pinskia@physics.uc.edu
Tue Feb 22 00:09:00 GMT 2005


On Feb 21, 2005, at 3:28 PM, Bob Green wrote:

> I get a segmentation fault when a C program allocates
> an 8MB array in the subroutine "main()".  The
> specifics are listed below.  Any help understanding
> if this is a bug would be greatly appreciated.

No this is not a bug, you are allocating the 8MB on the stack.
The stack size on ppc-darwin before 7 is only 512K though the stacksize
on ppc-darwin after 7 is 8M, you will still not be able to run the 
program
as there is overhead.
You need to either change the stack size limit or allocate it on the 
heap.

-- Pinski



More information about the Gcc-bugs mailing list