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: unassignedb...@nondot.org
          Reporter: dav...@freebsd.org
                CC: jdevliegh...@apple.com, keith.wal...@arm.com,
                    llvm-bugs@lists.llvm.org,
                    paul_robin...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to