diff options
author | Greta Yorsh <greta.yorsh@arm.com> | 2013-04-19 13:55:26 +0100 |
---|---|---|
committer | Greta Yorsh <gretay@gcc.gnu.org> | 2013-04-19 13:55:26 +0100 |
commit | 67bc84fbb05664ec45d2a0319520c96f011a9596 (patch) | |
tree | d427346b6e92609757c00d5e5ee52467426b530e /gcc | |
parent | dfe192f58f46b4dc07f816d6e930fe3620f23271 (diff) | |
download | gcc-67bc84fbb05664ec45d2a0319520c96f011a9596.zip gcc-67bc84fbb05664ec45d2a0319520c96f011a9596.tar.gz gcc-67bc84fbb05664ec45d2a0319520c96f011a9596.tar.bz2 |
re PR target/56797 (internal compiler error: in extract_insn, at recog.c:2150)
2013-04-19 Greta Yorsh <Greta.Yorsh@arm.com>
PR target/56797
* config/arm/arm.c (load_multiple_sequence): Require SP
as base register for loads if SP is in the register list.
From-SVN: r198091
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43ed933..439471d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-04-19 Greta Yorsh <Greta.Yorsh@arm.com> + + PR target/56797 + * config/arm/arm.c (load_multiple_sequence): Require SP + as base register for loads if SP is in the register list. + 2013-04-19 Martin Jambor <mjambor@suse.cz> PR tree-optimization/56718 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9088d1a..7567afc 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -10755,6 +10755,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, || (i != nops - 1 && unsorted_regs[i] == base_reg)) return 0; + /* Don't allow SP to be loaded unless it is also the base + register. It guarantees that SP is reset correctly when + an LDM instruction is interruptted. Otherwise, we might + end up with a corrupt stack. */ + if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) + return 0; + unsorted_offsets[i] = INTVAL (offset); if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) order[0] = i; |