diff options
author | J"orn Rennecke <joern.rennecke@superh.com> | 2003-12-15 17:42:43 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2003-12-15 17:42:43 +0000 |
commit | 69f38ab9fd8ac5c7f5b68c01673c4c6366fd343c (patch) | |
tree | a160396a81237e124ff088404cc470129c589b51 /gcc/reload.c | |
parent | a5ac3982bc53a972881bed634e3cc3dfa2141656 (diff) | |
download | gcc-69f38ab9fd8ac5c7f5b68c01673c4c6366fd343c.zip gcc-69f38ab9fd8ac5c7f5b68c01673c4c6366fd343c.tar.gz gcc-69f38ab9fd8ac5c7f5b68c01673c4c6366fd343c.tar.bz2 |
reload.c (reg_overlap_mentioned_for_reload_p): When looking at a PLUS in X...
* reload.c (reg_overlap_mentioned_for_reload_p):
When looking at a PLUS in X, avoid spuriously returning nonzero
when IN is a REG or another simple PLUS, or a MEM containing one.
* loop.c (loop_invariant_p): Amend comment about where new registers
might come from.
From-SVN: r74638
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index fe0f047..13f6900 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -6290,8 +6290,22 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in) || GET_CODE (x) == CC0) return reg_mentioned_p (x, in); else if (GET_CODE (x) == PLUS) - return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in) - || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in)); + { + /* We actually want to know if X is mentioned somewhere inside IN. + We must not say that (plus (sp) (const_int 124)) is in + (plus (sp) (const_int 64)), since that can lead to incorrect reload + allocation when spuriously changing a RELOAD_FOR_OUTPUT_ADDRESS + into a RELOAD_OTHER on behalf of another RELOAD_OTHER. */ + while (GET_CODE (in) == MEM) + in = XEXP (in, 0); + if (GET_CODE (in) == REG) + return 0; + else if (GET_CODE (in) == PLUS) + return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0)) + || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1))); + else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in) + || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in)); + } else abort (); |