Ok, now that 3.4.6 is fully working, I made a start on the 4.4 port.

4.4 appears to have invalidated a lot of 3.4.6 things.  Below are all
the changes I needed to make just to get an xgcc executable
built.  I didn't really know what most of it was about, but the
purpose was just to scope the changes.  Any changes that need
to be done to 4.4 I can now refer to how it was accomplished
in 3.4.6.

So, given the scope below, can someone please explain what
4.4 changes are affecting me and what I need to do to overcome
them?  Note that I have never had to do the machine changes
myself - in the past I simply waiting for Dave Pitts to do the
upgrade to the new version, and then with a working 370 code
generator I would make all the changes necessary for MVS.

This time I don't have a working code generator.  With these
changes to force an executable, I can go:

xgcc --version

and it works, but when I attempt a compile (with -S), I get an
internal error in builtin line 0, which is presumably completely
meaningless because I haven't actually done the work yet.

Thanks.  Paul.



Index: gcc4/config.sub
diff -c gcc4/config.sub:1.3 gcc4/config.sub:1.4
*** gcc4/config.sub:1.3 Mon Nov 23 12:58:07 2009
--- gcc4/config.sub Mon Nov 23 22:47:08 2009
***************
*** 940,945 ****
--- 940,948 ----
  rtpc | rtpc-*)
   basic_machine=romp-ibm
   ;;
+  i370 | i370-*)
+   basic_machine=i370-ibm
+   ;;
  s390 | s390-*)
   basic_machine=s390-ibm
   ;;
Index: gcc4/gcc/config.gcc
diff -c gcc4/gcc/config.gcc:1.3 gcc4/gcc/config.gcc:1.4
*** gcc4/gcc/config.gcc:1.3 Mon Nov 23 12:58:07 2009
--- gcc4/gcc/config.gcc Mon Nov 23 22:46:56 2009
***************
*** 358,363 ****
--- 358,366 ----
  cpu_type=spu
  need_64bit_hwint=yes
  ;;
+ i370*-*-*)
+  cpu_type=i370
+  ;;
 s390*-*-*)
  cpu_type=s390
  need_64bit_hwint=yes
***************
*** 1964,1969 ****
--- 1967,1984 ----
  thread_file='aix'
  extra_headers=altivec.h
  ;;
+ i370-*-mvspdp)
+     xm_defines='POSIX'  # 'FATAL_EXIT_CODE=12'
+     xm_file="i370/xm-mvs.h"
+     tm_file="i370/mvspdp.h i370/i370.h"
+     tmake_file="i370/t-mvs i370/t-i370"
+     c_target_objs="i370-c.o"
+     cxx_target_objs="i370-c.o"
+     ;;
+ s390-*-linux*)
+  tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
+  tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux"
+  ;;
 s390-*-linux*)
  tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
  tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux"
Index: gcc4/gcc/config/i370/i370-c.c
diff -c gcc4/gcc/config/i370/i370-c.c:1.5 gcc4/gcc/config/i370/i370-c.c:1.6
*** gcc4/gcc/config/i370/i370-c.c:1.5 Mon Nov 23 22:17:42 2009
--- gcc4/gcc/config/i370/i370-c.c Mon Nov 23 22:46:22 2009
***************
*** 34,40 ****

 #ifdef TARGET_HLASM

! #define BAD(msgid) do { warning (msgid); return; } while (0)

 /* #pragma map (name, alias) -
    In this implementation both name and alias are required to be
--- 34,43 ----

 #ifdef TARGET_HLASM

! #define BAD(msgid) do { warning (0, msgid); return; } while (0)
!
! /* +++ c_lex has gone. however, we don't use it for anything important anyway */
! #define c_lex(a)

 /* #pragma map (name, alias) -
    In this implementation both name and alias are required to be
***************
*** 42,52 ****
    anyone clarify?  */

 void
! i370_pr_map (pfile)
!      cpp_reader *pfile ATTRIBUTE_UNUSED;
 {
   tree name, alias, x;

   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma map' - ignored");

--- 45,55 ----
    anyone clarify?  */

 void
! i370_pr_map (cpp_reader *pfile ATTRIBUTE_UNUSED)
 {
   tree name, alias, x;

+ #if 0
   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma map' - ignored");

***************
*** 63,70 ****
     BAD ("missing ')' for '#pragma map' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning ("junk at end of '#pragma map'");
!
mvs_add_alias (IDENTIFIER_POINTER (name), TREE_STRING_POINTER (alias), 1);
 }

--- 66,73 ----
     BAD ("missing ')' for '#pragma map' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning (0, "junk at end of '#pragma map'");
! #endif
mvs_add_alias (IDENTIFIER_POINTER (name), TREE_STRING_POINTER (alias), 1);
 }

***************
*** 74,84 ****
    anyone clarify?  */

 void
! i370_pr_linkage (pfile)
!      cpp_reader *pfile ATTRIBUTE_UNUSED;
 {
   tree name, mode, x;

   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma linkage' - ignored");

--- 77,87 ----
    anyone clarify?  */

 void
! i370_pr_linkage (cpp_reader *pfile ATTRIBUTE_UNUSED)
 {
   tree name, mode, x;

+ #if 0
   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma linkage' - ignored");

***************
*** 95,102 ****
     BAD ("missing ')' for '#pragma linkage' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning ("junk at end of '#pragma linkage'");
!
 }

 /* #pragma checkout (mode) -
--- 98,105 ----
     BAD ("missing ')' for '#pragma linkage' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning (0, "junk at end of '#pragma linkage'");
! #endif
 }

 /* #pragma checkout (mode) -
***************
*** 105,115 ****
    anyone clarify?  */

 void
! i370_pr_checkout (pfile)
!      cpp_reader *pfile ATTRIBUTE_UNUSED;
 {
   tree mode, x;

   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma checkout' - ignored");

--- 108,118 ----
    anyone clarify?  */

 void
! i370_pr_checkout (cpp_reader *pfile ATTRIBUTE_UNUSED)
 {
   tree mode, x;

+ #if 0
   if (c_lex (&x) != CPP_OPEN_PAREN)
     BAD ("missing '(' after '#pragma checkout' - ignored");

***************
*** 120,127 ****
     BAD ("missing ')' for '#pragma checkout' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning ("junk at end of '#pragma checkout'");
!
 }

 /* #pragma nomargins
--- 123,130 ----
     BAD ("missing ')' for '#pragma checkout' - ignored");

   if (c_lex (&x) != CPP_EOF)
!     warning (0, "junk at end of '#pragma checkout'");
! #endif
 }

 /* #pragma nomargins
***************
*** 129,136 ****
    We just ignore. */

 void
! i370_pr_skipit (pfile)
!      cpp_reader *pfile ATTRIBUTE_UNUSED;
 {
 }

--- 132,138 ----
    We just ignore. */

 void
! i370_pr_skipit (cpp_reader *pfile ATTRIBUTE_UNUSED)
 {
 }

Index: gcc4/gcc/config/i370/i370.c
diff -c gcc4/gcc/config/i370/i370.c:1.5 gcc4/gcc/config/i370/i370.c:1.6
*** gcc4/gcc/config/i370/i370.c:1.5 Mon Nov 23 22:17:43 2009
--- gcc4/gcc/config/i370/i370.c Mon Nov 23 22:46:22 2009
***************
*** 1,3 ****
--- 1,4 ----
+ /* +++ references to cfun framesize are bogus */
 /* Subroutines for insn-output.c for System/370.
    Copyright (C) 1989, 1993, 1995, 1997, 1998, 1999, 2000, 2002
    Free Software Foundation, Inc.
***************
*** 274,281 ****

   /* We're 370 floating point, not IEEE floating point.  */
   memset (real_format_for_mode, 0, sizeof real_format_for_mode);
!   REAL_MODE_FORMAT (SFmode) = &i370_single_format;
!   REAL_MODE_FORMAT (DFmode) = &i370_double_format;
 }

 static int statfunc = 0;
--- 275,285 ----

   /* We're 370 floating point, not IEEE floating point.  */
   memset (real_format_for_mode, 0, sizeof real_format_for_mode);
!   /*REAL_MODE_FORMAT (SFmode) = &i370_single_format;
!   REAL_MODE_FORMAT (DFmode) = &i370_double_format;*/
!   /* +++ this is wrong */
!   REAL_MODE_FORMAT (SFmode) = &ibm_extended_format;
!   REAL_MODE_FORMAT (DFmode) = &ibm_extended_format;
 }

 static int statfunc = 0;
***************
*** 588,600 ****
               rtx note;
               for (note = REG_NOTES (insn); note;  note = XEXP(note,1))
                 {
                    if (REG_LABEL == REG_NOTE_KIND(note))
                      {
                         rtx label = XEXP (note,0);
if (!label || CODE_LABEL != GET_CODE (label)) abort ();

                         I370_RECORD_LABEL_REF(label,here);
!                      }
                 }
            }
        }
--- 592,606 ----
               rtx note;
               for (note = REG_NOTES (insn); note;  note = XEXP(note,1))
                 {
+                    /* +++ what is reg_label? */
+                    /*
                    if (REG_LABEL == REG_NOTE_KIND(note))
                      {
                         rtx label = XEXP (note,0);
if (!label || CODE_LABEL != GET_CODE (label)) abort ();

                         I370_RECORD_LABEL_REF(label,here);
!                      } */
                 }
            }
        }
***************
*** 1048,1059 ****
   ap = (alias_node_t *) xmalloc (sizeof (alias_node_t));
   if (strlen (realname) > MAX_LONG_LABEL_SIZE)
     {
!       warning ("real name is too long - alias ignored");
       return;
     }
   if (strlen (aliasname) > MAX_MVS_LABEL_SIZE)
     {
!       warning ("alias name is too long - alias ignored");
       return;
     }

--- 1054,1065 ----
   ap = (alias_node_t *) xmalloc (sizeof (alias_node_t));
   if (strlen (realname) > MAX_LONG_LABEL_SIZE)
     {
!       warning (0, "real name is too long - alias ignored");
       return;
     }
   if (strlen (aliasname) > MAX_MVS_LABEL_SIZE)
     {
!       warning (0, "alias name is too long - alias ignored");
       return;
     }

***************
*** 1568,1574 ****
   fprintf (f, "* Function %.*s prologue: stack = %ld, args = %d\n",
            nlen, mvs_function_name,
     l,
!     current_function_outgoing_args_size);
 #endif

   if (mvs_first_entry)
--- 1574,1580 ----
   fprintf (f, "* Function %.*s prologue: stack = %ld, args = %d\n",
            nlen, mvs_function_name,
     l,
!     0 /*cfun->machine->frame_size*/);
 #endif

   if (mvs_first_entry)
***************
*** 1594,1607 ****
   fprintf (f, "\tPDPPRLG CINDEX=%d,FRAME=%d,BASER=%d,ENTRY=%s\n",
 #endif
     mvs_page_num,
!     STACK_FRAME_BASE + l + current_function_outgoing_args_size,
     BASE_REGISTER,
     mvs_need_entry ? "YES" : "NO");
   fprintf (f, "\tB\tFEN%d\n", mvs_page_num);
 #ifdef TARGET_DIGNUS
   fprintf (f, "@FRAMESIZE_%d DC F'%d'\n",
     mvs_page_num,
!     STACK_FRAME_BASE + l + current_function_outgoing_args_size);
 #endif
 #ifdef TARGET_PDPMAC
   fprintf (f, "\tLTORG\n");
--- 1600,1613 ----
   fprintf (f, "\tPDPPRLG CINDEX=%d,FRAME=%d,BASER=%d,ENTRY=%s\n",
 #endif
     mvs_page_num,
!     STACK_FRAME_BASE + l + 0 /*cfun->machine->frame_size*/,
     BASE_REGISTER,
     mvs_need_entry ? "YES" : "NO");
   fprintf (f, "\tB\tFEN%d\n", mvs_page_num);
 #ifdef TARGET_DIGNUS
   fprintf (f, "@FRAMESIZE_%d DC F'%d'\n",
     mvs_page_num,
!     STACK_FRAME_BASE + l + cfun->machine->frame_size);
 #endif
 #ifdef TARGET_PDPMAC
   fprintf (f, "\tLTORG\n");
***************
*** 1615,1621 ****
 #ifdef TARGET_LE
   assemble_name (f, mvs_function_name);
   fprintf (f, "\tEDCPRLG USRDSAL=%d,BASEREG=%d\n",
!     STACK_FRAME_BASE + l + current_function_outgoing_args_size,
     BASE_REGISTER);
 #endif

--- 1621,1627 ----
 #ifdef TARGET_LE
   assemble_name (f, mvs_function_name);
   fprintf (f, "\tEDCPRLG USRDSAL=%d,BASEREG=%d\n",
!     STACK_FRAME_BASE + l + cfun->machine->frame_size,
     BASE_REGISTER);
 #endif

***************
*** 1644,1650 ****
   fprintf (f, "\tDS\tD\n");
   fprintf (f, "\tDS\tCL(" HOST_WIDE_INT_PRINT_DEC ")\n",
     STACK_POINTER_OFFSET + l
!     + current_function_outgoing_args_size);
   fprintf (f, "\tORG\tFDSE%03d\n", function_label_index);
   fprintf (f, "\tDS\tCL(120+8)\n");
   fprintf (f, "\tORG\n");
--- 1650,1656 ----
   fprintf (f, "\tDS\tD\n");
   fprintf (f, "\tDS\tCL(" HOST_WIDE_INT_PRINT_DEC ")\n",
     STACK_POINTER_OFFSET + l
!     + cfun->machine->frame_size);
   fprintf (f, "\tORG\tFDSE%03d\n", function_label_index);
   fprintf (f, "\tDS\tCL(120+8)\n");
   fprintf (f, "\tORG\n");
***************
*** 1868,1874 ****
   /* store stack size where we can get to it */
 #ifdef STACK_GROWS_DOWNWARDS
   stackframe_size =
! STACK_POINTER_OFFSET + current_function_outgoing_args_size + frame_size;
 #else /* STACK_GROWS_DOWNWARDS */
   stackframe_size =
      STACK_POINTER_OFFSET + current_function_args_size + frame_size;
--- 1874,1880 ----
   /* store stack size where we can get to it */
 #ifdef STACK_GROWS_DOWNWARDS
   stackframe_size =
!      STACK_POINTER_OFFSET + cfun->machine->frame_size + frame_size;
 #else /* STACK_GROWS_DOWNWARDS */
   stackframe_size =
      STACK_POINTER_OFFSET + current_function_args_size + frame_size;
Index: gcc4/gcc/config/i370/i370.h
diff -c gcc4/gcc/config/i370/i370.h:1.6 gcc4/gcc/config/i370/i370.h:1.7
*** gcc4/gcc/config/i370/i370.h:1.6 Mon Nov 23 22:17:43 2009
--- gcc4/gcc/config/i370/i370.h Mon Nov 23 22:46:22 2009
***************
*** 88,93 ****
--- 88,95 ----

 #define TARGET_64BIT 0

+ #if 0
+ This unused (in mvspdp) stuff is now poisoned
 /* Macro to define tables used to set the flags.  This is a list in braces
    of pairs in braces, each pair being { "NAME", VALUE }
    where VALUE is the bits to set or minus the bits to clear.
***************
*** 99,104 ****
--- 101,107 ----
   { "pickax", 2, "Experimental i370 PIC"}, \
   { "no-pickax", -2, "Disable experimental i370 PIC"}, \
   { "", TARGET_DEFAULT, 0} }
+ #endif

 extern void i370_override_options (void);
 #define OVERRIDE_OPTIONS i370_override_options()
***************
*** 203,211 ****
--- 206,216 ----

 #define MAX_MVS_PAGE_LENGTH 4068

+ #if 0 /* +++ now poisoned */
 #define PREDICATE_CODES \
   {"r_or_s_operand", { REG, SUBREG, MEM }}, \
   {"s_operand", { MEM }},
+ #endif

 /* Conservative page size when considering literals and overhead. */

***************
*** 499,507 ****
    the R1 points at that mem location.
  */

! #ifdef TARGET_PDPMAC
 #define STRUCT_VALUE_REGNUM 0
! #else
 #define STRUCT_VALUE_REGNUM 1
 #endif

--- 504,514 ----
    the R1 points at that mem location.
  */

! #if 0 /*def TARGET_PDPMAC*/
! +++ this variable is now poisoned - check structs still get returned
! properly
 #define STRUCT_VALUE_REGNUM 0
! #elif 0 /*used to be else*/
 #define STRUCT_VALUE_REGNUM 1
 #endif

***************
*** 656,663 ****
    first local allocated.  Otherwise, it is the offset to the BEGINNING
    of the first local allocated.  */

! #define STARTING_FRAME_OFFSET        \
!      (STACK_POINTER_OFFSET + current_function_outgoing_args_size)

#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = STARTING_FRAME_OFFSET

--- 663,670 ----
    first local allocated.  Otherwise, it is the offset to the BEGINNING
    of the first local allocated.  */

! /* +++ used to have a real value */
! #define STARTING_FRAME_OFFSET 0

#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = STARTING_FRAME_OFFSET

***************
*** 807,814 ****
 /* For an arg passed partly in registers and partly in memory, this is the
    number of registers used.  For args passed entirely in registers or
    entirely in memory, zero.  */
!
 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0

 /* Define if returning from a function call automatically pops the
    arguments described by the number-of-args field in the call.  */
--- 814,823 ----
 /* For an arg passed partly in registers and partly in memory, this is the
    number of registers used.  For args passed entirely in registers or
    entirely in memory, zero.  */
! /* +++ now poisoned */
! #if 0
 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
+ #endif

 /* Define if returning from a function call automatically pops the
    arguments described by the number-of-args field in the call.  */
***************
*** 848,856 ****
 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 15 || (N) == 16)

 /* This macro definition sets up a default value for `main' to return.  */
!
 #define DEFAULT_MAIN_RETURN  c_expand_return (integer_zero_node)
!

 /* Output assembler code for a block containing the constant parts of a
    trampoline, leaving space for the variable parts.
--- 857,866 ----
 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 15 || (N) == 16)

 /* This macro definition sets up a default value for `main' to return.  */
! /* +++ now poisoned */
! #if 0
 #define DEFAULT_MAIN_RETURN  c_expand_return (integer_zero_node)
! #endif

 /* Output assembler code for a block containing the constant parts of a
    trampoline, leaving space for the variable parts.
***************
*** 1134,1141 ****
 /* ??? Investigate defining STORE_FLAG_VALUE to (-1).  */

 /* When a prototype says `char' or `short', really pass an `int'.  */
!
 #define PROMOTE_PROTOTYPES 1

 /* Don't perform CSE on function addresses.  */

--- 1144,1153 ----
 /* ??? Investigate defining STORE_FLAG_VALUE to (-1).  */

 /* When a prototype says `char' or `short', really pass an `int'.  */
! /* +++ now poisoned */
! #if 0
 #define PROMOTE_PROTOTYPES 1
+ #endif

 /* Don't perform CSE on function addresses.  */

***************
*** 1252,1268 ****
 /* Define standard character escape sequences for non-ASCII targets
    only.  */

- #ifdef TARGET_EBCDIC
- #define TARGET_ESC 39
- #define TARGET_BELL 47
- #define TARGET_BS 22
- #define TARGET_TAB 5
- #define TARGET_NEWLINE 21
- #define TARGET_VT 11
- #define TARGET_FF 12
- #define TARGET_CR 13
- #endif
-
 /* ======================================================== */

 #ifdef TARGET_HLASM
--- 1264,1269 ----
***************
*** 1270,1276 ****
--- 1271,1280 ----
 #define TEXT_SECTION_ASM_OP "* Program text area"
 #define DATA_SECTION_ASM_OP "* Program data area"
 #define INIT_SECTION_ASM_OP "* Program initialization area"
+ /* +++ now poisoned */
+ #if 0
 #define SHARED_SECTION_ASM_OP "* Program shared data"
+ #endif
 #define CTOR_LIST_BEGIN  /* NO OP */
 #define CTOR_LIST_END  /* NO OP */
 #define MAX_MVS_LABEL_SIZE 8

Reply via email to