Blame SOURCES/gcc8-pr90756.patch

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