[llvm-bugs] [Bug 51942] New: Variable's value late availability after VectorCombinePass at Os

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 22 13:01:47 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51942

            Bug ID: 51942
           Summary: Variable's value late availability after
                    VectorCombinePass 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

A variable (l_113) value is visile after its declarations and it becomes
available only at line 11.
>From opt-bisect, it seems that the pass after which this behaviour occurs is: 
VectorCombinePass on function (main)

$ cat a.c
int a,  b,  g   ;
int *c = &a;
char d,  e,  f   ;
void  h(i) {
  int l_113 = 9;
  d = *c |=   
                     f =
                                       e      
                                  <= 5  ;
    int *l_80 = b;
    g = *c || *l_80  ^ i;

}
int main() 
  {
       h(5);
  }

$ 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/debuginfo-analysis/issues/issue15/opt' (x86_64).
(lldb) b h
Breakpoint 1: where = opt`h at a.c:9:35, address = 0x0000000000400478
(lldb) r
Process 40 launched: '/home/stepping/debuginfo-analysis/issues/issue15/opt'
(x86_64)
Process 40 stopped
* thread #1, name = 'opt', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400478 opt`h(i=5) at a.c:9:35
   6      d = *c |=   
   7                         f =
   8                                           e      
-> 9                                      <= 5  ;
   10       int *l_80 = b;
   11       g = *c || *l_80  ^ i;
   12     
(lldb) frame var
(int) i = 5
(int) l_113 = <variable not available>

(int *) l_80 = <variable not available>

(lldb) s
Process 40 stopped
* thread #1, name = 'opt', stop reason = step in
    frame #0: 0x0000000000400481 opt`h(i=5) at a.c:7:24
   4    void  h(i) {
   5      int l_113 = 9;
   6      d = *c |=   
-> 7                         f =
   8                                           e      
   9                                      <= 5  ;
   10       int *l_80 = b;
(lldb) frame var
(int) i = 5
(int) l_113 = <variable not available>

(int *) l_80 = <variable not available>

(lldb) s
Process 40 stopped
* thread #1, name = 'opt', stop reason = step in
    frame #0: 0x0000000000400488 opt`h(i=5) at a.c:9:35
   6      d = *c |=   
   7                         f =
   8                                           e      
-> 9                                      <= 5  ;
   10       int *l_80 = b;
   11       g = *c || *l_80  ^ i;
   12     
(lldb) frame var
(int) i = 5
(int) l_113 = <variable not available>

(int *) l_80 = <variable not available>

(lldb) n
Process 40 stopped
* thread #1, name = 'opt', stop reason = step over
    frame #0: 0x000000000040048b opt`h(i=5) at a.c:6:8
   3    char d,  e,  f   ;
   4    void  h(i) {
   5      int l_113 = 9;
-> 6      d = *c |=   
   7                         f =
   8                                           e      
   9                                      <= 5  ;
(lldb) n
Process 40 stopped
* thread #1, name = 'opt', stop reason = step over
    frame #0: 0x00000000004004a1 opt`h(i=5) at a.c:11:12
   8                                           e      
   9                                      <= 5  ;
   10       int *l_80 = b;
-> 11       g = *c || *l_80  ^ i;
   12     
   13   }
   14   int main() 
(lldb) frame var
(int) i = 5
(int) l_113 = 9
(int *) l_80 = <variable not available>

-- 
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/20210922/fe09e0d4/attachment-0001.html>


More information about the llvm-bugs mailing list