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: unassignedb...@nondot.org
          Reporter: david.stenb...@ericsson.com
                CC: jdevliegh...@apple.com, keith.wal...@arm.com,
                    llvm-bugs@lists.llvm.org,
                    paul_robin...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to