[LLVMbugs] [Bug 20726] New: Empty inline assembly block results in erroneous stack pointer and segmentation fault

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 21 11:06:59 PDT 2014


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

            Bug ID: 20726
           Summary: Empty inline assembly block results in erroneous stack
                    pointer and segmentation fault
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: johan.overbye at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Error occurs on iOS, in C++ code built with Xcode 5.1.1, using -mno-thumb.

The following boiled-down function seems to reproduce the issue both with and
without optimisation enabled. I've inspected the disassembly without
optimisation and there does seem to be an error in the generated code which
causes SP to receive an erroneous value.

inline void test()
{
    register int v0 asm ("r0") = 0;
    register int v1 asm ("r1") = 0;
    register int v2 asm ("r2") = 0;
    register int v3 asm ("r3") = 0;
    register int v4 asm ("r4") = 0;
    register int v5 asm ("r5") = 0;
    register int v6 asm ("r6") = 0;
    register int v7 asm ("r7") = 0;
    int v8 = 0;
    int v9 = 0;

    asm volatile (
    ""
    :
    [v0] "+r" (v0),
    [v1] "+r" (v1),
    [v2] "+r" (v2),
    [v3] "+r" (v3),
    [v4] "+r" (v4),
    [v5] "+r" (v5),
    [v6] "+r" (v6),
    [v7] "+r" (v7),
    [v8] "+r" (v8),
    [v9] "+r" (v9)
    ::);
}

-- 
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/20140821/06274ad7/attachment.html>


More information about the llvm-bugs mailing list