[llvm-bugs] [Bug 26518] New: rsp register considered uninitialized

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 7 12:16:58 PST 2016


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

            Bug ID: 26518
           Summary: rsp register considered uninitialized
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cardoe at cardoe.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Using: Ubuntu clang version 3.8.0-svn257166-1~exp1 (trunk) (based on LLVM
3.8.0)

The following code:

static inline struct cpu_info *get_cpu_info(void)
{
    register unsigned long sp asm("rsp");

    return (struct cpu_info *)((sp & ~(STACK_SIZE-1)) + STACK_SIZE) - 1;
}

Results in an uninitialized warning for the variable 'sp' when compiling with
clang. GCC conversely does not report the variable as uninitialized but the
syntax does look like a GCCism. However I think it can be safe to assume that
rsp is initialized so this is probably a small corner case.

Build seen at: https://travis-ci.org/cardoe/xen/jobs/107263394

-- 
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/20160207/42cced37/attachment.html>


More information about the llvm-bugs mailing list