summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-16 04:31:30 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-16 04:31:30 +0000
commitbb2bc4f3d488a9cfc7e534907a52ec57e23a7fd6 (patch)
treef0fc6a874d85829d0f97a943b956d34c53269040 /gcc
parentc65a66ea5856277dcf4defdb6dfe9c8ef6361aef (diff)
downloadgcc-bb2bc4f3d488a9cfc7e534907a52ec57e23a7fd6.tar.gz
PR rtl-optimization/55547
PR rtl-optimization/53827 PR debug/53671 PR debug/49888 * alias.c (memrefs_conflict_p): Set sizes to negative after AND adjustments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195227 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/alias.c18
2 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e9220f5f8c6..6f7441e8b23 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2013-01-16 Alexandre Oliva <aoliva@redhat.com>
+
+ PR rtl-optimization/55547
+ PR rtl-optimization/53827
+ PR debug/53671
+ PR debug/49888
+ * alias.c (memrefs_conflict_p): Set sizes to negative after
+ AND adjustments.
+
2013-01-15 Jakub Jelinek <jakub@redhat.com>
PR target/55940
diff --git a/gcc/alias.c b/gcc/alias.c
index df328ec9d73..9a386dde382 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2080,14 +2080,20 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
/* Deal with alignment ANDs by adjusting offset and size so as to
cover the maximum range, without taking any previously known
- alignment into account. */
+ alignment into account. Make a size negative after such an
+ adjustments, so that, if we end up with e.g. two SYMBOL_REFs, we
+ assume a potential overlap, because they may end up in contiguous
+ memory locations and the stricter-alignment access may span over
+ part of both. */
if (GET_CODE (x) == AND && CONST_INT_P (XEXP (x, 1)))
{
HOST_WIDE_INT sc = INTVAL (XEXP (x, 1));
unsigned HOST_WIDE_INT uc = sc;
- if (xsize > 0 && sc < 0 && -uc == (uc & -uc))
+ if (sc < 0 && -uc == (uc & -uc))
{
- xsize -= sc + 1;
+ if (xsize > 0)
+ xsize = -xsize;
+ xsize += sc + 1;
c -= sc + 1;
return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)),
ysize, y, c);
@@ -2097,9 +2103,11 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
{
HOST_WIDE_INT sc = INTVAL (XEXP (y, 1));
unsigned HOST_WIDE_INT uc = sc;
- if (ysize > 0 && sc < 0 && -uc == (uc & -uc))
+ if (sc < 0 && -uc == (uc & -uc))
{
- ysize -= sc + 1;
+ if (ysize > 0)
+ ysize = -ysize;
+ ysize += sc + 1;
c += sc + 1;
return memrefs_conflict_p (xsize, x,
ysize, canon_rtx (XEXP (y, 0)), c);