Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Nathan Sidwell
On 07/31/15 04:43, Jakub Jelinek wrote: Hi! I wonder if we shouldn't change: TREE_TYPE (ctx->receiver_decl) = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT); in fixup_child_record_type to add: if (is_gimple_omp_offloaded (ctx->stmt)) type = build_qualif

Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Richard Biener
On Fri, Jul 31, 2015 at 11:51 AM, Jakub Jelinek wrote: > On Fri, Jul 31, 2015 at 11:41:47AM +0200, Richard Biener wrote: >> >> Const qualification of a pointer or reference doesn't result in any >> >> optimization. The >> >> decl you refer to has to be constant. >> > >> > Even if the pointer woul

Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Jakub Jelinek
On Fri, Jul 31, 2015 at 11:41:47AM +0200, Richard Biener wrote: > >> Const qualification of a pointer or reference doesn't result in any > >> optimization. The > >> decl you refer to has to be constant. > > > > Even if the pointer would be addressable? > > Yes, it's the decls readonly setting tha

Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Richard Biener
On Fri, Jul 31, 2015 at 11:31 AM, Jakub Jelinek wrote: > On Fri, Jul 31, 2015 at 11:22:30AM +0200, Richard Biener wrote: >> On Fri, Jul 31, 2015 at 10:43 AM, Jakub Jelinek wrote: >> > Hi! >> > >> > I wonder if we shouldn't change: >> > >> > TREE_TYPE (ctx->receiver_decl) >> > = build_qualif

Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Jakub Jelinek
On Fri, Jul 31, 2015 at 11:22:30AM +0200, Richard Biener wrote: > On Fri, Jul 31, 2015 at 10:43 AM, Jakub Jelinek wrote: > > Hi! > > > > I wonder if we shouldn't change: > > > > TREE_TYPE (ctx->receiver_decl) > > = build_qualified_type (build_reference_type (type), > > TYPE_QUAL_RESTRICT);

Re: Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Richard Biener
On Fri, Jul 31, 2015 at 10:43 AM, Jakub Jelinek wrote: > Hi! > > I wonder if we shouldn't change: > > TREE_TYPE (ctx->receiver_decl) > = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT); > > in fixup_child_record_type to add: > > if (is_gimple_omp_offloaded (ctx->stmt

Constification of _omp_fn.* argument for target regions

2015-07-31 Thread Jakub Jelinek
Hi! I wonder if we shouldn't change: TREE_TYPE (ctx->receiver_decl) = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT); in fixup_child_record_type to add: if (is_gimple_omp_offloaded (ctx->stmt)) type = build_qualified_type (type, TYPE_QUAL_CONST); before it (