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: unassignedclangb...@nondot.org
          Reporter: car...@cardoe.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to