diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-11 21:40:32 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-11 21:40:32 -0400 |
commit | 922d9d40d1932088a59f6ab9370363dce5feb121 (patch) | |
tree | 34936721c59694b6afee507088c30b6fffb72ef6 /gcc | |
parent | eda115ddc4abcc6e577078351dd60c03ee11c06d (diff) | |
download | gcc-922d9d40d1932088a59f6ab9370363dce5feb121.zip gcc-922d9d40d1932088a59f6ab9370363dce5feb121.tar.gz gcc-922d9d40d1932088a59f6ab9370363dce5feb121.tar.bz2 |
(eliminate_regs_in_insn): Don't use a later elimination than
eliminate_regs would use.
From-SVN: r4663
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/reload1.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 0881342..87076c8 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3107,14 +3107,22 @@ eliminate_regs_in_insn (insn, replace) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == XEXP (SET_SRC (old_body), 0) - && ep->can_eliminate - && ep->offset == - INTVAL (XEXP (SET_SRC (old_body), 1))) + && ep->can_eliminate) { - PATTERN (insn) = gen_rtx (SET, VOIDmode, - SET_DEST (old_body), ep->to_rtx); - INSN_CODE (insn) = -1; - val = 1; - goto done; + /* We must stop at the first elimination that will be used. + If this one would replace the PLUS with a REG, do it + now. Otherwise, quit the loop and let eliminate_regs + do its normal replacement. */ + if (ep->offset == - INTVAL (XEXP (SET_SRC (old_body), 1))) + { + PATTERN (insn) = gen_rtx (SET, VOIDmode, + SET_DEST (old_body), ep->to_rtx); + INSN_CODE (insn) = -1; + val = 1; + goto done; + } + + break; } } |