[llvm-bugs] [Bug 39715] New: [DebugInfo] Lifetime of function arguments is too short in optimized code.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 19 16:29:06 PST 2018


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

            Bug ID: 39715
           Summary: [DebugInfo] Lifetime of function arguments is too
                    short in optimized code.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: aprantl at apple.com, friss at apple.com,
                    jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org, rnk at google.com,
                    vk at vedantk.com, vsk at apple.com, zturner at google.com

Same test case as before:

__attribute__((noinline))
int fn1 (long int x, long int y, long int z) {
        int l = x * 2;
        int q = y * z;
        return l + q;
}

__attribute__((noinline)) long int
fn2 (long int a, long int b, long int c)
{
  long int q = 2 * a;
  return fn1 (5, 6, 7);
}

int main(void) {
        return fn2(14, 23, 34);
}

(built with -O3 -g).
lldb session:

Process 30254 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x0000000100000f74 a.out`fn1(x=5, y=6, z=7) at optout.c:4:19
[opt]
   1    __attribute__((noinline))
   2    int fn1 (long int x, long int y, long int z) {
   3            int l = x * 2;
-> 4            int q = y * z;
   5            return l + q;
   6    }
   7    
(lldb) frame var z
(long) z = 7
(lldb) n
Process 30254 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100000f77 a.out`fn1(x=5, y=6, z=<unavailable>) at
optout.c:5:18 [opt]
   2    int fn1 (long int x, long int y, long int z) {
   3            int l = x * 2;
   4            int q = y * z;
-> 5            return l + q;
   6    }
   7    
   8    __attribute__((noinline)) long int
(lldb) frame var z
(long) z = <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/20181120/cfbc205b/attachment.html>


More information about the llvm-bugs mailing list