[PATCH] D52614: [DebugInfo][Dexter] Divide-before-return displays wrong value in debugger

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 27 08:01:34 PDT 2018


CarlosAlbertoEnciso created this revision.
CarlosAlbertoEnciso added reviewers: dstenb, 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 read1 = foo;
    int read2 = foo;
  
    switch ((read1 == 4) ? 3 : 1) {
    case 1:
      read1 *= read2;
      break;
    case 3:
      read1 /= read2;
      break;
    }
  
    return read1;
  }

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

When in the debugger, on the line "return read1;", the value of "read1"
is reported as '4', where it should be '1', as described by:

PR38773 <https://bugs.llvm.org/show_bug.cgi?id=38773>


Repository:
  rL LLVM

https://reviews.llvm.org/D52614

Files:
  include/llvm/CodeGen/MachineInstr.h
  lib/CodeGen/MachineCSE.cpp
  lib/CodeGen/MachineCopyPropagation.cpp
  lib/CodeGen/MachineInstr.cpp
  test/CodeGen/MIR/X86/pr38773.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52614.167325.patch
Type: text/x-patch
Size: 10433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180927/6a0b239b/attachment.bin>


More information about the llvm-commits mailing list