https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99508
Bug ID: 99508
Summary: Asm labels declared inside a function are ignored
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: frank.mehnert at googlemail dot com
Target Milestone: ---
This is apparently a gcc-11 regression. Following example:
#include
void foo()
{
void bar() asm ("bar_assembler");
extern unsigned buzz asm("buzz_assembler");
bar();
printf("%d\n", buzz);
}
Compile this C++ source code with -c and look at the generated symbols with
'objdump -tC'.
g++-10:
*UND* bar_assembler
*UND* buzz_assembler
*UND* printf
g++-11: (Debian experimental 20210306):
*UND* bar()
*UND* buzz
*UND* printf
g++11 produces the same result as g++10 if 'bar' and 'buzz' are declared
outside foo().