regmove.c (regmove_optimize): Avoid setting a register twice in a parallel set.
authorRoman Zippel <zippel@linux-m68k.org>
Sat, 11 Aug 2001 01:05:24 +0000 (01:05 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 11 Aug 2001 01:05:24 +0000 (18:05 -0700)
        * regmove.c (regmove_optimize): Avoid setting a register twice in
        a parallel set.

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

gcc/ChangeLog
gcc/regmove.c

index 9d9bbe1d4956a0b41183979f5a97640bf46dd202..29440f54283c7c3bc25f7680936e4ba1d411e658 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-10  Roman Zippel  <zippel@linux-m68k.org>
+           Richard Henderson  <rth@redhat.com>
+
+       * regmove.c (regmove_optimize): Avoid setting a register twice in
+       a parallel set.
+
 2001-08-10  Richard Henderson  <rth@redhat.com>
 
        * doc/extend.texi (Arrays and pointers implementation): Document
index 587acea6893769d663bea8cdaa6cbe0835a0b8d5..ac1675e358fd92e5318e995e1fae3d2f3d45357d 100644 (file)
@@ -1319,6 +1319,14 @@ regmove_optimize (f, nregs, regmove_dump_file)
              if (! set)
                continue;
 
+             /* Note that single_set ignores parts of a parallel set for
+                which one of the destinations is REG_UNUSED.  We can't
+                handle that here, since we can wind up rewriting things
+                such that a single register is set twice within a single
+                parallel.  */
+             if (reg_set_p (src, insn))
+               continue;
+
              /* match_no/dst must be a write-only operand, and
                 operand_operand/src must be a read-only operand.  */
              if (match.use[op_no] != READ