diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-01-29 09:05:47 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2004-01-29 09:05:47 +0100 |
commit | 4e44c1ef05495c25b59a2c2779e843c80c23b606 (patch) | |
tree | 3850dbb336a34d41f22a4d5c00512ef7204ac372 /gcc/emit-rtl.c | |
parent | f470c378ac3e1ee9261034709851f4c6ef068fef (diff) | |
download | gcc-4e44c1ef05495c25b59a2c2779e843c80c23b606.zip gcc-4e44c1ef05495c25b59a2c2779e843c80c23b606.tar.gz gcc-4e44c1ef05495c25b59a2c2779e843c80c23b606.tar.bz2 |
re PR rtl-optimization/13424 (gcc.dg/20031202-1.c is miscompiled)
PR optimization/13424
* expr.c (store_constructor): Revert 2003-12-03 change.
* emit-rtl.c (change_address): Check also if MEM_ATTRS is set as
expected before returning early. Avoid sharing RTL if they
need to be changed.
* config/i386/i386.c (ix86_expand_movstr): Rework rep_mov and strmov
handling so that memory attributes are preserved. Don't call
ix86_set_move_mem_attrs.
(ix86_set_move_mem_attrs_1, ix86_set_move_mem_attrs): Removed.
(ix86_expand_clrstr): Rename src argument to
dst. Rework rep_stos and strset handling so that memory attributes
are preserved.
(ix86_expand_strlen): Pass src argument to
ix86_expand_strlensi_unroll_1. Rework strlenqi_1 handling so that
memory attributes are preserved.
(ix86_expand_strlensi_unroll_1): Add src argument. Use
change_address instead of gen_rtx_MEM.
* config/i386/i386.md (strmov, strmov_singleop, rep_mov): New
expanders.
(strmovdi_rex64, strmovsi, strmovsi_rex64, strmovhi, strmovhi_rex64,
strmovqi, strmovqi_rex64): Remove.
(rep_mov*, strmov*): Prefix insn names with *.
(strset, strset_singleop, rep_stos): New expanders.
(strsetdi_rex64, strsetsi, strsetsi_rex64, strsethi, strsethi_rex64,
strsetqi, strsetqi_rex64): Remove.
(rep_stos*, strset*): Prefix insn names with *.
(rep_stosqi_rex64): Likewise. Fix mode of dirflag reg from DImode
to SImode.
(cmpstrsi): Rework cmpstrqi_1 handling so that memory attributes
are preserved.
(cmpstrqi_nz_1, cmpstrqi_nz_rex_1, cmpstrqi_1, cmpstrqi_rex_1):
Prefix insn names with *.
(cmpstrqi_nz_1, cmpstrqi_1): New expanders.
(strlenqi_1, strlenqi_rex_1): Prefix insn names with *.
(strlenqi_1): New expander.
* config/i386/i386.h (ix86_set_move_mem_attrs): Remove prototype.
From-SVN: r76852
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 294577c..b1429da 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1869,19 +1869,29 @@ change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate) rtx change_address (rtx memref, enum machine_mode mode, rtx addr) { - rtx new = change_address_1 (memref, mode, addr, 1); + rtx new = change_address_1 (memref, mode, addr, 1), size; enum machine_mode mmode = GET_MODE (new); + unsigned int align; + + size = mmode == BLKmode ? 0 : GEN_INT (GET_MODE_SIZE (mmode)); + align = mmode == BLKmode ? BITS_PER_UNIT : GET_MODE_ALIGNMENT (mmode); /* If there are no changes, just return the original memory reference. */ if (new == memref) - return new; + { + if (MEM_ATTRS (memref) == 0 + || (MEM_EXPR (memref) == NULL + && MEM_OFFSET (memref) == NULL + && MEM_SIZE (memref) == size + && MEM_ALIGN (memref) == align)) + return new; + + new = gen_rtx_MEM (mmode, addr); + MEM_COPY_ATTRIBUTES (new, memref); + } MEM_ATTRS (new) - = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, - mmode == BLKmode ? 0 : GEN_INT (GET_MODE_SIZE (mmode)), - (mmode == BLKmode ? BITS_PER_UNIT - : GET_MODE_ALIGNMENT (mmode)), - mmode); + = get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align, mmode); return new; } |