http://llvm.org/bugs/show_bug.cgi?id=13145
Bug #: 13145
Summary: Naming a function like a register name confuses the
asm parser
Product: libraries
Version: 3.1
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Backend: ARM
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 8727
--> http://llvm.org/bugs/attachment.cgi?id=8727
Testcase for invalid label name due to function name on ARM and MBlaze
Having a function named like 'r3' in the C code will cause LLC to emit a label
called 'r3:' in the assembly file for ARM, and a call like this: 'bl r3'.
Parsing the code using llvm-mc causes an error because it tries to match r3 as
register instead of as a label.
I attached a simple test case, here is how to reproduce the error:
clang -O0 -target arm -o test.s -S test.c
llvm-mc -arch=arm -filetype=obj -assemble -o test.o test.s
I do not know if the ARM assembler syntax has different mnemonics for all
immediate and register operand instruction versions. In that case it would be
necessary to parse the operand depending on the mnemonic, otherwise the syntax
is simply ambiguous.
The same problem also exists in the MBlaze backend btw.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs