aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@redhat.com>2002-10-15 22:46:31 +0000
committerJim Wilson <wilson@gcc.gnu.org>2002-10-15 15:46:31 -0700
commitc15c18c5815a10afc6057038d2a50053083a5491 (patch)
tree085aaa50a332ab656a80e21bcfc25d0732cae018 /gcc/reload1.c
parent1a55127d2253848d525bb62ff95bd70fc65a5d2f (diff)
downloadgcc-c15c18c5815a10afc6057038d2a50053083a5491.zip
gcc-c15c18c5815a10afc6057038d2a50053083a5491.tar.gz
gcc-c15c18c5815a10afc6057038d2a50053083a5491.tar.bz2
Fix x86 miscompilation of gdb mips simulator.
* 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
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index ea703f1..a163b8a 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -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 ();
+ }
}
}
}