public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paul Edwards" <mutazilah@gmail.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: i370 port
Date: Fri, 31 Mar 2017 10:34:00 -0000	[thread overview]
Message-ID: <B2EC4DA4C8594157ACD2F17C45FAE918@PaulDell> (raw)
In-Reply-To: <Pine.LNX.4.64.0906051459030.7321@digraph.polyomino.org.uk>

Hi Joseph. (reviving a thread from 2009)

I have been streamlining the execution
of MVS (i370) via my "runmvs" script
recently, and now it only takes a few
seconds to do a test on MVS because
I have taken out all the unnecessary
pauses and made lots of other
improvements, and bypassing bugs
in Hercules.

Numerous other i370 bugs have been
fixed in GCC 3.2.3 too.

So I decided it was time to take a look
at the test suite to see what state that
was in.

With the aid of a script (below), I got
the following results:

C:\devel\gcc\gcc\config\i370\test>showres

C:\devel\gcc\gcc\config\i370\test>grep passed results.txt   | wc
    516    1032   10278

C:\devel\gcc\gcc\config\i370\test>grep failed results.txt   | wc
    117     234    2373

C:\devel\gcc\gcc\config\i370\test>


I looked at the first few errors. One
was deficiencies with "long long"
which is currently in the "too hard"
basket.

Some were ASCII assumptions (the
i370 port is EBCDIC).

And there was a genuine bug which I
have passed on to Dave Pitts for
analysis.

Regarding the ASCII errors, here’s an
example:

C:\devel\gcc\gcc\testsuite\gcc.c-torture\execute>type 20000412-3.c
typedef struct {
  char y;
  char x[32];
} X;

int z (void)
{
  X xxx;
  xxx.x[0] =
  xxx.x[31] = '0';
  xxx.y = 0xf;
  return f (xxx, xxx);
}

int main (void)
{
  int val;

  val = z ();
  if (val != 0x60)
    abort ();
  exit (0);
}

int f(X x, X y)
{
  if (x.y != y.y)
    return 'F';

  return x.x[0] + y.x[0];
}


They have assumed that '0' is 0x30,
but on EBCDIC it is 0xf0.

The documentation says:

C:\devel\gcc\gcc\testsuite>grep PORTABLE readme.gcc
DO NOT PUT NON-PORTABLE TESTCASES IN gcc.c-torture.


So what do you suggest I do with this class
of error?

The choices seem to be:

1. Remove/ignore it as it is non-portable so
shouldn't be there in the first place.

2. Create a new internal define like __EBCDIC__
and if that is set, do something different.

3. Create a user-define like -DEBCDIC to be
tested.

4. Do something like:

#if '0' == 0x30

(untested)

5. Use an existing define, like __MVS__
and if that is set, do something-or-other.


Any suggestions?

I know 3.2.3 is very old, but this is a very
long road, and this is where the most
stable i370.md environment is.

BTW, I saw someone mention something
about a "compile farm". MVS/380 is a
freely available i370 platform which
allows you to run tests on MVS pretty
easily, if a time comes when people
want to run tests on MVS to see if
their code works on EBCDIC as C90
allows.

Here is what it looks like on my system:

Just call this script:

call mvsgccr cprog.c output.txt

and it produces an output file that
includes:

07.28.30 JOB    1  $HASP373 MVSGCCR  STARTED - INIT  3 - CLASS C - SYS BSP1
07.28.30 JOB    1  IEF403I MVSGCCR - STARTED - TIME=07.28.30
07.28.30 JOB    1  IEFACTRT - Stepname  Procstep  Program   Retcode
07.28.31 JOB    1  MVSGCCR    S1        CREATE    IEFBR14   RC= 0000
07.28.31 JOB    1 *IEF233A M 401,PCTOMF,,MVSGCCR,COMP
07.28.32 JOB    1  MVSGCCR    S1        COMP      GCCNOMM   RC= 0000
07.28.33 JOB    1  MVSGCCR    S1        ASM       ASMA90    RC= 0000
07.28.33 JOB    1  MVSGCCR    S1        LKED      IEWL      RC= 0000
07.28.33 JOB    1  MVSGCCR    S1        EXECC     CPROG     RC= 0000
07.28.33 JOB    1  IEF404I MVSGCCR - ENDED - TIME=07.28.33
07.28.33 JOB    1  $HASP395 MVSGCCR  ENDED

On a failure of a test case, this line:

07.28.33 JOB    1  MVSGCCR    S1        EXECC     CPROG     RC= 0000

changes to:

07.28.33 JOB    1  MVSGCCR    S1        EXECC     CPROG     RC= 0012


MVS is a very interesting environment
in my opinion, and it's cool to have
code working there too.

I was thinking that maybe for people
who don't wish to install MVS/380
or TK4- on their system, there could
be some sort of hacked ftp so that
people could go:

ftp some.site
put cprog.c
put go.txt (this hangs while the C
program is compiled)
get output.txt
bye

Or for the more generic case:
ftp some.different.site
put in.jcl
put in.zip
put go.txt (hangs possibly 10 minutes)
get output.txt
get out.zip
bye

(for when you wish to build an entire
application, like "sed", on MVS).

go.txt could have the required runmvs
command, such as:

runmvs in.jcl output.txt in.zip out.zip


Usage here:

C:\mvs380>runmvs
Usage runmvs jcl.file print.file [aux_input.file|none] 
[aux_output.file|none] [ascii|binary|rdwund|rdwvar|vart] [ascii|binary] 
[awstap.file|none]
e.g. runmvs compile.jcl output.txt world.c world.s ascii ascii
or runmvs buildgcc.jcl output.txt source.zip xmit.dat
default is for files (if provided) to be binary


BTW, is that the main testsuite I should
be running? There's 633 C files there. Is
that enough, given that I'm only building
and testing C, or should I also compile
the stuff in the "compile" directory at the
same level as "execute"?

Thanks. Paul.





C:\devel\gcc\gcc\config\i370\test>type onecomp.bat
rem this should be run in a directory under config/i370
copy ..\..\..\testsuite\gcc.c-torture\execute\%1 cprog.c
call mvsgccr cprog.c output.txt
grep "EXECC     CPROG     RC= 0000" output.txt
if errorlevel 1 goto bad
echo %1 passed >>results.txt
goto exit
:bad
echo %1 failed >>results.txt
:exit

C:\devel\gcc\gcc\config\i370\test>



C:\devel\gcc\gcc\config\i370\test>head dotests.bat
del results.txt

call onecomp 20000112-1.c
call onecomp 20000113-1.c
call onecomp 20000121-1.c
call onecomp 20000205-1.c
call onecomp 20000217-1.c
call onecomp 20000223-1.c
call onecomp 20000224-1.c
call onecomp 20000225-1.c

C:\devel\gcc\gcc\config\i370\test>





-----Original Message----- 
From: Joseph S. Myers
Sent: Saturday, June 6, 2009 1:02 AM
To: Paul Edwards
Cc: gcc@gcc.gnu.org
Subject: Re: i370 port

On Sat, 6 Jun 2009, Paul Edwards wrote:

> The port is to a pure C90 environment (ie not posix, not unix).  It was a
> major effort to achieve that, and it has only just been completed to the
> point where the compiler recompiles itself with full optimization.  The
> environment where it runs is not set up to run shell scripts or makes
> or test suites.  It's set up to run JCL, and there's a stack of JCL card
> decks to allow GCC to compile, which would be good to have included
> in the i370 directory.

You can test a cross compiler if you have some way of copying a test
executable to the i370 system, running it and getting its output and exit
status back (actually you don't need to be able to get the exit status
since DejaGnu has wrappers to include it in the output if needed).  There
is no need for the target to be able to run shell scripts or makes.  You
would need to write your own DejaGnu board file that deals with copying
to/from the i370 system and running programs there.  The testsuite
routinely runs for much more limited embedded systems (using appropriate
board files).

-- 
Joseph S. Myers
joseph@codesourcery.com 

  parent reply	other threads:[~2017-03-31 10:34 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 12:45 Paul Edwards
2009-06-05 14:33 ` Joseph S. Myers
2009-06-05 14:57   ` Paul Edwards
2009-06-05 15:03     ` Joseph S. Myers
2009-06-05 15:24       ` Paul Edwards
2009-06-05 15:47         ` Joseph S. Myers
2009-09-11 17:35       ` i370 port - in search of hooks Paul Edwards
2017-03-31 10:34       ` Paul Edwards [this message]
2009-09-12 12:41   ` i370 port Paul Edwards
2009-06-05 15:21 ` Ulrich Weigand
2009-06-05 15:39   ` Paul Edwards
2009-06-05 15:49     ` Daniel Jacobowitz
2009-06-05 15:57       ` Paul Edwards
2009-06-05 20:20         ` Joseph S. Myers
2009-06-05 20:45           ` Paul Edwards
2009-06-06 15:00       ` Paul Edwards
2009-06-15 17:46         ` Ulrich Weigand
2009-06-19  0:06           ` Paul Edwards
2009-06-19 12:28             ` Ulrich Weigand
2009-07-18 11:28               ` Paul Edwards
2009-07-20 14:27                 ` Ulrich Weigand
2009-08-08 12:04                   ` Paul Edwards
2009-08-10 21:25                     ` Ulrich Weigand
2009-08-11  0:34                       ` Paul Edwards
2009-08-11 15:21                         ` Ulrich Weigand
2009-08-12 11:52                           ` Paul Edwards
2009-08-12 15:27                             ` Paolo Bonzini
2009-08-12 16:35                             ` Ulrich Weigand
2009-08-12 17:27                               ` Paul Edwards
2009-08-12 17:56                                 ` Paolo Bonzini
2009-08-12 19:46                                 ` Ulrich Weigand
2009-08-12 20:31                                   ` Paul Edwards
2009-08-19 12:07                               ` Paul Edwards
2009-08-19 12:27                                 ` Paolo Bonzini
2009-08-20 12:49                               ` Paul Edwards
2009-08-20 22:48                                 ` Ulrich Weigand
2009-08-21  2:37                                   ` Paul Edwards
2009-08-21 16:46                                     ` Ulrich Weigand
2009-06-05 15:44   ` Joseph S. Myers
2009-06-05 15:52     ` Paul Edwards
2009-09-08 15:55     ` Paul Edwards
2009-09-14 15:32       ` Ulrich Weigand
2021-09-02  8:15   ` s390 port Paul Edwards
2021-09-02 14:34     ` Ulrich Weigand
2021-09-02 14:50       ` Paul Edwards
2021-09-02 14:53         ` Ulrich Weigand
2021-09-02 15:01           ` Paul Edwards
2021-09-02 15:13             ` Ulrich Weigand
2021-09-02 15:26               ` Paul Edwards
2021-09-02 19:46                 ` Ulrich Weigand
2021-09-02 20:05                   ` Paul Edwards
2021-09-02 20:16                     ` Andreas Schwab
2021-09-03 11:18                     ` Ulrich Weigand
2021-09-03 11:35                       ` Paul Edwards
2021-09-03 12:12                         ` Ulrich Weigand
2021-09-03 12:38                           ` Paul Edwards
2021-09-03 12:53                             ` Jakub Jelinek
2021-09-03 13:12                               ` Paul Edwards
2022-12-20  4:27                           ` Paul Edwards
2009-08-23  8:50 i370 port Paul Edwards
2009-08-26 22:13 ` Henrik Sorensen
2009-09-09 22:33 Paul Edwards
2009-09-14 15:42 ` Ulrich Weigand
2009-09-15 12:59   ` Paul Edwards
2009-09-15 13:51     ` Ulrich Weigand
2009-09-17 13:00       ` Paul Edwards
2009-09-17 17:55         ` Ulrich Weigand
2009-09-18  0:35           ` Paul Edwards
2009-09-18 12:06             ` Ulrich Weigand
2009-09-18 12:23               ` Paul Edwards
2009-09-18 13:27                 ` Ulrich Weigand
2009-09-18 13:42                   ` Paul Edwards
2009-09-18 16:08                     ` Ulrich Weigand
2009-09-19 12:57                       ` Paul Edwards
2009-09-25 10:19                       ` Paul Edwards
2009-09-25 15:20                         ` Ulrich Weigand
2009-11-04  5:21                       ` Paul Edwards
2009-11-04 16:47                         ` Ulrich Weigand
2009-11-09 14:55                           ` Paul Edwards
2009-11-09 15:57                             ` Ian Lance Taylor
2009-11-09 23:10                               ` Paul Edwards
2009-11-10 14:58                               ` Paul Edwards
2009-11-10 15:36                                 ` Ian Lance Taylor
2009-11-10 15:51                               ` Paul Edwards
2009-11-10 15:56                                 ` Ian Lance Taylor
2009-12-02 22:03                                   ` Paul Edwards
2011-08-13  8:34                           ` Paul Edwards
2011-08-15 14:32                             ` Ulrich Weigand
2011-08-15 15:26                               ` Paul Edwards
2011-08-15 17:23                                 ` Ulrich Weigand
2011-08-16 11:20                                   ` Paul Edwards
2011-08-16 13:26                                     ` Ulrich Weigand
2011-08-18 12:15                                       ` Paul Edwards
2011-08-18 13:14                                         ` Ulrich Weigand
2011-08-18 14:18                                           ` Paul Edwards
2009-09-22 12:31 Paul Edwards
2011-08-20  7:44 Paul Edwards
2011-08-20 10:09 Paul Edwards
2011-08-20 12:15 Paul Edwards
2011-08-22 12:23 ` Ulrich Weigand
2012-04-05 13:32   ` Paul Edwards
2012-04-06 18:13     ` Ulrich Weigand
2012-04-06  5:51 Paul Edwards
2012-04-06 12:49 Paul Edwards
2012-04-06 18:16 ` Ulrich Weigand
2012-04-07  4:12   ` Paul Edwards
2012-04-07  5:45 Paul Edwards
2012-04-08 17:43 ` Ulrich Weigand
2014-02-11 17:01   ` Paul Edwards
2014-02-13  4:23 Paul Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B2EC4DA4C8594157ACD2F17C45FAE918@PaulDell \
    --to=mutazilah@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).