#include <string> struct foobar { std::string s; }; int main(int argc, char **argv) { foobar fb; fb = (foobar) { "abcd" }; return 0; } ----- [mr_w@mravojed ~/build/xtest] $ /usr/local/gcc/3.3.2/bin/g++ -v -save-temps xt9. cpp Reading specs from /usr/local/gcc/3.3.2/lib/gcc-lib/i386-redhat-linux/3.3. 2/specs Configured with: ../configure --prefix=/usr/local/gcc/3.3.2 --infodir=/usr/local/gcc/3.3.2/share/info --mandir=/usr/local/gcc/3.3. 2/share/man --disable-static --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,f77,objc,java,ksi --enable-c99 --enable-long-long --enable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x i386-redhat-linux Thread model: posix gcc version 3.3.2 (PLD Linux) /usr/local/gcc/3.3.2/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1plus -E -D__GNUG__=3 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -D_GNU_SOURCE xt9.cpp xt9.ii ignoring nonexistent directory "/usr/local/gcc/3.3.2/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/gcc/3.3.2/include/c++/3.3.2 /usr/local/gcc/3.3.2/include/c++/3.3.2/i386-redhat-linux /usr/local/gcc/3.3.2/include/c++/3.3.2/backward /usr/local/include /usr/local/gcc/3.3.2/include /usr/local/gcc/3.3.2/lib/gcc-lib/i386-redhat-linux/3.3.2/include /usr/include End of search list. /usr/local/gcc/3.3.2/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1plus -fpreprocessed xt9.ii -quiet -dumpbase xt9.cpp -auxbase xt9 -version -o xt9.s GNU C++ version 3.3.2 (PLD Linux) (i386-redhat-linux) compiled by GNU C version 3.3.2 (PLD Linux). GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31913 g++: Internal error: Segmentation fault (program cc1plus) Please submit a full bug report. See <URL:http://bugs.pld.org.pl/> for instructions.
Confirmed. This seems to go into an infinite loop with 3.3 and mainline. I don't presently have the time to track it down, just wanted to confirm it. W.
Indeed. Crashes 3.3.2, but not 3.3.1 or mainline. Here's a reduced code snippet: =============================================== struct A { A(); A(const A&); A(int); }; struct B { A a; }; void foo() { B b; b = (B){0}; } =============================================== According to Phil's tester, the regression was introduced between 2003-10-14-3.3 (#246) and 2003-10-15-3.3 (#247).
Sorry, I just checked with an outdate version of mainline. The program indeed crashes gcc 3.3.2 and mainline.
Jason, I suspect your patch http://gcc.gnu.org/ml/gcc-cvs/2003-10/msg00551.html as being responsible for the regression. (I can't check right now, though.) Could you please have a look anyway?
Subject: Bug 12726 CVSROOT: /cvs/gcc Module name: gcc Changes by: jason@gcc.gnu.org 2003-10-23 06:40:52 Added files: gcc/testsuite/g++.dg/ext: complit2.C Log message: PR c++/12726 * tree.c (build_target_expr_with_type): Don't call force_rvalue for CONSTRUCTORs. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/complit2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 12726 CVSROOT: /cvs/gcc Module name: gcc Changes by: jason@gcc.gnu.org 2003-10-23 06:41:31 Modified files: gcc/cp : ChangeLog tree.c Log message: PR c++/12726 * tree.c (build_target_expr_with_type): Don't call force_rvalue for CONSTRUCTORs. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3742&r2=1.3743 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.353&r2=1.354
Only a 3.2.3 regression now.
Typo in Jason's comment: It's a 3.3.2-only regression now!
Subject: Bug 12726 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: jason@gcc.gnu.org 2003-10-23 10:48:06 Modified files: gcc/cp : ChangeLog tree.c Log message: PR c++/12726 * tree.c (build_target_expr_with_type): Don't call force_rvalue for CONSTRUCTORs. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.218&r2=1.3076.2.219 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.307.2.5&r2=1.307.2.6
Fixed for 3.3.3 and 3.4.
*** Bug 12765 has been marked as a duplicate of this bug. ***
Subject: Bug 12726 CVSROOT: /cvs/gcc Module name: gcc Changes by: reichelt@gcc.gnu.org 2003-11-03 21:29:35 Modified files: gcc/testsuite : ChangeLog gcc/testsuite/g++.dg/ext: complit2.C Log message: PR c++/12726 * g++.dg/ext/complit2.C: Replace test with self-contained version. * ChangeLog: Add missing first entry for above test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3166&r2=1.3167 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/complit2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
*** Bug 13192 has been marked as a duplicate of this bug. ***
*** Bug 13281 has been marked as a duplicate of this bug. ***
*** Bug 13235 has been marked as a duplicate of this bug. ***