diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-04-27 11:39:47 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-04-27 11:39:47 +0000 |
commit | 8c74fb06c66b569a26f93c0d569d4437fdcfd415 (patch) | |
tree | a4840b670d6361a1ddbbb4b10ca1921ee3bb7e7c /gcc/reload1.c | |
parent | a9b77cd1f72118dead00c720f1fc3348b7c5127e (diff) | |
download | gcc-8c74fb06c66b569a26f93c0d569d4437fdcfd415.zip gcc-8c74fb06c66b569a26f93c0d569d4437fdcfd415.tar.gz gcc-8c74fb06c66b569a26f93c0d569d4437fdcfd415.tar.bz2 |
reload.h (elimination_target_reg_p): Declare.
gcc/
* reload.h (elimination_target_reg_p): Declare.
* reload.c (find_reloads): Don't apply the reg_rtx move
optimization if the SET_DEST satisfies elimination_target_reg_p.
* reload1.c (elimination_target_reg_p): New function.
(gen_reload): In the move/add2 fallback, make sure that op0
does not overlap the destination register.
From-SVN: r124215
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 9ee046a..4d2dea5 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3607,6 +3607,20 @@ update_eliminables (HARD_REG_SET *pset) SET_HARD_REG_BIT (*pset, HARD_FRAME_POINTER_REGNUM); } +/* Return true if X is used as the target register of an elimination. */ + +bool +elimination_target_reg_p (rtx x) +{ + struct elim_table *ep; + + for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) + if (ep->to_rtx == x && ep->can_eliminate) + return true; + + return false; +} + /* Initialize the table of registers to eliminate. */ static void @@ -7873,6 +7887,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type) /* If that failed, copy the address register to the reload register. Then add the constant to the reload register. */ + gcc_assert (!reg_overlap_mentioned_p (out, op0)); gen_reload (out, op1, opnum, type); insn = emit_insn (gen_add2_insn (out, op0)); set_unique_reg_note (insn, REG_EQUIV, in); |