summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-31 16:28:34 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-31 16:28:34 +0000
commitddefdc2aca6603f235b01d02f885d31e0971d8df (patch)
treee2ad4a12ed74c499257b5d0318e45ae551aa7b73 /gcc/combine.c
parent9c61a71b065ed706f13a0a7069c52358554ae2e4 (diff)
downloadgcc-ddefdc2aca6603f235b01d02f885d31e0971d8df.tar.gz
PR target/18701
* combine.c (combine_simplify_rtx): Do not allow paradoxical subregs of MEM. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92762 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 61b93dd3048..90934e11672 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3983,10 +3983,14 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest)
}
/* Don't change the mode of the MEM if that would change the meaning
- of the address. */
+ of the address. Similarly, don't allow widening, as that may
+ access memory outside the defined object or using an address
+ that is invalid for a wider mode. */
if (MEM_P (SUBREG_REG (x))
&& (MEM_VOLATILE_P (SUBREG_REG (x))
- || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0))))
+ || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0))
+ || (GET_MODE_SIZE (mode)
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))))
return gen_rtx_CLOBBER (mode, const0_rtx);
/* Note that we cannot do any narrowing for non-constants since