[PATCH, GCC/ARM] Make arm_feature_set agree with type of FL_* macros

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Mon Nov 14 18:56:00 GMT 2016


My apologize, I realized when trying to apply the patch that I wrote it on top 
of the optional -mthumb patch instead of the reverse. I'll rebase it to not 
screw up bisect.

Best regards,

Thomas

On 14/11/16 14:47, Kyrill Tkachov wrote:
>
> On 14/11/16 14:07, Thomas Preudhomme wrote:
>> Hi,
>>
>> Currently arm_feature_set is defined in gcc/config/arm/arm-flags as an array
>> of 2 unsigned long. However, the flags stored in these two entries are
>> (signed) int, being combinations of bits set via expression of the form 1 <<
>> bitno. This creates 3 issues:
>>
>> 1) undefined behavior when setting the msb (1 << 31)
>> 2) undefined behavior when storing a flag with msb set (negative int) into one
>> of the unsigned array entries (positive int)
>> 3) waste of space since the top 32 bits of each entry is not used
>>
>> This patch changes the definition of FL_* macro to be unsigned int by using
>> the form 1U << bitno instead and changes the definition of arm_feature_set to
>> be an array of 2 unsigned (int) entries.
>>
>> Bootstrapped on arm-linux-gnueabihf targeting Thumb-2 state.
>>
>> Is this ok for trunk?
>>
>
> Ok.
> Thanks,
> Kyrill
>
>> Best regards,
>>
>> Thomas
>



More information about the Gcc-patches mailing list