This is the mail archive of the
mailing list for the GCC project.
Re: [trans-mem, PATCH] do not dereference node if null in expand_call_tm (PR middle-end/52047)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Patrick Marlier <patrick dot marlier at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Aldy Hernandez <aldyh at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 2 Feb 2012 10:22:10 +0100
- Subject: Re: [trans-mem, PATCH] do not dereference node if null in expand_call_tm (PR middle-end/52047)
- References: <4F2820C9.firstname.lastname@example.org> <CAFiYyc1Rx1UfV4ZfYp2OBcM2F3g9ipTXJ=E6RUvP5=3n_0PEDw@mail.gmail.com> <4F29AC6E.email@example.com>
On Wed, Feb 1, 2012 at 10:19 PM, Patrick Marlier
> On 02/01/2012 03:59 AM, Richard Guenther wrote:
>> The patch looks ok, but I'm not sure why you do not get a cgraph node
>> here - cgraph doesn't really care for builtins as far as I can see.
> I cannot help on this...
>> Don't you maybe want to handle builtins in a special way here?
> Indeed, I think my patch is wrong. __builtin_prefetch should have the
> transaction_pure attribute. I don't know how usually it should be done but
> what about adding a gcc_assert before to dereference node (potentially
> How the attached patch looks like now?
> (Tested on i686)
>> At least those that are const/pure?
> About const/pure, we cannot consider those functions as transaction_pure
> because they can read global and shared variable.
Well, const functions cannot access global memory, they can only inspect
Of course __builtin_prefetch seems to be special in some way. Note that
users can explicitely call it, so setting the attribute from the prefetching
pass isn't the correct thing to do.
Note that __builtin_prefetch has the 'no vops' attribute - I think you should
simply consider all 'no vops' builtins as transaction pure instead or
consider a set of builtins as transaction pure (that's more scalable than
sticking the attribute onto random builtins - see how we handle builtins in
the alias machinery, we avoid sticking the fnspec attribute onto each
builtin but simply have special handling for them).
> BTW, I will post a PR (and probably a patch) about this.
> Thanks for your comment!
> ? ? ? ?PR middle-end/52047
> ? ? ? ?* trans-mem.c (expand_call_tm): Add an assertion.
> ? ? ? ?* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Add transaction_pure
> ? ? ? ?attribute to __builtin_prefetch.
> ? ? ? ?(tree_ssa_prefetch_arrays): Likewise.