From 2b80199f41d444c88474b32792a7e828f2a96b68 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 29 Mar 2011 01:53:46 +0200 Subject: re PR debug/48203 (ICE in dwarf2out.c while building eglibc.) PR debug/48203 * cfgexpand.c (expand_debug_expr) : Only create ENTRY_VALUE if incoming or address of incoming's MEM is a hard REG. * dwarf2out.c (mem_loc_descriptor): Don't emit DW_OP_GNU_entry_value of DW_OP_fbreg. * var-tracking.c (vt_add_function_parameter): Ensure cselib_lookup on ENTRY_VALUE is able to find the canonical parameter VALUE. * cselib.c (rtx_equal_for_cselib_1) : Use rtx_equal_p instead of rtx_equal_for_cselib_1 to compare ENTRY_VALUE_EXPs. (cselib_hash_rtx) : If ENTRY_VALUE_EXP is a REG_P or MEM_P with REG_P address, compute hash directly instead of calling cselib_hash_rtx on ENTRY_VALUE_EXP. (preserve_only_constants): Don't clear VALUES forwaring ENTRY_VALUE to some other VALUE. * gcc.dg/pr48203.c: New test. From-SVN: r171640 --- gcc/var-tracking.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'gcc/var-tracking.c') diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index ef02937..9729956 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -8472,7 +8472,7 @@ vt_add_function_parameter (tree parm) VAR_INIT_STATUS_INITIALIZED, NULL, INSERT); if (dv_is_value_p (dv)) { - cselib_val *val = CSELIB_VAL_PTR (dv_as_value (dv)); + cselib_val *val = CSELIB_VAL_PTR (dv_as_value (dv)), *val2; struct elt_loc_list *el; el = (struct elt_loc_list *) ggc_alloc_cleared_atomic (sizeof (*el)); @@ -8481,6 +8481,23 @@ vt_add_function_parameter (tree parm) ENTRY_VALUE_EXP (el->loc) = incoming; el->setting_insn = get_insns (); val->locs = el; + val2 = cselib_lookup_from_insn (el->loc, GET_MODE (incoming), + true, VOIDmode, get_insns ()); + if (val2 + && val2 != val + && val2->locs + && rtx_equal_p (val2->locs->loc, el->loc)) + { + struct elt_loc_list *el2; + + preserve_value (val2); + el2 = (struct elt_loc_list *) + ggc_alloc_cleared_atomic (sizeof (*el2)); + el2->next = val2->locs; + el2->loc = dv_as_value (dv); + el2->setting_insn = get_insns (); + val2->locs = el2; + } if (TREE_CODE (TREE_TYPE (parm)) == REFERENCE_TYPE && INTEGRAL_TYPE_P (TREE_TYPE (TREE_TYPE (parm)))) { @@ -8499,6 +8516,24 @@ vt_add_function_parameter (tree parm) ENTRY_VALUE_EXP (el->loc) = mem; el->setting_insn = get_insns (); val->locs = el; + val2 = cselib_lookup_from_insn (el->loc, GET_MODE (mem), + true, VOIDmode, + get_insns ()); + if (val2 + && val2 != val + && val2->locs + && rtx_equal_p (val2->locs->loc, el->loc)) + { + struct elt_loc_list *el2; + + preserve_value (val2); + el2 = (struct elt_loc_list *) + ggc_alloc_cleared_atomic (sizeof (*el2)); + el2->next = val2->locs; + el2->loc = val->val_rtx; + el2->setting_insn = get_insns (); + val2->locs = el2; + } } } } -- cgit v1.1