[PATCH, i386]: Fix annoying "i386.md: operand 1 missing mode" warnings

Uros Bizjak ubizjak@gmail.com
Mon Nov 23 16:02:00 GMT 2009


On 11/23/2009 04:46 PM, Jakub Jelinek wrote:
> On Mon, Nov 23, 2009 at 01:51:26PM +0100, Uros Bizjak wrote:
>    
>> @@ -24535,7 +24546,7 @@ ix86_builtin_reciprocal (unsigned int fn
>>   int
>>   avx_vpermilp_parallel (rtx par, enum machine_mode mode)
>>   {
>> -  unsigned i, nelt = GET_MODE_NUNITS (mode);
>> +  int i, nelt = GET_MODE_NUNITS (mode);
>>     unsigned mask = 0;
>>     unsigned char ipar[8];
>>
>> @@ -24548,7 +24559,7 @@ avx_vpermilp_parallel (rtx par, enum mac
>>     for (i = 0; i<  nelt; ++i)
>>       {
>>         rtx er = XVECEXP (par, 0, i);
>> -      unsigned HOST_WIDE_INT ei;
>> +      HOST_WIDE_INT ei;
>>
>>         if (!CONST_INT_P (er))
>>   	return 0;
>>      
> Won't this consider negative constants as valid?
> I'd say
> --- config/i386/i386.c	(revision 154447)
> +++ config/i386/i386.c	(working copy)
> @@ -24539,7 +24539,7 @@ avx_vpermilp_parallel (rtx par, enum mac
>     unsigned mask = 0;
>     unsigned char ipar[8];
>
> -  if (XVECLEN (par, 0) != nelt)
> +  if ((unsigned int) XVECLEN (par, 0) != nelt)
>       return 0;
>
>     /* Validate that all of the elements are constants, and not totally
>
> would be shorter and better, given that negative number of elements
> doesn't make any sense.
>    

This part was included from [1] just to fix the bootstrap. I don't 
consider this part relevant to the core of the patch and it isn't 
intended for commit.

[1] http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01222.html

Uros.



More information about the Gcc-patches mailing list