From: Richard Henderson Date: Fri, 1 Feb 2008 18:58:21 +0000 (-0800) Subject: re PR c/34993 (ICE with attribute for array with unknown bound) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6faf32a11adcc724449c57950428ff344291b93;p=thirdparty%2Fgcc.git re PR c/34993 (ICE with attribute for array with unknown bound) PR c/34993 * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN for unbounded arrays. From-SVN: r132049 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 405c00155253..9d1a04557e47 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-01-31 Richard Henderson + + PR c/34993 + * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN + for unbounded arrays. + 2008-01-31 Andreas Krebbel * config/s390/fixdfdi.h (__fixunstfdi, __fixtfdi): Rearrange diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34993.c b/gcc/testsuite/gcc.c-torture/compile/pr34993.c new file mode 100644 index 000000000000..ced4d5646c16 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr34993.c @@ -0,0 +1,5 @@ +/* PR c/34993 */ + +/* { dg-do compile } */ + +typedef int x[] __attribute((may_alias)); diff --git a/gcc/tree.c b/gcc/tree.c index e537e9cd3141..6541344f2e5d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3288,8 +3288,9 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals) hashcode = type_hash_list (TYPE_ARG_TYPES (ntype), hashcode); break; case ARRAY_TYPE: - hashcode = iterative_hash_object (TYPE_HASH (TYPE_DOMAIN (ntype)), - hashcode); + if (TYPE_DOMAIN (ntype)) + hashcode = iterative_hash_object (TYPE_HASH (TYPE_DOMAIN (ntype)), + hashcode); break; case INTEGER_TYPE: hashcode = iterative_hash_object