Kyrill Tkachov <kyrylo.tkac...@foss.arm.com> writes:
> Hi Richard,
>
> On 10/3/19 1:45 PM, Richard Sandiford wrote:
>> Noticed while debugging the arm bootstrap failure.
>>
>> Tested on arm-linux-gnueabihf.  OK to install?
>>
>> Richard
>>
>>
>> 2019-10-03  Richard Sandiford <richard.sandif...@arm.com>
>>
>> gcc/
>>         * config/arm/arm.c (arm_print_value): Use real_to_decimal
>>         to print CONST_DOUBLEs.
>>
>> Index: gcc/config/arm/arm.c
>> ===================================================================
>> --- gcc/config/arm/arm.c        2019-09-19 10:04:17.889997155 +0100
>> +++ gcc/config/arm/arm.c        2019-10-03 13:43:41.618712286 +0100
>> @@ -16122,7 +16122,12 @@ arm_print_value (FILE *f, rtx x)
>>        return;
>>
>>      case CONST_DOUBLE:
>> -      fprintf (f, "<0x%lx,0x%lx>", (long)XWINT (x, 2), (long)XWINT 
>> (x, 3));
>> +      {
>> +       char fpstr[20];
>> +       real_to_decimal (fpstr, CONST_DOUBLE_REAL_VALUE (x),
>> +                        sizeof (fpstr), 0, 1);
>> +       fputs (fpstr, f);
>
> I notice in other uses of real_to_decimal in other ports they pre-fill 
> the buffer with '\0'.
>
> Does real_to_decimal behave sanely wrt to NULL-termination?

Yeah, it adds a terminator.  I'd copied the code from arm_print_operand,
so hopefully it's OK.

> If so, ok for trunk.

Thanks, applied.

Richard

Reply via email to