[PATCH][alias-improvements] Fix last patch
Richard Guenther
rguenther@suse.de
Wed Feb 4 13:19:00 GMT 2009
More testing revealed that the get_val_for fix wasn't correct. Thus
I have installed the following.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.
Richard.
2009-02-03 Richard Guenther <rguenther@suse.de>
Revert
* tree-ssa-loop-niter.c (chain_of_csts_start): Use NULL_TREE.
Simplify test for memory referencing statement.
(get_val_for): Handle &a[i_1] by bailing out.
(loop_niter_by_eval): Handle get_va_for bailing out.
* tree-ssa-loop-niter.c (chain_of_csts_start): Use NULL_TREE.
Simplify test for memory referencing statement. Exclude
non-invariant ADDR_EXPRs.
Index: gcc/tree-ssa-loop-niter.c
===================================================================
*** gcc/tree-ssa-loop-niter.c (revision 143920)
--- gcc/tree-ssa-loop-niter.c (working copy)
*************** chain_of_csts_start (struct loop *loop,
*** 1966,1972 ****
return NULL;
code = gimple_assign_rhs_code (stmt);
! if (gimple_references_memory_p (stmt))
return NULL;
use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE);
--- 1966,1975 ----
return NULL;
code = gimple_assign_rhs_code (stmt);
! if (gimple_references_memory_p (stmt)
! || TREE_CODE_CLASS (code) == tcc_reference
! || (code == ADDR_EXPR
! && !is_gimple_min_invariant (gimple_assign_rhs1 (stmt))))
return NULL;
use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE);
*************** get_val_for (tree x, tree base)
*** 2064,2072 ****
gimple_expr_type (stmt), rhs1, rhs2);
}
else
! /* We can also end up with for example &a._M_instance[i_1]; for
! which we just bail out for now. */
! return NULL_TREE;
}
--- 2067,2073 ----
gimple_expr_type (stmt), rhs1, rhs2);
}
else
! gcc_unreachable ();
}
*************** loop_niter_by_eval (struct loop *loop, e
*** 2134,2147 ****
for (i = 0; i < MAX_ITERATIONS_TO_TRACK; i++)
{
for (j = 0; j < 2; j++)
! {
! aval[j] = get_val_for (op[j], val[j]);
! if (aval[j] == NULL_TREE)
! {
! fold_undefer_and_ignore_overflow_warnings ();
! return chrec_dont_know;
! }
! }
acnd = fold_binary (cmp, boolean_type_node, aval[0], aval[1]);
if (acnd && integer_zerop (acnd))
--- 2135,2141 ----
for (i = 0; i < MAX_ITERATIONS_TO_TRACK; i++)
{
for (j = 0; j < 2; j++)
! aval[j] = get_val_for (op[j], val[j]);
acnd = fold_binary (cmp, boolean_type_node, aval[0], aval[1]);
if (acnd && integer_zerop (acnd))
*************** loop_niter_by_eval (struct loop *loop, e
*** 2157,2164 ****
for (j = 0; j < 2; j++)
{
val[j] = get_val_for (next[j], val[j]);
! if (!val[j]
! || !is_gimple_min_invariant (val[j]))
{
fold_undefer_and_ignore_overflow_warnings ();
return chrec_dont_know;
--- 2151,2157 ----
for (j = 0; j < 2; j++)
{
val[j] = get_val_for (next[j], val[j]);
! if (!is_gimple_min_invariant (val[j]))
{
fold_undefer_and_ignore_overflow_warnings ();
return chrec_dont_know;
More information about the Gcc-patches
mailing list