aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-08-30 14:06:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-08-30 14:06:00 +0000
commit315f5f1bfbcbc444e5853fb54fa37edae58e5f91 (patch)
tree04e75f6b96cabc5abbb23cc93d17526c05e9e9f7 /gcc/tree-inline.c
parent2ddd46d69b09a88fb82832285b69090fa08bddc2 (diff)
downloadgcc-315f5f1bfbcbc444e5853fb54fa37edae58e5f91.zip
gcc-315f5f1bfbcbc444e5853fb54fa37edae58e5f91.tar.gz
gcc-315f5f1bfbcbc444e5853fb54fa37edae58e5f91.tar.bz2
re PR tree-optimization/48571 (Missed data-dependence for (bogus?) reconstructed array-refs)
2011-08-30 Richard Guenther <rguenther@suse.de> PR middle-end/48571 * gimple.h (maybe_fold_offset_to_address): Remove. (maybe_fold_offset_to_reference): Likewise. (maybe_fold_stmt_addition): Likewise. (may_propagate_address_into_dereference): Likewise. * tree-inline.c (remap_gimple_op_r): Do not reconstruct array references. * gimple-fold.c (canonicalize_constructor_val): Likewise. Canonicalize invariant POINTER_PLUS_EXPRs to invariant MEM_REF addresses instead. (may_propagate_address_into_dereference): Remove. (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_offset_to_reference): Likewise. (maybe_fold_offset_to_address): Likewise. (maybe_fold_stmt_addition): Likewise. (fold_gimple_assign): Do not reconstruct array references but instead canonicalize invariant POINTER_PLUS_EXPRs to invariant MEM_REF addresses. (gimple_fold_stmt_to_constant_1): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * gimplify.c (gimplify_conversion): Likewise. (gimplify_expr): Likewise. * gcc.c-torture/execute/pr48571-1.c: New testcase. * gcc.dg/tree-ssa/ssa-ccp-25.c: Remove. * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise. * gcc.dg/pr36902.c: XFAIL. From-SVN: r178312
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index e9daff6..741e8e4 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -853,43 +853,14 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
tree ptr = TREE_OPERAND (*tp, 0);
tree type = remap_type (TREE_TYPE (*tp), id);
tree old = *tp;
- tree tem;
/* We need to re-canonicalize MEM_REFs from inline substitutions
that can happen when a pointer argument is an ADDR_EXPR.
Recurse here manually to allow that. */
walk_tree (&ptr, remap_gimple_op_r, data, NULL);
- if ((tem = maybe_fold_offset_to_reference (EXPR_LOCATION (*tp),
- ptr,
- TREE_OPERAND (*tp, 1),
- type))
- && TREE_THIS_VOLATILE (tem) == TREE_THIS_VOLATILE (old))
- {
- tree *tem_basep = &tem;
- while (handled_component_p (*tem_basep))
- tem_basep = &TREE_OPERAND (*tem_basep, 0);
- if (TREE_CODE (*tem_basep) == MEM_REF)
- *tem_basep
- = build2 (MEM_REF, TREE_TYPE (*tem_basep),
- TREE_OPERAND (*tem_basep, 0),
- fold_convert (TREE_TYPE (TREE_OPERAND (*tp, 1)),
- TREE_OPERAND (*tem_basep, 1)));
- else
- *tem_basep
- = build2 (MEM_REF, TREE_TYPE (*tem_basep),
- build_fold_addr_expr (*tem_basep),
- build_int_cst
- (TREE_TYPE (TREE_OPERAND (*tp, 1)), 0));
- *tp = tem;
- TREE_THIS_VOLATILE (*tem_basep) = TREE_THIS_VOLATILE (old);
- TREE_THIS_NOTRAP (*tem_basep) = TREE_THIS_NOTRAP (old);
- }
- else
- {
- *tp = fold_build2 (MEM_REF, type,
- ptr, TREE_OPERAND (*tp, 1));
- TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
- }
+ *tp = fold_build2 (MEM_REF, type,
+ ptr, TREE_OPERAND (*tp, 1));
+ TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
*walk_subtrees = 0;