On 20/01/24 00:55, David Brown wrote:
>>>> LM1873:
>>>> movl $4294967295, %eax
Thanks Scott (in other message) for
confirming that the generated code was bad.
That triggered me to make the compiler
have short == int == long == 64 bits to
overcome the problem and match SubC by
using the stack for parameters too.
It was to a large extent successful, but
not completely (floating point issues I
think), but it has triggered another
change of direction that I am still mulling
over. The ELF executable is available in
the UCX64 section of
http://pdos.org
> You've only posted bits of your code - try posting it all here. It's
It's gcc.c from gcc 3.2.3.
> Also, why are you using such an ancient version of gcc?
It is sort of the only one known to support
the i370 target properly.
And I have spent 2 decades beating it into shape.
And the source code is (now) C90 compliant
as opposed to being written in Turtle Graphics
or whatever language modern gcc is now written in.
Note that it needs to be C90-compliant
otherwise it won't run on PDOS/386.
> And what changes did you make to it?
Most of the work was in the i370 machine
definition, or other things in i370 to
support the EBCDIC target. It was Dave
Pitts who changed the body of gcc to
support EBCDIC. But that work would have
been obsoleted by gcc 3.4.6 which has the
ability to change the character set, but
gcc 3.4.6 has some internal errors when
targeting i370 and noone was willing/able
to fix them, so I abandoned my 3.4.6
effort and went back to 3.2.3.
But there were some intrusive changes, like
stopping after one error, since otherwise
it will scroll off the screen when run on
the primitive PDOS/386.
Note that it is i370 output that is accepted
on MVS 3.8j, not s390. Also what is accepted
by the S/370 hardware. And yes, there are
workarounds that sort of maybe could be used
with some effort sort of maybe.
And maybe one day I will change to use one
of those sort of maybe works methods. Or
more likely Jean-Marc will come through with
his SubC mods, and I'll then provide an i370
target.
Until then, it's gcc 3.2.3 that works at
all for the work that I am doing. And all
the targets that I support run on PDOS/386
except for this latest one which is 64-bit
and now that I have a reference - albeit
64-bit ELF - I may see if I can build it as
a 32-bit Windows executable to produce the
same output (and thus run on PDOS/386) or
I may make contact with Bart again to see
if his update for cc64 is available now
so that I can build a 64-bit Windows executable
and thus run on UCX64, as it is unlikely
that cc64 can handle the gcc 3.2.3 code,
even though it is C90-compliant. But it
shouldn't be necessary because I believe I
can target Win64 with this existing ELF
binary run under qemu x64 user, and have
stubs to change the calling convention for
the handful of kernel32 functions I need,
as has already been proven with 32-bit SubC.
BFN. Paul.