]> git.ipfire.org Git - thirdparty/gcc.git/commit
[offloading] Error on missing symbols
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2018 13:48:56 +0000 (13:48 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2018 13:48:56 +0000 (13:48 +0000)
commit07c14f81e79fe4e4dfbd1176bcf10937f1fdf38f
tree2d768b42e3a31f9210ad81e2e41b2466bd284d01
parent76c21b271247ccbd681bdb4530426d2fe35dbfa5
[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  <tdevries@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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267134 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/lto-cgraph.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded-aux.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/function-not-offloaded.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/variable-not-offloaded.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c-c++-common/function-not-offloaded.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c-c++-common/variable-not-offloaded.c [new file with mode: 0644]