Re: 68000 issue in longlong.h

2021-03-08 Thread Torbjörn Granlund
Thanks for your analysis, Niels! I now agree that sticking an & in there is the right thing to do. (I'm adding a test config for plain 68000 too; I thought we had one already but that does not seem to be the case.) -- Torbjörn Please encrypt, key id 0xC8601622

Re: 68000 issue in longlong.h

2021-03-05 Thread Niels Möller
"se...@t-online.de" writes: > There you see the original code on the left and the generated assembly in the > middle. > You can add the & to > "=d" (__umul_tmp1) > in the left window and you see immediately the change in the comiled output. Ok, let me see if I understand the problem. The

AW: 68000 issue in longlong.h

2021-03-05 Thread se...@t-online.de
If you could show the generated code (after gcc's register allocation) *and* point out precisely where things go wrong, that would be helpful. Regards, /Niels The generated code is on the compiler explorer link I provided: http://franke.ms/cex/z/oG53bK There you see the original code on the

Re: AW: 68000 issue in longlong.h

2021-03-04 Thread Torbjörn Granlund
"se...@t-online.de" writes: Can you explain why __umul_tmp1 should not be an "early-clobber output"? Because it is not written to before we're done with the input. (I wrote this code close to 30 years ago. It is stll possible that it is buggy, but it looks correct to me and it has been in

AW: 68000 issue in longlong.h

2021-03-04 Thread se...@t-online.de
> With his change the tests pass so I think the change is reasonable. >I disagree. If I am right that the inline asm is correct, changing it >to avoid triggering a compiler bug is not a reasonable change. But >perhaps I am wrong and the inline asm is buggy, but then somebody needs >to explain

Re: AW: 68000 issue in longlong.h

2021-03-03 Thread Torbjörn Granlund
gmp-bugs-ow...@gmplib.org writes: With his change the tests pass so I think the change is reasonable. I disagree. If I am right that the inline asm is correct, changing it to avoid triggering a compiler bug is not a reasonable change. But perhaps I am wrong and the inline asm is buggy, but

AW: 68000 issue in longlong.h

2021-03-03 Thread se...@t-online.de
>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

Re: 68000 issue in longlong.h

2021-03-03 Thread Torbjörn Granlund
"se...@t-online.de" writes: Hello, I am compiling and testing libgmp for AmigaOS. Yes, I am crazy. I use Thanks to bebbo's gcc https://github.com/bebbo/amiga-gcc I was quite successful. I had