[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559 --- Comment #6 from Andrew Pinski --- *** Bug 123565 has been marked as a duplicate of this bug. ***
[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559 Michal Jireš changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Michal Jireš --- Fixed
[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559
--- Comment #4 from GCC Commits ---
The master branch has been updated by Michal Jires :
https://gcc.gnu.org/g:fa20d1d7095122c7fc0e701b08ec383a60404bb0
commit r16-7332-gfa20d1d7095122c7fc0e701b08ec383a60404bb0
Author: Michal Jires
Date: Fri Jan 30 16:42:48 2026 +0100
c,c++: Fix incorrect warning with asm defined symbols
Static symbols defined in assembly cause wrong "used but never defined"
warning.
static void asm_fn();
asm("%cc0:" :: ":"(&asm_fn));
This happens in C,C++ frontends before cgraph is created where the
relevant flags are located.
We can suppress these warnings with OPT_Wunused.
C,C++ frontends and cgraphunit suppressed OPT_Wunused and
OPT_Wunused_function interchangeably, so we unify suppression to
only OPT_Wunused.
PR testsuite/123559
gcc/c/ChangeLog:
* c-decl.cc (c_write_global_declarations_1): Check and suppress
OPT_Wunused.
* c-typeck.cc (build_asm_expr): Suppress OPT_Wunused.
gcc/ChangeLog:
* cgraphunit.cc (check_global_declaration): Suppress OPT_Wunused.
gcc/cp/ChangeLog:
* decl.cc (wrapup_namespace_globals): Check and suppress
OPT_Wunused.
* semantics.cc (finish_asm_stmt): Suppress OPT_Wunused.
gcc/testsuite/ChangeLog:
* c-c++-common/toplevel-extended-asm-1.c: New test.
[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559 --- Comment #3 from Richard Biener --- I would suggest to set TREE_ASM_WRITTEN if a static function is defined by a toplevel asm and check that in the diagnostic.
[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559 Andrew Pinski changed: What|Removed |Added CC||roland at gnu dot org --- Comment #2 from Andrew Pinski --- *** Bug 123565 has been marked as a duplicate of this bug. ***
[Bug testsuite/123559] FAIL: gcc.dg/lto/toplevel-extended-asm-2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123559 H.J. Lu changed: What|Removed |Added Last reconfirmed||2026-01-12 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Target Milestone|--- |16.0 --- Comment #1 from H.J. Lu --- I got .../gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-2_1.c:1:13: warning: 'static_asm_fn' used but never defined
