[LLVMbugs] [Bug 18865] New: ARMLoadStoreOptimizer should be disable when Address Sanitizer is enable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 16 22:30:31 PST 2014


            Bug ID: 18865
           Summary: ARMLoadStoreOptimizer should be disable when Address
                    Sanitizer is enable
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedbugs at nondot.org
          Reporter: manjian2006 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12076
  --> http://llvm.org/bugs/attachment.cgi?id=12076&action=edit
source that cause bug

test code is in the uploaded attachment.
clang -Os -target arm-linux-androideabi -march=armv7-a -fsanitize=address
-mthumb -S /tmp/1.cpp

illegal code generated:
=>    lsrs    r6, r4, #3
    ldr    r1, [r1, r0]
    add    r0, r2
    str    r0, [r4, #4]
    str    r1, [r4, #8]
    movw    r1, #62208
    movw    r0, #61937
    movt    r1, #62451
    add.w    r5, r4, #16
=>    stm.w    r6, {r0, r1}

r4 stores the results of __asan_stack_malloc_1,r6 is the shadow memory address
of r4.Since r4 is a stack address,which is aligned to 64 bits when the target
is ARM, the right swift will result in a address not aligned to 32 bits.So
stm.w will result in alignment fault (A3.2.1).
The code is from FunctionStackPoisoner::poisonRedZones in 

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/20140217/489359fc/attachment.html>

More information about the llvm-bugs mailing list