<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 Information at O1"
href="https://bugs.llvm.org/show_bug.cgi?id=45895">45895</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong Line Information at O1
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>C
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>massarelli@diag.uniroma1.it
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, ditaliano@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Line 9 should not be hit during debugging.
$ cat a.c
char a;
int b;
void c( d)
{
int si1 = a, si2 = d;
b =
si1 > si2 || si2 > si1 < si2 ?
0 :
si1 * si2;
}
int main ()
{
c( 80);
}
$ clang -v
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
c25b20c0f6c13d68dbc2e185764082d61ae4a132)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0
Selected GCC installation: /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
$ lldb -v
lldb version 11.0.0
clang revision c25b20c0f6c13d68dbc2e185764082d61ae4a132
llvm revision c25b20c0f6c13d68dbc2e185764082d61ae4a132
$ clang -O1 -g -o opt a.c
$ lldb opt
(lldb) target create "opt"
Current executable set to 'opt' (x86_64).
(lldb) b -l 9
Breakpoint 1: where = opt`c + 19 at a.c:9:15, address = 0x00000000004004b3
(lldb) r
Process 229 launched: 'opt' (x86_64)
Process 229 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x00000000004004b3 opt`c(d=80) at a.c:9:15
6 b =
7 si1 > si2 || si2 > si1 < si2 ?
8 0 :
-> 9 si1 * si2;
10 }
11 int main ()
12 {
(lldb) p si1
(int) $0 = 0
(lldb) p si2
(int) $1 = 80
(lldb) expr si1 > si2 || si2 > si1 < si2
(bool) $2 = true
(lldb) s
Process 229 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004b8 opt`c(d=80) at a.c:7:34
4 {
5 int si1 = a, si2 = d;
6 b =
-> 7 si1 > si2 || si2 > si1 < si2 ?
8 0 :
9 si1 * si2;
10 }
(lldb) s
Process 229 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004bd opt`c(d=80) at a.c:6:11
3 void c( d)
4 {
5 int si1 = a, si2 = d;
-> 6 b =
7 si1 > si2 || si2 > si1 < si2 ?
8 0 :
9 si1 * si2;
(lldb) s
Process 229 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004c3 opt`c(d=80) at a.c:10:5
7 si1 > si2 || si2 > si1 < si2 ?
8 0 :
9 si1 * si2;
-> 10 }
11 int main ()
12 {
13 c( 80);
(lldb) s
Process 229 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004db opt`main at a.c:14:5
11 int main ()
12 {
13 c( 80);
-> 14 }
(lldb) s</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>