[llvm-bugs] [Bug 52240] New: Variable's value late availability after SimplifyCFG at Os
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Oct 20 10:35:07 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=52240
Bug ID: 52240
Summary: Variable's value late availability after SimplifyCFG
at Os
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: DebugInfo
Assignee: unassignedbugs at nondot.org
Reporter: cristianassaiante at outlook.com
CC: jdevlieghere at apple.com, keith.walker at arm.com,
llvm-bugs at lists.llvm.org,
paul_robinson at playstation.sony.com
Variable l_47 value is not available at line 9 even if it has been assigned.
The value become available again at line 10.
>From bisect, this behavior may be caused by SimplifyCFGPass on function (main).
$ cat a.c
int a, c, d;
int *b[4];
int main()
{
int f; {
int *l_47 = &a;
int e = 0;
for (; e < 4; e++)
b[e] = &a;
f = c;
}
d = f; }
$ clang -v
clang version 13.0.0
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 13.0.0
$ clang -g -Os -o opt a.c
$ lldb opt
(lldb) target create "opt"
Current executable set to '/home/stepping/64/reduce/opt' (x86_64).
(lldb) b 6
Breakpoint 1: where = opt`main at a.c:9:12, address = 0x0000000000400478
(lldb) run
Process 282 launched: '/home/stepping/64/reduce/opt' (x86_64)
Process 282 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
frame #0: 0x0000000000400478 opt`main at a.c:9:12
6 int *l_47 = &a;
7 int e = 0;
8 for (; e < 4; e++)
-> 9 b[e] = &a;
10 f = c;
11 }
12 d = f; }
(lldb) frame var
(int) f = <variable not available>
(int) e = 0
(int *) l_47 = <variable not available>
(lldb) n
Process 282 stopped
* thread #1, name = 'opt', stop reason = step over
frame #0: 0x0000000000400497 opt`main at a.c:10:10
7 int e = 0;
8 for (; e < 4; e++)
9 b[e] = &a;
-> 10 f = c;
11 }
12 d = f; }
(lldb) frame var
(int) f = <variable not available>
(int) e = 0
(int *) l_47 = 0x0000000000601040
--
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/20211020/6251d042/attachment.html>
More information about the llvm-bugs
mailing list