Jeff Law writes:

> On 09/08/2015 06:17 AM, Jiong Wang wrote:
>>
>> All other cost helper functions are using signed int to hold cost
>> while seq_cost is using unsigned int.
>>
>> This fix this. bootstrap OK on x86.
>>
>> OK for trunk?
>>
>> 2015-09-08  Jiong Wang  <jiong.w...@arm.com>
>>
>> gcc/
>>    * rtl.h (seq_cost): Change return type from "unsigned" to "int".
>>    * rtlanal.c (seq_cost): Likewise.
> Why not go the other way and start making things unsigned -- for a cost 
> function like this, unsigned seems more natural to me.

I was using "(unsigned) -1" to represent maximum cost, then later known
there is MAX_COST macro and found it's actually signed type, and quick
search shows most of the code in gcc/rtlanal.c, are using "int", so I am
changing seq_cost which seems to be the only cost helper using unsigned.

And looks like there is no consistent type to hold cost value across
gcc, some are using "unsigned" while others are using "int", I guess
they are surviving because gcc disable -Wconversion by default.

-- 
Regards,
Jiong

Reply via email to