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

            Bug ID: 45425
           Summary: Wrong line table information at -Og
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedb...@nondot.org
          Reporter: ditali...@apple.com
                CC: apra...@apple.com, dblai...@gmail.com,
                    echri...@gmail.com, jdevliegh...@apple.com,
                    jeremy.morse.l...@gmail.com, keith.wal...@arm.com,
                    llvm-bugs@lists.llvm.org,
                    paul_robin...@playstation.sony.com, v...@apple.com

$ cat a.c

int a;
int b(char c) {
  return (a >= 2 || c >> a)
             ? c
             : 0;
}
int
main()
{
  return b(0);
}

$ ./clang --version
clang version 11.0.0 (https://github.com/llvm/llvm-project
b7397e81fe4dee8ffd4a1353bf0cf3a7d2ed267b)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Users/dcci/work/llvm-mono/build-release/bin/.

$  ./lldb --version
lldb version 11.0.0
  clang revision b7397e81fe4dee8ffd4a1353bf0cf3a7d2ed267b
  llvm revision b7397e81fe4dee8ffd4a1353bf0cf3a7d2ed267b

To reproduce, set a breakpoint in main, and keep stepping through `s`.
Eventually, you'll hit line `4`, despite the conditions are both false, i.e.

* thread #1, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x0000000100000f7a a`b(c='\0') at a.c:4:16 [opt]
   1    int a;
   2    int b(char c) {
   3      return (a >= 2 || c >> a)
-> 4                 ? c
   5                 : 0;
   6    }
   7    int
(lldb) p (a >= 2)
(bool) $0 = false
(lldb) p (bool)(c >> a)
(bool) $1 = false

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to