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]

Re: [trans-mem, PATCH] do not dereference node if null in expand_call_tm (PR middle-end/52047)


On Tue, Jan 31, 2012 at 6:11 PM, Patrick Marlier
<patrick.marlier@gmail.com> wrote:
> 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.
>
> OK?

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?

Richard.

> (I am almost sure I already proposed this modification few time ago but it
> have been lost somewhere.)
> --
> Patrick.
>
> 2012-01-31 ?Patrick Marlier ?<patrick.marlier@gmail.com>
>
> ? ? ? ?PR middle-end/52047
> ? ? ? ?* trans-mem.c (expand_call_tm): Dereference node only if
> ? ? ? ?non-NULL.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]