Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gcc/dist/gcc Fix a problem with reloading the ...
details: https://anonhg.NetBSD.org/src/rev/0e75a665f238
branches: trunk
changeset: 329721:0e75a665f238
user: matt <matt%NetBSD.org@localhost>
date: Thu Jun 05 21:00:36 2014 +0000
description:
Fix a problem with reloading the inner reg of a subreg when it's a
mode dependent address.
diffstat:
external/gpl3/gcc/dist/gcc/reload.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diffs (53 lines):
diff -r 90ab0589bcec -r 0e75a665f238 external/gpl3/gcc/dist/gcc/reload.c
--- a/external/gpl3/gcc/dist/gcc/reload.c Thu Jun 05 19:49:04 2014 +0000
+++ b/external/gpl3/gcc/dist/gcc/reload.c Thu Jun 05 21:00:36 2014 +0000
@@ -846,6 +846,7 @@
reload_inner_reg_of_subreg (rtx x, enum machine_mode mode, bool output)
{
rtx inner;
+ int regno;
/* Only SUBREGs are problematical. */
if (GET_CODE (x) != SUBREG)
@@ -857,10 +858,20 @@
if (CONSTANT_P (inner) || GET_CODE (inner) == PLUS)
return true;
- /* If INNER is not a hard register, then INNER will not need reloading. */
- if (!(REG_P (inner) && HARD_REGISTER_P (inner)))
+ /* If INNER is not a register, then INNER will not need reloading. */
+ if (!REG_P (inner))
return false;
+ regno = REGNO (inner);
+
+ /* If INNER is not a hard register, then INNER will not need reloading
+ unless it's a mode dependent memory reference. */
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ return !output
+ && reg_equiv_mem (regno) != 0
+ && mode_dependent_address_p (XEXP (reg_equiv_mem (regno), 0),
+ MEM_ADDR_SPACE (reg_equiv_mem (regno)));
+
/* If INNER is not ok for MODE, then INNER will need reloading. */
if (!HARD_REGNO_MODE_OK (subreg_regno (x), mode))
return true;
@@ -1142,7 +1153,7 @@
if (in != 0 && reload_inner_reg_of_subreg (in, inmode, false))
{
- if (REG_P (SUBREG_REG (in)))
+ if (REG_P (SUBREG_REG (in)) && HARD_REGISTER_P (SUBREG_REG (in)))
subreg_in_class
= find_valid_class (inmode, GET_MODE (SUBREG_REG (in)),
subreg_regno_offset (REGNO (SUBREG_REG (in)),
@@ -1150,7 +1161,8 @@
SUBREG_BYTE (in),
GET_MODE (in)),
REGNO (SUBREG_REG (in)));
- else if (GET_CODE (SUBREG_REG (in)) == SYMBOL_REF)
+ else if (REG_P (SUBREG_REG (in))
+ || GET_CODE (SUBREG_REG (in)) == SYMBOL_REF)
subreg_in_class = find_valid_class_1 (inmode,
GET_MODE (SUBREG_REG (in)),
rclass);
Home |
Main Index |
Thread Index |
Old Index