From 666f7903e0334ef65669277383e4028a4fe9ef0c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 21 Apr 2017 10:51:53 +0200 Subject: [PATCH] re PR c/80468 (ICE on invalid AVX512 code with -m32) PR c/80468 * c-decl.c (finish_declspecs) : 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 | 6 ++++++ gcc/c/c-decl.c | 9 ++++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr80468.c | 10 ++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr80468.c diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ec192216232..143aff92523 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2017-04-21 Jakub Jelinek + + PR c/80468 + * c-decl.c (finish_declspecs) : If int_n_idx is not + enabled, set specs->type to integer_type_node. + 2017-04-03 Jonathan Wakely * c-array-notation.c: Fix typo in comment. diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 53c390c9e48..64a11079a0e 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -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, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 909f258c206..a40f9ffda33 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-21 Jakub Jelinek + + PR c/80468 + * gcc.dg/pr80468.c: New test. + 2017-04-21 Martin Liska PR tree-optimization/66278 diff --git a/gcc/testsuite/gcc.dg/pr80468.c b/gcc/testsuite/gcc.dg/pr80468.c new file mode 100644 index 00000000000..5c312a6289d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr80468.c @@ -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; +} -- 2.30.2