aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>2014-06-05 18:34:43 +0000
committerJeff Law <law@gcc.gnu.org>2014-06-05 12:34:43 -0600
commita148c4b2645a213a99d26056ed942fcec918bc42 (patch)
treef7ff5f5bcf5270f0634b04ac3d90cdcb69b10d38 /gcc/cfgexpand.c
parent64e13bcd19db627535a6309d9d5f7b24e5724453 (diff)
downloadgcc-a148c4b2645a213a99d26056ed942fcec918bc42.zip
gcc-a148c4b2645a213a99d26056ed942fcec918bc42.tar.gz
gcc-a148c4b2645a213a99d26056ed942fcec918bc42.tar.bz2
re PR debug/52472 (ICE: in convert_debug_memory_address, at cfgexpand.c:2491)
PR target/52472 * cfgexpand.c (expand_debug_expr): Use address space of nested TREE_TYPE for ADDR_EXPR and MEM_REF. PR target/52472 * gcc.target/avr/pr52472.c: New test. From-SVN: r211288
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 8b0e466..e161cb7 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3941,10 +3941,7 @@ expand_debug_expr (tree exp)
op0 = plus_constant (inner_mode, op0, INTVAL (op1));
}
- if (POINTER_TYPE_P (TREE_TYPE (exp)))
- as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
- else
- as = ADDR_SPACE_GENERIC;
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))));
op0 = convert_debug_memory_address (targetm.addr_space.address_mode (as),
op0, as);
@@ -4467,7 +4464,7 @@ expand_debug_expr (tree exp)
return NULL;
}
- as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
op0 = convert_debug_memory_address (mode, XEXP (op0, 0), as);
return op0;