[PATCH] Some set but not used warnings workarounds

Jakub Jelinek jakub@redhat.com
Fri Nov 27 12:39:00 GMT 2009


On Fri, Nov 27, 2009 at 01:34:28PM +0100, Uros Bizjak wrote:
> > --- gcc/genemit.c.jj	2009-02-20 15:34:31.000000000 +0100
> > +++ gcc/genemit.c	2009-11-26 17:36:35.000000000 +0100
> > @@ -520,12 +520,13 @@ gen_expand (rtx expand)
> >  	 (unless we aren't going to use them at all).  */
> >        if (XVEC (expand, 1) != 0)
> >  	{
> > -	  for (i = 0; i < operands; i++)
> > -	    printf ("    operand%d = operands[%d];\n", i, i);
> > -	  for (; i <= max_dup_opno; i++)
> > -	    printf ("    operand%d = operands[%d];\n", i, i);
> > -	  for (; i <= max_scratch_opno; i++)
> > -	    printf ("    operand%d = operands[%d];\n", i, i);
> > +	  for (i = 0;
> > +	       i < MAX (operands, MAX (max_scratch_opno, max_dup_opno) + 1);
> 
> 	       i <= MAX (operands, MAX (max_scratch_opno, max_dup_opno));

That's not equivalent.  If say max_dup_opno and max_scratch_opno are
-1, that would iterate one more times than it is supposed to.

	Jakub



More information about the Gcc-patches mailing list