summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 16:40:36 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 16:40:36 +0000
commitf87ea39e0190cbc279e888dd9e8290abe5f7f907 (patch)
tree0b38a75908809e609122b64e553250403bfc82e0 /gcc/cfgexpand.c
parentd4a4310a608f91433ac7fb15fee6f8d4de9e6dce (diff)
downloadgcc-f87ea39e0190cbc279e888dd9e8290abe5f7f907.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169057 138bc75d-0d04-0410-961f-82ee72b054a4
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 81e988b1fe7..aeb23610565 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: