From: Jakub Jelinek Date: Thu, 4 Jul 2019 04:49:22 +0000 (+0200) Subject: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a59b2e42062f2d00fb44a008cd395d0b9590c631;p=gcc.git re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and s390x) PR rtl-optimization/90756 * explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it for VECTOR_TYPE_P. * gcc.dg/pr90756.c: New test. From-SVN: r273036 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d6758d454c..2cfc446ac34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-04 Jakub Jelinek + + PR rtl-optimization/90756 + * explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it + for VECTOR_TYPE_P. + 2019-07-03 Dennis Zhang * config/aarch64/aarch64.md: Remove redundant constraints from diff --git a/gcc/explow.c b/gcc/explow.c index ba06458ebdc..aea7118af1e 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -892,16 +892,7 @@ promote_ssa_mode (const_tree name, int *punsignedp) tree type = TREE_TYPE (name); int unsignedp = TYPE_UNSIGNED (type); - machine_mode mode = TYPE_MODE (type); - - /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */ - if (mode == BLKmode) - { - gcc_assert (VECTOR_TYPE_P (type)); - mode = type->type_common.mode; - } - - machine_mode pmode = promote_mode (type, mode, &unsignedp); + machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp); if (punsignedp) *punsignedp = unsignedp; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa00f0b1b33..66045e531c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-04 Jakub Jelinek + + PR rtl-optimization/90756 + * gcc.dg/pr90756.c: New test. + 2019-07-04 Chenghua Xu * gcc.target/mips/mips-fmadd.c: Rename to ... diff --git a/gcc/testsuite/gcc.dg/pr90756.c b/gcc/testsuite/gcc.dg/pr90756.c new file mode 100644 index 00000000000..3507aa29e70 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr90756.c @@ -0,0 +1,26 @@ +/* PR rtl-optimization/90756 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wno-psabi" } */ +/* { dg-additional-options "-mno-sse" { target ia32 } } */ + +typedef float B __attribute__((vector_size(4 * sizeof (float)))); +typedef unsigned long long C __attribute__((vector_size(4 * sizeof (long long)))); +typedef short D __attribute__((vector_size(4 * sizeof (short)))); +B z; +void foo (C); +C bar (D); +B baz (); +D qux (B); + +void +quux (int x) +{ + B n = z, b = z; + while (1) + switch (x) + { + case 0: n = baz (); /* FALLTHRU */ + case 1: { B o = n; n = b; b = o; } /* FALLTHRU */ + case 2: { D u = qux (b); C v = bar (u); foo (v); } + } +}