[PATCH v3 01/17] gcc PR 88409: miscompilation due to missing cc clobber in longlong.h macros

Alexander Cherepanov ch3root@openwall.com
Mon Mar 9 15:23:38 GMT 2020


On 06/03/2020 21.24, 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.
> 
> include/
> 2019-03-28  Vineet Gupta <vgupta@synopsys.com>
> 
> 	PR 89877
> 
> 	* longlong.h [__arc__] (add_ssaaaa): Add cc clobber
> 	(sub_ddmmss): Likewise.
Is PR number in subject (88409) wrong? The one in Changelog (89877) 
seems to be right.

-- 
Alexander Cherepanov


More information about the Libc-alpha mailing list