*BSD News Article 14105


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!uunet!enterpoop.mit.edu!ai-lab!hal.gnu.ai.mit.edu!not-for-mail
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
Newsgroups: comp.os.386bsd.bugs
Subject: Re: Gcc 2.3.3 bug ?
Date: 6 Apr 1993 15:21:16 -0400
Organization: dis
Lines: 34
Message-ID: <1psl7c$1pj1@hal.gnu.ai.mit.edu>
References: <1993Apr6.154454.22346@cm.cf.ac.uk>
NNTP-Posting-Host: hal.ai.mit.edu


In article <1993Apr6.154454.22346@cm.cf.ac.uk> paul@isl.cf.ac.uk (Paul)
writes:
>
> main()
> {  
>     long int Domain_Class[253][229][2];
> }

You are obvious overflowing your process's stack limit.

> 0x71 in main () (breaks.c line 2)
> 2       (breaks.c)
> (gdb) disass
> Dump of assembler code from 0x68 to 0x78:
> 0x68 <main>:    pushl  %ebp
> 0x69 <main+1>:  movl   %esp,%ebp
> 0x6b <main+3>:  subl   $0x71288,%esp
> 0x71 <main+9>:  call   0xf8
> 0x76 <main+14>: leave  
> 0x77 <main+15>: ret    
> End of assembler dump.

Since the function does nothing, it would seem like the step of setting
up the variable on the stack should be omitted.  In this case, the
`defer-pop' optimization and the implicit call to __main() (for C++
constructors) are getting in the way.

It's not clear that this is really a bug in GCC.

-- 
 \  /   Charles Hannum, mycroft@ai.mit.edu
 /\ \   PGP public key available on request.  MIME, AMS, NextMail accepted.
Scheme  White heterosexual atheist male (WHAM) pride!