]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/80468 (ICE on invalid AVX512 code with -m32)
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 Apr 2017 08:51:53 +0000 (10:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 21 Apr 2017 08:51:53 +0000 (10:51 +0200)
PR c/80468
* c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not
enabled, set specs->type to integer_type_node.

* gcc.dg/pr80468.c: New test.

From-SVN: r247052

gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr80468.c [new file with mode: 0644]

index ec1922162329d17624753f6af2663d478b2da8f2..143aff925236a2b95e9021127fc504d7d711851e 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/80468
+       * c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not
+       enabled, set specs->type to integer_type_node.
+
 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
 
        * c-array-notation.c: Fix typo in comment.
index 53c390c9e48d939330c555b12bddeea39235c14f..64a11079a0e3c1c9694c0bc67b2648011f3cf105 100644 (file)
@@ -10929,9 +10929,12 @@ finish_declspecs (struct c_declspecs *specs)
     case cts_int_n:
       gcc_assert (!specs->long_p && !specs->short_p && !specs->long_long_p);
       gcc_assert (!(specs->signed_p && specs->unsigned_p));
-      specs->type = (specs->unsigned_p
-                    ? int_n_trees[specs->int_n_idx].unsigned_type
-                    : int_n_trees[specs->int_n_idx].signed_type);
+      if (! int_n_enabled_p[specs->int_n_idx])
+       specs->type = integer_type_node;
+      else
+       specs->type = (specs->unsigned_p
+                      ? int_n_trees[specs->int_n_idx].unsigned_type
+                      : int_n_trees[specs->int_n_idx].signed_type);
       if (specs->complex_p)
        {
          pedwarn (specs->locations[cdw_complex], OPT_Wpedantic,
index 909f258c206e2cf751e342a0a92bede97b34936a..a40f9ffda33ab82af4e90e5ff5cc2d6d322e945c 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/80468
+       * gcc.dg/pr80468.c: New test.
+
 2017-04-21  Martin Liska  <mliska@suse.cz>
 
        PR tree-optimization/66278
diff --git a/gcc/testsuite/gcc.dg/pr80468.c b/gcc/testsuite/gcc.dg/pr80468.c
new file mode 100644 (file)
index 0000000..5c312a6
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR c/80468 */
+/* { dg-do compile { target { ! int128 } } } */
+/* { dg-options "" } */
+
+void
+foo (void)
+{
+  __attribute__ ((__vector_size__ (4 * sizeof (unsigned)))) __int128 b;        /* { dg-error "is not supported on this target" } */
+  0 != b;
+}