This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]