aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-08-18 08:11:22 +0930
committerAlan Modra <amodra@gcc.gnu.org>2016-08-18 08:11:22 +0930
commit66592e95db41216e6fb1d76a831f8efa6bcf0d6f (patch)
treef81e4c1cdce3465669f486e5c83c18bd770bc7ee /gcc/reload.c
parent6fbf26cc575cd5d50acc63a0d935744399230435 (diff)
downloadgcc-66592e95db41216e6fb1d76a831f8efa6bcf0d6f.zip
gcc-66592e95db41216e6fb1d76a831f8efa6bcf0d6f.tar.gz
gcc-66592e95db41216e6fb1d76a831f8efa6bcf0d6f.tar.bz2
[RELOAD] Don't assume subreg mem address is ok
This patch fixes a case where reload blindly assumes a subreg mem is OK if its address has been partially reloaded by legitimize_reload_address. PR rtl-optimization/72771 * reload.c (find_reloads): Don't assume that a subreg mem is OK when find_reloads_toplev returns address_reloaded==-1. (alternative_allows_const_pool_ref): Update comment. testsuite/ * gcc.c-torture/compile/pr72771.c: New. From-SVN: r239549
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index afdd56d..cd0d661 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3961,7 +3961,7 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
there will be no reload needed at all. */
if (plus == NULL_RTX
&& subreg == NULL_RTX
- && alternative_allows_const_pool_ref (this_address_reloaded == 0
+ && alternative_allows_const_pool_ref (this_address_reloaded != 1
? substed_operand[i]
: NULL,
recog_data.constraints[i],
@@ -4606,8 +4606,8 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
/* Return true if alternative number ALTNUM in constraint-string
CONSTRAINT is guaranteed to accept a reloaded constant-pool reference.
- MEM gives the reference if it didn't need any reloads, otherwise it
- is null. */
+ MEM gives the reference if its address hasn't been fully reloaded,
+ otherwise it is NULL. */
static bool
alternative_allows_const_pool_ref (rtx mem ATTRIBUTE_UNUSED,