[fpc-devel] MIPS big-endian program starts but does nothing
Marco van de Voort
marcov at stack.nl
Tue Sep 9 12:50:39 CEST 2014
In our previous episode, Mark Morgan Lloyd said:
> > In addition, what is the supposed difference between an "empty program"
> > and program "built with only minimal RTL initialisation"?
>
> I don't see why something like this
>
> program test;
> begin
> end.
>
> should use anything other than the absolute minimum that's needed to
> terminate in good order.
Well, first you must realize that that program is equal to
program test;
Uses System;
begin
FPC_INITIALIZEUNITS;
// nothing
FPC_FINALIZEUNITS;
end.
The FPC_* routines walk tables and call the all units' initialization
and finalization sections. In this case System's.
Your observation reduces to letting the compiler figuring out that in the
system unit initialization the FPU Initialization can be safely skipped, and
that possible state (like the FPU control word) is not important.
This is nearly impossible.
More information about the fpc-devel
mailing list