[llvm-bugs] [Bug 39874] New: Incorrect debug value for integer when building at `-O1`

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 3 17:44:17 PST 2018


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

            Bug ID: 39874
           Summary: Incorrect debug value for integer when building at
                    `-O1`
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

$ cat a.c

char a = 25;
short b() {
  short i = 23680;
  i = a;
  optimize_me_not();
  return a;
}
int main() { b(); }

$ cat b.c
void optimize_me_not() {}

Process 98619 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100000f8b a.out`b at a.c:6:10 [opt]
   3      short i = 23680;
   4      i = a;
   5      optimize_me_not();
-> 6      return a;
   7    }
   8    int main() { b(); }
(lldb) frame var a
(char) a = '\x19'
(lldb) frame var i
(short) i = 23680

`i` should be 25.


-- 
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/20181204/aefaa1e2/attachment.html>


More information about the llvm-bugs mailing list