aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-10-06 18:38:29 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-10-06 18:38:29 +0200
commitb799033017f0b33846490fc4612b4eb29b9ed0c6 (patch)
tree6d63b4a87380ed4deee53471eb0ac57a208ac508 /gcc/tree-ssa-forwprop.c
parentb966d3a966a20aaa3de54d6a7ea78703ffb22a8d (diff)
downloadgcc-b799033017f0b33846490fc4612b4eb29b9ed0c6.zip
gcc-b799033017f0b33846490fc4612b4eb29b9ed0c6.tar.gz
gcc-b799033017f0b33846490fc4612b4eb29b9ed0c6.tar.bz2
re PR tree-optimization/49279 (Optimization incorrectly presuming constant variable inside loop in g++ 4.5 and 4.6 with -O2 and -O3 for x86_64 targets)
PR tree-optimization/49279 * tree-ssa-structalias.c (find_func_aliases): Don't handle CAST_RESTRICT. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Allow restrict propagation. * tree-ssa.c (useless_type_conversion_p): Don't return false if TYPE_RESTRICT differs. * gcc.dg/tree-ssa/restrict-4.c: XFAIL. * gcc.c-torture/execute/pr49279.c: New test. From-SVN: r179620
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index c6b92cf..a8737da 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -804,11 +804,6 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
&& ((rhs_code == SSA_NAME && rhs == name)
|| CONVERT_EXPR_CODE_P (rhs_code)))
{
- /* Don't propagate restrict pointer's RHS. */
- if (TYPE_RESTRICT (TREE_TYPE (lhs))
- && !TYPE_RESTRICT (TREE_TYPE (name))
- && !is_gimple_min_invariant (def_rhs))
- return false;
/* Only recurse if we don't deal with a single use or we cannot
do the propagation to the current statement. In particular
we can end up with a conversion needed for a non-invariant