re PR target/13789 ([tree-ssa] ICE on _builtin_expect_addr)
authorRichard Henderson <rth@redhat.com>
Tue, 3 Feb 2004 04:37:29 +0000 (20:37 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 3 Feb 2004 04:37:29 +0000 (20:37 -0800)
        PR target/13789
        * expr.c (store_expr): Use force_operand before emit_move_insn.

From-SVN: r77158

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/gcc.c-torture/compile/20040202-1.c [new file with mode: 0644]

index a467635..8e2f3c1 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-02  Richard Henderson  <rth@redhat.com>
+
+        PR target/13789
+        * expr.c (store_expr): Use force_operand before emit_move_insn.
+
 2004-02-02  Jeff Law  <law@redhat.com>
            Roger Sayle  <roger@eyesopen.com>
 
index 8bf0732..ba27b04 100644 (file)
@@ -4334,7 +4334,11 @@ store_expr (tree exp, rtx target, int want_value)
                         (want_value & 2
                          ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
       else
-       emit_move_insn (target, temp);
+       {
+         temp = force_operand (temp, target);
+         if (temp != target)
+           emit_move_insn (target, temp);
+       }
     }
 
   /* If we don't want a value, return NULL_RTX.  */
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040202-1.c b/gcc/testsuite/gcc.c-torture/compile/20040202-1.c
new file mode 100644 (file)
index 0000000..ba32c80
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR target/13789 */
+/* Failed on SPARC due to a bug in store_expr.  */
+
+void *foo (void *c)
+{
+  void *a = __builtin_extract_return_addr (c);
+  return a;
+}