[Bug inline-asm/101727] invalid symbol redefinition when -O2 enabled

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 2 18:25:26 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101727

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, the documentation talks about it:
https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Basic-Asm.html#Basic-Asm
Under certain circumstances, GCC may duplicate (or remove duplicates of) your
assembly code when optimizing. This can lead to unexpected duplicate symbol
errors during compilation if your assembly code defines symbols or labels.
and
https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Extended-Asm.html#Extended-Asm
Under certain circumstances, GCC may duplicate (or remove duplicates of) your
assembly code when optimizing. This can lead to unexpected duplicate symbol
errors during compilation if your asm code defines symbols or labels. Using
‘%=’ (see AssemblerTemplate) may help resolve this problem.
Normally people use numbered labels instead (leal 1f(...); ... 1: ...) or one
can use %=.


More information about the Gcc-bugs mailing list