Re: Pascal


Paul Edwards
 

On Sat, Oct 23, 2021 at 12:41 PM, Markus Loew wrote:

If you could fix the i370 port to stop it from generating negative
indexes, that would be really great.
does it concern GCCMVS?
Yep.

what i370 port are you speaking about?
GCCMVS used/uses the existing i370 port of GCC. It was
decommissioned after 3.4.6.

what code do you speak about? where and
how does appear that error?
If you run this code (or similar):

F:\devel\gcc\gcc>type bug34.c
/* Demonstrate a 32-bit bug in GCC 3.2.3 v9.0 when
using a negative index. */

char buf[5];
char *end = &buf[4];

void foo(void)
{
end[-1] = 'X';
return;
}


through gcc -Os you will get:

L 2,=A(END)
L 3,4+=A(END)
L 3,0(2)
L 2,=F'-1'
L 4,=F'-25'
STC 4,0(2,3)

See that use of R2 being set to -1 as an index? That has been
screwing up 32-bit S/3X0 code for something like a decade.

It is preventing z/PDOS to be able to cope with 32-bit code
and 64-bit code running with no mode changes required
whatsoever. z/PDOS simply goes into AM64 at startup and
no further mode changes are required.

If you know how to constrain index registers to positive numbers
only, we're in business. There's very little code that uses negative
indexes, so it's not a performance problem. But just one line of
generated code that uses it and we're screwed.

IBM is being coy in the GCC mailing list about how to apply that
constraint, probably because they realize the ramifications of it.

I've tried various things myself without success.

The same problem affects the still-extant s390 target.

I can actually test it myself if you just tell me what to try.

Or on the 80386 side there are some enhancements I would
like made to "subc".
does it all concern GCCMVS as well?
No, "subc" is another compiler. You can get both the gccmvs
and the subc source code in custom.zip from http://pdos.org

It would be good if subc could be modified to produce S/370
code too. Note that subc is public domain, which is why I'm so
keen on it. If the 80386 version can be made sufficiently
functional I will build PDOS/386 with subc instead of gccwin.

My knowledge about the i686 instruction set is very reduced,
It's 386 that I want, and I think most of the problems in subc
are related to parsing C code, not instruction generation.

BTW, I believe there is a "GNU Pascal" but I don't know the
details. That might be another option instead of fpc.

and it will
certainly take some effort
to reactivate my 370 assembler programming expertise (a question of a few
days).
That's certainly quick.

Finally I hope to find one or two experienced enthusiasts, inspired and
motivated to take part in a
"fpc for MVS 3.8j port" project  team, I would like to create. Willing to
learn is the best motivation.
And a good teacher is welcome as well. It IS an ambitious goal.
Note that as part of the PDOS/386 project I have a "pascal"
target which provides a small runtime for fpc so that
executables you produce do not have copyrighted code in them.

BTW I have started to look for Paul Robinson. I have written a mail to Kent
Tessman ( kent@generalcoffee.com ),
the creator of the Hugo (
http://web.archive.org/web/20110611063518/http://wurb.com/if/devsys/4 )
programming language. It is well possible that he knows Mr Robinson, as I
found his
compay's name mentioned together with Hugo. I sent a hidden copy to the owner
of this group, in the hope
that it is you :-)
Yes, that came through, and I already replied.

Actually I am studying the source code of Stanford Pascal, made available to
MVS 3.8j by Bernd Oppolzer.
Ok.

BFN. Paul.

Join hercules-380@groups.io to automatically receive all group messages.