ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly if the RHS isn't...
authorRoger Sayle <roger@eyesopen.com>
Sun, 29 May 2005 18:56:42 +0000 (18:56 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 29 May 2005 18:56:42 +0000 (18:56 +0000)
* ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly
if the RHS isn't suitable for calling emit_move_insn.

Co-Authored-By: Richard Henderson <rth@redhat.com>
From-SVN: r100329

gcc/ChangeLog
gcc/ifcvt.c

index bb4a382cf5aadd1c26fc8742f26a034968e5cd5a..33df7c513db4beb8fe6f02342e36d891b1e94809 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-29  Roger Sayle  <roger@eyesopen.com>
+           Richard Henderson  <rth@redhat.com>
+
+       * ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly
+       if the RHS isn't suitable for calling emit_move_insn.
+
 2005-05-29  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-ssa-ccp.c (ccp_fold): Return immediately after calling
index 9575e62b2f1c2bd8a07ebb33b378852a9d28dbdc..5c822b64d95d75a719e52c9d27c0f4f00ac07eb6 100644 (file)
@@ -691,7 +691,11 @@ noce_emit_move_insn (rtx x, rtx y)
       optab ot;
 
       start_sequence ();
-      insn = emit_move_insn (x, y);
+      /* Check that the SET_SRC is reasonable before calling emit_move_insn,
+        otherwise construct a suitable SET pattern ourselves.  */
+      insn = (OBJECT_P (y) || CONSTANT_P (y) || GET_CODE (y) == SUBREG)
+            ? emit_move_insn (x, y)
+            : emit_insn (gen_rtx_SET (VOIDmode, x, y));
       seq = get_insns ();
       end_sequence();