------- Comment #6 from sebpop at gmail dot com 2010-03-01 18:10 ------- Subject: Re: [4.5 Regression] ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:5238
On Mon, Mar 1, 2010 at 12:02, changpeng dot fang at amd dot com > I have a fix for this problem. We should not decrease the cost if the cost is > infinite. > Looks good. Thanks for fixing this. Please test with the minor modification below, and submit a patch to gcc-patches@ > diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c > index 74dadf7..9accda9 100644 > --- a/gcc/tree-ssa-loop-ivopts.c > +++ b/gcc/tree-ssa-loop-ivopts.c > @@ -4124,7 +4124,11 @@ determine_use_iv_cost_condition (struct ivopts_data > *data, > if (integer_zerop (*bound_cst) > && (operand_equal_p (*control_var, cand->var_after, 0) > || operand_equal_p (*control_var, cand->var_before, 0))) > - elim_cost.cost -= 1; > + { > + /* Should not decrease the cost if it is infinite */ > + if (!infinite_cost_p (elim_cost)) You should fuse this condition into the previous condition expression to avoid the inner if. > + elim_cost.cost -= 1; > + } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43209