This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE for static vars in offloaded functions
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 7 Mar 2018 14:29:48 +0100 (CET)
- Subject: Re: [PATCH] Fix ICE for static vars in offloaded functions
- Authentication-results: sourceware.org; auth=none
- References: <2299637a-3124-8609-e68d-225703f16abe@mentor.com> <20180307132516.GE5867@tucnak>
On Wed, 7 Mar 2018, Jakub Jelinek wrote:
> On Wed, Mar 07, 2018 at 02:20:26PM +0100, Tom de Vries wrote:
> > Fix ICE for static vars in offloaded functions
> >
> > 2018-03-06 Tom de Vries <tom@codesourcery.com>
> >
> > PR lto/84592
> > * varpool.c (varpool_node::get_create): Mark static variables in
> > offloaded functions as offloadable.
> >
> > * testsuite/libgomp.c/pr84592-2.c: New test.
> > * testsuite/libgomp.c/pr84592.c: New test.
> > * testsuite/libgomp.oacc-c-c++-common/pr84592-3.c: New test.
>
> Ok, thanks
+ bool in_offload_func
+ = (cfun
+ && TREE_STATIC (decl)
+ && (lookup_attribute ("omp target entr
I think you want to use decl_function_context (decl) here,
not rely on magic cfun being set. The whole varpool.c file
doesn't mention cfun yet and you shoudln't either.
please fix if you already committed the fix.
Thanks,
Richard.
> Jakub
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)