]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR middle-end/90139
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Apr 2019 11:58:11 +0000 (11:58 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Apr 2019 11:58:11 +0000 (11:58 +0000)
* tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return
assign_temp instead of gen_reg_rtx.

* gcc.c-torture/compile/pr90139.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270457 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr90139.c [new file with mode: 0644]
gcc/tree-outof-ssa.c

index d160ddfb72882655a3f79ea09c4cd219f0fdd858..5327dcda6f39a051524751637f7b2f90a8ae8132 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2019-04-19  Christophe Lyon  <christophe.lyon@linaro.org>
 
        PR translation/90118
index 0b5c3439bc93079098a8bc09617b1d121237c8c7..7458b4cc2ef9c3d11ba83658cb683622270e19ed 100644 (file)
@@ -1,5 +1,8 @@
 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/90139
+       * gcc.c-torture/compile/pr90139.c: New test.
+
        PR c++/90138
        * g++.dg/template/pr90138.C: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr90139.c b/gcc/testsuite/gcc.c-torture/compile/pr90139.c
new file mode 100644 (file)
index 0000000..f3d99f0
--- /dev/null
@@ -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);
+      }
+}
index 6cac55bde062845a8b6459cbc43682ba86545b10..713b0b0666c7f662277a0cb9ad5533479ce37e2d 100644 (file)
@@ -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)));