aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-03-03 17:06:33 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-03-03 17:06:33 +0100
commit71f3a3f5171d29dc3625fa7556c5732aa6b26241 (patch)
treec3601aa48d9068674838a86d0409cbf0d3eb7859 /gcc/cfgexpand.c
parent4b1a5c0ded00e987f78929d4189ce12792d57fcc (diff)
downloadgcc-71f3a3f5171d29dc3625fa7556c5732aa6b26241.zip
gcc-71f3a3f5171d29dc3625fa7556c5732aa6b26241.tar.gz
gcc-71f3a3f5171d29dc3625fa7556c5732aa6b26241.tar.bz2
re PR debug/47283 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c)
PR debug/47283 * cfgexpand.c (expand_debug_expr) <case MEM_REF>: If MEM_REF first operand is not is_gimple_mem_ref_addr, try to fold it. If the operand still isn't is_gimple_mem_ref_addr, clear MEM_EXPR on op0. From-SVN: r170654
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index ecfd1a5..059c5b2 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2578,6 +2578,15 @@ expand_debug_expr (tree exp)
}
case MEM_REF:
+ if (!is_gimple_mem_ref_addr (TREE_OPERAND (exp, 0)))
+ {
+ tree newexp = fold_binary (MEM_REF, TREE_TYPE (exp),
+ TREE_OPERAND (exp, 0),
+ TREE_OPERAND (exp, 1));
+ if (newexp)
+ return expand_debug_expr (newexp);
+ }
+ /* FALLTHROUGH */
case INDIRECT_REF:
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0)
@@ -2611,6 +2620,9 @@ expand_debug_expr (tree exp)
op0 = gen_rtx_MEM (mode, op0);
set_mem_attributes (op0, exp, 0);
+ if (TREE_CODE (exp) == MEM_REF
+ && !is_gimple_mem_ref_addr (TREE_OPERAND (exp, 0)))
+ set_mem_expr (op0, NULL_TREE);
set_mem_addr_space (op0, as);
return op0;