<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Wrong line table information at -Og"
href="https://bugs.llvm.org/show_bug.cgi?id=45425">45425</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong line table information at -Og
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>DebugInfo
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ditaliano@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>aprantl@apple.com, dblaikie@gmail.com, echristo@gmail.com, jdevlieghere@apple.com, jeremy.morse.llvm@gmail.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com, vsk@apple.com
</td>
</tr></table>
<p>
<div>
<pre>$ 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 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>