freemint / m68k-atari-mint-gcc

Fork of GNU's gcc with support for the m68k-atari-mint target
https://github.com/freemint/m68k-atari-mint-gcc/wiki
Other
26 stars 7 forks source link

gcc 14.1.0 unable to compile itself for m68k #41

Open th-otto opened 5 months ago

th-otto commented 5 months ago

Today gcc 14.1.0 was released, and i've ported our patches to it.

That seems to work well when building the cross-compiler (--target-=m68k-atari-mintelf --build=x86_64-suse-linux), but not when cross-compiling the m68k version(s) with it (--target=m68k-atari-mintelf --host=m68k-atari-mintelf --build=x86_64-suse-linux)

In that case i get:

/tmp/ccpLXgrk.s: Assembler messages:
/tmp/ccpLXgrk.s:16664: Error: operands mismatch -- statement `sub.l -402(%fp),-446(%fp)' ignored
/tmp/ccpLXgrk.s:16813: Error: operands mismatch -- statement `sub.l -274(%fp),-302(%fp)' ignored
make[1]: *** [Makefile:1202: tree-data-ref.o] Error 1

This is obviously a wrong instruction (one of the operands must be a data register).

I had something similar already with gcc-11.4.0, but not with other versions. Any idea what is causing this?

Branch can be found at https://github.com/th-otto/m68k-atari-mint-gcc/tree/mint/gcc-14

Edit: seems to work when compiling that source with -Os instead.

mikrosk commented 5 months ago

Good call on trying this path as well.

I presume that gcc 13.2 did not exhibit this problem? Maybe you can try m68k-elf target, that would make it more visible for gcc guys when reported.

th-otto commented 4 months ago

Just for info: i've opened a bug report on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115010. They mentioned a nice tool there, cvise (https://github.com/marxin/cvise/). With that i was able to reduce the testcase from ~1.7MB preprocessed source to a small 7-line source.

th-otto commented 3 weeks ago

The bug was fixed in current master branch of gcc-14: https://github.com/gcc-mirror/gcc/commit/dba20679f1bf138ab5e61ad131b887db42083174 (not yet released). I've applied that fix also to my fork. Just keep that in mind if you port gcc-14.