aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2006-07-18 17:27:57 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2006-07-18 13:27:57 -0400
commit548a6c6d0eaf08b916db237479647fa01d7e91a7 (patch)
tree679bafddf7ab1d19e5ae8da990d4b134067ac67a /gcc/tree-ssa-operands.c
parent492b73bda96d446cb62113559f1f705c1da365f3 (diff)
downloadgcc-548a6c6d0eaf08b916db237479647fa01d7e91a7.zip
gcc-548a6c6d0eaf08b916db237479647fa01d7e91a7.tar.gz
gcc-548a6c6d0eaf08b916db237479647fa01d7e91a7.tar.bz2
re PR tree-optimization/28410 (Wrong aliasing with global var grouping during call clobbering)
PR 28410 * tree-ssa-operands.c (access_can_touch_variable): Update comment. Return true if ALIAS is .GLOBAL_VAR. testsuite/ChangeLog PR 28410 * gcc.dg/tree-ssa/pr28410.c: New test. From-SVN: r115564
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 3cd8c45..0563781 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1037,9 +1037,7 @@ append_v_must_def (tree var)
/* REF is a tree that contains the entire pointer dereference
expression, if available, or NULL otherwise. ALIAS is the variable
we are asking if REF can access. OFFSET and SIZE come from the
- memory access expression that generated this virtual operand.
- FOR_CLOBBER is true is this is adding a virtual operand for a call
- clobber. */
+ memory access expression that generated this virtual operand. */
static bool
access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
@@ -1049,6 +1047,12 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
unsigned HOST_WIDE_INT uoffset = (unsigned HOST_WIDE_INT) offset;
tree base = ref ? get_base_address (ref) : NULL;
+ /* If ALIAS is .GLOBAL_VAR then the memory reference REF must be
+ using a call-clobbered memory tag. By definition, call-clobbered
+ memory tags can always touch .GLOBAL_VAR. */
+ if (alias == global_var)
+ return true;
+
/* If ALIAS is an SFT, it can't be touched if the offset
and size of the access is not overlapping with the SFT offset and
size. This is only true if we are accessing through a pointer