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

            Bug ID: 39532
           Summary: Assembly parsing error (too many operands for
                    instruction) for ARM Cortex-M
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

error encountered when compiling newlib for Cortex-M3 with -Os.

====== ldrb.S ===================
        .text
        .global test
        .type test, %function

        ldrb.w    r2, [r3], #1

        .size test, . - strlen
==================================

Compiling above code with gives error.

$ clang -target arm-none-eabi -mcpu=cortex-m3  -c ldrb.S
ldrb.S:5:19: error: too many operands for instruction
 ldrb.w r2, [r3], #1
                  ^

GCC compiles it without complaining.

Whether or not this behavior is correct is a bit confusing because "A7.7.45
LDRB(immediate)" section of the ARM7-m architecture manual shows that  .W
suffix is applied to T2 encoding but not to T3 encoding (above).
However "A7.2 Standard assembler syntax fields" suggests that .W suffix is used
to force the assembler to select 32-bit encoding. So I think Clang shouldn't
really regard it as an error.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to