https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71499

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |vries at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #2)
> The is the OpenACC variant of OpenMP's PR71535.
> 
> You need to add "#pragma acc routine" for function "test".  (Of course, we
> shouldn't run into an ICE nevertheless.)

This is a duplicate of
libgomp/testsuite/libgomp.oacc-c-c++-common/function-not-offloaded.c , which
was fixed here ( https://gcc.gnu.org/ml/gcc-cvs/2018-12/msg00431.html ):
...
Author: vries
Date: Fri Dec 14 13:48:56 2018
New Revision: 267134

URL: https://gcc.gnu.org/viewcvs?rev=267134&root=gcc&view=rev
Log:
[offloading] Error on missing symbols

When compiling an OpenMP or OpenACC program containing a reference in the
offloaded code to a symbol that has not been included in the offloaded code,
the offloading compiler may ICE in lto1.

Fix this by erroring out instead, mentioning the problematic symbol:
...
error: variable 'var' has been referenced in offloaded code but hasn't
  been marked to be included in the offloaded code
lto1: fatal error: errors during merging of translation units
compilation terminated.
...

Build x86_64 with nvptx accelerator and reg-tested libgomp.

Build x86_64 and reg-tested libgomp.

2018-12-14  Tom de Vries  <tdevr...@suse.de>

        * lto-cgraph.c (verify_node_partition): New function.
        (input_overwrite_node, input_varpool_node): Use verify_node_partition.

        * testsuite/libgomp.c-c++-common/function-not-offloaded-aux.c: New
test.
        * testsuite/libgomp.c-c++-common/function-not-offloaded.c: New test.
        * testsuite/libgomp.c-c++-common/variable-not-offloaded.c: New test.
        * testsuite/libgomp.oacc-c-c++-common/function-not-offloaded.c: New
test.
        * testsuite/libgomp.oacc-c-c++-common/variable-not-offloaded.c: New
test.

Added:
    trunk/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded-aux.c
    trunk/libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c
    trunk/libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c
    trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/function-not-offloaded.c
    trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/variable-not-offloaded.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-cgraph.c
    trunk/libgomp/ChangeLog
...

Reply via email to