[llvm-bugs] [Bug 40648] New: [DebugInfo at O2] InstCombine drops dbg.value of an argument

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 7 07:32:18 PST 2019


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

            Bug ID: 40648
           Summary: [DebugInfo at O2] InstCombine drops dbg.value of an
                    argument
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: CONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: jeremy.morse.llvm at gmail.com
                CC: chackz0x12 at gmail.com, dblaikie at gmail.com,
                    greg.bedwell at sony.com,
                    international.phantom at gmail.com,
                    llvm-bugs at lists.llvm.org, paul.robinson at am.sony.com
            Blocks: 38768

With the code below, llvm/clang r352480, and command line "-O2 -g -c", the
'nose' argument does not have a location in the output file. This is not the
same as bug 40645 despite being similar code, because the dbg.value records for
'nose' are deleted by InstCombine, and it doesn't leave dbg.value(undef...)
hanging around.

Reproducer is slightly convoluted because I was trying to stimulate
InstCombines instruction sinking between two blocks where control flow always
moves exclusively from one block to exclusively the other block. This would
normally never happen, but the try-catch block forces that to happen.

-------->8--------
struct chin {
  int a;
  int b;
};

int ext(int a, int b);

int toinline(int a, int b)
{
  return 0;
}

int
foo(struct chin nose, int more, int a, int b)
{

  try {
    ext(a, b);
  } catch (int i) {
    return 0;
  }

  more += toinline(nose.a, nose.b);

  return more;
}
--------8<--------


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=38768
[Bug 38768] [meta][DebugInfo] Umbrella bug for poor debug experiences
-- 
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/20190207/9c2f98f2/attachment.html>


More information about the llvm-bugs mailing list