reload1.c (eliminate_regs_in_insn): Allow a set to be a PARALLEL with (clobber (match...
authorJ"orn Rennecke <amylaar@redhat.com>
Mon, 6 Nov 2000 20:09:04 +0000 (20:09 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 6 Nov 2000 20:09:04 +0000 (20:09 +0000)
* reload1.c (eliminate_regs_in_insn): Allow a set to be a PARALLEL
with (clobber (match_scratch...)).

From-SVN: r37281

gcc/ChangeLog
gcc/reload1.c

index f24e1838027d81c741ebd4aa80a12bb511492634..0bf70491b0946cc6e25c49c7116fd3c45a893629 100644 (file)
@@ -1,3 +1,8 @@
+Mon Nov  6 20:08:13 2000  J"orn Rennecke <amylaar@redhat.com>
+
+       * reload1.c (eliminate_regs_in_insn): Allow a set to be a PARALLEL
+       with (clobber (match_scratch...)).
+
 2000-11-06  Neil Booth  <neilb@earthling.net>
 
        * c-lex.c (init_c_lex): If cpp_start_read fails, exit with
index 66c98f545953fd38a1a8584757f01b5fbc1493ad..9e985e445b27a5c189b3499162d314dde045eee0 100644 (file)
@@ -2953,13 +2953,24 @@ eliminate_regs_in_insn (insn, replace)
 
            if (offset == 0)
              {
-               /* We assume here that we don't need a PARALLEL of
-                  any CLOBBERs for this assignment.  There's not
-                  much we can do if we do need it.  */
+               int num_clobbers;
+               /* We assume here that if we need a PARALLEL with
+                  CLOBBERs for this assignment, we can do with the
+                  MATCH_SCRATCHes that add_clobbers allocates.
+                  There's not much we can do if that doesn't work.  */
                PATTERN (insn) = gen_rtx_SET (VOIDmode,
                                              SET_DEST (old_set),
                                              ep->to_rtx);
-               INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
+               num_clobbers = 0;
+               INSN_CODE (insn) = recog (PATTERN (insn), insn, &num_clobbers);
+               if (num_clobbers)
+                 {
+                   rtvec vec = rtvec_alloc (num_clobbers + 1);
+
+                   vec->elem[0] = PATTERN (insn);
+                   PATTERN (insn) = gen_rtx_PARALLEL (VOIDmode, vec);
+                   add_clobbers (PATTERN (insn), INSN_CODE (insn));
+                 }
                if (INSN_CODE (insn) < 0)
                  abort ();
              }