[llvm-bugs] [Bug 27884] New: Assembler not accepting hex constants that include '0b' or '0B' as first characters in intel syntax

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 25 16:07:32 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27884

            Bug ID: 27884
           Summary: Assembler not accepting hex constants that include
                    '0b' or '0B' as first characters in intel syntax
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider the following assembly code:

.intel_syntax
add rax, 0A0h
add rax, 0a0h
add rbx, 0B0h
add rbx, 0b0h

Both lines are in intel syntax and add a hexadecimal constant to the value in a
register. However, when you try to compile this using clang, you get an error:

reduced3.asm:4:14: error: unknown token in expression
add rbx, 0B0h
             ^
reduced3.asm:5:14: error: unknown token in expression
add rbx, 0b0h
             ^

(The carat points to just after the 'h' character if it gets mangled). I
suspect this is because the function AsmLexer::LexDigit() in AsmLexer.cpp i
parsing assuming AT&T syntax and gets confused. Prior to the change in r263802,
the compiler was correctly accepting the constant when it was '0B', but after
that change, both are causing errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160525/c9ec3691/attachment-0001.html>


More information about the llvm-bugs mailing list