From: Jakub Jelinek Date: Tue, 22 Jan 2008 16:18:14 +0000 (+0100) Subject: re PR c++/34917 (ICE with const vector) X-Git-Tag: releases/gcc-4.3.0~479 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42a89d2d5484ad7d68071cc7c1cbc8c759ac783d;p=thirdparty%2Fgcc.git re PR c++/34917 (ICE with const vector) 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. From-SVN: r131726 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc76be76da41..a720103fb859 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-01-22 Jakub Jelinek + + PR c++/34917 + * tree.c (build_type_attribute_qual_variant): Call + build_qualified_type if attributes are equal, but quals are not. + 2008-01-22 Manuel Lopez-Ibanez PR 32102 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9a6eb68daab2..7f0c716a0698 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-01-22 Jakub Jelinek + + PR c++/34917 + * g++.dg/ext/vector12.C: New test. + 2008-01-22 Manuel Lopez-Ibanez PR 32102 diff --git a/gcc/testsuite/g++.dg/ext/vector12.C b/gcc/testsuite/g++.dg/ext/vector12.C new file mode 100644 index 000000000000..e0b6d2ba6321 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector12.C @@ -0,0 +1,4 @@ +// PR c++/34917 +// { dg-do compile } + +const int i __attribute ((vector_size (8))) = {}; diff --git a/gcc/tree.c b/gcc/tree.c index 4757cbccc137..b6b3eef26e19 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3735,6 +3735,8 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals) ttype = build_qualified_type (ntype, quals); } + else if (TYPE_QUALS (ttype) != quals) + ttype = build_qualified_type (ttype, quals); return ttype; }