[PATCH] Fix PR78027

Alexander Monakov amonakov@ispras.ru
Fri Dec 9 14:57:00 GMT 2016


On Thu, 8 Dec 2016, Jeff Law wrote:
> > 	PR fortran/78027
> > 
> > 	gcc/
> > 	* ipa-icf.c (sem_function::parse): Don't process functions with
> > 	oacc decl attributes, as they may be OpenACC routines.
> > 
> > 	gcc/testsuite/
> > 	* c-c++-common/goacc/acc-icf.c: New test.
> > 	* gfortran.dg/goacc/pr78027.f90: New test.
> This follows the same approach as we do for openmp.  This is fine for the
> trunk.

Normally all offloaded code has either "omp declare target" (most functions) or
"omp target entrypoint" (only toplevel offloaded code).  This used to include
OpenACC functions: they would have "oacc fnattrib" _in_ _addition_ to those
attributes, not _instead_ of them!  If something related to a recent OpenACC
patch adds "oacc fnattrib" without at the same time adding "omp declare target",
it's probable that other places in the compiler may break, not just IPA ICF.

The explanation and the patch are written as if "oacc fnattrib" can appear
without "omp declare target" -- ttbomk this could never happen before.

Can this please be cleared up?

Alexander

P.S. (and for the record, I'm unhappy that the reason for blacklisting "omp *"
attributes doesn't seem to be documented anywhere -- I see no way to understand
from looking at this code _why_ the check is there; is it due to issues with
"omp declare simd"? or something else?)



More information about the Gcc-patches mailing list