This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Small testcase demonstrating template-free memory explosion problem.



Corey --

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

    Corey> I have managed to isolate a half-decent (note:
    Corey> template-free!) test case that will not compile with -O2,
    Corey> given 300M of virtual memory.  I hope it proves helpful.

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> % g++ -v Reading specs from
    Corey> /usr2/aloco/lib/gcc-lib/alpha-dec-osf3.2/egcs-2.91.03/specs
    Corey> gcc version egcs-2.91.03 971225 (gcc-2.8.0) % limit
    Corey> datasize 300M % g++ -O2 big.cc big.cc: In function `int
    Corey> main()': big.cc:59: virtual memory exhausted


    Corey> ------------------------------------------------------------------------

    Corey> class class4_t { public: ~class4_t() {} };

    Corey> class class3_t { public: class4_t x; ~class3_t() { } };


    Corey> class class2_t { public: class3_t x; class2_t () { } };

    Corey> class class1_t { public: class1_t() { class2_t x; } };

    Corey> class class0_t { public: class1_t x; class0_t() { } };

    Corey> int main() { new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; new class0_t; new class0_t; new class0_t; new
    Corey> class0_t; }

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]