*** gcc-2.6.0/Makefile.in-dist	Wed Jul 13 17:47:13 1994
--- gcc-2.6.0/Makefile.in	Thu Sep 15 17:46:04 1994
***************
*** 939,948 ****
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
  $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
  $(srcdir)/c-parse.y: $(srcdir)/c-parse.in
! 	sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
! 	  -e "/^ifc$$/d" -e "/^end ifc$$/d" \
! 	  $(srcdir)/c-parse.in >tmp-c-parse.y
  	$(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
  
  $(srcdir)/c-gperf.h: $(srcdir)/c-parse.gperf
--- 939,957 ----
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
  $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
+ # WJE:  conditionally include Apollo grammar extensions.
  $(srcdir)/c-parse.y: $(srcdir)/c-parse.in
! 	if [ -n "$(XM_APOLLO)" ]; then \
! 	  sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
! 	    -e "/^ifc$$/d" -e "/^end ifc$$/d" \
! 	    -e "/^ifapollo$$/d" -e "/^end ifapollo$$/d" \
! 	    $(srcdir)/c-parse.in >tmp-c-parse.y; \
! 	else \
! 	  sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
! 	    -e "/^ifc$$/d" -e "/^end ifc$$/d" \
! 	    -e "/^ifapollo$$/,/^end ifapollo$$/d" \
! 	    $(srcdir)/c-parse.in >tmp-c-parse.y; \
! 	fi
  	$(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
  
  $(srcdir)/c-gperf.h: $(srcdir)/c-parse.gperf
***************
*** 982,991 ****
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
  $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
  $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in
! 	sed -e "/^ifc$$/,/^end ifc$$/d" \
! 	  -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
! 	  $(srcdir)/c-parse.in >tmp-objc-parse.y
  	$(srcdir)/move-if-change tmp-objc-parse.y $(srcdir)/objc-parse.y
  
  objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \
--- 991,1009 ----
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
  $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
+ # WJE:  conditionally include Apollo grammar extensions.
  $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in
! 	if [ -n "$(XM_APOLLO)" ]; then \
! 	  sed -e "/^ifc$$/,/^end ifc$$/d" \
! 	    -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
! 	    -e "/^ifapollo$$/d" -e "/^end ifapollo$$/d" \
! 	    $(srcdir)/c-parse.in >tmp-objc-parse.y; \
! 	else \
! 	  sed -e "/^ifc$$/,/^end ifc$$/d" \
! 	    -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
! 	    -e "/^ifapollo$$/,/^end ifapollo$$/d" \
! 	    $(srcdir)/c-parse.in >tmp-objc-parse.y; \
! 	fi
  	$(srcdir)/move-if-change tmp-objc-parse.y $(srcdir)/objc-parse.y
  
  objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \
*** gcc-2.6.0/configure-dist	Mon Jul 11 18:25:53 1994
--- gcc-2.6.0/configure	Thu Sep 15 17:46:04 1994
***************
*** 901,908 ****
  	m68k-apollo-*)
  		xmake_file=m68k/x-apollo68
  		tm_file=m68k/apollo68.h
- 		use_collect2=yes
  		header_files=math-68881.h
  		;;
  	m68k-atari-sysv4*)              # Atari variant of V.4.
  		tm_file=m68k/atari.h
--- 901,908 ----
  	m68k-apollo-*)
  		xmake_file=m68k/x-apollo68
  		tm_file=m68k/apollo68.h
  		header_files=math-68881.h
+ 		fixincludes=Makefile.in # SR10.3.x is mostly OK
  		;;
  	m68k-atari-sysv4*)              # Atari variant of V.4.
  		tm_file=m68k/atari.h
*** gcc-2.6.0/bc-optab.c-dist	Mon Mar 14 07:11:59 1994
--- gcc-2.6.0/bc-optab.c	Thu Sep 15 17:46:04 1994
***************
*** 59,64 ****
--- 59,67 ----
    int cost;			/* A rather arbitrary cost function. */
  } conversion_recipe[NUM_TYPECODES][NUM_TYPECODES];
  
+ /* WJE:  Apollo C does not like -1 value for enum, requires cast.
+    FIXME the -1 is really misuse of the enum type.  */
+ 
  /* Binary operator tables.  */
  struct binary_operator optab_plus_expr[] = {
    { addSI, SIcode, SIcode, SIcode },
***************
*** 67,73 ****
    { addDF, DFcode, DFcode, DFcode },
    { addXF, XFcode, XFcode, XFcode },
    { addPSI, Pcode, Pcode, SIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_minus_expr[] = {
--- 70,77 ----
    { addDF, DFcode, DFcode, DFcode },
    { addXF, XFcode, XFcode, XFcode },
    { addPSI, Pcode, Pcode, SIcode },
!   { (enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode) -1 }
  };
  
  struct binary_operator optab_minus_expr[] = {
***************
*** 77,83 ****
    { subDF, DFcode, DFcode, DFcode },
    { subXF, XFcode, XFcode, XFcode },
    { subPP, SIcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  /* The ordering of the tables for multiplicative operators
--- 81,88 ----
    { subDF, DFcode, DFcode, DFcode },
    { subXF, XFcode, XFcode, XFcode },
    { subPP, SIcode, Pcode, Pcode },
!   { (enum bytecode_opcode) -1,   (enum typecode)-1,
!       (enum typecode) -1,   (enum typecode) -1 }
  };
  
  /* The ordering of the tables for multiplicative operators
***************
*** 92,98 ****
    { mulSF, SFcode, SFcode, SFcode },
    { mulDF, DFcode, DFcode, DFcode },
    { mulXF, XFcode, XFcode, XFcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_trunc_div_expr[] = {
--- 97,104 ----
    { mulSF, SFcode, SFcode, SFcode },
    { mulDF, DFcode, DFcode, DFcode },
    { mulXF, XFcode, XFcode, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_trunc_div_expr[] = {
***************
*** 100,106 ****
    { divDU, DUcode, DUcode, DUcode },
    { divSI, SIcode, SIcode, SIcode },
    { divDI, DIcode, DIcode, DIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_trunc_mod_expr[] = {
--- 106,113 ----
    { divDU, DUcode, DUcode, DUcode },
    { divSI, SIcode, SIcode, SIcode },
    { divDI, DIcode, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_trunc_mod_expr[] = {
***************
*** 108,114 ****
    { modDU, DUcode, DUcode, DUcode },
    { modSI, SIcode, SIcode, SIcode },
    { modDI, DIcode, DIcode, DIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_rdiv_expr[] = {
--- 115,122 ----
    { modDU, DUcode, DUcode, DUcode },
    { modSI, SIcode, SIcode, SIcode },
    { modDI, DIcode, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_rdiv_expr[] = {
***************
*** 115,139 ****
    { divSF, SFcode, SFcode, SFcode },
    { divDF, DFcode, DFcode, DFcode },
    { divXF, XFcode, XFcode, XFcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_bit_and_expr[] = {
    { andSI, SIcode, SIcode, SIcode },
    { andDI, DIcode, DIcode, DIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_bit_ior_expr[] = {
    { iorSI, SIcode, SIcode, SIcode },
    { iorDI, DIcode, DIcode, DIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_bit_xor_expr[] = {
    { xorSI, SIcode, SIcode, SIcode },
    { xorDI, DIcode, DIcode, DIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_lshift_expr[] = {
--- 123,151 ----
    { divSF, SFcode, SFcode, SFcode },
    { divDF, DFcode, DFcode, DFcode },
    { divXF, XFcode, XFcode, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_bit_and_expr[] = {
    { andSI, SIcode, SIcode, SIcode },
    { andDI, DIcode, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_bit_ior_expr[] = {
    { iorSI, SIcode, SIcode, SIcode },
    { iorDI, DIcode, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_bit_xor_expr[] = {
    { xorSI, SIcode, SIcode, SIcode },
    { xorDI, DIcode, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_lshift_expr[] = {
***************
*** 141,147 ****
    { lshiftSU, SUcode, SUcode, SIcode },
    { lshiftDI, DIcode, DIcode, SIcode },
    { lshiftDU, DUcode, DUcode, SIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_rshift_expr[] = {
--- 153,160 ----
    { lshiftSU, SUcode, SUcode, SIcode },
    { lshiftDI, DIcode, DIcode, SIcode },
    { lshiftDU, DUcode, DUcode, SIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_rshift_expr[] = {
***************
*** 149,165 ****
    { rshiftSU, SUcode, SUcode, SIcode },
    { rshiftDI, DIcode, DIcode, SIcode },
    { rshiftDU, DUcode, DUcode, SIcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_truth_and_expr[] = {
    { andSI, SIcode, Tcode, Tcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_truth_or_expr[] = {
    { iorSI, SIcode, Tcode, Tcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_lt_expr[] = {
--- 162,181 ----
    { rshiftSU, SUcode, SUcode, SIcode },
    { rshiftDI, DIcode, DIcode, SIcode },
    { rshiftDU, DUcode, DUcode, SIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_truth_and_expr[] = {
    { andSI, SIcode, Tcode, Tcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_truth_or_expr[] = {
    { iorSI, SIcode, Tcode, Tcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_lt_expr[] = {
***************
*** 171,177 ****
    { ltDF, Tcode, DFcode, DFcode },
    { ltXF, Tcode, XFcode, XFcode },
    { ltP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_le_expr[] = {
--- 187,194 ----
    { ltDF, Tcode, DFcode, DFcode },
    { ltXF, Tcode, XFcode, XFcode },
    { ltP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_le_expr[] = {
***************
*** 183,189 ****
    { leDF, Tcode, DFcode, DFcode },
    { leXF, Tcode, XFcode, XFcode },
    { leP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_ge_expr[] = {
--- 200,207 ----
    { leDF, Tcode, DFcode, DFcode },
    { leXF, Tcode, XFcode, XFcode },
    { leP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_ge_expr[] = {
***************
*** 195,201 ****
    { geDF, Tcode, DFcode, DFcode },
    { geXF, Tcode, XFcode, XFcode },
    { geP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_gt_expr[] = {
--- 213,220 ----
    { geDF, Tcode, DFcode, DFcode },
    { geXF, Tcode, XFcode, XFcode },
    { geP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_gt_expr[] = {
***************
*** 207,213 ****
    { gtDF, Tcode, DFcode, DFcode },
    { gtXF, Tcode, XFcode, XFcode },
    { gtP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_eq_expr[] = {
--- 226,233 ----
    { gtDF, Tcode, DFcode, DFcode },
    { gtXF, Tcode, XFcode, XFcode },
    { gtP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_eq_expr[] = {
***************
*** 217,223 ****
    { eqDF, Tcode, DFcode, DFcode },
    { eqXF, Tcode, XFcode, XFcode },
    { eqP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  struct binary_operator optab_ne_expr[] = {
--- 237,244 ----
    { eqDF, Tcode, DFcode, DFcode },
    { eqXF, Tcode, XFcode, XFcode },
    { eqP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct binary_operator optab_ne_expr[] = {
***************
*** 227,233 ****
    { neDF, Tcode, DFcode, DFcode },
    { neXF, Tcode, XFcode, XFcode },
    { neP, Tcode, Pcode, Pcode },
!   { -1, -1, -1, -1 },
  };
  
  /* Unary operator tables.  */
--- 248,255 ----
    { neDF, Tcode, DFcode, DFcode },
    { neXF, Tcode, XFcode, XFcode },
    { neP, Tcode, Pcode, Pcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,
!      (enum typecode) -1,   (enum typecode)-1}
  };
  
  /* Unary operator tables.  */
***************
*** 237,254 ****
    { negSF, SFcode, SFcode },
    { negDF, DFcode, DFcode },
    { negXF, XFcode, XFcode },
!   { -1, -1, -1 },
  };
  
  struct unary_operator optab_bit_not_expr[] = {
    { notSI, SIcode, SIcode },
    { notDI, DIcode, DIcode },
!   { -1, -1, -1 },
  };
  
  struct unary_operator optab_truth_not_expr[] = {
    { notT, SIcode, SIcode },
!   { -1, -1, -1 },
  };
  
  /* Increment operator tables.  */
--- 259,276 ----
    { negSF, SFcode, SFcode },
    { negDF, DFcode, DFcode },
    { negXF, XFcode, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct unary_operator optab_bit_not_expr[] = {
    { notSI, SIcode, SIcode },
    { notDI, DIcode, DIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,   (enum typecode)-1}
  };
  
  struct unary_operator optab_truth_not_expr[] = {
    { notT, SIcode, SIcode },
!   {(enum bytecode_opcode) -1,   (enum typecode) -1,   (enum typecode)-1}
  };
  
  /* Increment operator tables.  */
***************
*** 265,271 ****
    { predecSF, SFcode },
    { predecDF, DFcode },
    { predecXF, XFcode },
!   { -1, -1 },
  };
  
  struct increment_operator optab_preincrement_expr[] = {
--- 287,293 ----
    { predecSF, SFcode },
    { predecDF, DFcode },
    { predecXF, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode)-1}
  };
  
  struct increment_operator optab_preincrement_expr[] = {
***************
*** 281,287 ****
    { preincSF, SFcode },
    { preincDF, DFcode },
    { preincXF, XFcode },
!   { -1, -1 },
  };
  
  struct increment_operator optab_postdecrement_expr[] = {
--- 303,309 ----
    { preincSF, SFcode },
    { preincDF, DFcode },
    { preincXF, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode)-1}
  };
  
  struct increment_operator optab_postdecrement_expr[] = {
***************
*** 297,303 ****
    { postdecSF, SFcode },
    { postdecDF, DFcode },
    { postdecXF, XFcode },
!   { -1, -1 },
  };
  
  struct increment_operator optab_postincrement_expr[] = {
--- 319,325 ----
    { postdecSF, SFcode },
    { postdecDF, DFcode },
    { postdecXF, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode)-1}
  };
  
  struct increment_operator optab_postincrement_expr[] = {
***************
*** 313,319 ****
    { postincSF, SFcode },
    { postincDF, DFcode },
    { postincXF, XFcode },
!   { -1, -1 },
  };
  
  /* Table of conversions supported by the interpreter.  */
--- 335,341 ----
    { postincSF, SFcode },
    { postincDF, DFcode },
    { postincXF, XFcode },
!   {(enum bytecode_opcode) -1,   (enum typecode)-1}
  };
  
  /* Table of conversions supported by the interpreter.  */
***************
*** 325,339 ****
    int cost;			/* 1 for no-op conversions, 2 for widening conversions,
  				   4 for int/float conversions, 8 for narrowing conversions.  */
  } conversion_info[] = {
!   { -1, QIcode, QUcode, 1 },
!   { -1, HIcode, HUcode, 1 },
!   { -1, SIcode, SUcode, 1 },
!   { -1, DIcode, DUcode, 1 },
!   { -1, QUcode, QIcode, 1 },
!   { -1, HUcode, HIcode, 1 },
!   { -1, SUcode, SIcode, 1 },
!   { -1, DUcode, DIcode, 1 },
!   { -1, Tcode, SIcode, 1 },
    { convertQIHI, QIcode, HIcode, 2 },
    { convertQUHU, QUcode, HUcode, 2 },
    { convertQUSU, QUcode, SUcode, 2 },
--- 347,361 ----
    int cost;			/* 1 for no-op conversions, 2 for widening conversions,
  				   4 for int/float conversions, 8 for narrowing conversions.  */
  } conversion_info[] = {
!   { (enum bytecode_opcode) -1,   QIcode, QUcode, 1 },
!   { (enum bytecode_opcode) -1,   HIcode, HUcode, 1 },
!   { (enum bytecode_opcode) -1,   SIcode, SUcode, 1 },
!   { (enum bytecode_opcode) -1,   DIcode, DUcode, 1 },
!   { (enum bytecode_opcode) -1,   QUcode, QIcode, 1 },
!   { (enum bytecode_opcode) -1,   HUcode, HIcode, 1 },
!   { (enum bytecode_opcode) -1,   SUcode, SIcode, 1 },
!   { (enum bytecode_opcode) -1,   DUcode, DIcode, 1 },
!   { (enum bytecode_opcode) -1,   Tcode,  SIcode, 1 },
    { convertQIHI, QIcode, HIcode, 2 },
    { convertQUHU, QUcode, HUcode, 2 },
    { convertQUSU, QUcode, SUcode, 2 },
*** gcc-2.6.0/c-common.c-dist	Wed Jul  6 04:06:51 1994
--- gcc-2.6.0/c-common.c	Thu Sep 15 17:46:04 1994
***************
*** 222,231 ****
  	/* We can't set DECL_PACKED for a VAR_DECL, because the bit is
  	   used for DECL_REGISTER.  It wouldn't mean anything anyway.  */
  	else
! 	  warning_with_decl (decl, "`packed' attribute ignore");
  
        }
      else if (TREE_VALUE (a) == get_identifier ("noreturn")
  	     || TREE_VALUE (a) == get_identifier ("volatile"))
        {
  	if (TREE_CODE (decl) == FUNCTION_DECL)
--- 222,237 ----
  	/* We can't set DECL_PACKED for a VAR_DECL, because the bit is
  	   used for DECL_REGISTER.  It wouldn't mean anything anyway.  */
  	else
! 	  warning_with_decl (decl, "`packed' attribute ignored");
  
        }
      else if (TREE_VALUE (a) == get_identifier ("noreturn")
+ #ifdef TM_APOLLO
+ 	     /* Apollo has these additional synonyms for volatile.  */
+ 	     || TREE_VALUE (a) == get_identifier ("__noreturn")
+ 	     || TREE_VALUE (a) == get_identifier ("device")
+ 	     || TREE_VALUE (a) == get_identifier ("__device")
+ #endif
  	     || TREE_VALUE (a) == get_identifier ("volatile"))
        {
  	if (TREE_CODE (decl) == FUNCTION_DECL)
***************
*** 236,241 ****
--- 242,254 ----
  	    = build_pointer_type
  	      (build_type_variant (TREE_TYPE (type),
  				   TREE_READONLY (TREE_TYPE (type)), 1));
+ #ifdef TM_APOLLO
+ 	/* Apollo allows these to apply to variables.  */
+ 	else if (     TREE_CODE (decl) == VAR_DECL
+ 		 ||   TREE_CODE (decl) == FIELD_DECL
+ 		 ||   TREE_CODE (decl) == TYPE_DECL)
+ 	  TREE_THIS_VOLATILE (decl) = 1;
+ #endif
  	else
  	  warning_with_decl (decl, "`%s' attribute ignored",
  			     IDENTIFIER_POINTER (TREE_VALUE (a)));
***************
*** 253,258 ****
--- 266,276 ----
  	else
  	  warning_with_decl (decl, "`const' attribute ignored");
        }
+ #ifdef TM_APOLLO
+     else if (TREE_VALUE (a) == get_identifier ("a0_return")
+ 	     ||   TREE_VALUE (a) == get_identifier ("__a0_return"))
+       apollo_set_a0_return (decl);
+ #endif /* TM_APOLLO */
      else if (TREE_CODE (name) != TREE_LIST)
       {
  #ifdef VALID_MACHINE_ATTRIBUTE
***************
*** 327,333 ****
  	error_with_decl (decl, "section attributes are not supported for this target");
  #endif
        }
!     else if (!strcmp (IDENTIFIER_POINTER (name), "aligned")
  	     && list_length (args) == 1
  	     && TREE_CODE (TREE_VALUE (args)) == INTEGER_CST)
        {
--- 345,355 ----
  	error_with_decl (decl, "section attributes are not supported for this target");
  #endif
        }
!     else if ((!strcmp (IDENTIFIER_POINTER (name), "aligned")
! #ifdef TM_APOLLO
! 	      ||   !strcmp (IDENTIFIER_POINTER (name), "__aligned")
! #endif /* TM_APOLLO */
! 	      )
  	     && list_length (args) == 1
  	     && TREE_CODE (TREE_VALUE (args)) == INTEGER_CST)
        {
***************
*** 347,357 ****
--- 369,402 ----
  	    continue;
  	  }
  
+ #ifdef TM_APOLLO
+ 	/* Apollo has a different meaning for the "aligned" option.
+ 	   aligned (1) is halfword alignment, aligned (2) longword, etc.
+ 	   It is used in many header files at SR10.3.5 and earlier.  */
+ 	align = (1 << TREE_INT_CST_LOW (align_expr)) * BITS_PER_UNIT;
+ #else
  	align = TREE_INT_CST_LOW (align_expr) * BITS_PER_UNIT;
+ #endif
  	
  	if (exact_log2 (align) == -1)
  	  error_with_decl (decl,
  			   "requested alignment of `%s' is not a power of 2");
+ #ifdef TM_APOLLO
+ 	/* Apollo allows "aligned" typedefs.  These are used in some of
+ 	   the Apollo-specific header files at SR10.3.
+ 	   FIXME There does not seem to be an easy way to handle this
+ 	   here, so ignore it for now.  Setting DECL_ALIGN (decl) is
+ 	   useless.  The Apollo header files use alignment constructs
+ 	   mostly to suppress word alignments on the DN10000, so ignoring
+ 	   it *SHOULD* be safe in most cases.  */
+ 	else if (TREE_CODE (decl) == TYPE_DECL)
+ 	  {
+ 	    if (pedantic)
+ 	      pedwarn ("`aligned' attribute used with other than a variable or field, ignored");
+ 	    else
+ 	      warning_with_decl (decl, "`aligned' attribute ignored for '%s`");
+ 	  }
+ #endif /* TM_APOLLO */
  	else if (TREE_CODE (decl) != VAR_DECL
  		 && TREE_CODE (decl) != FIELD_DECL)
  	  error_with_decl (decl,
*** gcc-2.6.0/c-decl.c-dist	Tue Jul 12 20:33:48 1994
--- gcc-2.6.0/c-decl.c	Thu Sep 15 17:46:04 1994
***************
*** 3225,3230 ****
--- 3225,3269 ----
        register tree value = TREE_VALUE (link);
        register enum tree_code code = TREE_CODE (value);
  
+ #ifdef TM_APOLLO
+       /* Look for the Apollo "sized enum" extension.  Change the size of the
+          enum type to match.  Use of "-fshort-enums" disables this.  */
+       int  type_prec = 0;
+       tree next_link;
+ 
+       if (value == get_identifier ("char"))
+ 	type_prec = TYPE_PRECISION (char_type_node);
+       if (value == get_identifier ("short"))
+ 	type_prec = TYPE_PRECISION (short_integer_type_node);
+       if (value == get_identifier ("long"))
+ 	type_prec = TYPE_PRECISION (long_integer_type_node);
+ 
+       next_link = TREE_CHAIN (link);
+ 
+       if (     type_prec   &&   next_link
+ 	  &&   TREE_CODE (TREE_VALUE (next_link)) == ENUMERAL_TYPE)
+ 	{
+ 	  link  = next_link;
+ 	  value = TREE_VALUE (link);
+ 	  code  = TREE_CODE  (value);
+ 
+ 	  if (flag_short_enums)
+ 	    warning ("enum size specifier ignored");
+ 	  else if (TYPE_PRECISION (value) != type_prec)
+ 	    {
+ 	      TYPE_PRECISION (value) = type_prec;
+ 	      TYPE_SIZE (value) = 0;
+ 	      fixup_unsigned_type (value);
+ 	    }
+ 
+ 	  if (pedantic)
+ 	    {
+ 	      pedwarn ("Apollo sized enum extension is used");
+ 	      warned = 1;
+ 	    }
+ 	}
+ #endif /* TM_APOLLO */
+ 
        if (code == RECORD_TYPE || code == UNION_TYPE || code == ENUMERAL_TYPE)
  	/* Used to test also that TYPE_SIZE (value) != 0.
  	   That caused warning for `struct foo;' at top level in the file.  */
***************
*** 3919,3924 ****
--- 3958,3967 ----
    int bitfield = 0;
    int size_varies = 0;
  
+ #ifdef TM_APOLLO
+   int reference_flag = 0;
+ #endif
+ 
    if (decl_context == BITFIELD)
      bitfield = 1, decl_context = FIELD;
  
***************
*** 3939,3944 ****
--- 3982,3992 ----
      while (decl)
        switch (TREE_CODE (decl))
  	{
+ #ifdef TM_APOLLO
+ 	  /* Apollo reference variable extension.  */
+ 	case ADDR_EXPR:
+ 	  reference_flag = 1;
+ #endif
  	case ARRAY_REF:
  	case INDIRECT_REF:
  	case CALL_EXPR:
***************
*** 4021,4026 ****
--- 4069,4088 ----
  		goto found;
  	      }
  	  }
+ 
+ #ifdef TM_APOLLO
+       /* Allow the "char enum" Apollo extension.  */
+ 
+       if (type   &&   TREE_CODE (type) == ENUMERAL_TYPE
+ 	  &&   id == get_identifier ("char"))
+ 	/* char ENUM type defined as part of a typedef, such as
+ 	   "typedef char enum ce {A, B} ct;" */
+ 	;
+       else if (type == char_type_node   &&   TREE_CODE (id) == ENUMERAL_TYPE)
+ 	/* Most common case.  */
+ 	type = id;
+       else /* This joins to the following IF */
+ #endif /* TM_APOLLO */
        if (type)
  	error ("two or more data types in declaration of `%s'", name);
        /* Actual typedefs come to us as TYPE_DECL nodes.  */
***************
*** 4079,4084 ****
--- 4141,4201 ----
        type = long_double_type_node;
      }
  
+ #ifdef TM_APOLLO
+   /* Process the Apollo sized enum extension.  If a sized enum is found, the
+      size is applied and the modifiers cleared.  FIXME This code does NOT
+      check for consistency with any previous enum type definitions.
+      Doing so would require changes to the grammar and the creation
+      of enum types.  */
+ 
+   if (TREE_CODE (type) == ENUMERAL_TYPE)
+     {
+       int short_enum = specbits   &   1 << (int) RID_SHORT;
+       int long_enum  = specbits   &   1 << (int) RID_LONG;
+       int type_prec  = 0;
+ 
+       /* Check the validity of the modifiers then apply any sizes.  */
+ 
+       if (specbits   &   (1 << (int) RID_SIGNED   |   1 << (int) RID_UNSIGNED)
+ 	  ||   longlong)
+ 	error ("illegal modifiers specified for enum `%s'", name);
+       else if (     explicit_char && short_enum
+ 	       ||   explicit_char && long_enum
+ 	       ||   short_enum    && long_enum)
+ 	error ("ambiguous size for sized enum `%s'", name);
+       else if (explicit_char)
+ 	type_prec = TYPE_PRECISION (char_type_node);
+       else if (short_enum)
+ 	type_prec = TYPE_PRECISION (short_integer_type_node);
+       else if (long_enum)
+ 	type_prec = TYPE_PRECISION (long_integer_type_node);
+ 
+       if (type_prec)
+ 	{
+ 	  if (flag_short_enums)
+ 	    warning ("enum size specifier ignored");
+ 	  else if (TYPE_PRECISION (type) != type_prec)
+ 	    {
+ 	      TYPE_PRECISION (type) = type_prec;
+ 	      TYPE_SIZE (type) = 0;
+ 	      fixup_unsigned_type (type);
+ 	    }
+ 
+ 	  if (pedantic)
+ 	    pedwarn ("Apollo sized enum extension is used");
+ 	}
+ 
+       /* Clear any type modifiers that were used.  */
+ 
+       specbits &= ~((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
+ 		    | (1 << (int) RID_UNSIGNED) | (1 << (int) RID_SIGNED)
+ 		    | (1 << (int) RID_CHAR));
+ 
+       explicit_char = 0;
+       longlong = 0;
+     }
+ #endif /* TM_APOLLO */
+ 
    /* Check all other uses of type modifiers.  */
  
    if (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
***************
*** 4520,4526 ****
--- 4637,4648 ----
  	      TYPE_CONTEXT (TREE_VALUE (link)) = type;
  	  }
  	}
+ #ifdef TM_APOLLO
+       else if (     TREE_CODE (declarator) == INDIRECT_REF
+ 	       ||   TREE_CODE (declarator) == ADDR_EXPR)
+ #else /* not TM_APOLLO */
        else if (TREE_CODE (declarator) == INDIRECT_REF)
+ #endif /* not TM_APOLLO */
  	{
  	  /* Merge any constancy or volatility into the target type
  	     for the pointer.  */
***************
*** 4534,4540 ****
--- 4656,4669 ----
  	  volatilep = 0;
  	  size_varies = 0;
  
+ #ifdef TM_APOLLO
+ 	  if (TREE_CODE (declarator) == INDIRECT_REF)
+ 	    type = build_pointer_type (type);
+ 	  else
+ 	    type = build_reference_type (type);
+ #else /* not TM_APOLLO */
  	  type = build_pointer_type (type);
+ #endif /* not TM_APOLLO */
  
  	  /* Process a list of type modifier keywords
  	     (such as const or volatile) that were given inside the `*'.  */
***************
*** 4850,4855 ****
--- 4979,4989 ----
  
  	if (specbits & 1 << (int) RID_ITERATOR)
  	  ITERATOR_P (decl) = 1;
+ 
+ #ifdef TM_APOLLO
+ 	if (reference_flag   &&   ! initialized   &&   ! DECL_EXTERNAL (decl))
+ 	  error ("reference variable `%s' requires an initializer", name);
+ #endif
        }
  
      /* Record `register' declaration for warnings on &
*** gcc-2.6.0/c-lex.c-dist	Sat Jul  2 18:12:12 1994
--- gcc-2.6.0/c-lex.c	Thu Sep 15 17:46:04 1994
***************
*** 110,115 ****
--- 110,152 ----
  {
    return build1 (INDIRECT_REF, type_quals, target);
  }
+ 
+ #ifdef TM_APOLLO
+ 
+ /* This is for the Apollo reference variable language extension.
+    Return something to represent absolute declarators containing a &.
+    TARGET is the absolute declarator that the & contains.
+    TYPE_QUALS is a list of modifiers such as const or volatile
+    to apply to the reference type, represented as identifiers.
+ 
+    We return an ADDR_EXPR whose "contents" are TARGET
+    and whose type is the modifier list.
+    This was adapted from cp/lex.c.  */
+ 
+ tree
+ make_reference_declarator (type_quals, target)
+      tree type_quals, target;
+ {
+   if (pedantic)
+     pedwarn ("Apollo reference variable extension used");
+ 
+   if (target)
+     {
+       if (TREE_CODE (target) == ADDR_EXPR)
+ 	{
+ 	  error ("cannot declare references to references");
+ 	  return target;
+ 	}
+       if (TREE_CODE (target) == INDIRECT_REF)
+ 	{
+ 	  error ("cannot declare pointers to references");
+ 	  return target;
+ 	}
+     }
+ 
+  return build1 (ADDR_EXPR, type_quals, target);
+ }
+ #endif /* TM_APOLLO */
  
  void
  forget_protocol_qualifiers ()
***************
*** 488,493 ****
--- 525,541 ----
  	      goto skipline;
  	    }
  	}
+ #ifdef TM_APOLLO
+       else if (c == 'e'
+ 	       && getc (finput) == 'j'
+ 	       && getc (finput) == 'e'
+ 	       && getc (finput) == 'c'
+ 	       && getc (finput) == 't'
+ 	       && ((c = getc (finput)) == ' ' || c == '\t' || c == '\n'))
+ 	/* Apollo has an "#eject" directive, ignore it.  The pedantic
+ 	   warning is in cccp.c.  */
+ 	goto skipline;
+ #endif /* TM_APOLLO */
  
        error ("undefined or invalid # directive");
        goto skipline;
***************
*** 889,894 ****
--- 937,948 ----
  };
  #endif /* 0 */
  
+ #ifdef TM_APOLLO
+ /* This is set TRUE if the last token was a '#'.  It is used to recognize
+    the Apollo '#attribute' and similar keywords.  */
+ static int sharp_seen = 0;
+ #endif
+ 
  int
  yylex ()
  {
***************
*** 1024,1029 ****
--- 1078,1109 ----
        {
  	register struct resword *ptr;
  
+ #ifdef TM_APOLLO /* Check for special Apollo keywords beginning with '#'.  */
+ 	if (sharp_seen)
+ 	  {
+ 	    if (strcmp (token_buffer, "options") == 0)
+ 	      {
+ 		value = APOLLO_OPTIONS;
+ 		goto done;
+ 	      }
+ 	    else if (strcmp (token_buffer, "attribute") == 0)
+ 	      {
+ 		value = APOLLO_ATTRIBUTE;
+ 		goto done;
+ 	      }
+ 	  }
+ 	else
+ 	  {
+ 	    /* Look for the "__options((...))" form.  This could be
+ 	       put into the keyword table and this code removed.  */
+ 	    if (strcmp (token_buffer, "__options") == 0)
+ 	      {
+ 		value = APOLLO_OPTIONS;
+ 		goto done;
+ 	      }
+ 	  }
+ #endif /* TM_APOLLO */
+ 
  	if (ptr = is_reserved_word (token_buffer, p - token_buffer))
  	  {
  	    if (ptr->rid)
***************
*** 1180,1186 ****
--- 1260,1273 ----
  			  {
  			    *p++ = c;
  			    *p = 0;
+ 
+ #ifdef TM_APOLLO
+ 			    /* This is for Apollo '#' keywords.  */
+ 			    value = ELLIPSIS;
+ 			    goto done;
+ #else
  			    return ELLIPSIS;
+ #endif
  			  }
  			error ("parse error at `..'");
  		      }
***************
*** 1963,1968 ****
--- 2050,2060 ----
  
  done:
  /*  yylloc.last_line = lineno; */
+ 
+ #ifdef TM_APOLLO
+   /* Remember if token was '#' for special Apollo keywords.  */
+   sharp_seen = (value == '#');
+ #endif
  
    return value;
  }
*** gcc-2.6.0/c-lex.h-dist	Fri Apr  9 18:00:25 1993
--- gcc-2.6.0/c-lex.h	Thu Sep 15 17:46:04 1994
***************
*** 77,79 ****
--- 77,84 ----
  extern int yylex ();
  
  extern char *get_directive_line ();
+ 
+ #ifdef TM_APOLLO
+ /* For Apollo reference variable extension.  */
+ extern tree make_reference_declarator ();
+ #endif
*** gcc-2.6.0/c-parse.in-dist	Mon Jul 11 17:14:27 1994
--- gcc-2.6.0/c-parse.in	Thu Sep 15 17:46:04 1994
***************
*** 134,139 ****
--- 134,145 ----
  %token ATTRIBUTE EXTENSION LABEL
  %token REALPART IMAGPART
  
+ ifapollo
+ /* Apollo reserved words.  These are the 'options' and
+    'attribute' modifiers.  */
+ %token APOLLO_ATTRIBUTE APOLLO_OPTIONS
+ end ifapollo
+ 
  /* Add precedence rules to solve dangling else s/r conflict */
  %nonassoc IF
  %nonassoc ELSE
***************
*** 1048,1054 ****
  		  finish_decl (d, NULL_TREE, $2); }
  	;
  /* the * rules are dummies to accept the Apollo extended syntax
!    so that the header files compile. */
  maybe_attribute:
        /* empty */
    		{ $$ = NULL_TREE; }
--- 1054,1061 ----
  		  finish_decl (d, NULL_TREE, $2); }
  	;
  /* the * rules are dummies to accept the Apollo extended syntax
!    so that the header files compile.  In release SR10.3.5 and earlier, both
!    the '#' and '_' forms are still used in the header files.  */
  maybe_attribute:
        /* empty */
    		{ $$ = NULL_TREE; }
***************
*** 1064,1071 ****
  	;
  
  attribute:
!       ATTRIBUTE '(' '(' attribute_list ')' ')'
  		{ $$ = $4; }
  	;
  
  attribute_list:
--- 1071,1092 ----
  	;
  
  attribute:
! 	ATTRIBUTE '(' '(' attribute_list ')' ')'
  		{ $$ = $4; }
+ ifapollo
+ 	| '#' APOLLO_ATTRIBUTE '[' attribute_list ']'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `#attribute' extension used"); }
+ 	| '#' APOLLO_OPTIONS '(' attribute_list ')'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `#options' extension used"); }
+ 	| APOLLO_OPTIONS '(' '(' attribute_list ')' ')'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `__options' extension used"); }
+ end ifapollo
  	;
  
  attribute_list:
***************
*** 1232,1237 ****
--- 1253,1263 ----
  		{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); }
  	| '*' type_quals after_type_declarator  %prec UNARY
  		{ $$ = make_pointer_declarator ($2, $3); }
+ ifapollo
+ 	| '&' type_quals after_type_declarator  %prec UNARY
+ 		/* Apollo reference variable extension.  */
+ 		{ $$ = make_reference_declarator ($2, $3); }
+ end ifapollo
  	| TYPENAME
  ifobjc
  	| OBJECTNAME
***************
*** 1255,1260 ****
--- 1281,1291 ----
  		{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); }
  	| '*' type_quals parm_declarator  %prec UNARY
  		{ $$ = make_pointer_declarator ($2, $3); }
+ ifapollo
+ 	| '&' type_quals parm_declarator  %prec UNARY
+ 		/* Apollo reference variable extension.  */
+ 		{ $$ = make_reference_declarator ($2, $3); }
+ end ifapollo
  	| TYPENAME
  	;
  
***************
*** 1271,1276 ****
--- 1302,1312 ----
  		{ $$ = $2; }
  	| '*' type_quals notype_declarator  %prec UNARY
  		{ $$ = make_pointer_declarator ($2, $3); }
+ ifapollo
+ 	| '&' type_quals notype_declarator  %prec UNARY
+ 		/* Apollo reference variable extension.  */
+ 		{ $$ = make_reference_declarator ($2, $3); }
+ end ifapollo
  	| notype_declarator '[' expr ']'  %prec '.'
  		{ $$ = build_nt (ARRAY_REF, $1, $3); }
  	| notype_declarator '[' ']'  %prec '.'
***************
*** 1470,1475 ****
--- 1506,1519 ----
  		{ $$ = make_pointer_declarator ($2, $3); }
  	| '*' type_quals  %prec UNARY
  		{ $$ = make_pointer_declarator ($2, NULL_TREE); }
+ ifapollo
+ 	| '&' type_quals absdcl1  %prec UNARY
+ 		/* Apollo reference variable extension.  */
+ 		{ $$ = make_reference_declarator ($2, $3); }
+ 	| '&' type_quals  %prec UNARY
+ 		/* Apollo reference variable extension.  */
+ 		{ $$ = make_reference_declarator ($2, NULL_TREE); }
+ end ifapollo
  	| absdcl1 '(' parmlist  %prec '.'
  		{ $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
  	| absdcl1 '[' expr ']'  %prec '.'
*** gcc-2.6.0/c-typeck.c-dist	Fri Jul  1 16:41:21 1994
--- gcc-2.6.0/c-typeck.c	Thu Sep 15 17:46:04 1994
***************
*** 70,75 ****
--- 70,222 ----
  static void output_init_element		PROTO((tree, tree, tree, int));
  static void output_pending_init_elements PROTO((int));
  
+ #ifdef TM_APOLLO
+ 
+ extern tree pushdecl_top_level ();
+ 
+ /* This routine was taken from cp-decl2.c with little change.  */
+ 
+ #define AUTO_TEMP_FORMAT "_$tmp_%d"
+ static int temp_name_counter = 0;
+ 
+ /* Hand off a unique name which can be used for variable we don't really
+    want to know about anyway, for example, the anonymous variables which
+    are needed to make references work.  Declare this thing so we can use it.
+    The variable created will be of type TYPE.
+ 
+    STATICP is nonzero if this variable should be static.  */
+ 
+ static tree
+ get_temp_name (type, staticp)
+      tree type;
+      int staticp;
+ {
+   char buf[sizeof (AUTO_TEMP_FORMAT) + 20];
+   tree decl;
+   int toplev = global_bindings_p ();
+ 
+   push_obstacks_nochange ();
+   if (toplev || staticp)
+     {
+       end_temporary_allocation ();
+       sprintf (buf, AUTO_TEMP_FORMAT, temp_name_counter++);
+       decl = pushdecl_top_level (build_decl (VAR_DECL, get_identifier (buf), type));
+     }
+   else
+     {
+       sprintf (buf, AUTO_TEMP_FORMAT, temp_name_counter++);
+       decl = pushdecl (build_decl (VAR_DECL, get_identifier (buf), type));
+     }
+   TREE_USED (decl) = 1;
+   TREE_STATIC (decl) = staticp;
+ 
+   /* If this is a local variable, then lay out its rtl now.
+      Otherwise, callers of this function are responsible for dealing
+      with this variable's rtl.  */
+   if (! toplev)
+     {
+       expand_decl (decl);
+       expand_decl_init (decl);
+     }
+   pop_obstacks ();
+ 
+   return decl;
+ }
+ 
+ 
+ 
+ /* This routine was taken from cp-cvt.c with little change.  */
+ 
+ /* We are using a reference VAL for its value. Bash that reference all the
+    way down to its lowest form. */
+ static tree
+ convert_from_reference (val)
+      tree val;
+ {
+   tree type = TREE_TYPE (val);
+ 
+   if (TREE_CODE (type) == OFFSET_TYPE)
+     type = TREE_TYPE (type);
+   if (TREE_CODE (type) == REFERENCE_TYPE)
+     {
+       tree target_type = TREE_TYPE (type);
+       tree nval;
+ 
+       /* This can happen if we cast to a reference type.  */
+       if (TREE_CODE (val) == ADDR_EXPR)
+ 	{
+ 	  nval = build1 (NOP_EXPR, build_pointer_type (target_type), val);
+ 	  nval = build_indirect_ref (nval, NULL_PTR);
+ 	  /* The below was missing, are other important flags missing too? */
+ 	  TREE_SIDE_EFFECTS (nval) = TREE_SIDE_EFFECTS (val);
+ 	  return nval;
+ 	}
+ 
+       nval = build1 (INDIRECT_REF, target_type, val);
+ 
+       TREE_THIS_VOLATILE (nval) = TYPE_VOLATILE (target_type);
+       TREE_SIDE_EFFECTS (nval) = TYPE_VOLATILE (target_type);
+       TREE_READONLY (nval) = TYPE_READONLY (target_type);
+       /* The below was missing, are other important flags missing too? */
+       TREE_SIDE_EFFECTS (nval) |= TREE_SIDE_EFFECTS (val);
+       return nval;
+     }
+   return val;
+ }
+ 
+ 
+ 
+ /* This routine performs the conversions needed for initializing objects
+    as opposed to assigning to them.  This distinction is made in parameter
+    passing and function value return involving reference variables.  It
+    is based loosely upon the matching routine in cp-typeck.c.  */
+ 
+ static tree
+ convert_for_initialization (exp, type, rhs, flags, errtype, fundecl,
+ 			    funname, parmnum)
+      tree exp, type, rhs;
+      int flags;
+      char *errtype;
+      tree fundecl, funname;
+      int parmnum;
+ {
+   if (rhs == error_mark_node)
+     ;
+   else if (TREE_CODE (type) == REFERENCE_TYPE)
+     {
+       /* Dereference type, then turn array into pointer.  */
+       type = TREE_TYPE (type);
+       if (TREE_CODE (type) == ARRAY_TYPE)
+ 	type = build_pointer_type (TREE_TYPE (type));
+       rhs = convert_for_assignment (type, rhs, errtype, fundecl,
+ 				    funname, parmnum);
+ 
+       if (! lvalue_p (rhs))
+ 	{
+ 	  tree decl;
+ 
+ 	  decl = get_temp_name (type,   global_bindings_p ());
+ 	  DECL_INITIAL (decl) = rhs;
+ 	  /* finish_decl () does matching pop_obstacks ().  */
+ 	  push_obstacks_nochange ();
+ 	  finish_decl (decl, rhs, NULL_TREE);
+ 	  rhs = decl;
+ 	}
+ 
+       if (mark_addressable (rhs) == 0)
+ 	return error_mark_node;
+ 
+       rhs = build1 (ADDR_EXPR,   build_pointer_type (type),   rhs);
+       TREE_CONSTANT (rhs) = global_bindings_p ();
+     }
+   else
+     rhs = convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum);
+ 
+   return rhs;
+ }
+ 
+ #endif /* TM_APOLLO */
+ 
  /* Do `exp = require_complete_type (exp);' to make sure exp
     does not have an incomplete type.  (That includes void types.)  */
  
***************
*** 319,324 ****
--- 466,486 ----
        return build_type_attribute_variant (t1, attributes);
  #endif
  
+ #ifdef TM_APOLLO
+     case REFERENCE_TYPE:
+       {
+ 	tree target = common_type (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
+ 				   TYPE_MAIN_VARIANT (TREE_TYPE (t2)));
+ 	int constp
+ 	  = TYPE_READONLY (TREE_TYPE (t1)) || TYPE_READONLY (TREE_TYPE (t2));
+ 	int volatilep
+ 	  = TYPE_VOLATILE (TREE_TYPE (t1)) || TYPE_VOLATILE (TREE_TYPE (t2));
+ 	t1 = build_reference_type (c_build_type_variant (target, constp,
+ 				 volatilep));
+ 	return build_type_attribute_variant (t1, attributes);
+       }
+ #endif /* TM_APOLLO */
+ 
      case ARRAY_TYPE:
        {
  	tree elt = common_type (TREE_TYPE (t1), TREE_TYPE (t2));
***************
*** 492,497 ****
--- 654,662 ----
  
    switch (TREE_CODE (t1))
      {
+ #ifdef TM_APOLLO
+     case REFERENCE_TYPE:
+ #endif
      case POINTER_TYPE:
        val = (TREE_TYPE (t1) == TREE_TYPE (t2)
  	      ? 1 : comptypes (TREE_TYPE (t1), TREE_TYPE (t2)));
***************
*** 824,829 ****
--- 989,1000 ----
      }
    if (code == ERROR_MARK)
      return size_int (1);
+ 
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     type = TREE_TYPE (type);
+ #endif
+ 
    if (TYPE_SIZE (type) == 0)
      {
        error ("sizeof applied to an incomplete type");
***************
*** 850,855 ****
--- 1021,1032 ----
        || code == VOID_TYPE
        || code == ERROR_MARK)
      return size_int (1);
+ 
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     type = TREE_TYPE (type);
+ #endif
+ 
    if (TYPE_SIZE (type) == 0)
      return size_int (0);
  
***************
*** 903,908 ****
--- 1080,1090 ----
    if (code == VOID_TYPE || code == ERROR_MARK)
      return size_int (1);
  
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     type = TREE_TYPE (type);
+ #endif
+ 
    return size_int (TYPE_ALIGN (type) / BITS_PER_UNIT);
  }
  
***************
*** 987,992 ****
--- 1169,1183 ----
    register tree type = TREE_TYPE (exp);
    register enum tree_code code = TREE_CODE (type);
  
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     {
+       exp = convert_from_reference (exp);
+       type = TREE_TYPE (exp);
+       code = TREE_CODE (type);
+     }
+ #endif /* TM_APOLLO */
+ 
    /* Constants can be used directly unless they're not loadable.  */
    if (TREE_CODE (exp) == CONST_DECL)
      exp = DECL_INITIAL (exp);
***************
*** 1062,1069 ****
--- 1253,1275 ----
  					TYPE_VOLATILE (type) || volatilep);
  
        if (TREE_CODE (exp) == INDIRECT_REF)
+ #ifdef TM_APOLLO
+ 	{
+ 	  /* Stripping away the INDIRECT_REF is not the right
+ 	     thing to do for references...  */
+ 
+ 	  tree inner = TREE_OPERAND (exp, 0);
+ 	  if (TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE)
+ 	    inner = build1 (CONVERT_EXPR,
+ 			    build_pointer_type (TREE_TYPE (TREE_TYPE (inner))),
+ 			    inner);
+ 
+ 	  return convert (TYPE_POINTER_TO (TREE_TYPE (type)), inner);
+ 	}
+ #else /* not TM_APOLLO */
  	return convert (TYPE_POINTER_TO (restype),
  			TREE_OPERAND (exp, 0));
+ #endif /* not TM_APOLLO */
  
        if (TREE_CODE (exp) == COMPOUND_EXPR)
  	{
***************
*** 1226,1231 ****
--- 1432,1445 ----
  	 build_component_ref (TREE_OPERAND (datum, 2), component));
      }
  
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     {
+       datum = convert_from_reference (datum);
+       code = TREE_CODE (TREE_TYPE (datum));
+     }
+ #endif /* TM_APOLLO */
+ 
    /* See if there is a field or component with name COMPONENT.  */
  
    if (code == RECORD_TYPE || code == UNION_TYPE)
***************
*** 1292,1298 ****
--- 1506,1516 ----
    register tree pointer = default_conversion (ptr);
    register tree type = TREE_TYPE (pointer);
  
+ #ifdef TM_APOLLO
+   if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE)
+ #else
    if (TREE_CODE (type) == POINTER_TYPE)
+ #endif
      {
        if (TREE_CODE (pointer) == ADDR_EXPR
  	  && !flag_volatile
***************
*** 1355,1360 ****
--- 1573,1583 ----
        || TREE_TYPE (index) == error_mark_node)
      return error_mark_node;
  
+ #ifdef TM_APOLLO
+   if (TREE_CODE (TREE_TYPE (index)) == REFERENCE_TYPE)
+     index = convert_from_reference (index);
+ #endif
+ 
    if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
        && TREE_CODE (array) != INDIRECT_REF)
      {
***************
*** 1723,1731 ****
--- 1946,1961 ----
  		    }
  		}
  
+ #ifdef TM_APOLLO
+ 	      parmval =
+ 		convert_for_initialization (NULL_TREE, type, val, 0,
+ 					    (char *)0, /* arg passing  */
+ 					    fundecl, name, parmnum + 1);
+ #else
  	      parmval = convert_for_assignment (type, val, 
  					        (char *)0, /* arg passing  */
  						fundecl, name, parmnum + 1);
+ #endif
  	      
  #ifdef PROMOTE_PROTOTYPES
  	      if ((TREE_CODE (type) == INTEGER_TYPE
***************
*** 2225,2230 ****
--- 2455,2474 ----
  	    pedwarn ("comparison between pointer and integer");
  	  op0 = convert (TREE_TYPE (op1), op0);
  	}
+ #ifdef TM_APOLLO
+       else if (     (code0 == RECORD_TYPE   ||   code0 == UNION_TYPE)
+ 	       &&   TREE_TYPE (op0) == TREE_TYPE (op1)
+ 	       &&   TYPE_SIZE (TREE_TYPE (op0)) != 0)
+ 	{
+ 	  /* Apollo allows structure comparisons.  It does simple block
+ 	     comparisons that may be fooled by pad byte contents rather than
+ 	     field by field comparisons.  The same applies to unions.  The
+ 	     TYPE_SIZE test excludes incomplete types.  */
+ 
+ 	  if (pedantic)
+ 	    warning ("comparison between structures");
+ 	}
+ #endif
        else
  	/* If args are not valid, clear out RESULT_TYPE
  	   to cause an error message later.  */
***************
*** 2651,2656 ****
--- 2895,2909 ----
  
    if (typecode == ERROR_MARK)
      return error_mark_node;
+ 
+ #ifdef TM_APOLLO
+   if (typecode == REFERENCE_TYPE && code != ADDR_EXPR && ! noconvert)
+     {
+       arg = convert_from_reference (arg);
+       typecode = TREE_CODE (TREE_TYPE (arg));
+     }
+ #endif /* TM_APOLLO */
+ 
    if (typecode == ENUMERAL_TYPE)
      typecode = INTEGER_TYPE;
  
***************
*** 2876,2881 ****
--- 3129,3144 ----
        /* Note that this operation never does default_conversion
  	 regardless of NOCONVERT.  */
  
+ #ifdef TM_APOLLO
+       if (typecode == REFERENCE_TYPE)
+ 	{
+ 	  arg = build1 (CONVERT_EXPR,
+ 			build_pointer_type (TREE_TYPE (TREE_TYPE (arg))),
+ 			arg);
+ 	  return arg;
+ 	}
+ #endif /* TM_APOLLO */
+ 
        /* Let &* cancel out to simplify resulting code.  */
        if (TREE_CODE (arg) == INDIRECT_REF)
  	{
***************
*** 3569,3574 ****
--- 3832,3840 ----
        /* Convert functions and arrays to pointers,
  	 but don't convert any other types.  */
        if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
+ #ifdef TM_APOLLO
+ 	  || TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE
+ #endif
  	  || TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE)
  	value = default_conversion (value);
        otype = TREE_TYPE (value);
***************
*** 3658,3663 ****
--- 3924,3938 ----
    tree lhstype = TREE_TYPE (lhs);
    tree olhstype = lhstype;
  
+ #ifdef TM_APOLLO
+   if (TREE_CODE (lhstype) == REFERENCE_TYPE)
+     {
+       lhs = convert_from_reference (lhs);
+       lhstype = TREE_TYPE (lhs);
+       olhstype = lhstype;
+     }
+ #endif
+ 
    /* Types that aren't fully specified cannot be used in assignments.  */
    lhs = require_complete_type (lhs);
  
***************
*** 3833,3838 ****
--- 4108,4118 ----
    register tree rhstype;
    register enum tree_code coder;
  
+ #ifdef TM_APOLLO
+   if (TREE_CODE (TREE_TYPE (rhs)) == REFERENCE_TYPE)
+     rhs = convert_from_reference (rhs);
+ #endif
+ 
    /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
    /* Do not use STRIP_NOPS here.  We do not want an enumerator
       whose value is 0 to count as a null pointer constant.  */
***************
*** 4581,4586 ****
--- 4861,4918 ----
    if (TREE_CODE (init) == NON_LVALUE_EXPR)
      inside_init = TREE_OPERAND (init, 0);
  
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     {
+       /* Handle simple scalar reference variable initializations by
+ 	 dereferencing and making any value cell variables.  */
+       type = TREE_TYPE (type);
+       code = TREE_CODE (type);
+ 
+       if (     code == ARRAY_TYPE   ||   code == RECORD_TYPE
+ 	  ||   code == REFERENCE_TYPE)
+ 	{
+ 	  /* These would require many modifications to handle correctly.
+ 	     Apollo CC does not handle many of them either.  */
+ 	  sorry ("nonscalar reference initialization");
+ 	  init = error_mark_node;
+ 	}
+       else if (! lvalue_p (init))
+ 	{
+ 	  tree decl = get_temp_name (type,   global_bindings_p ());
+ 	  DECL_INITIAL (decl) = init;
+ 	  /* finish_decl () does matching pop_obstacks ().  */
+ 	  push_obstacks_nochange ();
+ 	  finish_decl (decl, init, NULL_TREE);
+ 	  init = decl;
+ 	}
+       else if (TREE_CODE (init) == VAR_DECL   &&   global_bindings_p ())
+ 	{
+ 	  /* A top-level reference variable is being initialized from
+ 	     another variable.  Use the other variable as the value
+ 	     cell for the reference.  No type conversion is allowed.  */
+ 
+ 	  if (comptypes (type, TREE_TYPE (init)) != 1)
+ 	    {
+ 	      error ("variables must have the same type");
+ 	      init = error_mark_node;
+ 	    }
+ 	}
+       else
+ 	init = digest_init (type, inside_init, require_constant,
+ 			    constructor_constant);
+ 
+       if (init == error_mark_node   ||   mark_addressable (init) == 0)
+ 	return error_mark_node;
+ 
+       init = build1 (ADDR_EXPR,   build_pointer_type (TREE_TYPE (init)),
+ 		     init);
+       TREE_CONSTANT (init) = global_bindings_p ();
+ 
+       return init;
+     }
+ #endif /* TM APOLLO */
+ 
    /* Initialization of an array of chars from a string constant
       optionally enclosed in braces.  */
  
***************
*** 5953,5958 ****
--- 6285,6303 ----
    tree orig_value = value;
    int string_flag = value != 0 && TREE_CODE (value) == STRING_CST;
  
+ #ifdef TM_APOLLO
+   if (       TREE_CODE (constructor_type) == REFERENCE_TYPE
+       || (   TREE_CODE (constructor_type) == ARRAY_TYPE
+ 	  && TREE_CODE (TREE_TYPE (constructor_type)) == REFERENCE_TYPE))
+     {
+       /* Trap the most common difficult cases for reference variables.
+ 	 These would require many modifications to handle correctly.
+ 	 Apollo CC does not handle many of them either.  */
+       sorry ("nonscalar reference initialization");
+       return;
+     }
+ #endif /* TM_APOLLO */
+ 
    /* Handle superfluous braces around string cst as in
       char x[] = {"foo"}; */
    if (string_flag
***************
*** 6301,6315 ****
--- 6646,6677 ----
      }
    else
      {
+ #ifdef TM_APOLLO
+       tree t = convert_for_initialization (NULL_TREE, valtype, retval, 0,
+ 					   "return", NULL_TREE,
+ 					   NULL_TREE, 0);
+ #else
        tree t = convert_for_assignment (valtype, retval, "return",
  				       NULL_TREE, NULL_TREE, 0);
+ #endif
        tree res = DECL_RESULT (current_function_decl);
+ #ifdef TM_APOLLO
+       tree res_type = TREE_TYPE (res);
+ #endif
        tree inner;
  
        if (t == error_mark_node)
  	return;
  
+ #ifdef TM_APOLLO
+       /* Change reference type to pointer type to the same object.  */
+       /* TREE_TYPE (t) should be the proper pointer type here.      */
+       if (TREE_CODE (res_type) == REFERENCE_TYPE)
+ 	res_type = TREE_TYPE (t);
+       inner = t = convert (res_type, t);
+ #else
        inner = t = convert (TREE_TYPE (res), t);
+ #endif
  
        /* Strip any conversions, additions, and subtractions, and see if
  	 we are returning the address of a local variable.  Warn if so.  */
***************
*** 6334,6340 ****
--- 6696,6706 ----
  	    warning ("function returns address of local variable");
  	}
  
+ #ifdef TM_APOLLO
+       t = build (MODIFY_EXPR, res_type, res, t);
+ #else
        t = build (MODIFY_EXPR, TREE_TYPE (res), res, t);
+ #endif
        TREE_SIDE_EFFECTS (t) = 1;
        expand_return (t);
        current_function_returns_value = 1;
***************
*** 6350,6355 ****
--- 6716,6730 ----
  {
    register enum tree_code code = TREE_CODE (TREE_TYPE (exp));
    tree type = TREE_TYPE (exp);
+ 
+ #ifdef TM_APOLLO
+   if (code == REFERENCE_TYPE)
+     {
+       exp  = convert_from_reference (exp);
+       type = TREE_TYPE (exp);
+       code = TREE_CODE (type);
+     }
+ #endif
  
    if (code != INTEGER_TYPE && code != ENUMERAL_TYPE && code != ERROR_MARK)
      {
*** gcc-2.6.0/cccp.c-dist	Mon Jul 11 14:07:09 1994
--- gcc-2.6.0/cccp.c	Thu Sep 15 17:46:04 1994
***************
*** 235,240 ****
--- 235,244 ----
  static int do_unassert ();
  static int do_warning ();
  
+ #ifdef TM_APOLLO
+ static int do_eject ();
+ #endif /* TM_APOLLO */
+ 
  static void add_import ();
  static void append_include_chain ();
  static void deps_output ();
***************
*** 788,793 ****
--- 792,800 ----
   T_DISABLED,	/* macro temporarily turned off for rescan */
   T_SPEC_DEFINED, /* special `defined' macro for use in #if statements */
   T_PCSTRING,	/* precompiled string (hashval is KEYDEF *) */
+ #ifdef TM_APOLLO
+  T_APOLLO,	/* Used for Apollo-specific directives like "#eject".  */
+ #endif /* TM_APOLLO */
   T_UNUSED	/* Used for something not defined.  */
   };
  
***************
*** 938,943 ****
--- 945,955 ----
    {  5, do_ident, "ident", T_IDENT},
    {  6, do_assert, "assert", T_ASSERT},
    {  8, do_unassert, "unassert", T_UNASSERT},
+ #ifdef TM_APOLLO
+   /* Apollo-specific directives used in some system header files.
+      At SR10.3, only "#eject" is used.  */
+   {  5, do_eject, "eject", T_APOLLO, 0, 0, 1},
+ #endif /* TM_APOLLO */
    {  -1, 0, "", T_UNUSED},
  };
  
***************
*** 9802,9804 ****
--- 9814,9835 ----
    return dst;
  }
  #endif /* VMS */
+ 
+ #ifdef TM_APOLLO
+ /* Process any Apollo-specific directives.  Currently this consists
+    only of issuing warnings if using "-pedantic".  */
+ 
+ static int
+ do_eject (buf, limit, op, keyword)
+      U_CHAR *buf, *limit;
+      FILE_BUF *op;
+      struct directive *keyword;
+ {
+   /* In the Apollo C compiler, this would start a new page in the listing
+      output file.  For GCC it is a no-op.
+      If only this could be modified to "eject" all the evil HP infidels
+      from the Temple of Apollo!  */
+   if (pedantic && done_initializing && !instack[indepth].system_header_p)
+     pedwarn ("ANSI C does not allow `#eject'");
+ }
+ #endif /* TM_APOLLO */
*** gcc-2.6.0/combine.c-dist	Tue Jul 12 12:17:44 1994
--- gcc-2.6.0/combine.c	Thu Sep 15 17:46:04 1994
***************
*** 4364,4369 ****
--- 4364,4370 ----
        rtx false = (GET_CODE (XEXP (src, 0)) == NE
  		   ? XEXP (src, 2) : XEXP (src, 1));
        rtx term1 = const0_rtx, term2, term3;
+       rtx cond = XEXP (XEXP (src, 0), 0);
  
        if (GET_CODE (true) == IOR && rtx_equal_p (XEXP (true, 0), false))
  	term1 = false, true = XEXP (true, 1), false = const0_rtx;
***************
*** 4377,4386 ****
  	       && rtx_equal_p (XEXP (false, 1), true))
  	term1 = true, false = XEXP (false, 0), true = const0_rtx;
  
!       term2 = gen_binary (AND, GET_MODE (src), XEXP (XEXP (src, 0), 0), true);
        term3 = gen_binary (AND, GET_MODE (src),
  			  gen_unary (NOT, GET_MODE (src), GET_MODE (src),
! 				     XEXP (XEXP (src, 0), 0)),
  			  false);
  
        SUBST (SET_SRC (x),
--- 4378,4396 ----
  	       && rtx_equal_p (XEXP (false, 1), true))
  	term1 = true, false = XEXP (false, 0), true = const0_rtx;
  
!       /* WJE:  extend COND to a full integer if it is a smaller type.  This
! 	 prevents improper reduction to a constant zero if TRUE or FALSE are
! 	 larger than COND.  This was observed on the Apollo configuration.
! 	 FIXME someday:  this could look at the sizes of TRUE and FALSE
! 	 rather than always using SImode.  */
!       if (INTEGRAL_MODE_P (GET_MODE (cond))
! 	  && GET_MODE_BITSIZE (GET_MODE (cond) < BITS_PER_WORD))
! 	cond = gen_unary (SIGN_EXTEND, SImode, GET_MODE (cond), cond);
! 
!       term2 = gen_binary (AND, GET_MODE (src), cond, true);
        term3 = gen_binary (AND, GET_MODE (src),
  			  gen_unary (NOT, GET_MODE (src), GET_MODE (src),
! 				     cond),
  			  false);
  
        SUBST (SET_SRC (x),
*** gcc-2.6.0/function.c-dist	Wed Jul 13 06:03:22 1994
--- gcc-2.6.0/function.c	Thu Sep 15 17:46:04 1994
***************
*** 2209,2216 ****
--- 2209,2224 ----
  #endif
  	    }
  
+ 	  /* WJE:  added start_sequence () and end_sequence () since
+ 	     change_address () may emit insns.  This problem was found on
+ 	     an Apollo port, but might affect other platforms.  */
+ 	  start_sequence ();
  	  memref = change_address (memref, mode, 
  				   plus_constant (XEXP (memref, 0), offset));
+ 	  seq = get_insns ();
+ 	  end_sequence ();
+ 	  emit_insns_before (seq, insn);
+ 	  seq = 0;
  
  	  /* Store this memory reference where
  	     we found the bit field reference.  */
***************
*** 5036,5042 ****
       on a machine that fails to restore the registers.  */
    if (NON_SAVING_SETJMP && current_function_calls_setjmp)
      {
!       setjmp_protect (DECL_INITIAL (current_function_decl));
        setjmp_protect_args ();
      }
  #endif
--- 5044,5056 ----
       on a machine that fails to restore the registers.  */
    if (NON_SAVING_SETJMP && current_function_calls_setjmp)
      {
!       /* WJE:  Added IF statement below.  In C++, the argument to
! 	 setjmp_protect () would be error_mark, leading to a NULL
! 	 dereference.  Another call is added to cp-decl.c to replace
! 	 this one.  This was found on an Apollo port, but may affect
! 	 other platforms.  */
!       if (DECL_INITIAL (current_function_decl) != error_mark_node)
! 	setjmp_protect (DECL_INITIAL (current_function_decl));
        setjmp_protect_args ();
      }
  #endif
*** gcc-2.6.0/genoutput.c-dist	Sat Mar 19 07:35:31 1994
--- gcc-2.6.0/genoutput.c	Thu Sep 15 17:46:04 1994
***************
*** 989,995 ****
  
  static int
  n_occurrences (c, s)
!      char c;
       char *s;
  {
    int n = 0;
--- 989,995 ----
  
  static int
  n_occurrences (c, s)
!      int c;
       char *s;
  {
    int n = 0;
*** gcc-2.6.0/objc-act.c-dist	Mon Jul 11 17:14:29 1994
--- gcc-2.6.0/objc-act.c	Thu Sep 15 17:46:04 1994
***************
*** 6447,6453 ****
  static void
  warn_with_method (message, mtype, method)
       char *message;
!      char mtype;
       tree method;
  {
    if (count_error (1) == 0)
--- 6447,6453 ----
  static void
  warn_with_method (message, mtype, method)
       char *message;
!      int mtype;
       tree method;
  {
    if (count_error (1) == 0)
*** gcc-2.6.0/optabs.c-dist	Mon Jul 11 17:35:00 1994
--- gcc-2.6.0/optabs.c	Thu Sep 15 17:46:04 1994
***************
*** 3278,3284 ****
      }
  #endif
  
!   /* No hardware instruction available; call a library rotine to convert from
       SImode, DImode, or TImode into SFmode, DFmode, XFmode, or TFmode.  */
      {
        rtx libfcn;
--- 3278,3284 ----
      }
  #endif
  
!   /* No hardware instruction available; call a library routine to convert from
       SImode, DImode, or TImode into SFmode, DFmode, XFmode, or TFmode.  */
      {
        rtx libfcn;
***************
*** 3562,3567 ****
--- 3562,3568 ----
    if (libfcn)
      {
        rtx insns;
+       rtx value;
  
        to = protect_from_queue (to, 1);
        from = protect_from_queue (from, 0);
***************
*** 3571,3581 ****
  
        start_sequence ();
  
!       emit_library_call (libfcn, 1, GET_MODE (to), 1, from, GET_MODE (from));
        insns = get_insns ();
        end_sequence ();
  
!       emit_libcall_block (insns, target, hard_libcall_value (GET_MODE (to)),
  			  gen_rtx (unsignedp ? FIX : UNSIGNED_FIX,
  				   GET_MODE (to), from));
      }
--- 3572,3591 ----
  
        start_sequence ();
  
!       /* WJE:  use emit_library_call_value () since "long long" may be
! 	 passed using the argument pointer convention on some systems
! 	 like Apollo.  */
!       /* emit_library_call (libfcn, 1, GET_MODE (to), 1, from, GET_MODE (from)); */
!       value = emit_library_call_value (libfcn, NULL_RTX, 1,
! 				       GET_MODE (to),
! 				       1, from, GET_MODE (from));
        insns = get_insns ();
        end_sequence ();
  
!       /* emit_libcall_block (insns, target, hard_libcall_value (GET_MODE (to)),
! 			  gen_rtx (unsignedp ? FIX : UNSIGNED_FIX,
! 				   GET_MODE (to), from)); */
!       emit_libcall_block (insns, target, value,
  			  gen_rtx (unsignedp ? FIX : UNSIGNED_FIX,
  				   GET_MODE (to), from));
      }
*** gcc-2.6.0/reload.c-dist	Tue Jul 12 14:07:50 1994
--- gcc-2.6.0/reload.c	Thu Sep 15 17:46:04 1994
***************
*** 1881,1887 ****
  
  int
  n_occurrences (c, s)
!      char c;
       char *s;
  {
    int n = 0;
--- 1881,1887 ----
  
  int
  n_occurrences (c, s)
!      int c;
       char *s;
  {
    int n = 0;
*** gcc-2.6.0/toplev.c-dist	Wed Jul  6 21:58:55 1994
--- gcc-2.6.0/toplev.c	Thu Sep 15 17:46:04 1994
***************
*** 2072,2077 ****
--- 2072,2083 ----
    if (flag_caller_saves)
      init_caller_save ();
  
+ #ifdef NONSTANDARD_PIC
+   /* Initialize any special PIC support.  For Apollo, this sets up
+      a PIC symbol collector.  */
+   NONSTANDARD_PIC_INIT;
+ #endif /* NONSTANDARD_PIC */
+ 
    /* If auxiliary info generation is desired, open the output file.
       This goes in the same directory as the source file--unlike
       all the other output files.  */
***************
*** 2452,2457 ****
--- 2458,2469 ----
  #endif
        }
    }
+ 
+ #ifdef NONSTANDARD_PIC
+   /* Finish any special PIC support.  For Apollo, this writes the
+      global object table to the assembler output file.  */
+   NONSTANDARD_PIC_FINISH;
+ #endif /* NONSTANDARD_PIC */
  
    /* Do dbx symbols */
  #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
*** gcc-2.6.0/tree.h-dist	Wed Jul 13 06:03:13 1994
--- gcc-2.6.0/tree.h	Thu Sep 15 17:46:04 1994
***************
*** 464,469 ****
--- 464,487 ----
    char common[sizeof (struct tree_common)];
    int length;
    char *pointer;
+ 
+ #ifdef TM_APOLLO
+   /* These fields are used on Apollos to generate the global offset table
+      used for PIC references, since the assembler can not tell when such
+      references are actually required.  (The offset really should be 32
+      bits, but this seems adequate and saves space.)
+      Apollo shared library symbols appear in the Known Global Table.  (KGT)
+      These always require a PIC reference since the Apollo runtime system can
+      not perform text section relocations when a program starts.  The Apollo
+      compiler looks up all externals in the KGT and generates a data section
+      link for those symbols it finds.  The PIC mechanism is abused here to do
+      the same thing.  (This makes you want to hurl, don't it!)  */
+ 
+   unsigned apollo_searched_flag  : 1;  /* KGT search has been done      */
+   unsigned apollo_needs_pic_flag : 1;  /* Symbol requires PIC reference */
+   unsigned apollo_a0_return      : 1;  /* Function returns value in A0  */
+   unsigned apollo_pic_offset     : 29; /* Offset in PIC global table    */
+ #endif /* TM_APOLLO */
  };
  
  /* In a TREE_LIST node.  */
*** gcc-2.6.0/cp/Make-lang.in-dist	Fri Jun  3 16:34:33 1994
--- gcc-2.6.0/cp/Make-lang.in	Thu Sep 15 17:44:33 1994
***************
*** 72,78 ****
   $(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
   $(srcdir)/cp/errfn.c $(srcdir)/cp/gc.c $(srcdir)/cp/method.c \
   $(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
!  $(srcdir)/cp/error.c $(srcdir)/cp/init.c $(srcdir)/cp/parse.y \
   $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c
  
  cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o
--- 72,78 ----
   $(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
   $(srcdir)/cp/errfn.c $(srcdir)/cp/gc.c $(srcdir)/cp/method.c \
   $(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
!  $(srcdir)/cp/error.c $(srcdir)/cp/init.c $(srcdir)/cp/parse.in \
   $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c
  
  cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o
*** gcc-2.6.0/cp/Makefile.in-dist	Fri Jun  3 16:34:37 1994
--- gcc-2.6.0/cp/Makefile.in	Thu Sep 15 17:44:33 1994
***************
*** 197,202 ****
--- 197,214 ----
  	cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
  	cd $(srcdir); grep '^#define[ 	]*YYEMPTY' parse.c >>parse.h
  
+ # WJE:  Make cp-parse.y from cp-parse.in to conditionally include Apollo
+ # grammar extensions.
+ $(srcdir)/parse.y: $(srcdir)/parse.in
+ 	if [ -n "$(XM_APOLLO)" ]; then \
+ 	  sed -e "/^ifapollo$$/d" -e "/^end ifapollo$$/d" \
+ 	    $(srcdir)/parse.in > tmp-parse.y; \
+ 	else \
+ 	  sed -e "/^ifapollo$$/,/^end ifapollo$$/d" \
+ 	    $(srcdir)/parse.in > tmp-parse.y; \
+ 	fi
+ 	$(srcdir)/../move-if-change tmp-parse.y $(srcdir)/parse.y
+ 
  # hash.h really depends on $(srcdir)/gxx.gperf.
  # But this would screw things for people that don't have gperf,
  # if gxx.gpref got touched, say.
***************
*** 206,214 ****
  		$(srcdir)/gxx.gperf >$(srcdir)/hash.h
  
  spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
!   parse.h $(srcdir)/../flags.h lex.h
  lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
!   parse.h input.c $(srcdir)/../flags.h hash.h lex.h
  decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
    lex.h decl.h $(srcdir)/../stack.h
  decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
--- 218,226 ----
  		$(srcdir)/gxx.gperf >$(srcdir)/hash.h
  
  spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
!   $(srcdir)/parse.h $(srcdir)/../flags.h lex.h
  lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
!   $(srcdir)/parse.h input.c $(srcdir)/../flags.h hash.h lex.h
  decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
    lex.h decl.h $(srcdir)/../stack.h
  decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
***************
*** 229,235 ****
    $(srcdir)/../expr.h ../insn-codes.h
  edsel.o : edsel.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h
! pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h parse.h
  error.o : error.c $(CONFIG_H) $(CXX_TREE_H)
  errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H)
  sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
--- 241,247 ----
    $(srcdir)/../expr.h ../insn-codes.h
  edsel.o : edsel.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h $(srcdir)/../flags.h
  xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h
! pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(srcdir)/parse.h
  error.o : error.c $(CONFIG_H) $(CXX_TREE_H)
  errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H)
  sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h
*** gcc-2.6.0/cp/decl.c-dist	Wed Jul 13 06:10:43 1994
--- gcc-2.6.0/cp/decl.c	Thu Sep 15 17:44:33 1994
***************
*** 5945,5952 ****
        /* Initialize variables in need of static initialization with
  	 an empty CONSTRUCTOR to keep assemble_variable from putting them in
  	 the wrong program space.  */
!       if (flag_pic == 0
! 	  && TREE_STATIC (decl)
  	  && TREE_PUBLIC (decl)
  	  && ! DECL_EXTERNAL (decl)
  	  && TREE_CODE (decl) == VAR_DECL
--- 5945,5959 ----
        /* Initialize variables in need of static initialization with
  	 an empty CONSTRUCTOR to keep assemble_variable from putting them in
  	 the wrong program space.  */
!       if (
! #ifndef NO_SPECIAL_PIC_INIT
! 	  /* WJE:  added ifndef around the flag_pic test below for Apollo.
! 	     This allows uninitialized local static variables to go into
! 	     the bss section, even in PIC code.  Is the flag_pic test
! 	     for Sun systems?  */
! 	  flag_pic == 0 &&
! #endif
! 	  TREE_STATIC (decl)
  	  && TREE_PUBLIC (decl)
  	  && ! DECL_EXTERNAL (decl)
  	  && TREE_CODE (decl) == VAR_DECL
***************
*** 7301,7306 ****
--- 7308,7326 ----
  		}
  	    }
  	}
+ #ifdef TM_APOLLO
+       /* Allow the "char enum" Apollo extension.  */
+ 
+       if (type   &&   TREE_CODE (type) == ENUMERAL_TYPE
+ 	  &&   id == get_identifier ("char"))
+ 	/* char ENUM type defined as part of a typedef, such as
+ 	   "typedef char enum ce {A, B} ct;" */
+ 	;
+       else if (type == char_type_node   &&   TREE_CODE (id) == ENUMERAL_TYPE)
+ 	/* Most common case.  */
+ 	type = id;
+       else /* This joins to the following IF */
+ #endif /* TM_APOLLO */
        if (type)
  	error ("two or more data types in declaration of `%s'", name);
        else if (TREE_CODE (id) == IDENTIFIER_NODE)
***************
*** 7426,7431 ****
--- 7446,7507 ----
  				 TYPE_VOLATILE (type));
      }
  
+ #ifdef TM_APOLLO
+   /* Process the Apollo sized enum extension.  If a sized enum is found, the
+      size is applied and the modifiers cleared.  FIXME This code does NOT
+      check for consistency with any previous enum type definitions.
+      Doing so would require changes to the grammar and the creation
+      of enum types.  */
+ 
+   if (TREE_CODE (type) == ENUMERAL_TYPE)
+     {
+       int short_enum = RIDBIT_SETP (RID_SHORT, specbits);
+       int long_enum  = RIDBIT_SETP (RID_LONG,  specbits);
+       int type_prec  = 0;
+ 
+       /* Check the validity of the modifiers then apply any sizes.  */
+ 
+       if (     RIDBIT_SETP (RID_SIGNED,   specbits)
+ 	  ||   RIDBIT_SETP (RID_UNSIGNED, specbits)   ||   longlong)
+ 	error ("illegal modifiers specified for enum `%s'", name);
+       else if (     explicit_char && short_enum
+ 	       ||   explicit_char && long_enum
+ 	       ||   short_enum    && long_enum)
+ 	error ("ambiguous size for sized enum `%s'", name);
+       else if (explicit_char)
+ 	type_prec = TYPE_PRECISION (char_type_node);
+       else if (short_enum)
+ 	type_prec = TYPE_PRECISION (short_integer_type_node);
+       else if (long_enum)
+ 	type_prec = TYPE_PRECISION (long_integer_type_node);
+ 
+       if (type_prec)
+ 	{
+ 	  if (flag_short_enums)
+ 	    warning ("enum size specifier ignored");
+ 	  else if (TYPE_PRECISION (type) != type_prec)
+ 	    {
+ 	      TYPE_PRECISION (type) = type_prec;
+ 	      TYPE_SIZE (type) = 0;
+ 	      fixup_unsigned_type (type);
+ 	    }
+ 
+ 	  if (pedantic)
+ 	    pedwarn ("Apollo sized enum extension is used");
+ 	}
+ 
+       /* Clear any type modifiers that were used.  */
+ 
+       RIDBIT_RESET (RID_LONG,     specbits);
+       RIDBIT_RESET (RID_SHORT,    specbits);
+       RIDBIT_RESET (RID_UNSIGNED, specbits);
+       RIDBIT_RESET (RID_SIGNED,   specbits);
+       RIDBIT_RESET (RID_CHAR,     specbits);
+       explicit_char = 0;
+       longlong = 0;
+     }
+ #endif /* TM_APOLLO */
+ 
    /* Check all other uses of type modifiers.  */
  
    if (RIDBIT_SETP (RID_UNSIGNED, specbits)
***************
*** 11531,11541 ****
--- 11607,11624 ----
  
    /* ??? Compensate for Sun brain damage in dealing with data segments
       of PIC code.  */
+ #ifndef NO_SPECIAL_PIC_INIT
+   /* WJE:  added ifndef around this for Apollo.  Possible FIXME:  This
+      code may cause generation of calls to nonexistent constructors from
+      a global constructor.  This was observed in the Apollo port when
+      declaring a top-level class instance where the class had a virtual
+      member but no constructor.  */
    if (flag_pic
        && (DECL_CONSTRUCTOR_P (fndecl)
  	  || DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (fndecl)))
        && CLASSTYPE_NEEDS_VIRTUAL_REINIT (TYPE_METHOD_BASETYPE (fntype)))
      DECL_INLINE (fndecl) = 0;
+ #endif /* NO_SPECIAL_PIC_INIT */
  
    if (DECL_EXTERNAL (fndecl)
        /* This function is just along for the ride.  If we can make
*** gcc-2.6.0/cp/lex.c-dist	Wed Jun 15 13:29:07 1994
--- gcc-2.6.0/cp/lex.c	Thu Sep 15 17:44:33 1994
***************
*** 2679,2684 ****
--- 2679,2695 ----
  	      goto skipline;
  	    }
  	}
+ #ifdef TM_APOLLO
+       else if (c == 'e'
+ 	       && getch () == 'j'
+ 	       && getch () == 'e'
+ 	       && getch () == 'c'
+ 	       && getch () == 't'
+ 	       && ((c = getch ()) == ' ' || c == '\t' || c == '\n'))
+ 	/* Apollo has an "#eject" directive, ignore it.  The pedantic
+ 	   warning is in cccp.c.  */
+ 	goto skipline;
+ #endif /* TM_APOLLO */
        error ("undefined or invalid # directive");
        goto skipline;
      }
***************
*** 3269,3274 ****
--- 3280,3291 ----
    { &long_long_unsigned_type_node, 1, 1, 1}
  };
  
+ #ifdef TM_APOLLO
+ /* This is set TRUE if the last token was a '#'.  It is used to recognize
+    the Apollo '#attribute' and similar keywords.  */
+ static int sharp_seen = 0;
+ #endif
+ 
  int
  real_yylex ()
  {
***************
*** 3322,3328 ****
--- 3339,3353 ----
  	value = END_OF_SAVED_INPUT;
        else if (do_pending_expansions ())
  	/* this will set yychar for us */
+ #ifdef TM_APOLLO
+ 	{
+ 	  /* Do the '#' processing before returning.  */
+ 	  value = yychar;
+ 	  goto done;
+ 	}
+ #else
  	return yychar;
+ #endif
        else
  	value = ENDFILE;
        break;
***************
*** 3424,3429 ****
--- 3449,3480 ----
  	{
  	  register struct resword *ptr;
  
+ #ifdef TM_APOLLO /* Check for special Apollo keywords beginning with '#'.  */
+ 	  if (sharp_seen)
+ 	    {
+ 	      if (strcmp (token_buffer, "options") == 0)
+ 		{
+ 		  value = APOLLO_OPTIONS;
+ 		  goto done;
+ 		}
+ 	      else if (strcmp (token_buffer, "attribute") == 0)
+ 		{
+ 		  value = APOLLO_ATTRIBUTE;
+ 		  goto done;
+ 		}
+ 	    }
+ 	  else
+ 	    {
+ 	      /* Look for the "__options((...))" form.  This could be
+ 		 put into the keyword table and this code removed.  */
+ 	      if (strcmp (token_buffer, "__options") == 0)
+ 		{
+ 		  value = APOLLO_OPTIONS;
+ 		  goto done;
+ 		}
+ 	    }
+ #endif /* TM_APOLLO */
+ 
  	  if (ptr = is_reserved_word (token_buffer, p - token_buffer))
  	    {
  	      if (ptr->rid)
***************
*** 4512,4517 ****
--- 4563,4573 ----
  /*  yylloc.last_line = lineno; */
  #ifdef GATHER_STATISTICS
    token_count[value] += 1;
+ #endif
+ 
+ #ifdef TM_APOLLO
+   /* Remember if token was '#' for special Apollo keywords.  */
+   sharp_seen = (value == '#');
  #endif
  
    return value;
*** gcc-2.6.0/cp/parse.y-dist	Wed Jul  6 23:18:25 1994
--- gcc-2.6.0/cp/parse.y	Thu Sep 15 17:49:03 1994
***************
*** 146,151 ****
--- 146,157 ----
  %token HEADOF CLASSOF SIGOF
  %token ATTRIBUTE EXTENSION LABEL
  
+ ifapollo
+ /* Apollo reserved words.  These are the 'options' and
+    'attribute' modifiers.  */
+ %token APOLLO_ATTRIBUTE APOLLO_OPTIONS
+ end ifapollo
+ 
  /* the reserved words... C++ extensions */
  %token <ttype> AGGR
  %token <itype> VISSPEC
***************
*** 1959,1965 ****
  	;
  
  /* the * rules are dummies to accept the Apollo extended syntax
!    so that the header files compile. */
  maybe_attribute:
        /* empty */
    		{ $$ = NULL_TREE; }
--- 1965,1972 ----
  	;
  
  /* the * rules are dummies to accept the Apollo extended syntax
!    so that the header files compile.  In release SR10.3.5 and earlier, both
!    the '#' and '_' forms are still used in the header files.  */
  maybe_attribute:
        /* empty */
    		{ $$ = NULL_TREE; }
***************
*** 1975,1982 ****
  	;
  
  attribute:
!       ATTRIBUTE '(' '(' attribute_list ')' ')'
  		{ $$ = $4; }
  	;
  
  attribute_list:
--- 1982,2003 ----
  	;
  
  attribute:
! 	ATTRIBUTE '(' '(' attribute_list ')' ')'
  		{ $$ = $4; }
+ ifapollo
+ 	| '#' APOLLO_ATTRIBUTE '[' attribute_list ']'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `#attribute' extension used"); }
+ 	| '#' APOLLO_OPTIONS '(' attribute_list ')'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `#options' extension used"); }
+ 	| APOLLO_OPTIONS '(' '(' attribute_list ')' ')'
+ 		{ $$ = $4;
+ 		  if (pedantic)
+ 		    pedwarn ("Apollo `__options' extension used"); }
+ end ifapollo
  	;
  
  attribute_list:
*** gcc-2.6.0/config/m68k/x-apollo68-dist	Sun Jun 27 17:24:36 1993
--- gcc-2.6.0/config/m68k/x-apollo68	Thu Sep 15 17:44:06 1994
***************
*** 1,15 ****
! # x-apollo68 -- 680x0 based Apollos as host system
  
! # vasta@apollo.com says this is how to compile on an Apollo (SR10.x).
! # Use a Berkeley environment.
! CC=cc -g -A nansi -A cpu,3000 -A runtype,bsd4.3 -A systype,any -DSHORT_ENUM_BUG
! OLDCC=cc -g -A nansi -A cpu,3000 -A runtype,bsd4.3 -A systype,any -DSHORT_ENUM_BUG
  
! # This used to redefine CFLAGS and LIBGCC2_CFLAGS to eliminate the unsupported
! # -g flag from both macros.  This gives an undebugable stage1 compiler which
! # is bad, and it also does the wrong thing if we are cross compiling to a
! # target which does support debugging.  There is currently no way to avoid
! # the -g option that doesn't break something else.
  
! # Apollo does not have B option.
! TAROUTOPTS=xpf
--- 1,54 ----
! # This is for Apollo 680xx-based workstations running SR10.x.
! # It has been tested under SR10.3.5 using CC 6.8 in a BSD environment
! # with the ANSI header files installed.
! # The two sets of loader flags are needed since GCC uses '-A' for its
! # own purposes and provides another mechanism to pass things to the linker.
! # The stack size must be increased on cpp, cc1, and cc1plus or they may hit
! # the limit when compiling some large files.  The LDFLAGS below will
! # increase the stack size for ANY program.
  
! # For the initial build using Apollo CC, use this.
! LDFLAGS = -A stacksize,100000
! # For the bootstrap and subsequent builds using GCC, use this.
! # LDFLAGS = -Xlinker -A -Xlinker stacksize,100000
  
! # After gcc is installed and tested, a stripped build could
! # be done with these settings.  For the smallest possible library, the
! # -g1 flag could be removed from LIBGCC2_CFLAGS in Makefile.
! # CC = gcc
! # CFLAGS = -O2
! # LDFLAGS = -s -Xlinker -A -Xlinker stacksize,100000
  
! # This is used for building libgcc1 with Apollo CC.  The cpu flag is set for
! # best performance on DN3xxx and DN4xxx systems.  The flag setting probably
! # does not matter, since it only affects the more complex math instructions
! # like the trigonometric operations.  For older versions of CC, use 3000
! # instead of mathchip.
! CCLIBFLAGS = -O -A cpu,mathchip
! 
! # The stacksize flags are not needed for enquire.
! ENQUIRE_LDFLAGS =
! 
! # These are for the Apollo shared library support.  The ld library is for
! # the shared symbol lookup calls used in apollo-pic.c
! EXTRA_OBJS  = apollo-pic.o
! CLIB = -lld
! 
! # This is used in the Makefile to conditionally include Apollo grammar
! # extensions into the parsers.  These are needed for many of the
! # system header files.
! XM_APOLLO = apollo
! 
! # C++ global constructors and destructors are handled using named COFF
! # sections to accumulate the lists, and the crtstuff.c routines to
! # use them.
! EXTRA_PARTS = crtbegin.o crtend.o
! 
! # Apollo tar does not have a B or p option at or before SR10.3.5.
! # The SR10.3.5 manual page claims that both are present, but /bin/tar
! # fails with xpf and xBf.
! TAROUTOPTS = xf
! 
! # Do not use fixproto.  It may redefine _flsbuf, etc inappropriately
! # in stdio.h.  Most of the SR10.3.x ANSI headers are C++-ready.
! STMP_FIXPROTO =
*** gcc-2.6.0/config/m68k/apollo68.h-dist	Mon May 16 10:48:19 1994
--- gcc-2.6.0/config/m68k/apollo68.h	Thu Sep 15 17:44:05 1994
***************
*** 23,82 ****
  
  #define TM_APOLLO
  
! /* See m68k.h.  7 means 68020 with 68881.  */
  
  #ifndef TARGET_DEFAULT
  #define TARGET_DEFAULT 7
  #endif
  
- /* Target switches for the Apollo is the same as in m68k.h, except
-    there is no Sun FPA. */
- 
- #undef TARGET_SWITCHES
- #define TARGET_SWITCHES  \
-   { { "68020", 5},				\
-     { "c68020", 5},				\
-     { "68881", 2},				\
-     { "bitfield", 4},				\
-     { "68000", -5},				\
-     { "c68000", -5},				\
-     { "soft-float", -0102},			\
-     { "nobitfield", -4},			\
-     { "rtd", 8},				\
-     { "nortd", -8},				\
-     { "short", 040},				\
-     { "noshort", -040},				\
-     { "", TARGET_DEFAULT}}
- 
  /* Define __HAVE_68881__ in preprocessor,
     according to the -m flags.
     This will control the use of inline 68881 insns in certain macros.
     Also inform the program which CPU this is for.  */
  
! #if TARGET_DEFAULT & 02
  
- /* -m68881 is the default */
  #define CPP_SPEC \
! "%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}\
! %{!ansi:%{m68000:-Dmc68010 }%{mc68000:-Dmc68010 }%{!mc68000:%{!m68000:-Dmc68020 }}\
! %{!ansi:-D_APOLLO_SOURCE}}"
  
! #else
  
! /* -msoft-float is the default */
! #define CPP_SPEC \
! "%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
! %{!ansi:%{m68000:-Dmc68010 }%{mc68000:-Dmc68010 }%{!mc68000:%{!m68000:-Dmc68020 }}\
! %{!ansi:-D_APOLLO_SOURCE}}"
  
- #endif
- 
- /* Names to predefine in the preprocessor for this target machine.  */
- /* These are the ones defined by Apollo, plus mc68000 for uniformity with
-    GCC on other 68000 systems.  */
- 
- #define CPP_PREDEFINES "-Dapollo -Daegis -Dunix -Asystem(unix)  -Acpu(m68k) -Amachine(m68k)"
- 
  /* cpp has to support a #sccs directive for the /usr/include files */
  
  #define SCCS_DIRECTIVE
--- 23,67 ----
  
  #define TM_APOLLO
  
! /* See m68k.h.  7 means 68020 with 68881.  0407 means 68040 constrained
!    to run on a 68020 with 68881.
!    Use the default TARGET_SWITCHES in m68k.h.  */
  
  #ifndef TARGET_DEFAULT
  #define TARGET_DEFAULT 7
  #endif
  
  /* Define __HAVE_68881__ in preprocessor,
     according to the -m flags.
     This will control the use of inline 68881 insns in certain macros.
     Also inform the program which CPU this is for.  */
  
! /* Also define names for gcc to give to cpp for this target machine.  These
!    are the ones defined by Apollo plus a processor type identifier.  This
!    list was taken from the v6.8 ANSI CC.
!    /usr/include/apollo_$std.h is used to set initial values for /com/cc and
!    "/bin/cc -A nansi" when code is generated.  It is not used by /bin/cc -E,
!    /bin/CC in ansi mode, or /usr/lib/cpp.
!    /usr/lib/cpp apparently defines apollo, aegis, and unix internally. 
!    /bin/cc apparently defines the above plus _BFMT__COFF, _APOLLO_SOURCE, and
!    _ISP__* internally.  Use of "-A ansi" suppresses apollo, aegis, unix, and
!    _APOLLO_SOURCE.  These strings were found by examining the programs and
!    header files and running test cases.  */
  
  #define CPP_SPEC \
! "%{!msoft-float:-D__HAVE_68881__ }\
! %{!ansi:%{m68030:-Dmc68030 -D__mc68030__ }%{m68040:-Dmc68040 -D__mc68040__ }\
! %{!m68000:%{!mc68000:%{!m68030:%{!m68040:-Dmc68020 -D__mc68020__ }}}}\
! -D_APOLLO_SOURCE }%{ansi:%{m68030:-D__mc68030__ }%{m68040: -D__mc68040__ }\
! %{!m68000:%{!mc68000:%{!m68030:%{!m68040:-D__mc68020__ }}}}}\
! -D_BFMT__COFF -D_ISP__M68K -D_ISP__A88K=0 -D_ISP__PA_RISC=0 "
  
! /* Names to predefine in the preprocessor for this target machine.
!    These are the ones defined by Apollo, plus mc68000 for uniformity with
!    GCC on other 68000 systems.  __mc68000__ is required by longlong.h.  */
  
! #define CPP_PREDEFINES "-Dapollo -Daegis -Dunix -Dmc68000 -Asystem(unix) -Acpu(m68k) -Amachine(m68k)"
  
  /* cpp has to support a #sccs directive for the /usr/include files */
  
  #define SCCS_DIRECTIVE
***************
*** 90,130 ****
  
  #define DOLLARS_IN_IDENTIFIERS 2
  
! /* -m68000 requires special flags to the assembler.  */
  
  #define ASM_SPEC \
!  "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}}"
  
! /* STARTFILE_SPEC
!    Note that includes knowledge of the default specs for gcc, ie. no
!    args translates to the same effect as -m68881 */
  
! #if TARGET_DEFAULT & 2
! /* -m68881 is the default */
! #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
! #else
! /* -msoft-float is the default */
! #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
! #endif
  
! /* Specify library to handle `-a' basic block profiling.  */
  
! #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
! %{a:/usr/lib/bb_link.o} "
  
! /* Debugging is not supported yet */
  
! #undef DBX_DEBUGGING_INFO
! #undef SDB_DEBUGGING_INFO
  
! /* We have atexit(2).  So C++ can use it for global destructors.  */
  
! #if 0 /* troy@cbme.unsw.edu.au says people are still using sr10.2
! 	 and it does not support atexit.  */
  #define HAVE_ATEXIT
- #endif
  
  /* Every structure or union's size must be a multiple of 2 bytes.  */
  
--- 75,116 ----
  
  #define DOLLARS_IN_IDENTIFIERS 2
  
! /* -m680xx requires special flags to the assembler.  GAS is assumed to have
!    been modified to generate COFF by default.  */
  
  #define ASM_SPEC \
! "%{m68000:-m68000}%{mc68000:-m68000}%{m68030:-m68030}%{m68040:-m68040}\
! %{!m68000:%{!mc68000:%{!m68030:%{!m68040:-m68020}}}}"
  
! /* The startfiles and libraries include the crtbegin and crtend files
!    for global constructors.  All of the commonly used library routines
!    are in shared libraries.  The /usr/apollo/lib startfiles are only
!    used in strict ANSI mode since they turn off matherr ().  */
  
! #define STARTFILE_SPEC \
!   "%{ansi:/usr/apollo/lib/%{pg:gcrt0.o}%{!pg:%{p:mcrt0.o}%{!p:crt0.o}}}\
! %{!ansi:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}} crtbegin.o%s"
  
! #define LIB_SPEC "crtend.o%s"
  
! /* DBX debugging is supported by GDB using .stab and .stabstr sections
!    in the COFF .o file.  The native Apollo format is not supported.
!    There is no length limit on stab symbols.  */
  
! #define DBX_DEBUGGING_INFO
! #define DBX_CONTIN_LENGTH 0
  
! /* Use the GNU stab.h.  */
  
! #define NO_STAB_H
  
! /* At SR10.3+ we have atexit(2).  So C++ can use it for global destructors.
!    NOTE:  comment this out if you are using an earlier OS.  The command
!    "esa atexit" may be used from UNIX or AEGIS shells to check for the
!    presence of atexit in the shared libraries.  Systems without atexit (2)
!    will need a new crt0.o that calls the GNU exit routine.  */
! 
  #define HAVE_ATEXIT
  
  /* Every structure or union's size must be a multiple of 2 bytes.  */
  
***************
*** 131,137 ****
  #define STRUCTURE_SIZE_BOUNDARY 16
  
  /* Boundary (in *bits*) on which stack pointer should be aligned.  */
! #undef STACK_BOUNDARY
  #define STACK_BOUNDARY 32
  
  /* Functions which return large structures get the address
--- 117,124 ----
  #define STRUCTURE_SIZE_BOUNDARY 16
  
  /* Boundary (in *bits*) on which stack pointer should be aligned.  */
! 
! #undef  STACK_BOUNDARY
  #define STACK_BOUNDARY 32
  
  /* Functions which return large structures get the address
***************
*** 142,152 ****
  #define STRUCT_VALUE 0
  #define STRUCT_VALUE_INCOMING 0
  
! /* Specify how to pad function arguments.
!    Arguments are not padded at all; the stack is kept aligned on long
!    boundaries. */
  
! #define FUNCTION_ARG_PADDING(mode, size) none
  
  /* The definition of this macro imposes a limit on the size of
     an aggregate object which can be treated as if it were a scalar
--- 129,149 ----
  #define STRUCT_VALUE 0
  #define STRUCT_VALUE_INCOMING 0
  
! /* Set padding of function arguments to match that done by Apollo CC v6.8.
!    It halfword-aligns arguments and does not promote short integral
!    prototypes.  The stack is adjusted initially so it winds up
!    longword-aligned after the last argument is pushed.  Character arguments
!    have even stack addresses, with a pad byte below them as generated
!    by the normal m68k "moveb <value>,sp@-" behavior.
!    The flag M68K_DISABLE_QI_PUSH_EXPANSION was added in the Apollo
!    modification of m68k.md to disable the normal expansion of QI values
!    into HI values when pushed onto the stack.  */
  
! #undef  PARM_BOUNDARY
! #define PARM_BOUNDARY 16
! #undef  PROMOTE_PROTOTYPES
! #define FUNCTION_ARG_PADDING(MODE, TYPE) none
! #define M68K_DISABLE_QI_PUSH_EXPANSION
  
  /* The definition of this macro imposes a limit on the size of
     an aggregate object which can be treated as if it were a scalar
***************
*** 161,168 ****
     returned that way. */
  
  #define RETURN_IN_MEMORY(type) \
!   (TYPE_MODE (type) == BLKmode \
!    || GET_MODE_SIZE (TYPE_MODE (type)) > UNITS_PER_WORD)
  
  /* In order to link with Apollo libraries, we can't prefix external
     symbols with an underscore.  */
--- 158,164 ----
     returned that way. */
  
  #define RETURN_IN_MEMORY(type) \
!   (GET_MODE_SIZE (TYPE_MODE (type)) > UNITS_PER_WORD)
  
  /* In order to link with Apollo libraries, we can't prefix external
     symbols with an underscore.  */
***************
*** 169,175 ****
  
  #undef  USER_LABEL_PREFIX
  
! /* Use a prefix for local labels, just to be on the save side.  */
  
  #undef LOCAL_LABEL_PREFIX
  #define LOCAL_LABEL_PREFIX "."
--- 165,171 ----
  
  #undef  USER_LABEL_PREFIX
  
! /* Use a prefix for local labels, just to be on the safe side.  */
  
  #undef LOCAL_LABEL_PREFIX
  #define LOCAL_LABEL_PREFIX "."
***************
*** 185,191 ****
  
  #define ASM_RETURN_CASE_JUMP    return "jmp %%pc@(2,%0:w)"
  
- 
  /* Here are the new register names.  */
  
  #undef REGISTER_NAMES
--- 181,186 ----
***************
*** 204,206 ****
--- 199,332 ----
   "%fpa16", "%fpa17", "%fpa18", "%fpa19", "%fpa20", "%fpa21", "%fpa22", "%fpa23", \
   "%fpa24", "%fpa25", "%fpa26", "%fpa27", "%fpa28", "%fpa29", "%fpa30", "%fpa31" }
  #endif /* defined SUPPORT_SUN_FPA */
+ 
+ /* The Apollo setjmp () function only saves registers A5, A6, and SP.
+    This directive alerts the compiler to save around setjmp () calls.  */
+ 
+ #define NON_SAVING_SETJMP 1
+ 
+ /* Functions marked with the a0_return attribute return their values in
+    register A0 rather than D0.  This is used for calling some Pascal
+    functions from C code.  */
+ 
+ #undef  FUNCTION_VALUE
+ #define FUNCTION_VALUE(VALTYPE,FUNC) \
+   gen_rtx (REG, TYPE_MODE (VALTYPE),   apollo_a0_return_p (FUNC) ? 8 : 0)
+ 
+ /* These are the Apollo-specific PIC code generation routines.  They are
+    defined in apollo-pic.c.  The PIC mechanism is [ab]used to handle
+    Apollo shared library references.  flag_pic is always set during
+    code generation.  */
+ 
+ extern void apollo_pic_init ();
+ extern void apollo_pic_finish ();
+ extern int  apollo_pic_all_p ();
+ extern int  apollo_legitimate_pic_operand_p ();
+ extern int  apollo_a0_return_p ();
+ extern void apollo_set_a0_return ();
+ extern void apollo_asm_file_end ();
+ 
+ /* These activate some PIC extensions needed to build a global
+    offset table and special-case some external symbols.  The REPLACE_*
+    macros disable compilation of some functions in m68k.c.  */
+ 
+ #define NONSTANDARD_PIC
+ #define REPLACE_FUNCTION_PROLOGUE
+ #define REPLACE_FUNCTION_EPILOGUE
+ #define REPLACE_LEGITIMIZE_PIC_ADDRESS
+ 
+ #define ASM_DECLARE_FUNCTION_NAME apollo_asm_declare_function_name
+ 
+ #undef  LEGITIMATE_PIC_OPERAND_P
+ #define LEGITIMATE_PIC_OPERAND_P(X) apollo_legitimate_pic_operand_p (X)
+ 
+ #define NONSTANDARD_PIC_INIT   apollo_pic_init ()
+ #define NONSTANDARD_PIC_FINISH apollo_pic_finish ()
+ 
+ /* This is the name of the local data label used as the base for PIC
+    references.  The string includes LOCAL_LABEL_PREFIX.  */
+ 
+ #define GLOBAL_OFFSET_TABLE_NAME ".L__GLOBAL.OFFSET.TABLE."
+ 
+ /* Make some Apollo-specific sections at the end of assembler output.  */
+ 
+ #define ASM_FILE_END(FILE) apollo_asm_file_end (FILE)
+ 
+ /* C++ support.  Named COFF sections are used to collect global
+    constructors and destructors.  The crtbegin.o and crtend.o endmarkers
+    are used.  Garbage collection support will require adding a macro
+    ASM_OUTPUT_GC_ENTRY similar to ASM_OUTPUT_CONSTRUCTOR.  */
+ 
+ /* These are the assembler directives to select the global constructor
+    and destructor sections.  They are marked as data sections so that
+    they may point to routines in shared libraries.  */
+ 
+ #define CTORS_SECTION_ASM_OP ".section\t.ctors,\"w\""
+ #define DTORS_SECTION_ASM_OP ".section\t.dtors,\"w\""
+ #define UNWIND_SECTION_ASM_OP ".section\t.unwind"
+ 
+ /* These are the extra sections names and switching routines.
+    They are used in varasm.c  */
+ 
+ #define EXTRA_SECTIONS in_ctors, in_dtors, in_unwind
+ #define EXTRA_SECTION_FUNCTIONS \
+ void \
+ ctors_section () \
+ { \
+   if (in_section != in_ctors) \
+     { \
+       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+       in_section = in_ctors; \
+     } \
+ } \
+  \
+ void \
+ dtors_section () \
+ { \
+   if (in_section != in_dtors) \
+     { \
+       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+       in_section = in_dtors; \
+     } \
+ } \
+  \
+ void \
+ unwind_section () \
+ { \
+   if (in_section != in_unwind) \
+     { \
+       fprintf (asm_out_file, "%s\n", UNWIND_SECTION_ASM_OP); \
+       in_section = in_unwind; \
+     } \
+ }
+ 
+ 
+ 
+ /* These macros are used to register global constructors and destructors
+    so that they will be called before and after main () runs.  */
+ 
+ #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+   { \
+     ctors_section (); \
+     fprintf (FILE, "\t.long "); \
+     assemble_name (FILE, NAME); \
+     fprintf (FILE, "\n"); \
+   }
+ 
+ #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+   { \
+     dtors_section (); \
+     fprintf (FILE, "\t.long "); \
+     assemble_name (FILE, NAME); \
+     fprintf (FILE, "\n"); \
+   }
+ 
+ /* This keeps libgcc2.c from making symbols for the constructor and
+    destructor lists.  Their definitions are in the startup files.  */
+ 
+ #define CTOR_LISTS_DEFINED_EXTERNALLY
+ 
+ /* This turns off some flag_pic dependencies in cp/decl.c that would
+    otherwise cause bad code generation.  */
+ 
+ #define NO_SPECIAL_PIC_INIT
*** gcc-2.6.0/config/m68k/m68k.c-dist	Sat Apr 16 18:16:27 1994
--- gcc-2.6.0/config/m68k/m68k.c	Thu Sep 15 17:44:05 1994
***************
*** 66,71 ****
--- 66,77 ----
  }
  
  
+ /* The macros REPLACE_FUNCTION_PROLOGUE, REPLACE_FUNCTION_EPILOGUE,
+    and REPLACE_LEGITIMIZE_PIC_ADDRESS are defined on Apollo systems to
+    allow replacement of some routines in this file.  */
+ 
+ #ifndef REPLACE_FUNCTION_PROLOGUE
+ 
  /* This function generates the assembly code for function entry.
     STREAM is a stdio stream to output the code to.
     SIZE is an int: how many units of temporary storage to allocate.
***************
*** 243,248 ****
--- 249,256 ----
  #endif
      }
  }
+ 
+ #endif /* not REPLACE_FUNCTION_PROLOGUE */
  
  /* Return true if this function's epilogue can be output as RTL.  */
  
***************
*** 264,269 ****
--- 272,279 ----
    return 1;
  }
  
+ #ifndef REPLACE_FUNCTION_EPILOGUE
+ 
  /* This function generates the assembly code for function exit,
     on machines that need it.  Args are same as for FUNCTION_PROLOGUE.
  
***************
*** 533,538 ****
--- 543,550 ----
    else
      fprintf (stream, "\trts\n");
  }
+ 
+ #endif /* REPLACE_FUNCTION_EPILOGUE */
  
  /* Similar to general_operand, but exclude stack_pointer_rtx.  */
  
***************
*** 768,773 ****
--- 780,787 ----
  }
  
  
+ #ifndef REPLACE_LEGITIMIZE_PIC_ADDRESS
+ 
  /* Legitimize PIC addresses.  If the address is already
     position-independent, we return ORIG.  Newly generated
     position-independent addresses go to REG.  If we need more
***************
*** 858,863 ****
--- 872,878 ----
    return pic_ref;
  }
  
+ #endif /* not REPLACE_LEGITIMIZE_PIC_ADDRESS */
  
  /* Return the best assembler insn template
     for moving operands[1] into operands[0] as a fullword.  */
*** gcc-2.6.0/config/m68k/m68k.md-dist	Thu Jun 30 17:14:18 1994
--- gcc-2.6.0/config/m68k/m68k.md	Thu Sep 15 17:44:05 1994
***************
*** 710,716 ****
--- 710,720 ----
    ""
    "
  {
+ #ifdef NONSTANDARD_PIC
+   if (flag_pic && ! LEGITIMATE_PIC_OPERAND_P (operands[1]))
+ #else
    if (flag_pic && symbolic_operand (operands[1], SImode)) 
+ #endif
      {
        /* The source is an address which requires PIC relocation.  
           Call legitimize_pic_address with the source, mode, and a relocation
***************
*** 889,894 ****
--- 893,922 ----
  {
    rtx xoperands[4];
  
+ #ifdef M68K_DISABLE_QI_PUSH_EXPANSION
+   /* This is provided for systems like Apollo that only halfword-align
+      function arguments, and that use the normal stack pointer rounding when
+      pushing character values.  It loses for pushing a struct of several
+      bytes a byte at a time.  */
+   if (GET_CODE (operands[0]) == MEM
+       && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC
+       && XEXP (XEXP (operands[0], 0), 0) == stack_pointer_rtx)
+     {
+       if (ADDRESS_REG_P (operands[1]))
+ 	{
+ 	  /* It is not permitted to move a byte from an address register.
+ 	     Push a word, then copy the low stack byte to its high byte.  */
+ 	  xoperands[1] = operands[1];
+ 	  xoperands[2] = gen_rtx (MEM, QImode,
+ 				  gen_rtx (PLUS, VOIDmode,
+ 					   stack_pointer_rtx, const1_rtx));
+ 	  output_asm_insn (\"move%.w %1,%-\;move%.b %2,%@\", xoperands);
+ 	  return \"\";
+ 	}
+       else
+ 	return \"move%.b %1,%-\";
+     }
+ #else /* not M68K_DISABLE_QI_PUSH_EXPANSION */
    /* This is probably useless, since it loses for pushing a struct
       of several bytes a byte at a time.  */
    if (GET_CODE (operands[0]) == MEM
***************
*** 905,910 ****
--- 933,939 ----
        output_asm_insn (\"move%.b %1,%-\;move%.b %@,%2\", xoperands);
        return \"\";
      }
+ #endif /* not M68K_DISABLE_QI_PUSH_EXPANSION */
  
    /* Moving a byte into an address register is not possible.  */
    /* Use d0 as an intermediate, but don't clobber its contents.  */
***************
*** 4765,4771 ****
--- 4794,4804 ----
    ""
    "
  {
+ #ifdef NONSTANDARD_PIC
+   if (flag_pic && ! LEGITIMATE_PIC_OPERAND_P (XEXP (operands[0], 0)))
+ #else
    if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+ #endif
  #ifdef MOTOROLA
      SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  #else
***************
*** 4780,4786 ****
  	 (match_operand:SI 1 "general_operand" "g"))]
    ;; Operand 1 not really used on the m68000.
  
!   "! flag_pic"
    "*
  #ifdef MOTOROLA
  #ifdef MOTOROLA_BSR
--- 4813,4823 ----
  	 (match_operand:SI 1 "general_operand" "g"))]
    ;; Operand 1 not really used on the m68000.
  
!   "! flag_pic
! #ifdef NONSTANDARD_PIC
! 	||   LEGITIMATE_PIC_OPERAND_P (XEXP (operands[0], 0))
! #endif
!   "
    "*
  #ifdef MOTOROLA
  #ifdef MOTOROLA_BSR
***************
*** 4800,4806 ****
  	 (match_operand:SI 1 "general_operand" "g"))]
    ;; Operand 1 not really used on the m68000.
  
!   "flag_pic"
    "*
  #ifdef MOTOROLA
    if (GET_CODE (operands[0]) == MEM 
--- 4837,4847 ----
  	 (match_operand:SI 1 "general_operand" "g"))]
    ;; Operand 1 not really used on the m68000.
  
!   "flag_pic
! #ifdef NONSTANDARD_PIC
! 	&&   ! LEGITIMATE_PIC_OPERAND_P (XEXP (operands[0], 0))
! #endif
!   "
    "*
  #ifdef MOTOROLA
    if (GET_CODE (operands[0]) == MEM 
***************
*** 4825,4831 ****
--- 4866,4876 ----
    ""
    "
  {
+ #ifdef NONSTANDARD_PIC
+   if (flag_pic && ! LEGITIMATE_PIC_OPERAND_P (XEXP (operands[1], 0)))
+ #else
    if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+ #endif
  #ifdef MOTOROLA
      SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  #else
***************
*** 4840,4846 ****
  	(call (match_operand:QI 1 "memory_operand" "o")
  	      (match_operand:SI 2 "general_operand" "g")))]
    ;; Operand 2 not really used on the m68000.
!   "! flag_pic"
    "*
  #ifdef MOTOROLA
  #ifdef MOTOROLA_BSR
--- 4885,4895 ----
  	(call (match_operand:QI 1 "memory_operand" "o")
  	      (match_operand:SI 2 "general_operand" "g")))]
    ;; Operand 2 not really used on the m68000.
!   "! flag_pic
! #ifdef NONSTANDARD_PIC
! 	||   LEGITIMATE_PIC_OPERAND_P (XEXP (operands[1], 0))
! #endif
!   "
    "*
  #ifdef MOTOROLA
  #ifdef MOTOROLA_BSR
***************
*** 4860,4866 ****
  	(call (match_operand:QI 1 "memory_operand" "o")
  	      (match_operand:SI 2 "general_operand" "g")))]
    ;; Operand 2 not really used on the m68000.
!   "flag_pic"
    "*
  #ifdef MOTOROLA
    if (GET_CODE (operands[1]) == MEM 
--- 4909,4919 ----
  	(call (match_operand:QI 1 "memory_operand" "o")
  	      (match_operand:SI 2 "general_operand" "g")))]
    ;; Operand 2 not really used on the m68000.
!   "flag_pic
! #ifdef NONSTANDARD_PIC
! 	&&   ! LEGITIMATE_PIC_OPERAND_P (XEXP (operands[1], 0))
! #endif
!   "
    "*
  #ifdef MOTOROLA
    if (GET_CODE (operands[1]) == MEM 
***************
*** 5081,5086 ****
--- 5134,5140 ----
    return \"move%.l %2,%@\";
  }")
  
+ ;; M68K_DISABLE_QI_PUSH_EXPANSION disables this.
  ;; Speed up pushing a single byte but leaving four bytes of space.
  
  (define_peephole
***************
*** 5087,5093 ****
    [(set (mem:QI (pre_dec:SI (reg:SI 15)))
  	(match_operand:QI 1 "general_operand" "dami"))
     (set (reg:SI 15) (minus:SI (reg:SI 15) (const_int 2)))]
!   "! reg_mentioned_p (stack_pointer_rtx, operands[1])"
    "*
  {
    rtx xoperands[4];
--- 5141,5153 ----
    [(set (mem:QI (pre_dec:SI (reg:SI 15)))
  	(match_operand:QI 1 "general_operand" "dami"))
     (set (reg:SI 15) (minus:SI (reg:SI 15) (const_int 2)))]
!   "
! #ifdef M68K_DISABLE_QI_PUSH_EXPANSION
! 	0
! #else
! 	! reg_mentioned_p (stack_pointer_rtx, operands[1])
! #endif
!   "
    "*
  {
    rtx xoperands[4];
