diff options
author | Richard Biener <rguenther@suse.de> | 2015-10-26 15:24:45 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-10-26 15:24:45 +0000 |
commit | e802444145fa89d9f82a2e5302a324340d0622c9 (patch) | |
tree | 314271c235223775e02c6e174ae248fb8969e6cb /gcc/alias.c | |
parent | fec40d06dadf9cd5bf4adb0ee9a47f267e6c7693 (diff) | |
download | gcc-e802444145fa89d9f82a2e5302a324340d0622c9.zip gcc-e802444145fa89d9f82a2e5302a324340d0622c9.tar.gz gcc-e802444145fa89d9f82a2e5302a324340d0622c9.tar.bz2 |
re PR rtl-optimization/67443 (DSE removes required store instruction)
2015-10-26 Richard Biener <rguenther@suse.de>
Dominik Vogt <vogt@linux.vnet.ibm.com>
PR middle-end/67443
* alias.c (ao_ref_from_mem): Remove promoted subreg handling.
Properly prune ref->ref for accesses outside of ref.
* gcc.target/s390/pr67443.c: New testcase.
Co-Authored-By: Dominik Vogt <vogt@linux.vnet.ibm.com>
From-SVN: r229372
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 1c58547..5c1ad34 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -339,15 +339,16 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) || !MEM_SIZE_KNOWN_P (mem)) return true; - /* If the base decl is a parameter we can have negative MEM_OFFSET in - case of promoted subregs on bigendian targets. Trust the MEM_EXPR - here. */ + /* If MEM_OFFSET/MEM_SIZE get us outside of ref->offset/ref->max_size + drop ref->ref. */ if (MEM_OFFSET (mem) < 0 - && (MEM_SIZE (mem) + MEM_OFFSET (mem)) * BITS_PER_UNIT == ref->size) - return true; + || (ref->max_size != -1 + && ((MEM_OFFSET (mem) + MEM_SIZE (mem)) * BITS_PER_UNIT + > ref->max_size))) + ref->ref = NULL_TREE; - /* Otherwise continue and refine size and offset we got from analyzing - MEM_EXPR by using MEM_SIZE and MEM_OFFSET. */ + /* Refine size and offset we got from analyzing MEM_EXPR by using + MEM_SIZE and MEM_OFFSET. */ ref->offset += MEM_OFFSET (mem) * BITS_PER_UNIT; ref->size = MEM_SIZE (mem) * BITS_PER_UNIT; |