[PATCH] D51976: [DebugInfo][Dexter] Speculated BB presents illegal variable value to debugger

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 12 04:45:25 PDT 2018


CarlosAlbertoEnciso created this revision.
CarlosAlbertoEnciso added reviewers: efriedma, vsk, aprantl.
CarlosAlbertoEnciso added a project: debug-info.
Herald added subscribers: llvm-commits, JDevlieghere.

For the below test:

  int main() {
    volatile int foo = 4;
    int read = foo;
    int read1 = foo;
  
    int result = 0;
    if (read == 4) {
      result = read1 + 2;
    } else {
      result = read1 - 2;
    }
  
    return result;
  }

Debug location information for 'result' is wrong with -O2.

When in the debugger, on the line "if (read == 4)", the value of "result"
is reported as '2', where it should be zero, as described by:

PR38763 <https://bugs.llvm.org/show_bug.cgi?id=38763>


Repository:
  rL LLVM

https://reviews.llvm.org/D51976

Files:
  include/llvm/Transforms/Utils/Local.h
  lib/Transforms/Utils/Local.cpp
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/CodeGen/X86/pr38763.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51976.165055.patch
Type: text/x-patch
Size: 7672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180912/0aa78aec/attachment.bin>


More information about the llvm-commits mailing list