<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 Og"
href="https://bugs.llvm.org/show_bug.cgi?id=46009">46009</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong line 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>Linux
</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>massarelli@diag.uniroma1.it
</td>
</tr>
<tr>
<th>CC</th>
<td>ditaliano@apple.com, jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
</td>
</tr></table>
<p>
<div>
<pre>Line 8 should not be hit.
$ cat a.c
int a, b, c ;
int main ()
{
{int ui1 = 5, ui2 = b;
c =
ui2 == 0 ?
ui1 :
(ui1 / ui2);
}
}
$ clang -v
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
268fa40daa151d3b4bff1df12b62e5dae94685d7)
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
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
$ lldb -v
$ lldb opt
(lldb) target create "opt"
Current executable set to 'opt' (x86_64).
(lldb) b main
Breakpoint 1: where = opt`main at a.c:4:26, address = 0x0000000000400480
(lldb) r
Process 65 launched: 'opt' (x86_64)
Process 65 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x0000000000400480 opt`main at a.c:4:26
1 int a, b, c ;
2 int main ()
3 {
-> 4 {int ui1 = 5, ui2 = b;
5 c =
6 ui2 == 0 ?
7 ui1 :
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0000000000400486 opt`main at a.c:8:16
5 c =
6 ui2 == 0 ?
7 ui1 :
-> 8 (ui1 / ui2);
9 }
10 }
(lldb) di
opt`main:
0x400480 <+0>: movl 0x200ba6(%rip), %ecx ; b
-> 0x400486 <+6>: movl $0x5, %eax
0x40048b <+11>: testl %ecx, %ecx
0x40048d <+13>: je 0x400493 ; <+19> at a.c:5:10
0x40048f <+15>: xorl %edx, %edx
0x400491 <+17>: idivl %ecx
0x400493 <+19>: movl %eax, 0x200b97(%rip) ; c
0x400499 <+25>: xorl %eax, %eax
0x40049b <+27>: retq
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x000000000040048b opt`main at a.c:6:15
3 {
4 {int ui1 = 5, ui2 = b;
5 c =
-> 6 ui2 == 0 ?
7 ui1 :
8 (ui1 / ui2);
9 }
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0000000000400493 opt`main at a.c:5:10
2 int main ()
3 {
4 {int ui1 = 5, ui2 = b;
-> 5 c =
6 ui2 == 0 ?
7 ui1 :
8 (ui1 / ui2);
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0000000000400499 opt`main at a.c:10:1
7 ui1 :
8 (ui1 / ui2);
9 }
-> 10 }</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>