[LLVMbugs] [Bug 20323] New: clang generates illegal ARM STR opcode with FlexOffset

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 16 08:27:12 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20323

            Bug ID: 20323
           Summary: clang generates illegal ARM STR opcode with FlexOffset
           Product: clang
           Version: 3.4
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: max at duempel.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12776
  --> http://llvm.org/bugs/attachment.cgi?id=12776&action=edit
Demo program

Compile the attached program on an ARM (e.g. Raspberry Pi, Cubieboard) with:
clang++ -std=c++11 -O2 -S str_flexoffset.cpp

The resulting assembly file contains the following opcode:

        str     r2, [r2], #4

Some CPUs crash with SIGILL (e.g. Qualcomm QSD8250, Allwinner A20), while
others ignore the problem (e.g. Qualcomm MSM7200A, Allwinner A10, Exynos 4210).

Documentation on STR:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0068b/Bcfihdhj.html#Chdjhhhe

"Rn must not be the same as Rd, if the instruction:
    is pre-indexed with writeback (the ! suffix);
    is post-indexed;
    uses the T suffix;"

Here, Rn and Rd are the same, and the ", #4" is a post-indexed FlexOffset. This
combination is illegal.

I could observe this problem with clang 3.5 (Debian 1:3.5~svn211669-1), clang
3.4 (Android NDK r9d) and clang 3.0 (Debian 1:3.0-6.2).

Link to the original bug report: http://bugs.xcsoar.org/ticket/3356

-- 
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/20140716/db296e76/attachment.html>


More information about the llvm-bugs mailing list