[PATCH] Fix -fprofile-arcs -fopenmp (PR gcov-profile/34610)

Richard Guenther richard.guenther@gmail.com
Mon Jan 14 15:06:00 GMT 2008


On Jan 9, 2008 9:43 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Wed, Jan 09, 2008 at 09:35:02PM +0100, Jan Hubicka wrote:
> > > with -fopenmp -O2 -fprofile-generate, then after running works with -fopenmp
> > > -O2 -fprofile-use.  gcov outputs looks believable as well, if I run the
> > > program with OMP_NUM_THREADS=1 (otherwise, as the updating of counters isn't
> > > thread safe, some values are smaller than the expected 1000).
> >
> > In general if profiling sees program consistently before or consistently
> > after OMP transfomrations, we are safe.  We do the former.
> > Other question is whether OMP is taking care to update profile (counters
> > and frequencies) while removing the OMP constructs and doing the
> > transfomrations.
>
> The problematic ones OMP_FOR/OMP_CONTINUE are uninstrumented by this patch
> through EDGE_ABNORMAL, for OMP_PARALLEL there is AFAIK just one edge and
> similarly for OMP_RETURN, which are replaced by the function call/return,
> so that shouldn't be instrumented.  OMP_SECTIONS_SWITCH AFAIK should keep
> the edges untouched and similarly for the other constructs, so I believe
> with this patch we are fine.

Yes.  The patch is ok.

Thanks,
Richard.



More information about the Gcc-patches mailing list