diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-05-12 16:27:40 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-05-12 16:29:43 +0200 |
commit | a835f046cdf017b9e8ad5576df4f10daaf8420d0 (patch) | |
tree | bfdf51504f0e6f3c383bbbfc7c3d73debabd1d4f /gcc | |
parent | 2c04284abe5d5f1148c709a769f3b83bee2485d0 (diff) | |
download | gcc-a835f046cdf017b9e8ad5576df4f10daaf8420d0.zip gcc-a835f046cdf017b9e8ad5576df4f10daaf8420d0.tar.gz gcc-a835f046cdf017b9e8ad5576df4f10daaf8420d0.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto-cgraph.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc index 805c785..aed5e9d 100644 --- a/gcc/lto-cgraph.cc +++ b/gcc/lto-cgraph.cc @@ -1020,7 +1020,7 @@ output_symtab (void) When doing WPA we must output every asm just once. Since we do not partition asm nodes at all, output them to first output. This is kind of hack, but should work well. */ - if (!asm_nodes_output) + if (!asm_nodes_output && !lto_stream_offload_p) { asm_nodes_output = true; lto_output_toplevel_asms (); |