Blob Blame History Raw
2019-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/90139
	* tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return
	assign_temp instead of gen_reg_rtx.

--- /dev/null
+++ gcc/testsuite/gcc.c-torture/compile/pr90139.c
@@ -0,0 +1,20 @@
+/* PR middle-end/90139 */
+
+typedef float __attribute__((vector_size (sizeof (float)))) V;
+void bar (int, V *);
+int l;
+
+void
+foo (void)
+{
+  V n, b, o;
+  while (1)
+    switch (l)
+      {
+      case 0:
+	o = n;
+	n = b;
+	b = o;
+	bar (1, &o);
+      }
+}
--- gcc/tree-outof-ssa.c
+++ gcc/tree-outof-ssa.c
@@ -653,6 +653,8 @@ get_temp_reg (tree name)
   tree type = TREE_TYPE (name);
   int unsignedp;
   machine_mode reg_mode = promote_ssa_mode (name, &unsignedp);
+  if (reg_mode == BLKmode)
+    return assign_temp (type, 0, 0);
   rtx x = gen_reg_rtx (reg_mode);
   if (POINTER_TYPE_P (type))
     mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type)));