This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use div_and_round_double in try_move_mult_to_array_index
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 May 2005 20:18:22 -0600 (MDT)
- Subject: Re: [PATCH] Use div_and_round_double in try_move_mult_to_array_index
On Wed, 11 May 2005, Richard Guenther wrote:
> 2005-05-11 Richard Guenther <rguenth@gcc.gnu.org>
>
> * fold-const.c (div_if_zero_remainder): New function.
> (try_move_mult_to_index): Use it.
>
> * g++.dg/tree-ssa/tmmti-2.C: New testcase.
My preference for a slightly cleaner API, would be change the new
div_if_zero_remainder function to return a tree, and then use a
value of NULL_TREE to indicate a non-zero remainder.
tmp = div_if_zero_remainder (EXACT_DIV_EXPR, delta, step);
if (!tmp)
continue;
delta = tmp;
Roger
--