-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
m68k.md from January 9th produces crashing WCS #181
Comments
I suspect the statement to load the base register:
|
must rather look like:
notice the |
giving this a try:
|
m68k-amigaos-gcc -m68040 -ffast-math -S -O2 test.c -fbaserel
now:
|
Thanks for the update! |
can you compare it to a result using |
I will try with -fno-fast-math Right now I tried compiling/linking without -fbaserel. We ge the landscape then. The clouds are calculated but look very different. The mirroring of the sky in the water is totally wrong. |
Could you bisect it down to one file (or even one function) where it breaks? |
If so I will of course try until I find the problematic file or even the problematic function(s). |
That's an option per file. And inside each file you can do things like:
|
I found a problematic function: I compiled the project without -ffast-math. The calculated pictured lost all water-waves. The river looks like a perfect mirror now. I put that into compiler explorer. |
hm, the generated asm codes look identical to me... /shrug |
Really identical? It looks here very similar but not identical. Different registers used, different size of colored blocks. I just checked the link on a different pc. For instance the stack seems to be 12 bytes bigger if compiled with -ffast-math. Do function arguments have different size or alignment when compiled with -ffast-math? Edit: Line 64: with -ffast-math |
yes, there are some differences, but it's rather the same. The differences result in taking diffferent paths during the various optimizations.
both variants do not use the mentioned code from |
I am preparing an example. Should be ready in the evening. |
Here is the example. I fed the function with the original values from the first call and print several values. I run the executables on WinUAE with an m68040. The diff shows severeal differences.
|
heh, you killed the compiler again ^^ |
the emitted code was malformed and the loop compiler considered the results in d0/d1 as const and moved it to the top of the loop. |
Now it looks much better! The river is no longer a mirror ;-) WCS is happy again in this respect. |
thank you for providing such a good test case |
WCS crashes as soon as image calulation is started with "HALT3" (WinUAE, 68040)
Guilty is
projects/gcc/gcc/config/m68k/m68k.md commit 8c02308 (9.Jan22) "implement direct MathIeeeSingTransBase/MathIeeeDoubTransBase calls"
I went back in time step by step from recent toolchain until WCS executable works again. When I do
git checkout fd0a62e m68k.md
i.e. back to commit from January the 7th, the crash is gone.
I compile with
m68k-amigaos-gcc -DFORCE_MUIMASTER_VMIN=19 -I"/home/developer/Desktop/SelcoGit/3DNature/Amiga" -O2 -Wall -c -fmessage-length=0 -funsigned-char -MMD -MP -MF"file.d" -MT"file.o" -o "file.o" "../file.c" -g -noixemul -m68040 -fomit-frame-pointer -fbaserel -DSTATIC_FCN=static -DSTATIC_VAR=static -ffast-math -mregparm -Winline -DSWMEM_FAST_INLINE -flto
and link with
m68k-amigaos-gcc -o "WCS" ./file1.o ./file2.o ./file3.o -lmui -lm -Wl,-Map=wcs.map,--trace -ldebug -g -noixemul -m68040 -fomit-frame-pointer -fbaserel -DSTATIC_FCN=static -DSTATIC_VAR=static -ffast-math -mregparm -Winline -DSWMEM_FAST_INLINE -flto
The text was updated successfully, but these errors were encountered: