re PR debug/69947 (DW_OP_GNU_implicit_pointer broken on the trunk)

PR debug/69947
	* dwarf2out.c (prune_unused_types_walk_loc_descr): Handle
	all other ops that have dw_val_class_die_ref operands,
	and DW_OP_GNU_entry_value.

	* gcc.dg/guality/pr69947.c: New test.

From-SVN: r233958
This commit is contained in:
Jakub Jelinek 2016-03-04 08:27:15 +01:00 committed by Jakub Jelinek
parent b47d1d904d
commit f10cdc6c14
4 changed files with 52 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2016-03-04 Jakub Jelinek <jakub@redhat.com>
PR debug/69947
* dwarf2out.c (prune_unused_types_walk_loc_descr): Handle
all other ops that have dw_val_class_die_ref operands,
and DW_OP_GNU_entry_value.
2016-03-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/69904

View File

@ -25641,11 +25641,29 @@ prune_unused_types_walk_loc_descr (dw_loc_descr_ref loc)
for (; loc != NULL; loc = loc->dw_loc_next)
switch (loc->dw_loc_opc)
{
case DW_OP_GNU_implicit_pointer:
case DW_OP_GNU_convert:
case DW_OP_GNU_reinterpret:
if (loc->dw_loc_oprnd1.val_class == dw_val_class_die_ref)
prune_unused_types_mark (loc->dw_loc_oprnd1.v.val_die_ref.die, 1);
break;
case DW_OP_call2:
case DW_OP_call4:
case DW_OP_call_ref:
case DW_OP_GNU_const_type:
case DW_OP_GNU_parameter_ref:
gcc_assert (loc->dw_loc_oprnd1.val_class == dw_val_class_die_ref);
prune_unused_types_mark (loc->dw_loc_oprnd1.v.val_die_ref.die, 1);
break;
case DW_OP_GNU_regval_type:
case DW_OP_GNU_deref_type:
gcc_assert (loc->dw_loc_oprnd2.val_class == dw_val_class_die_ref);
prune_unused_types_mark (loc->dw_loc_oprnd2.v.val_die_ref.die, 1);
break;
case DW_OP_GNU_entry_value:
gcc_assert (loc->dw_loc_oprnd1.val_class == dw_val_class_loc);
prune_unused_types_walk_loc_descr (loc->dw_loc_oprnd1.v.val_loc);
break;
default:
break;
}

View File

@ -1,3 +1,8 @@
2016-03-04 Jakub Jelinek <jakub@redhat.com>
PR debug/69947
* gcc.dg/guality/pr69947.c: New test.
2016-03-03 Jakub Jelinek <jakub@redhat.com>
PR ada/70017

View File

@ -0,0 +1,22 @@
/* PR debug/69947 */
/* { dg-do run } */
/* { dg-options "-g" } */
#include "../nop.h"
static const char *c = "foobar";
__attribute__((noinline, noclone)) void
foo (void)
{
static const char a[] = "abcdefg";
const char *b = a; /* { dg-final { gdb-test 14 "c\[2\]" "'o'" } } */
asm (NOP : : : "memory"); /* { dg-final { gdb-test 14 "b\[4\]" "'e'" } } */
}
int
main ()
{
foo ();
return 0;
}