https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881
--- Comment #107 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Yong <jy...@gcc.gnu.org>: https://gcc.gnu.org/g:5840bf969e2bfdf4f6c51d04aeb1a96a87727d80 commit r16-867-g5840bf969e2bfdf4f6c51d04aeb1a96a87727d80 Author: LIU Hao <lh_mo...@126.com> Date: Sat Feb 22 13:11:51 2025 +0800 i386: Quote user-defined symbols in assembly in Intel syntax With `-masm=intel`, GCC generates registers without % prefixes. If a user-declared symbol happens to match a register, it will confuse the assembler. User-defined symbols should be quoted, so they are not to be mistaken for registers or operators. Support for quoted symbols were added in Binutils 2.26, originally for ARM assembly, where registers are also unprefixed: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d02603dc201f80cd9d2a1f4b1a16110b1e04222b This change is required for `@SECREL32` to work in Intel syntax when targeting Windows, where `@` is allowed as part of a symbol. GNU AS fails to parse a plain symbol with that suffix: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881#c79 gcc/ChangeLog: PR target/53929 PR target/80881 * config/i386/i386-protos.h (ix86_asm_output_labelref): Declare new function for quoting user-defined symbols in Intel syntax. * config/i386/i386.cc (ix86_asm_output_labelref): Implement it. * config/i386/i386.h (ASM_OUTPUT_LABELREF): Use it. * config/i386/cygming.h (ASM_OUTPUT_LABELREF): Use it.