[RFA] Fix various PPC build failures due to int-in-boolean-context code

Jeff Law law@redhat.com
Fri Oct 28 15:20:00 GMT 2016


On 10/28/2016 09:17 AM, Jakub Jelinek wrote:
> On Fri, Oct 28, 2016 at 09:12:29AM -0600, Jeff Law wrote:
>> 	* config/rs6000/rs6000.c (rs6000_option_override_internal): Avoid
>> 	false positive from int-in-boolean-context warnings.
>>
>> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
>> index 5e35e33..38a5226 100644
>> --- a/gcc/config/rs6000/rs6000.c
>> +++ b/gcc/config/rs6000/rs6000.c
>> @@ -3880,7 +3880,7 @@ rs6000_option_override_internal (bool global_init_p)
>>
>>  	 If there is a TARGET_DEFAULT, use that.  Otherwise fall back to using
>>  	 -mcpu=powerpc, -mcpu=powerpc64, or -mcpu=powerpc64le defaults.  */
>> -      HOST_WIDE_INT flags = ((TARGET_DEFAULT) ? TARGET_DEFAULT
>> +      HOST_WIDE_INT flags = ((TARGET_DEFAULT) != 0 ? TARGET_DEFAULT
>
> Why ()s around TARGET_DEFAULT?
Not strictly needed.  But I didn't see a need to change that given 
they've been in the port "forever" and they don't impact readability in 
any significant way.



If they are needed, they should be provided
> in the TARGET_DEFAULT macro definition.  So I think
>       HOST_WIDE_INT flags
> 	= (TARGET_DEFAULT != 0 ? TARGET_DEFAULT
> 	   : processor_target_table[cpu_index].target_enable);
> is what we want to use (the processor_target_table[cpu_index].target_enable
> line is too long where it is right now).
Agreed.  I wasn't looking to do any cleanups, just get everything 
building again with config-list.mk.

jeff



More information about the Gcc-patches mailing list