[llvm-bugs] [Bug 35619] New: Debug location missing for collapsed returns with opt > 0

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 11 03:40:08 PST 2017


            Bug ID: 35619
           Summary: Debug location missing for collapsed returns with opt
                    > 0
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: pmatos at linki.tools
                CC: llvm-bugs at lists.llvm.org

This is a hard one to solve in the general case.

For example:
#include <stdint.h>

volatile int16_t a_val = 2;
volatile int16_t arr[30];

int16_t __attribute__((noinline)) foo3(int16_t a, int16_t b) {
  if(a > b) {

    return 10;


  else if(a + 10 > b) {
    return 100;
  else {
    return 70;

int main() {
  arr[6] = foo3(1000, 101);
  return (int)(arr[6] & 0xff);

If one, compiles with optimization on (like -Os) runs this and sets a
breakpoint in 'return 10;' this breakpoint is not hit even though we do return

I understand the general problem, returns are collapsed and debug locs are
lost. However, I think it might be useful to have a tracking bug for this kind
of thing.

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/20171211/9d729ed7/attachment.html>

More information about the llvm-bugs mailing list