diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2004-12-31 16:28:34 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2004-12-31 16:28:34 +0000 |
commit | bf08edc1398aac7340cb2d4bc39a978070bfc798 (patch) | |
tree | e2ad4a12ed74c499257b5d0318e45ae551aa7b73 /gcc | |
parent | 32f2ce029997a7d1d4be975ddafd7dcf6574d49c (diff) | |
download | gcc-bf08edc1398aac7340cb2d4bc39a978070bfc798.zip gcc-bf08edc1398aac7340cb2d4bc39a978070bfc798.tar.gz gcc-bf08edc1398aac7340cb2d4bc39a978070bfc798.tar.bz2 |
re PR target/18701 (mmix-knuth-mmixware gcc.c-torture/execute failures: 20010224-1.c, 20020216-1.c, 20040218-1.c, 20040709-2.c)
PR target/18701
* combine.c (combine_simplify_rtx): Do not allow paradoxical
subregs of MEM.
From-SVN: r92762
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/combine.c | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81d0b99..86b5868 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,10 @@ 2004-12-31 Hans-Peter Nilsson <hp@bitrange.com> PR target/18701 + * combine.c (combine_simplify_rtx): Do not allow paradoxical + subregs of MEM. + + PR target/18701 * combine.c (gen_lowpart_for_combine): When stripping SUBREG of MEM, adjust imode and isize. diff --git a/gcc/combine.c b/gcc/combine.c index 61b93dd..90934e1 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 |