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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to