On the trunk r128169, configured thusly: $ ../clean/configure --target=armv5tl-montavista-linuxeabi --prefix=/home/daney/mvl_ti/gcj --with-sysroot=/home/daney/mvl_ti/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/target --enable-languages=c,c++ --with-float=soft --disable-java-awt --without-x --disable-jvmpi --enable-__cxa_atexit --disable-sjlj-exceptions I get the following ICE: $ /home/daney/gccsvn/arm-clean/gcc/g++ -B/home/daney/gccsvn/arm-clean/gcc/ -S foo.cc foo.cc: In constructor ‘C::C(int)’: foo.cc:15: internal compiler error: in build2_stat, at tree.c:3110 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. There is no ICE on i686-pc-linux-gnu native build. Test case: ----foo.cc----------- class A { public: virtual ~A(){}; }; class C { public: A *q; public: C(int x) { q = new A[x]; } }; --------------------
This is most likely my fault.
Created attachment 14171 [details] Proposed patch.
I might as well accept the bug as I am testing the fix...
Subject: Bug 33324 Author: daney Date: Sun Sep 9 23:31:35 2007 New Revision: 128312 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128312 Log: PR c++/33324 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR to calculate cookie_ptr. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/init.c
Now fixed by the patch.
Subject: Bug number PR 33324 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00704.html