https://bugs.llvm.org/show_bug.cgi?id=34708
Bug ID: 34708
Summary: Regression: Referencing labels across asm blocks
results in bad asm since 4.0.0
Product: clang
Version: 4.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: l...@thecybershadow.net
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
///////////// test.cpp ////////////
bool test()
{
__asm mov byte ptr [magic], 0x90;
__asm {
magic:
nop
};
}
///////////////////////////////////
$ clang -c -m32 -target i386-pc-windows-msvc18.0.0 test.cpp
test.cpp:3:3: error: assembler label 'L__MSASMLABEL_.0__magic' can not be
undefined
__asm mov byte ptr [magic], 0x90;
^
<inline asm>:2:2: note: instantiated into assembly here
mov byte ptr L__MSASMLABEL_.0__magic, 0x90
^
1 error generated.
Looking at the emitted assembly, it looks like Clang/LLVM uses the
"L__MSASMLABEL_.0__magic" label when referring to the address of the "magic"
label, but actually defines the label with the name "L__MSASMLABEL_.1__magic".
In 3.9.1 "L__MSASMLABEL_.0__magic" is used throughout.
This pattern is necessary for MSVC compatibility with programs using
self-modifying code.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs