[gomp4] acc routines bugfix

Ilya Verbin iverbin@gmail.com
Fri Jul 24 16:13:00 GMT 2015


On Fri, Jul 24, 2015 at 17:24:55 +0200, Jakub Jelinek wrote:
> On Fri, Jul 24, 2015 at 06:21:34PM +0300, Ilya Verbin wrote:
> > On Fri, Jul 24, 2015 at 08:05:00 -0700, Cesar Philippidis wrote:
> > > The second point is interesting. Offloaded functions require the "omp
> > > target" attribute or that function won't reach the lto compiler. That's
> > > fine because not all targets can handle general code. The problem occurs
> > > when a user forgets to bless a function as offloaded, which OpenACC
> > > allows. This patch teaches the lto-wrapper to error on unrecognized
> > > functions with flag_openacc or hit gcc_unreachable otherwise. I couldn't
> > > think of a way to test the lto error message because that involves
> > > having two compilers present. I wonder if it's ok to have libgomp check
> > > for compiler expected compiler errors? However, that's more of a
> > > gcc/testsuite type of check.
> > > 
> > > I don't think trunk has much support for acc routines just yet, so I
> > > applied this patch to gomp-4_0-branch for now.
> > 
> > OpenMP has similar issue.
> 
> Well, only for variables.  For functions the spec does not require anything
> like that, you can supply the functions in some other way.
> Generally, e.g. libc or libm functions aren't all #pragma omp declare target
> marked, yet they are usually allowed.

Library functions have node->in_other_partition = 0 and
node->used_from_other_partition = 0, I've just tried fprintf in a target region.
Only local functions without "declare target", but referenced from another
function with "declare target" get incorrect values here.

  -- Ilya



More information about the Gcc-patches mailing list