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] Some set but not used warnings workarounds


Hello!

> 2009-11-27  Jakub Jelinek  <jakub@redhat.com>
>
> 	* genemit.c (gen_expand, gen_split): Avoid set but not used warnings
> 	when operandN variables aren't used in the body of the expander
> 	or splitter.
>
> 	* gcc.dg/builtin-choose-expr.c: Avoid set but not used warnings.
> 	* gcc.dg/trunc-1.c: Likewise.
> 	* gcc.dg/vla-9.c: Likewise.
> 	* gcc.dg/dfp/composite-type.c: Likewise.
>
> --- 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));

Uros.


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