This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Mark by_ref mem_ref in build_receiver_ref as non-trapping
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, Thomas Schwinge <thomas at codesourcery dot com>, "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Mon, 23 Nov 2015 11:54:48 +0100
- Subject: Re: [PATCH] Mark by_ref mem_ref in build_receiver_ref as non-trapping
- Authentication-results: sourceware.org; auth=none
- References: <55A2618A dot 7050503 at mentor dot com> <87io9o1nbn dot fsf at kepler dot schwinge dot homeip dot net> <20150713083642 dot GO1788 at tucnak dot redhat dot com> <55A389AD dot 5010203 at mentor dot com> <5650B91A dot 8030107 at mentor dot com> <20151123084544 dot GV5675 at tucnak dot redhat dot com> <CAFiYyc2d55dWMpYAzhro23h_LFRdGHhiDjqBGuCKvqDzeU-A-w at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 23, 2015 at 11:39:26AM +0100, Richard Biener wrote:
> On Mon, Nov 23, 2015 at 9:45 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Sat, Nov 21, 2015 at 07:34:02PM +0100, Tom de Vries wrote:
> >> Mark by_ref mem_ref in build_receiver_ref as non-trapping
> >>
> >> 2015-11-21 Tom de Vries <tom@codesourcery.com>
> >>
> >> * omp-low.c (build_receiver_ref): Mark by_ref mem_ref as non-trapping.
> >
> > This is ok.
>
> Are you sure this is properly re-set by inlining via
>
> /* We cannot propagate the TREE_THIS_NOTRAP flag if we have
> remapped a parameter as the property might be valid only
> for the parameter itself. */
> if (TREE_THIS_NOTRAP (old)
> && (!is_parm (TREE_OPERAND (old, 0))
> || (!id->transform_parameter && is_parm (ptr))))
> TREE_THIS_NOTRAP (*tp) = 1;
>
> ? Or is this never hoistable to a place where TREE_THIS_NOTRAP is not true
> even after inlining? (I presume this is not directly a load via the
> static chain pointer?)
I don't think inlining is ever around here, this is inside of the outlined
bodies of the OpenMP constructs, those are the *.omp_fn* artificial
functions called from libgomp, and is used in cases where
.omp_data_i->field
is not the field itself, but pointer to the original variable. The caller
of the libgomp functions that in the end invoke the .omp_fn* functions
guarantees that the field in that case is initialized to an address of the
original variables, is not NULL or some invalid pointer.
Jakub