You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The "cc" clobber in GNU extended asm is dropped with a warning #256
Severity: warning noise on x86/x86-64; a possible wrong-code risk on targets
where GCC does not implicitly treat asm as clobbering the condition codes
(not verified here). Component:asm_clobbers_spec in src/extasm.c (ec_cc_clobber_ignored).
Expected: no diagnostic, and "cc" kept in the generated asm. GCC
(-Wall -Wextra) and Clang accept it silently. GCC documents "cc" as valid
on every target: on targets that model the condition codes as a register it
names that register, and elsewhere it has no effect.
The clobber isn't recorded at all, so the C-generating back end can't emit it.
On x86/x86-64 GCC treats every asm statement as clobbering the flags, so the
generated code is unaffected and this is just noise. On a target where GCC
relies on an explicit "cc" to know that the flags change, dropping it could
let GCC keep a comparison result live across the asm. I did not test this,
since this build is x86-64 only. Boost.Atomic uses "cc" heavily in its
ARM/AArch64/PowerPC/SPARC asm backends.
Suggested fix: record "cc" (for example as an anr_cc pseudo-register like anr_memory), emit it in the C-generating back end, and drop the warning.
At minimum, don't warn in GNU modes.
Impact on Boost
78 warnings in 19 translation units, all from boost/atomic/detail/extra_ops_gcc_x86.hpp (lines 1079, 1089, 1155, BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA). They show up in Boost.Atomic and
in libraries that include its extra ops (Thread, Log, Fiber, ...).
Activity