AW: 68000 issue in longlong.h
selco at t-online.de
selco at t-online.de
Wed Mar 3 15:39:31 UTC 2021
>The current code looks correct to me. Please explain why you think it
>is not correct.
>
>
>--
>Torbjörn
Hello,
thank you for looking into my report.
I am not an assembler expert. I compiled the lib with and without -O2 and found without -O2 the tests worked. So I started compiling the c-files with and without -O2 to find out the problematic file. I eventually found exactly one file. If all others in the lib were compiled with -O2 and only mpn/sqr_basecase.c without optimization, then the tests passed. So I suspceted a bug in Amiga gcc6 and asked the maintainer of amiga gcc6.
He tried and answered on https://github.com/bebbo/gcc/issues/145
This is his answer:
>I disabled the asm mult16x16 to hunt the bug and with the generic version it run well. So the problem had to be the asm.
>Here I compared the generated asm: http://franke.ms/cex/z/oG53bK and you see that only one register is used instead of two, since the modification is not recognized.
>
>/* here --> */ "=d" (__umul_tmp1),
>
>to
>
>/* here --> */ "=&d" (__umul_tmp1),
>
>does the magic.
With his change the tests pass so I think the change is reasonable.
Kind regards Alexander
More information about the gmp-bugs
mailing list