Small testcase demonstrating template-free memory explosion problem.

Mark Mitchell mmitchell@usa.net
Mon Jan 12 22:52:00 GMT 1998


>>>>> "Corey" == Corey Kosak <kosak@cs.cmu.edu> writes:

    >> This test case does not blow up for me with -O2.  It uses less
    >> than 5MB of memory.  It's possible that either you don't have
    >> some patch that I submitted, or that there's a problem on
    >> alpha-dec-osf3.2 that's not visible on i686-pc-linux-gnu.  I'm
    >> not sure where to go from here.

    Corey> Wow, that's really strange!  But indeed, my experience is
    Corey> the same as yours: Using freshly untarred (just egcs-core
    Corey> and egcs-g++) and then compiled egcs-971225 with no
    Corey> additional patches installed:

    Corey> Random thought: could this problem be due to an improper
    Corey> use of alloca() somewhere?  gcc uses alloca() a lot, and
    Corey> this intriguing warning appears in the man page for OSF
    Corey> alloca:

    Corey>                                      Note

    Corey>        The alloca() function requires inclusion of
    Corey> <alloca.h>.  Without this header file, alloca() allocates
    Corey> memory in the heap instead of the stack; this memory is not
    Corey> necessarily freed when the cal- ling routine exits.

This could definitely be the problem.  However, I don't know anything
about OSF.  However, gcc also contains its own definition of alloca,
so I'm not sure. 

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu




More information about the Gcc-bugs mailing list