The following valid code snippet triggers an ICE since GCC 4.2.0: ===================================================== const int i __attribute((vector_size(8))) = {}; ===================================================== bug.cc:1: internal compiler error: in start_decl, at cp/decl.c:4130 Please submit a full bug report, [etc.]
This is a blocker for me. Confirmed.
Confirmed gcc 4.2.2. test.cc ===================================================== const int i __attribute((vector_size(8))) = {}; int main(int argc, char **argv) { return 0; } ===================================================== test.cc:1: internal compiler error: in start_decl, at cp/decl.c:4018 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Testing a fix. --- tree.c.jj124 2008-01-22 10:46:20.000000000 +0100 +++ tree.c 2008-01-22 10:46:20.000000000 +0100 @@ -3735,6 +3735,8 @@ build_type_attribute_qual_variant (tree ttype = build_qualified_type (ntype, quals); } + else if (TYPE_QUALS (ttype) != quals) + ttype = build_qualified_type (ttype, quals); return ttype; } build_type_attribute_qual_variant wasn't changing quals to the requested ones if the attributes are equal. This seems to only make a difference for vectors, as build_type_attribute_qual_variant is static in tree.c and only called by build_type_attribute_variant which will have always equal quals and make_vector_type.
Subject: Bug 34917 Author: jakub Date: Tue Jan 22 16:18:14 2008 New Revision: 131726 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131726 Log: PR c++/34917 * tree.c (build_type_attribute_qual_variant): Call build_qualified_type if attributes are equal, but quals are not. * g++.dg/ext/vector12.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/vector12.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c
Fixed on the trunk.
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
4.2.4 is being released, changing milestones to 4.2.5.
Closing 4.2 branch, fixed in 4.3.