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][PING] Fix PR19807 and PR19639


On Tue, 10 May 2005, Richard Henderson wrote:

> On Tue, May 10, 2005 at 05:33:18PM +0200, Richard Guenther wrote:
> > ! 	      /* Try if delta is a multiple of step.  */
> > ! 	      tree mod = int_const_binop (TRUNC_MOD_EXPR, delta, step, 0);
> > ! 	      if (!integer_zerop (mod))
> > ! 		continue;
> >
> > ! 	      delta = int_const_binop (EXACT_DIV_EXPR, delta, step, 0);
>
> You can get both quotient and remainder from div_and_round_double.
> You then test remainder against zero directly and create a new
> constant node with the itype you extract.
>
> You can do this as a followup patch if you like.

I'll do it as a followup, breaking it out into sth like


/* Returns x/y if the remainder of the division of type CODE
   is zero.  Otherwise returns NULL_TREE.  */

static tree
div_zero_remainder (enum tree_code code, tree x, tree y);


better ideas for the name?

Thanks,
Richard.

>
> Otherwise ok.
>
>
>
> r~
>

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


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