[llvm-bugs] [Bug 47628] New: Incorrect entry value debug location after parameter modification

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 23 06:19:52 PDT 2020


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

            Bug ID: 47628
           Summary: Incorrect entry value debug location after parameter
                    modification
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: david.stenberg at ericsson.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

LLVM commit: 310af42ed9ab259ad05ed46d459203b3473ba66e

When compiling the following file:

  extern void bar(int);
  extern int side_effect, value;

  int foo(int param) {
    side_effect = param;
    param = value;
    bar(param);
    return 0;
  }

using:

  $ clang -O1 -g entry-value.c -S

we get entry value DEBUG_VALUEs for `param' even after the parameter has been
modified:

          .cfi_startproc
  # %bb.0:                                # %entry
          #DEBUG_VALUE: foo:param <- $edi
          #DEBUG_VALUE: foo:param <- $edi
          pushq   %rax
          .cfi_def_cfa_offset 16
  .Ltmp0:
          .loc    1 5 15 prologue_end             # entry-value.c:5:15
          movl    %edi, side_effect(%rip)
          .loc    1 6 11                          # entry-value.c:6:11
          movl    value(%rip), %edi
  .Ltmp1:
          #DEBUG_VALUE: foo:param <- [DW_OP_LLVM_entry_value 1] $edi
          #DEBUG_VALUE: foo:param <- $edi
          .loc    1 7 3                           # entry-value.c:7:3
          callq   bar
  .Ltmp2:
          #DEBUG_VALUE: foo:param <- [DW_OP_LLVM_entry_value 1] $edi
          .loc    1 8 3                           # entry-value.c:8:3
          xorl    %eax, %eax
          popq    %rcx
          .cfi_def_cfa_offset 8
          retq

This means that the parameter will be printed incorrectly (given that there is
a call site value for the parameter in the caller of `foo').

-- 
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/20200923/240fb44a/attachment.html>


More information about the llvm-bugs mailing list