]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix x86 miscompilation of gdb mips simulator.
authorJim Wilson <wilson@redhat.com>
Tue, 15 Oct 2002 22:46:31 +0000 (22:46 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 15 Oct 2002 22:46:31 +0000 (15:46 -0700)
* reload1.c (merge_assigned_reloads): After converting overlapping
reloads to RELOAD_OTHER, abort if there are now conflicting reloads.
* config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok.

From-SVN: r58184

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/reload1.c

index dcb9d7470ae8a016a277334e80b86267a9e194eb..6026be3b5e55c988d3afdb4ece81efb1d88ae9ae 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-15  Jim Wilson  <wilson@redhat.com>
+
+       * reload1.c (merge_assigned_reloads): After converting overlapping
+       reloads to RELOAD_OTHER, abort if there are now conflicting reloads.
+
+       * config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok.
+
 Tue Oct 15 22:08:35 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
        * expr.c (do_tablejump): Fix typo in my previous commit.
index efa84c9515cef5187ccc745f4cf6199ba776ddc7..de6216f9d0d8903f6a05cc5234456ac98500c52d 100644 (file)
        (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
                 (match_operand:DI 2 "general_operand" "roiF,riF")))
    (clobber (reg:CC 17))]
-  "!TARGET_64BIT"
+  "!TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
   "#")
 
 (define_split
index ea703f162eaca88a9e638e0537f39677252e1b48..a163b8afb517fa716d838dfce1c96ebd804243ae 100644 (file)
@@ -6119,10 +6119,24 @@ merge_assigned_reloads (insn)
                      || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
                  && reg_overlap_mentioned_for_reload_p (rld[j].in,
                                                         rld[i].in))
-               rld[j].when_needed
-                 = ((rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS
-                     || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
-                    ? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER);
+               {
+                 int k;
+
+                 rld[j].when_needed
+                   = ((rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS
+                       || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
+                      ? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER);
+
+                 /* Check to see if we accidentally converted two reloads
+                    that use the same reload register to the same type.
+                    If so, the resulting code won't work, so abort.  */
+                 if (rld[j].reg_rtx)
+                   for (k = 0; k < j; k++)
+                     if (rld[k].in != 0 && rld[k].reg_rtx != 0
+                         && rld[k].when_needed == rld[j].when_needed
+                         && rtx_equal_p (rld[k].reg_rtx, rld[j].reg_rtx))
+                       abort ();
+               }
        }
     }
 }