|
|
9805c9 |
2019-07-04 Jakub Jelinek <jakub@redhat.com>
|
|
|
9805c9 |
|
|
|
9805c9 |
PR rtl-optimization/90756
|
|
|
9805c9 |
* explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it
|
|
|
9805c9 |
for VECTOR_TYPE_P.
|
|
|
9805c9 |
|
|
|
9805c9 |
--- gcc/explow.c
|
|
|
9805c9 |
+++ gcc/explow.c
|
|
|
9805c9 |
@@ -892,16 +892,7 @@ promote_ssa_mode (const_tree name, int *punsignedp)
|
|
|
9805c9 |
|
|
|
9805c9 |
tree type = TREE_TYPE (name);
|
|
|
9805c9 |
int unsignedp = TYPE_UNSIGNED (type);
|
|
|
9805c9 |
- machine_mode mode = TYPE_MODE (type);
|
|
|
9805c9 |
-
|
|
|
9805c9 |
- /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */
|
|
|
9805c9 |
- if (mode == BLKmode)
|
|
|
9805c9 |
- {
|
|
|
9805c9 |
- gcc_assert (VECTOR_TYPE_P (type));
|
|
|
9805c9 |
- mode = type->type_common.mode;
|
|
|
9805c9 |
- }
|
|
|
9805c9 |
-
|
|
|
9805c9 |
- machine_mode pmode = promote_mode (type, mode, &unsignedp);
|
|
|
9805c9 |
+ machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
|
|
|
9805c9 |
if (punsignedp)
|
|
|
9805c9 |
*punsignedp = unsignedp;
|
|
|
9805c9 |
|
|
|
9805c9 |
--- /dev/null
|
|
|
9805c9 |
+++ gcc/testsuite/gcc.dg/pr90756.c
|
|
|
9805c9 |
@@ -0,0 +1,26 @@
|
|
|
9805c9 |
+/* PR rtl-optimization/90756 */
|
|
|
9805c9 |
+/* { dg-do compile } */
|
|
|
9805c9 |
+/* { dg-options "-O2 -Wno-psabi" } */
|
|
|
9805c9 |
+/* { dg-additional-options "-mno-sse" { target ia32 } } */
|
|
|
9805c9 |
+
|
|
|
9805c9 |
+typedef float B __attribute__((vector_size(4 * sizeof (float))));
|
|
|
9805c9 |
+typedef unsigned long long C __attribute__((vector_size(4 * sizeof (long long))));
|
|
|
9805c9 |
+typedef short D __attribute__((vector_size(4 * sizeof (short))));
|
|
|
9805c9 |
+B z;
|
|
|
9805c9 |
+void foo (C);
|
|
|
9805c9 |
+C bar (D);
|
|
|
9805c9 |
+B baz ();
|
|
|
9805c9 |
+D qux (B);
|
|
|
9805c9 |
+
|
|
|
9805c9 |
+void
|
|
|
9805c9 |
+quux (int x)
|
|
|
9805c9 |
+{
|
|
|
9805c9 |
+ B n = z, b = z;
|
|
|
9805c9 |
+ while (1)
|
|
|
9805c9 |
+ switch (x)
|
|
|
9805c9 |
+ {
|
|
|
9805c9 |
+ case 0: n = baz (); /* FALLTHRU */
|
|
|
9805c9 |
+ case 1: { B o = n; n = b; b = o; } /* FALLTHRU */
|
|
|
9805c9 |
+ case 2: { D u = qux (b); C v = bar (u); foo (v); }
|
|
|
9805c9 |
+ }
|
|
|
9805c9 |
+}
|