aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-20 17:40:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-20 17:40:36 +0100
commit583ac69ceb5c573aa3fd016f209f222b8ad704cb (patch)
tree0b38a75908809e609122b64e553250403bfc82e0 /gcc/cfgexpand.c
parent55429b8eb7922b9f016b93591f1dd8cf98546446 (diff)
downloadgcc-583ac69ceb5c573aa3fd016f209f222b8ad704cb.zip
gcc-583ac69ceb5c573aa3fd016f209f222b8ad704cb.tar.gz
gcc-583ac69ceb5c573aa3fd016f209f222b8ad704cb.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): Instead of generating (mem (debug_implicit_ptr)) for MEM_REFs use COMPONENT_REF etc. handling. * g++.dg/debug/pr47283.C: New test. From-SVN: r169057
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 81e988b..aeb2361 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2567,6 +2567,13 @@ expand_debug_expr (tree exp)
if (TREE_CODE (exp) == MEM_REF)
{
+ if (GET_CODE (op0) == DEBUG_IMPLICIT_PTR
+ || (GET_CODE (op0) == PLUS
+ && GET_CODE (XEXP (op0, 0)) == DEBUG_IMPLICIT_PTR))
+ /* (mem (debug_implicit_ptr)) might confuse aliasing.
+ Instead just use get_inner_reference. */
+ goto component_ref;
+
op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
if (!op1 || !CONST_INT_P (op1))
return NULL;
@@ -2605,6 +2612,7 @@ expand_debug_expr (tree exp)
return op0;
+ component_ref:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case COMPONENT_REF: