]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/34993 (ICE with attribute for array with unknown bound)
authorRichard Henderson <rth@redhat.com>
Thu, 31 Jan 2008 00:05:19 +0000 (16:05 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 31 Jan 2008 00:05:19 +0000 (16:05 -0800)
        PR c/34993
        * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
        for unbounded arrays.

From-SVN: r131970

gcc/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr34993.c [new file with mode: 0644]
gcc/tree.c

index 783fd914f50858c2df351d8bb8d3c9a7850ab664..2ecebda493e8778b564fa907586f8e00eb71397f 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-30  Richard Henderson  <rth@redhat.com>
+
+       PR c/34993
+       * tree.c (build_type_attribute_qual_variant): Skip TYPE_DOMAIN
+       for unbounded arrays.
+
 2008-01-30  Silvius Rus  <rus@google.com>
 
        * config/i386/xmmintrin.h (_mm_prefetch): Add const to first arg.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34993.c b/gcc/testsuite/gcc.c-torture/compile/pr34993.c
new file mode 100644 (file)
index 0000000..ced4d56
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR c/34993 */
+
+/* { dg-do compile } */
+
+typedef int x[] __attribute((may_alias));
index f61e24bac09c98e3000f50af769b42ccb5835d08..043968cb95f22086879549046810979807a2625f 100644 (file)
@@ -3701,8 +3701,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