[LLVMbugs] [Bug 13145] New: Naming a function like a register name confuses the asm parser
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jun 19 04:57:18 PDT 2012
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: unassignedbugs at nondot.org
ReportedBy: stefan at stefant.org
CC: llvmbugs at cs.uiuc.edu
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.
More information about the llvm-bugs
mailing list