This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 01/17/12 03:09, Richard Guenther wrote:On Mon, Jan 16, 2012 at 4:58 PM, Aldy Hernandez<aldyh@redhat.com> wrote:
Not really - you handle both ptr and *ptr in the same predicate and call both "address escaped". What I suggested was sth like
I think I confused myself and you by asking the wrong question in the first place.
Actually, what I want is to handle VAR_DECL correctly, and your original suggestion of using may_be_aliased() fits the bill. The other calls to ptr_deref_may_alias_global_p() were fine because we have an SSA_NAME.
We're now down to a one-liner :).
How about this? All TM memory optimization tests fixed, and no regressions.
Ok. Note that may_be_aliased (x) is also true if x is an automatic variable that has its address taken. You can use is_global_var (x) instead if you only want to test for "global memory".
Richard.
is_global_var is fine. Thanks.
Committed.
if (is_global_var (x)) return !TREE_READONLY (x);
Index: trans-mem.c =================================================================== --- trans-mem.c (revision 183253) +++ trans-mem.c (working copy) @@ -1497,8 +1497,6 @@ requires_barrier (basic_block entry_block, tree x, to needs_to_live_in_memory until we eliminate lower_sequence_tm altogether. */ needs_to_live_in_memory (x) - /* X escapes. */ - || is_global_var (x)) return true; else {
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |