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: Wed, 1 Feb 2012 09:59:48 +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>
On Tue, Jan 31, 2012 at 6:11 PM, Patrick Marlier
> In the PR testcase, a call to __builtin_prefetch is done. When this function
> call comes into expand_call_tm, there is no cgraph_node associated for this
> builtin and thus node->local fails.
> trans-mem.c (expand_call_tm):
> ? ? ?...
> ? ? ?node = cgraph_get_node (fn_decl);
> ? ? ?if (node->local.tm_may_enter_irr)
> ? ? ? ?transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
> ? ? ?...
> The attached patch adds a check for non-NULL node. I have added the testcase
> but I don't know if it is relevant.
> Currently bootstrapping on i686-pc-linux-gnu. Tested on i686-pc-linux-gnu.
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. Honza?
Don't you maybe want to handle builtins in a special way here? At least
those that are const/pure?
> (I am almost sure I already proposed this modification few time ago but it
> have been lost somewhere.)
> 2012-01-31 ?Patrick Marlier ?<email@example.com>
> ? ? ? ?PR middle-end/52047
> ? ? ? ?* trans-mem.c (expand_call_tm): Dereference node only if
> ? ? ? ?non-NULL.