]> git.ipfire.org Git - thirdparty/gcc.git/commit
LTO: Fix writing of toplevel asm with offloading [PR109816]
authorTobias Burnus <tobias@codesourcery.com>
Fri, 12 May 2023 14:27:40 +0000 (16:27 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 12 May 2023 14:29:43 +0000 (16:29 +0200)
commita835f046cdf017b9e8ad5576df4f10daaf8420d0
treebfdf51504f0e6f3c383bbbfc7c3d73debabd1d4f
parent2c04284abe5d5f1148c709a769f3b83bee2485d0
LTO: Fix writing of toplevel asm with offloading [PR109816]

When offloading was enabled, top-level 'asm' were added to the offloading
section, confusing assemblers which did not support the syntax. Additionally,
with offloading and -flto, the top-level assembler code did not end up
in the host files.

As r14-321-g9a41d2cdbcd added top-level 'asm' to one libstdc++ header file,
the issue became more apparent, causing fails with nvptx for some
C++ testcases.

PR libstdc++/109816

gcc/ChangeLog:

* lto-cgraph.cc (output_symtab): Guard lto_output_toplevel_asms by
'!lto_stream_offload_p'.

libgomp/ChangeLog:

* testsuite/libgomp.c++/target-map-class-1.C: New test.
* testsuite/libgomp.c++/target-map-class-2.C: New test.
gcc/lto-cgraph.cc
libgomp/testsuite/libgomp.c++/target-map-class-1.C [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/target-map-class-2.C [new file with mode: 0644]