aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-11-09 12:32:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-11-09 12:32:20 +0000
commit6aaa40131a37f28ffc3f1788b66293248b4abb5c (patch)
tree7d2129cd384ed49e7ccc4d5da76366ff0ada7d49 /gcc/tree-ssa-forwprop.c
parent06acf7d0ad169b40c2e7f83c7ed808b2e196a6a4 (diff)
downloadgcc-6aaa40131a37f28ffc3f1788b66293248b4abb5c.zip
gcc-6aaa40131a37f28ffc3f1788b66293248b4abb5c.tar.gz
gcc-6aaa40131a37f28ffc3f1788b66293248b4abb5c.tar.bz2
re PR target/33604 (Revision 119502 causes significantly slower results with 4.3/4.4 compared to 4.2)
2007-11-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/33604 * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Disregard changes in CV qualifiers of pointed to types for forward propagating ADDR_EXPRs. * tree-ssa-ccp.c (fold_stmt_r): Preserve volatileness of the original expression. * g++.dg/tree-ssa/pr33604.C: New testcase. * gcc.dg/pr32721.c: Adjust pattern. From-SVN: r130040
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 047d057..bacd34e 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -952,7 +952,15 @@ tree_ssa_forward_propagate_single_use_vars (void)
continue;
}
- if (TREE_CODE (rhs) == ADDR_EXPR)
+ if (TREE_CODE (rhs) == ADDR_EXPR
+ /* We can also disregard changes in CV qualifiers for
+ the dereferenced value. */
+ || ((TREE_CODE (rhs) == NOP_EXPR
+ || TREE_CODE (rhs) == CONVERT_EXPR)
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
+ && POINTER_TYPE_P (TREE_TYPE (rhs))
+ && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (rhs)),
+ TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))))))
{
if (forward_propagate_addr_expr (lhs, rhs))
{