Summary: | [3.3/3.4 Regression] ICE: g++ with bad struct initializer. | ||
---|---|---|---|
Product: | gcc | Reporter: | Kristian Hogsberg <krh> |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | gcc-bugs |
Priority: | P1 | Keywords: | ice-on-valid-code |
Version: | 3.2.2 | ||
Target Milestone: | 3.3.2 | ||
Host: | i386-redhat-linux | Target: | i386-redhat-linux |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2003-08-08 12:08:09 |
Description
Kristian Hogsberg
2003-08-08 09:42:39 UTC
It did not crash on 2.95.3 (and was accepted). I can confirm this in 3.3.1 (20030707) and the mainline (20030807). Even 2.97 20001231 crash (according to Phil's regression hunter) and 2.96 (20000731 RedHat) crashes. This is really ice-on-invalid-code, since a constant expression may contain addresses only with constant offsets. I can't reproduce the ICE with mainline 20030802 on alphaev68-unknown-linux-gnu. Actually it is valid as in C++ you can have initializers which are not constant. I also can confirm this on powerpc-apple-darwin6.6 on the mainline (20030806). Subject: Bug 11852 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-09-07 23:48:34 Modified files: gcc : varasm.c ChangeLog gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/init: struct1.C Log message: PR c++/11852 * varasm.c (initializer_constant_valid_p): Correct logic for CONSTRUCTORs. PR c++/11852 * g++.dg/init/struct1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.381&r2=1.382 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1000&r2=2.1001 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3035&r2=1.3036 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/struct1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 Subject: Bug 11852 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-09-07 23:51:05 Modified files: gcc : varasm.c ChangeLog gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/init: struct1.C Log message: PR c++/11852 * varasm.c (initializer_constant_valid_p): Correct logic for CONSTRUCTORs. PR c++/11852 * g++.dg/init/struct1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.324.2.7&r2=1.324.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.728&r2=1.16114.2.729 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.271&r2=1.2261.2.272 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/struct1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 Fixed in GCC 3.3.2, GCC 3.4. |