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

            Bug ID: 35015
           Summary: Optimized code debug info: loop induction variable
                    becomes constant
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedb...@nondot.org
          Reporter: apra...@apple.com
                CC: llvm-bugs@lists.llvm.org

Here's an example where loop optimizations cause very misleading debug info:

use(int i);
static struct status {
  int value;
  unsigned char *p;
} status[32];
int init(void)
{
  int i;
  for (i = 0; i < 32; i++) {
    status[i].value = 42;
    use(i);
  }
}

clang -g -c test.i -o - -Oz | llvm-dwarfdump -name i -
0x0000009f:         DW_TAG_variable [11]  
                     DW_AT_location( 0x00000000
                        0x0000000000000010 - 0x0000000000000032: consts +0,
stack-value )
                     DW_AT_name( "i" )
                     DW_AT_type( {0x0000006c} ( int ) )

The output of -print-after-all should give us a hint at which pass(es) are
dropping the llvm.dbg.value. Perhaps this is a use-case for
llvm::salvageDebugInfo().

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to