[Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 18 08:45:00 GMT 2012
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: jakub@gcc.gnu.org
ReportedBy: jakub@gcc.gnu.org
CC: aoliva@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.
More information about the Gcc-bugs
mailing list