[ping] Re: [Patch, libgcc] Fix build warnings in fixed-bit.c

Iain Sandoe iain@codesourcery.com
Fri Jun 22 12:47:00 GMT 2012


ping.

On 15 Jun 2012, at 14:31, Iain Sandoe wrote:

> Hi,
> 
> When building for, say, mips-linux-gnu, the build of objects from fixed-bit.c produces a lot of "set but not used" warnings for min_high & min_low.
> 
> looking at the code, these appear to be genuine.
> Fixed as below.
> 
> OK for trunk?
> Iain
> 
> libgcc:
> 	* fixed-bit.c (SATFRACT): Adjust declarations and init for
> 	min_high, min_low.
> 
> 
> Index: libgcc/fixed-bit.c
> ===================================================================
> --- libgcc/fixed-bit.c	(revision 188657)
> +++ libgcc/fixed-bit.c	(working copy)
> @@ -768,11 +768,12 @@ SATFRACT (FROM_FIXED_C_TYPE a)
> #if FROM_MODE_UNSIGNED == 0
>   BIG_SINT_C_TYPE high, low;
>   BIG_SINT_C_TYPE max_high, max_low;
> +# if TO_MODE_UNSIGNED == 0
>   BIG_SINT_C_TYPE min_high, min_low;
> +# endif
> #else
>   BIG_UINT_C_TYPE high, low;
>   BIG_UINT_C_TYPE max_high, max_low;
> -  BIG_UINT_C_TYPE min_high, min_low;
> #endif
> #if TO_FBITS > FROM_FBITS
>   BIG_UINT_C_TYPE utemp;
> @@ -819,13 +820,12 @@ SATFRACT (FROM_FIXED_C_TYPE a)
> #endif
> 
> #if TO_MODE_UNSIGNED == 0
> -  min_high = -1;
>   stemp = (BIG_SINT_C_TYPE)1 << (BIG_WIDTH - 1);
>   stemp = stemp >> (BIG_WIDTH - 1 - TO_I_F_BITS);
> +# if FROM_MODE_UNSIGNED == 0
> +  min_high = -1;
>   min_low = stemp;
> -#else
> -  min_high = 0;
> -  min_low = 0;
> +# endif
> #endif
> 
> #if FROM_MODE_UNSIGNED == 0 && TO_MODE_UNSIGNED == 0
> @@ -973,9 +973,9 @@ SATFRACT (FROM_INT_C_TYPE a)
>   FROM_INT_C_TYPE x = a;
>   BIG_SINT_C_TYPE high, low;
>   BIG_SINT_C_TYPE max_high, max_low;
> -  BIG_SINT_C_TYPE min_high, min_low;
> #if TO_MODE_UNSIGNED == 0
>   BIG_SINT_C_TYPE stemp;
> +  BIG_SINT_C_TYPE min_low, min_high;
> #endif
> #if BIG_WIDTH != TO_FBITS
>   BIG_UINT_C_TYPE utemp;
> @@ -1011,13 +1011,10 @@ SATFRACT (FROM_INT_C_TYPE a)
> #endif
> 
> #if TO_MODE_UNSIGNED == 0
> -  min_high = -1;
>   stemp = (BIG_SINT_C_TYPE)1 << (BIG_WIDTH - 1);
>   stemp = stemp >> (BIG_WIDTH - 1 - TO_I_F_BITS);
>   min_low = stemp;
> -#else
> -  min_high = 0;
> -  min_low = 0;
> +  min_high = -1;
> #endif
> 
> #if TO_MODE_UNSIGNED == 0
> 



More information about the Gcc-patches mailing list