re PR middle-end/45098 (Missed induction variable optimization)

2011-05-19  Tom de Vries  <tom@codesourcery.com>

	PR target/45098
	* tree-ssa-loop-ivopts.c (determine_iv_cost): Prevent
	cost_base.cost == 0.

From-SVN: r173893
This commit is contained in:
Tom de Vries 2011-05-19 08:49:28 +00:00 committed by Tom de Vries
parent 5bbe9958e0
commit a53c50249f
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-05-19 Tom de Vries <tom@codesourcery.com>
PR target/45098
* tree-ssa-loop-ivopts.c (determine_iv_cost): Prevent
cost_base.cost == 0.
2011-05-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/49002

View File

@ -4690,6 +4690,11 @@ determine_iv_cost (struct ivopts_data *data, struct iv_cand *cand)
base = cand->iv->base;
cost_base = force_var_cost (data, base, NULL);
/* It will be exceptional that the iv register happens to be initialized with
the proper value at no cost. In general, there will at least be a regcopy
or a const set. */
if (cost_base.cost == 0)
cost_base.cost = COSTS_N_INSNS (1);
cost_step = add_cost (TYPE_MODE (TREE_TYPE (base)), data->speed);
cost = cost_step + adjust_setup_cost (data, cost_base.cost);