On 09/10/2012 04:26 PM, Steven Bosscher wrote:
> + rtx index = force_reg (index_mode, dispatch_index);
You can't modify the result of force_reg. Use copy_to_{mode_,}reg instead.
> + rtx tmp = expand_simple_binop (index_mode, MINUS,
> + index, CONST1_RTX (index_mode),
> + index, 0, OPTAB_DIRECT);
> + gcc_assert (REG_P (tmp));
> + if (tmp != index)
> + emit_move_insn (index, tmp);
This pattern is force_expand_binop.
Of course, you don't really need to force index be the same all
the way down the chain. You could just as well use
index = expand_simple_binop (index_mode, MINUS, index, one,
index, 0, OPTAB_DIRECT);
and use any new pseudo in the next iteration.
Otherwise this looks good.
r~