[fpc-devel] 68k question

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Tue Dec 22 00:18:47 CET 2020


On Mon, 21 Dec 2020, J. Gareth Moreton via fpc-devel wrote:

> That should be fine - thanks Marcus.  I need to reproduce the internal
> error that's being reported, and so I can compare the disassembly of
> ppcross68k to see where my optimisation is going wrong.

To bould any cross compiler, you don't even need the assembler for that
particular platform, and you don't need to disassemble, you can just ask
the compiler to generate an assembly source for you instead.

Here's how I'd build in this case:

make crossall CPU_TARGET=m68k OS_TARGET=amiga OPT="-al" CROSSOPT="-al -sh"

The OPT="-al" part will make sure that an external assembler is used to
generate the crosscompiler assembly sources, and the compiler source lines
are intermixed as comments with the generated assembly. Then resulting
files will be placed in compiler/m68k/units/*.s

The code for the particular IE you're looking for will be in
compiler/m68k/units/cgcpu.s, but of course it's possible the wrong code is
not there, but somewhere where this function is called from, or in
optimize_op_const() which is called right before that IE occurs.

You'll probably need Windows binutils to compile the compiler like this,
because the use of the internal assembler is omitted. But I find this much
more useful than digging into disassemblies...

Then CROSSOPT="-al -sh"  is for triggering the crosscompiler part, "-al"
will make sure again, that assembly sources are generated, and "-sh" will
skip the assembling (and potentially linking, but that's not used for this
particular build) for the target platform, which means you won't need any
external utilities for the target platform. The generated m68k assembly
files will be in rtl/units/m68k-amiga, and in the respective packages


More information about the fpc-devel mailing list