diff options
| author | Michal Jires <mjires@suse.cz> | 2026-01-30 16:42:48 +0100 |
|---|---|---|
| committer | Michal Jires <mjires@suse.cz> | 2026-02-05 15:42:35 +0100 |
| commit | fa20d1d7095122c7fc0e701b08ec383a60404bb0 (patch) | |
| tree | 93444f0c5b3281d37f617b25f4a1b5651abd3eab /libjava/classpath/java | |
| parent | ce8a84ba6719a71365b611a94cc2454dd157f3b2 (diff) | |
| download | gcc-fa20d1d7095122c7fc0e701b08ec383a60404bb0.zip gcc-fa20d1d7095122c7fc0e701b08ec383a60404bb0.tar.gz gcc-fa20d1d7095122c7fc0e701b08ec383a60404bb0.tar.bz2 | |
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.
Diffstat (limited to 'libjava/classpath/java')
0 files changed, 0 insertions, 0 deletions
