http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970
Bug #: 54970 Summary: Missing DW_OP_GNU_implicit_pointer in debuginfo Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: ja...@gcc.gnu.org ReportedBy: ja...@gcc.gnu.org CC: aol...@gcc.gnu.org /* { dg-do run } */ /* { dg-options "-g" } */ #include "../nop.h" int main () { int a[] = { 1, 2, 3 }; /* { dg-final { gdb-test 12 "a\[1\]" "2" } } */ int *p = a + 2; /* { dg-final { gdb-test 12 "a\[2\]" "3" } } */ int *q = a + 1; /* { dg-final { gdb-test 12 "*p" "3" } } */ asm volatile ("NOP"); /* { dg-final { gdb-test 12 "*q" "2" } } */ *p += 10; /* { dg-final { gdb-test 16 "a\[1\]" "2" } } */ /* { dg-final { gdb-test 16 "a\[2\]" "13" } } */ /* { dg-final { gdb-test 16 "*p" "13" } } */ asm volatile ("NOP"); /* { dg-final { gdb-test 16 "*q" "2" } } */ *q += 10; /* { dg-final { gdb-test 20 "a\[1\]" "12" } } */ /* { dg-final { gdb-test 20 "a\[2\]" "13" } } */ /* { dg-final { gdb-test 20 "*p" "13" } } */ asm volatile ("NOP"); /* { dg-final { gdb-test 20 "*q" "12" } } */ return 0; } fails, apparently because we have # DEBUG p => &MEM[(void *)&a + 8B] and we fail to expand that as (plus (debug_implicit_ptr a) (const_int 8)). The reason for that is that we don't want (mem (debug_implicit_ptr x)) to appear in debug insns, that confuses aliasing. When expanding &a, we expand it as DEBUG_IMPLICIT_PTR, but when returning to MEM, we return NULL, as that is not appropriate thing to construct.