public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/51165] gcc.dg/tm/memopt-3.c failure
Date: Wed, 11 Jan 2012 15:14:00 -0000 [thread overview]
Message-ID: <bug-51165-4-T6L22gNMZv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51165-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51165
--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> 2012-01-11 15:13:39 UTC ---
On Wed, 11 Jan 2012, aldyh at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51165
>
> Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |rguenth at gcc dot gnu.org,
> | |rth at gcc dot gnu.org
>
> --- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-11 15:07:15 UTC ---
> The main problem here is that we are using ptr_deref_may_alias_global_p() to
> determine if a dereferenced address escapes whereas we were previously using
> is_call_clobbered() which understood VAR_DECLs, not just SSA_NAMEs.
>
> In requires_barrier() we call ptr_deref_may_alias_global_p() to determine if
> the address of `lala' below will escape:
>
> struct large { int x[100]; };
> extern struct large foobie (void) __attribute__((transaction_safe));
> int asdf;
>
> int f()
> {
> struct large lala;
> struct large lacopy = foobie();
> __transaction_atomic {
> lala = lacopy; <-- STORE SHOULD BE TRXN/THREAD LOCAL
> }
> return lala.x[asdf];
> }
>
> Before the fix to PR tree-optimization/43572, we used is_call_clobbered() which
> returned false for `lala', and everything worked fine. However, we are now
> using ptr_deref_may_alias_global_p() which only understands SSA_NAMEs, and
> `lala' is a VAR_DECL.
>
> Mr. Guenther (or Mr. Henderson), what is the recommended course of action here?
If you want to check whether something possibly escaped you can
use may_be_aliased (get_base_address (xxxx)) and if xxx is always
a VAR_DECL you can omit get_base_address. If get_base_addres (xxxx)
returns a MEM_REF you can refine the result by calling
ptr_deref_may_alias_global_p on its operand 0 (the pointer to the object).
There is no existing predicate that would answer whether a tree
accesses possibly 'escaped' memory (yet). If you write one,
stick it into tree-ssa-alias.c.
Richard.
next prev parent reply other threads:[~2012-01-11 15:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 16:13 [Bug other/51165] New: " aldyh at gcc dot gnu.org
2011-11-16 16:30 ` [Bug other/51165] " aldyh at gcc dot gnu.org
2012-01-10 18:53 ` aldyh at gcc dot gnu.org
2012-01-10 18:56 ` aldyh at gcc dot gnu.org
2012-01-10 18:56 ` aldyh at gcc dot gnu.org
2012-01-10 18:58 ` aldyh at gcc dot gnu.org
2012-01-11 15:07 ` aldyh at gcc dot gnu.org
2012-01-11 15:14 ` rguenther at suse dot de [this message]
2012-01-17 13:49 ` aldyh at gcc dot gnu.org
2012-01-17 13:51 ` aldyh at gcc dot gnu.org
2022-01-07 5:09 ` pinskia at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-51165-4-T6L22gNMZv@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).