diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-26 15:24:45 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-26 15:24:45 +0000 |
commit | 3470b0f7e62d9976986ef261567c59eaa768fc90 (patch) | |
tree | 314271c235223775e02c6e174ae248fb8969e6cb /gcc/alias.c | |
parent | 433f3eedc06164526b037a543f41b6638700cc70 (diff) | |
download | gcc-3470b0f7e62d9976986ef261567c59eaa768fc90.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229372 138bc75d-0d04-0410-961f-82ee72b054a4
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 1c58547df72..5c1ad34e088 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; |