From: Jakub Jelinek Date: Wed, 27 Jan 2010 16:38:58 +0000 (+0100) Subject: dwarf2out.c (mem_loc_descriptor): Remove special casing of CONSTANT_POOL_ADDRESS_P... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f277ad43f17845caab6501560944b3c85f14528;p=gcc.git dwarf2out.c (mem_loc_descriptor): Remove special casing of CONSTANT_POOL_ADDRESS_P SYMBOL_REFs. * dwarf2out.c (mem_loc_descriptor): Remove special casing of CONSTANT_POOL_ADDRESS_P SYMBOL_REFs. If for MEM recursive call on MEM's address failed, try avoid_constant_pool_reference and recurse if it returned something different. (loc_descriptor): If for MEM mem_loc_descriptor failed on the address, try avoid_constant_pool_reference and recurse if it returned something different. (dw_loc_list_1): If for MEM mem_loc_descriptor failed on the address and avoid_constant_pool_reference returned something different, don't set have_address. From-SVN: r156293 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ab9b18e1d7..f65d62af88b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2010-01-27 Jakub Jelinek + + * dwarf2out.c (mem_loc_descriptor): Remove special casing of + CONSTANT_POOL_ADDRESS_P SYMBOL_REFs. If for MEM recursive call + on MEM's address failed, try avoid_constant_pool_reference and + recurse if it returned something different. + (loc_descriptor): If for MEM mem_loc_descriptor failed on the + address, try avoid_constant_pool_reference and recurse if it + returned something different. + (dw_loc_list_1): If for MEM mem_loc_descriptor failed on the + address and avoid_constant_pool_reference returned something + different, don't set have_address. + 2010-01-27 Alexandre Oliva PR debug/42861 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0a6045a4a87..0fd93cb194a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12991,6 +12991,12 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, mem_loc_result = tls_mem_loc_descriptor (rtl); if (mem_loc_result != 0) add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_deref, 0, 0)); + else + { + rtx new_rtl = avoid_constant_pool_reference (rtl); + if (new_rtl != rtl) + return mem_loc_descriptor (new_rtl, mode, initialized); + } break; case LO_SUM: @@ -13004,34 +13010,6 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, pool. */ case CONST: case SYMBOL_REF: - /* Alternatively, the symbol in the constant pool might be referenced - by a different symbol. */ - if (GET_CODE (rtl) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (rtl)) - { - bool marked; - rtx tmp = get_pool_constant_mark (rtl, &marked); - - if (GET_CODE (tmp) == SYMBOL_REF) - { - rtl = tmp; - if (CONSTANT_POOL_ADDRESS_P (tmp)) - get_pool_constant_mark (tmp, &marked); - else - marked = true; - } - - /* If all references to this pool constant were optimized away, - it was not output and thus we can't represent it. - FIXME: might try to use DW_OP_const_value here, though - DW_OP_piece complicates it. */ - if (!marked) - { - expansion_failed (NULL_TREE, rtl, - "Constant was removed from constant pool.\n"); - return 0; - } - } - if (GET_CODE (rtl) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE) { @@ -13623,6 +13601,12 @@ loc_descriptor (rtx rtl, enum machine_mode mode, initialized); if (loc_result == NULL) loc_result = tls_mem_loc_descriptor (rtl); + if (loc_result == NULL) + { + rtx new_rtl = avoid_constant_pool_reference (rtl); + if (new_rtl != rtl) + loc_result = loc_descriptor (new_rtl, mode, initialized); + } break; case CONCAT: @@ -13897,10 +13881,19 @@ dw_loc_list_1 (tree loc, rtx varloc, int want_address, mode = GET_MODE (varloc); if (MEM_P (varloc)) { - varloc = XEXP (varloc, 0); - have_address = 1; + rtx addr = XEXP (varloc, 0); + descr = mem_loc_descriptor (addr, mode, initialized); + if (descr) + have_address = 1; + else + { + rtx x = avoid_constant_pool_reference (varloc); + if (x != varloc) + descr = mem_loc_descriptor (x, mode, initialized); + } } - descr = mem_loc_descriptor (varloc, mode, initialized); + else + descr = mem_loc_descriptor (varloc, mode, initialized); } else return 0;