[gomp4] acc routines bugfix

Cesar Philippidis cesar@codesourcery.com
Fri Jul 24 15:11:00 GMT 2015


Jim ran into an ICE in a fortran program which contains an acc vector
loop with a call to a subroutine. There are two things going on in here.
First, a couple of functions in tree-nested.c weren't considering the
_GANG, _WORKER, _VECTOR, and _SEQ omp clause codes. Second, the target
lto compiler would fail an assert if a routine clause wasn't applied to
the subroutine.

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.

Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector-routines.diff
Type: text/x-patch
Size: 2980 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150724/108be83a/attachment.bin>


More information about the Gcc-patches mailing list