reload1.c (eliminate_regs_in_insn): Don't restore an operand if doing so would replac...
authorBernd Schmidt <bernd.schmidt@codesourcery.com>
Sat, 10 Apr 2010 12:33:17 +0000 (12:33 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Sat, 10 Apr 2010 12:33:17 +0000 (12:33 +0000)
* reload1.c (eliminate_regs_in_insn): Don't restore an operand
if doing so would replace the entire pattern.

From-SVN: r158188

gcc/ChangeLog
gcc/reload1.c

index 5b2f0f05fbb693b20e1bd297a314709ce5658bdb..ed09c30850a36f0ccc49869376262d4609f64e09 100644 (file)
@@ -9,6 +9,9 @@
        (web_main): Call it.
        (union_defs): Don't try to recognize match_dups.
 
+       * reload1.c (eliminate_regs_in_insn): Don't restore an operand
+       if doing so would replace the entire pattern.
+
 2010-04-09  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/43707
index 02fef2d9eaefb77b3f4b1177c9b8db9c293b4ead..bd590cbc9c9b37ada64f3eccfadd5cc098a221cc 100644 (file)
@@ -3557,7 +3557,10 @@ eliminate_regs_in_insn (rtx insn, int replace)
     {
       /* Restore the old body.  */
       for (i = 0; i < recog_data.n_operands; i++)
-       *recog_data.operand_loc[i] = orig_operand[i];
+       /* Restoring a top-level match_parallel would clobber the new_body
+          we installed in the insn.  */
+       if (recog_data.operand_loc[i] != &PATTERN (insn))
+         *recog_data.operand_loc[i] = orig_operand[i];
       for (i = 0; i < recog_data.n_dups; i++)
        *recog_data.dup_loc[i] = orig_operand[(int) recog_data.dup_num[i]];
     }