]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/43546 (ICE: in assign_stack_local_1, at function.c:353 with -mpreferred...
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Feb 2014 13:20:06 +0000 (14:20 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 13 Feb 2014 13:20:06 +0000 (14:20 +0100)
PR target/43546
* expr.c (compress_float_constant): If x is a hard register,
extend into a pseudo and then move to x.

* gcc.target/i386/pr43546.c: New test.

From-SVN: r207757

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr43546.c [new file with mode: 0644]

index e0293c5096f654a1481574ff6cee16124f79d2cc..d159346e7234e0f2a848079654e7535857b52d81 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/43546
+       * expr.c (compress_float_constant): If x is a hard register,
+       extend into a pseudo and then move to x.
+
 2014-02-13  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * config/s390/s390.c (s390_asm_output_function_label): Fix crash
index f6708da20d9ea0e8920e52e07374af9a6f313371..29ce694704c0d177cae60c562faa51b0c129513a 100644 (file)
@@ -3726,12 +3726,21 @@ compress_float_constant (rtx x, rtx y)
         into a new pseudo.  This constant may be used in different modes,
         and if not, combine will put things back together for us.  */
       trunc_y = force_reg (srcmode, trunc_y);
-      emit_unop_insn (ic, x, trunc_y, UNKNOWN);
+
+      /* If x is a hard register, perform the extension into a pseudo,
+        so that e.g. stack realignment code is aware of it.  */
+      rtx target = x;
+      if (REG_P (x) && HARD_REGISTER_P (x))
+       target = gen_reg_rtx (dstmode);
+
+      emit_unop_insn (ic, target, trunc_y, UNKNOWN);
       last_insn = get_last_insn ();
 
-      if (REG_P (x))
+      if (REG_P (target))
        set_unique_reg_note (last_insn, REG_EQUAL, y);
 
+      if (target != x)
+       return emit_move_insn (x, target);
       return last_insn;
     }
 
index 392986f4f8f0e6ccce6f6dc0e55952b5d0f86e7b..881aa3df2a0c34e913c5677a151957161ccd9f7d 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/43546
+       * gcc.target/i386/pr43546.c: New test.
+
 2014-02-13  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * gcc.target/s390/hotpatch-compile-8.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr43546.c b/gcc/testsuite/gcc.target/i386/pr43546.c
new file mode 100644 (file)
index 0000000..53cb3a0
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/43546 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-additional-options "-mpreferred-stack-boundary=2 -msseregparm -msse" { target ia32 } } */
+
+extern void bar (double);
+
+void
+foo (void)
+{
+  bar (1.0);
+}