Blame SOURCES/gcc8-pr90756.patch

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