crash while compiling
Created attachment 6170 [details] file produced by gcc with option -save-temps gcc building options was: make CFLAGS='-O2 -march=pentium4 -mcpu=pentium4 -msse2 -funroll-all-loops -mpreferred-stack-boundary=4 -mfpmath=sse -malign-double -momit-leaf-frame-pointer -fomit-frame-pointer -fforce-mem -fforce-addr -falign-functions -falign-labels -falign-loops -falign-jumps -frename-registers -fno-cprop-registers -ffast-math' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
Confirmed a regression but I have not reduced it yet.
The testcase is here: ----------------- struct S { template <class T> S(const T &e); }; int operator *(const double, const S &); template <class T> struct X { enum { SIXTY_FOUR=64 }; struct node { unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; void add(const T &obj) {} }; node *head; }; void foo(int &c) { X<int>().head->add(c); } ------------------ g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In instantiation of `X<int>::node': x.cc:20: instantiated from here x.cc:12: internal compiler error: in instantiate_template, at cp/pt.c:8669 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc x.cc: In instantiation of `X<int>::node': x.cc:20: instantiated from here x.cc:12: internal compiler error: in instantiate_template, at cp/pt.c:8671 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. W.
Reduced a little further: struct S { template <class T> S(const T &e); }; int operator *(const double, const S &); template <class T> struct X { enum { SIXTY_FOUR=64 }; struct node { unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; // <-- catching operator* from above? void d() {} }; node *head; }; template struct X<int>;
Subject: Bug 15165 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: mmitchel@gcc.gnu.org 2004-05-23 22:45:13 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: crash19.C Log message: PR c++/15165 * g++.dg/template/crash19.C: New test. PR c++/15165 * g++.dg/template/crash19.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.104&r2=1.3892.2.105 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.25&r2=1.816.2.26 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.181&r2=1.3389.2.182 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash19.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 15165 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2004-05-23 22:48:38 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog pt.c Added files: gcc/testsuite/g++.dg/template: crash19.C Log message: PR c++/15165 * pt.c (instantiate_template): Robustify. PR c++/15165 * g++.dg/template/crash19.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3775&r2=1.3776 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash19.C.diff?cvsroot=gcc&r1=1.1&r2=1.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4055&r2=1.4056 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.853&r2=1.854
Fixed in GCC 3.4.1.
*** Bug 15038 has been marked as a duplicate of this bug. ***
*** Bug 16062 has been marked as a duplicate of this bug. ***