[llvm-bugs] [Bug 45820] New: Wrong line table information at -Og
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 6 15:43:15 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45820
Bug ID: 45820
Summary: Wrong line table information at -Og
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: DebugInfo
Assignee: unassignedbugs at nondot.org
Reporter: ditaliano at apple.com
CC: jdevlieghere at apple.com, keith.walker at arm.com,
llvm-bugs at lists.llvm.org,
paul_robinson at playstation.sony.com
short a, b;
void(c)(d) {}
short(e)(d) { return d; }
static short(f)(d) {}
short g() {
int l_284[2][3][6];
for (; a >= 0;) {
if (e(0 <= 0))
return 1;
for (;;) {
l_284[1][2][5] = 0;
break;
}
c(f);
f(l_284);
b = l_284[1][1][4];
}
}
int main() { g(); }
####
Process 16744 stopped
* thread #1: tid = 16744, 0x0000000000401181 drama.out`main + 1 at a.c:19, name
= 'drama.out', stop reason = breakpoint 1.1
frame #0: 0x0000000000401181 drama.out`main + 1 at a.c:19
16 b = l_284[1][1][4];
17 }
18 }
-> 19 int main() { g(); }
(lldb) s
Process 16744 stopped
* thread #1: tid = 16744, 0x0000000000401137 drama.out`g + 7 at a.c:7, name =
'drama.out', stop reason = step in
frame #0: 0x0000000000401137 drama.out`g + 7 at a.c:7
4 static short(f)(d) {}
5 short g() {
6 int l_284[2][3][6];
-> 7 for (; a >= 0 {
8 if (e(0 <= 0))
9 return 1;
10 for (; {
(lldb) s
Process 16744 stopped
* thread #1: tid = 16744, 0x0000000000401122 drama.out`e(d=1) + 2 at a.c:3,
name = 'drama.out', stop reason = step in
frame #0: 0x0000000000401122 drama.out`e(d=1) + 2 at a.c:3
1 short a, b;
2 void(c)(d) {}
-> 3 short(e)(d) { return d; }
4 static short(f)(d) {}
5 short g() {
6 int l_284[2][3][6];
7 for (; a >= 0 {
(lldb) s
Process 16744 stopped
* thread #1: tid = 16744, 0x0000000000401150 drama.out`g + 32 at a.c:11, name =
'drama.out', stop reason = step in
frame #0: 0x0000000000401150 drama.out`g + 32 at a.c:11
8 if (e(0 <= 0))
9 return 1;
10 for (; {
-> 11 l_284[1][2][5] = 0;
12 break;
13 }
14 c(f);
The line 9 should be always hit and the program should exit never executing
lines [10:12], however we see that line 11 is hit after returning from function
e. For some reason it only reproduces on Linux, I haven't investigated yet.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200506/da850d2d/attachment.html>
More information about the llvm-bugs
mailing list