summaryrefslogtreecommitdiff
path: root/gcc/lower-subreg.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-13 22:18:26 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-13 22:18:26 +0000
commitccd1ec59018aa6f271b689dc327794f5b4a242ed (patch)
tree7617ca582c6dc030410b09053bf05cad7cd5be52 /gcc/lower-subreg.c
parent27bfe7b7d89069c84a2b1d9f424ff64ca7f5902b (diff)
downloadgcc-ccd1ec59018aa6f271b689dc327794f5b4a242ed.tar.gz
PR middle-end/30751
* lower-subreg.c (resolve_simple_move): Decompose subregs in addresses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121894 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lower-subreg.c')
-rw-r--r--gcc/lower-subreg.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index fbb506c572e..908b10e4e06 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -501,7 +501,7 @@ resolve_subreg_use (rtx *px, void *data)
that the note must be removed. */
if (!x)
{
- gcc_assert(!insn);
+ gcc_assert (!insn);
return 1;
}
@@ -711,6 +711,23 @@ resolve_simple_move (rtx set, rtx insn)
return insn;
}
+ /* It's possible for the code to use a subreg of a decomposed
+ register while forming an address. We need to handle that before
+ passing the address to emit_move_insn. We pass NULL_RTX as the
+ insn parameter to resolve_subreg_use because we can not validate
+ the insn yet. */
+ if (MEM_P (src) || MEM_P (dest))
+ {
+ int acg;
+
+ if (MEM_P (src))
+ for_each_rtx (&XEXP (src, 0), resolve_subreg_use, NULL_RTX);
+ if (MEM_P (dest))
+ for_each_rtx (&XEXP (dest, 0), resolve_subreg_use, NULL_RTX);
+ acg = apply_change_group ();
+ gcc_assert (acg);
+ }
+
/* If SRC is a register which we can't decompose, or has side
effects, we need to move via a temporary register. */