<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 - Odd stepping b"
href="https://bugs.llvm.org/show_bug.cgi?id=46120">46120</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Odd stepping b
</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>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
</td>
</tr></table>
<p>
<div>
<pre>Line 24 is hit even if it is dead code. Moreover, the stepping behaviour is
odd: from line 13 it jumps to line 24 and then hit lines 18, 19, 21, 22.
$ cat -n a.c
1 short a, g_35, b, c;
2 int d, f ;
3 static short *g = &g_35;
4 char h, i ;
5 short ciriaco( j, k ) {
6 return k;
7 }
8
9 int main () {
10 {
11 int l = 1;
12 int *l_258 = b;
13 if (f) h++;
14 else {
15 int *m = &l;
16 *m = 0;
17 }
18 *g &= l;
19 i = d;
20 short e = l;
21 c = d * e;
22 if (a) {
23 int l_305 ;
24 (*l_258) = (ciriaco((l_305 != (void*)0), g_35));
25 }
26 }
27 }
$ cat a.c
short a, g_35, b, c;
int d, f ;
static short *g = &g_35;
char h, i ;
short ciriaco( j, k ) {
return k;
}
int main () {
{
int l = 1;
int *l_258 = b;
if (f) h++;
else {
int *m = &l;
*m = 0;
}
*g &= l;
i = d;
short e = l;
c = d * e;
if (a) {
int l_305 ;
(*l_258) = (ciriaco((l_305 != (void*)0), g_35));
}
}
}
$ 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 version 11.0.0
clang revision 268fa40daa151d3b4bff1df12b62e5dae94685d7
llvm revision 268fa40daa151d3b4bff1df12b62e5dae94685d7
$ lldb opt
(lldb) target create "opt"
Current executable set to 'opt' (x86_64).
(lldb) b main
Breakpoint 1: where = opt`main + 1 at a.c:12:18, address = 0x0000000000400491
(lldb) r
Process 65 launched: 'opt' (x86_64)
Process 65 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x0000000000400491 opt`main at a.c:12:18
9 int main () {
10 {
11 int l = 1;
-> 12 int *l_258 = b;
13 if (f) h++;
14 else {
15 int *m = &l;
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x0000000000400499 opt`main at a.c:13:9
10 {
11 int l = 1;
12 int *l_258 = b;
-> 13 if (f) h++;
14 else {
15 int *m = &l;
16 *m = 0;
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004b1 opt`main at a.c:24:49
21 c = d * e;
22 if (a) {
23 int l_305 ;
-> 24 (*l_258) = (ciriaco((l_305 != (void*)0), g_35));
25 }
26 }
27 }
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004bb opt`main at a.c:18:8
15 int *m = &l;
16 *m = 0;
17 }
-> 18 *g &= l;
19 i = d;
20 short e = l;
21 c = d * e;
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004c5 opt`main at a.c:19:9
16 *m = 0;
17 }
18 *g &= l;
-> 19 i = d;
20 short e = l;
21 c = d * e;
22 if (a) {
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004d1 opt`main at a.c:21:10
18 *g &= l;
19 i = d;
20 short e = l;
-> 21 c = d * e;
22 if (a) {
23 int l_305 ;
24 (*l_258) = (ciriaco((l_305 != (void*)0), g_35));
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004db opt`main at a.c:22:9
19 i = d;
20 short e = l;
21 c = d * e;
-> 22 if (a) {
23 int l_305 ;
24 (*l_258) = (ciriaco((l_305 != (void*)0), g_35));
25 }
(lldb) s
Process 65 stopped
* thread #1, name = 'opt', stop reason = step in
frame #0: 0x00000000004004f0 opt`main at a.c:27:1
24 (*l_258) = (ciriaco((l_305 != (void*)0), g_35));
25 }
26 }
-> 27 }</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>