summaryrefslogtreecommitdiff
path: root/gcc/tree-mudflap.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-15 10:25:15 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-15 10:25:15 +0000
commit6d1013f72266327f95bee6686a1c6da2a12ff675 (patch)
tree020f9b5c8e9194f2a72826f846f18ab34c661b39 /gcc/tree-mudflap.c
parent4bb918e02ce0785b3fbdca6277d732bc5e072470 (diff)
downloadgcc-6d1013f72266327f95bee6686a1c6da2a12ff675.tar.gz
PR libmudflap/53952
* expr.c (mem_ref_refers_to_non_mem_p): Factor out implementation into... (addr_expr_of_non_mem_decl_p_1): ... this new function. (addr_expr_of_non_mem_decl_p): New. * tree.h (addr_expr_of_non_mem_decl_p): Declare. * tree-mudflap.c (mf_xform_derefs_1): Don't change MEM_REFs and TARGET_MEM_REFs that have an ADDR_EXPR of a non-mem DECL as base operand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-mudflap.c')
-rw-r--r--gcc/tree-mudflap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 9b9c549a19b..90d04489188 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -877,6 +877,9 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
break;
case MEM_REF:
+ if (addr_expr_of_non_mem_decl_p (TREE_OPERAND (t, 0)))
+ return;
+
addr = fold_build_pointer_plus_loc (location, TREE_OPERAND (t, 0),
TREE_OPERAND (t, 1));
base = addr;
@@ -886,6 +889,9 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
break;
case TARGET_MEM_REF:
+ if (addr_expr_of_non_mem_decl_p (TMR_BASE (t)))
+ return;
+
addr = tree_mem_ref_addr (ptr_type_node, t);
base = addr;
limit = fold_build_pointer_plus_hwi_loc (location,