[PATCH] [ARC] PR 88409: miscompilation due to missing cc clobber in longlong.h macros

Vineet Gupta vineet.gupta1@synopsys.com
Fri Mar 29 01:32:00 GMT 2019


On 3/28/19 5:07 PM, Marc Glisse wrote:
> On Thu, 28 Mar 2019, Vineet Gupta wrote:
>
>> simple test such as below was failing.
>>
>> | void main(int argc, char *argv[])
>> | {
>> |    size_t total_time = 115424;                       // expected 115.424
>> |    double secs = (double)total_time/(double)1000;
>> |    printf("%s %d %lf\n", "secs", total_time, secs);  // prints 113.504
>> |    printf("%d\n", (size_t)secs);
>> | }
>>
>> The printf eventually called into glibc stdlib/divrem.c:__mpn_divrem()
>> which uses the __arc__ specific inline asm macros from longlong.h which
>> were causing miscompilation.
> Hello,
>
> do you intend to post similar patches for glibc and gmp, which both have a 
> similar longlong.h?

Yeah, glibc typically "syncs" longlong.h from gcc so once gcc patch is merged,
I'll post a sync patch to glibc.
Good tip about gmp, I wasn't aware of that. I suppose I could post there too once
dust settles on gcc side.

Thx,
-Vinet



More information about the Gcc-patches mailing list