re PR debug/33537 (C++ arguments passed by invisible reference have wrong type)

PR debug/33537
	* dwarf2out.c (gen_formal_parameter_die, gen_variable_die,
	gen_decl_die): Use TREE_TYPE (TREE_TYPE (decl)) as type
	rather than TREE_TYPE (decl) if DECL_BY_REFERENCE (decl).

From-SVN: r129820
This commit is contained in:
Jakub Jelinek 2007-11-01 11:17:42 +01:00 committed by Jakub Jelinek
parent d0a55efc84
commit 611cd333cd
2 changed files with 24 additions and 4 deletions

View File

@ -1,5 +1,10 @@
2007-11-01 Jakub Jelinek <jakub@redhat.com>
PR debug/33537
* dwarf2out.c (gen_formal_parameter_die, gen_variable_die,
gen_decl_die): Use TREE_TYPE (TREE_TYPE (decl)) as type
rather than TREE_TYPE (decl) if DECL_BY_REFERENCE (decl).
PR rtl-optimization/33673
* gcse.c (cprop_jump): If a conditional jump has been optimized
into unconditional jump, make the remaining normal edge fallthru

View File

@ -11832,8 +11832,11 @@ gen_formal_parameter_die (tree node, dw_die_ref context_die)
add_abstract_origin_attribute (parm_die, origin);
else
{
tree type = TREE_TYPE (node);
add_name_and_src_coords_attributes (parm_die, node);
add_type_attribute (parm_die, TREE_TYPE (node),
if (DECL_BY_REFERENCE (node))
type = TREE_TYPE (type);
add_type_attribute (parm_die, type,
TREE_READONLY (node),
TREE_THIS_VOLATILE (node),
context_die);
@ -12437,8 +12440,14 @@ gen_variable_die (tree decl, dw_die_ref context_die)
}
else
{
tree type = TREE_TYPE (decl);
if ((TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == RESULT_DECL)
&& DECL_BY_REFERENCE (decl))
type = TREE_TYPE (type);
add_name_and_src_coords_attributes (var_die, decl);
add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl),
add_type_attribute (var_die, type, TREE_READONLY (decl),
TREE_THIS_VOLATILE (decl), context_die);
if (TREE_PUBLIC (decl))
@ -13694,7 +13703,10 @@ gen_decl_die (tree decl, dw_die_ref context_die)
/* Output any DIEs that are needed to specify the type of this data
object. */
gen_type_die (TREE_TYPE (decl), context_die);
if (TREE_CODE (decl) == RESULT_DECL && DECL_BY_REFERENCE (decl))
gen_type_die (TREE_TYPE (TREE_TYPE (decl)), context_die);
else
gen_type_die (TREE_TYPE (decl), context_die);
/* And its containing type. */
origin = decl_class_context (decl);
@ -13728,7 +13740,10 @@ gen_decl_die (tree decl, dw_die_ref context_die)
break;
case PARM_DECL:
gen_type_die (TREE_TYPE (decl), context_die);
if (DECL_BY_REFERENCE (decl))
gen_type_die (TREE_TYPE (TREE_TYPE (decl)), context_die);
else
gen_type_die (TREE_TYPE (decl), context_die);
gen_formal_parameter_die (decl, context_die);
break;