===================================================================
@@ -16,5 +16,5 @@ int f()
return lala.x[0];
}
-/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */
===================================================================
@@ -19,5 +19,5 @@ int f()
return lala.x[i];
}
-/* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" } } */
/* { dg-final { cleanup-tree-dump "tmedge" } } */
===================================================================
@@ -17,6 +17,6 @@ int f()
return lala.x[asdf];
}
-/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala" 1 "tmedge" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "lala = tm_save" 1 "tmedge" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "lala = tm_save" 1 "tmedge" } } */
/* { dg-final { cleanup-tree-dump "tmedge" } } */
===================================================================
@@ -19,6 +19,6 @@ int f()
return lala.x[i];
}
-/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" } } */
/* { dg-final { cleanup-tree-dump "tmedge" } } */
===================================================================
@@ -332,6 +332,20 @@ ptr_deref_may_alias_ref_p_1 (tree ptr, a
return true;
}
+/* Returns true if an address escapes the current function. */
+bool
+address_escapes_p (tree x)
+{
+ x = get_base_address (x);
+ if (TREE_CODE (x) == SSA_NAME)
+ return ptr_deref_may_alias_global_p (x);
+ if (TREE_CODE (x) == MEM_REF)
+ return ptr_deref_may_alias_global_p (TREE_OPERAND (x, 0));
+ if (DECL_P (x))
+ return may_be_aliased (x);
+ return false;
+}
+
/* Dump alias information on FILE. */
===================================================================
@@ -99,6 +99,7 @@ extern tree ao_ref_base (ao_ref *);
extern alias_set_type ao_ref_alias_set (ao_ref *);
extern bool ptr_deref_may_alias_global_p (tree);
extern bool ptr_derefs_may_alias_p (tree, tree);
+extern bool address_escapes_p (tree);
extern bool refs_may_alias_p (tree, tree);
extern bool refs_may_alias_p_1 (ao_ref *, ao_ref *, bool);
extern bool refs_anti_dependent_p (tree, tree);
===================================================================
@@ -1347,7 +1347,7 @@ thread_private_new_memory (basic_block e
/* Search DEF chain to find the original definition of this address. */
do
{
- if (ptr_deref_may_alias_global_p (x))
+ if (address_escapes_p (x))
{
/* Address escapes. This is not thread-private. */
retval = mem_non_local;
@@ -1497,8 +1497,7 @@ requires_barrier (basic_block entry_bloc
to needs_to_live_in_memory until we eliminate
lower_sequence_tm altogether. */
needs_to_live_in_memory (x)
- /* X escapes. */
- || ptr_deref_may_alias_global_p (x))
+ || address_escapes_p (x))
return true;
else
{