diff options
author | Jim Wilson <wilson@redhat.com> | 2002-10-15 22:46:31 +0000 |
---|---|---|
committer | Jim Wilson <wilson@redhat.com> | 2002-10-15 22:46:31 +0000 |
commit | 6f84206d5eb0c6be9e489565d154dfd3672e86ba (patch) | |
tree | 085aaa50a332ab656a80e21bcfc25d0732cae018 /gcc/reload1.c | |
parent | 0ac887a8961026007310a9bcf6d3a437f4434e77 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@58184 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index ea703f162ea..a163b8afb51 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 (); + } } } } |