summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-27 16:38:58 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-27 16:38:58 +0000
commit8331aacd4fec86c5051fc65c78b422a9d3b9f1a1 (patch)
tree5a8473f69b90708c70a8b56a5cc276cfeba4a621 /gcc
parentbf262632f9e4c5afee5f8cf4a06b2fc1f874497b (diff)
downloadgcc-8331aacd4fec86c5051fc65c78b422a9d3b9f1a1.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156293 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/dwarf2out.c55
2 files changed, 37 insertions, 31 deletions
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 <jakub@redhat.com>
+
+ * 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 <aoliva@redhat.com>
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;