diff -ur orig-2.8.1/c-lex.c gcc-2.8.1/c-lex.c
--- orig-2.8.1/c-lex.c	Thu Feb 26 12:38:58 1998
+++ gcc-2.8.1/c-lex.c	Mon Apr 27 19:58:32 1998
@@ -366,12 +366,14 @@
 	case '\r':
 	  /* ANSI C says the effects of a carriage return in a source file
 	     are undefined.  */
+#ifndef atarist /* but not on an atarist, though hopefully we should'nt see it */
 	  if (pedantic && !newline_warning)
 	    {
 	      warning ("carriage return in source file");
 	      warning ("(we only warn about the first carriage return)");
 	      newline_warning = 1;
 	    }
+#endif
 	  c = GETC();
 	  break;
 
diff -ur orig-2.8.1/calls.c gcc-2.8.1/calls.c
--- orig-2.8.1/calls.c	Wed Feb 11 13:53:56 1998
+++ gcc-2.8.1/calls.c	Mon Apr 27 20:00:12 1998
@@ -2338,6 +2338,11 @@
   argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
   bzero ((char *) argvec, nargs * sizeof (struct arg));
 
+/* how would you do this RIGHT ?? fake a DECL node? dunno... */
+#ifdef ENCODE_SECTION_INFO
+  /* mark it as a function (to be in the text section that is) */
+  SYMBOL_REF_FLAG (fun) = 1;
+#endif
 
   INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
 
@@ -2865,6 +2870,11 @@
 
   argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
   bzero ((char *) argvec, (nargs + 1) * sizeof (struct arg));
+
+#ifdef ENCODE_SECTION_INFO
+  /* mark it as a function (to be in the text section that is) */
+  SYMBOL_REF_FLAG (fun) = 1;
+#endif
 
   INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
 
diff -ur orig-2.8.1/cccp.c gcc-2.8.1/cccp.c
--- orig-2.8.1/cccp.c	Thu Feb 26 12:38:58 1998
+++ gcc-2.8.1/cccp.c	Tue Aug 11 16:05:28 1998
@@ -127,6 +127,11 @@
 #define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3)
 #define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4)
 
+#ifdef atarist
+long _stksize = 1L;		/* use 1/4 of memory as stack */
+#define read(fd,buf,size)	_text_read(fd,buf,size)	/* this version of read() delete the CRs! */
+#endif
+
 /* VMS-specific definitions */
 #ifdef VMS
 #include <descrip.h>
@@ -161,6 +166,9 @@
 /* Find the largest host integer type and set its size and type.
    Watch out: on some crazy hosts `long' is shorter than `int'.  */
 
+#ifdef atarist
+#define HOST_WIDE_INT	long
+#endif
 #ifndef HOST_WIDE_INT
 # if HAVE_INTTYPES_H
 #  include <inttypes.h>
@@ -495,10 +503,9 @@
   = INCLUDE_DEFAULTS;
 #else
   = {
-    /* Pick up GNU C++ specific include files.  */
-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
-    { OLD_GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 },
 #ifdef CROSS_COMPILE
+    /* for cross GNU C++ specific include files.  */
+    { TOOL_INCLUDE_DIR"/g++", 1, 1 },
     /* This is the dir for fixincludes.  Put it just before
        the files that we fix.  */
     { GCC_INCLUDE_DIR, "GCC", 0, 0 },
@@ -510,6 +517,9 @@
     { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0 },
 #endif
 #else /* not CROSS_COMPILE */
+    /* Pick up GNU C++ specific include files.  */
+    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
+    { OLD_GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 },
 #ifdef LOCAL_INCLUDE_DIR
     /* This should be /usr/local/include and should come before
        the fixincludes-fixed header files.  */
@@ -1567,7 +1577,11 @@
 	break;
 
       case 'v':
+#ifdef atarist
+	fprintf (stderr, "GNU CPP version %s.%s", version_string, ATARI_PL);
+#else
 	fprintf (stderr, "GNU CPP version %s", version_string);
+#endif
 #ifdef TARGET_VERSION
 	TARGET_VERSION;
 #endif
@@ -1694,6 +1708,7 @@
     }
   }
 
+#ifndef atarist
   /* Add dirs from CPATH after dirs from -I.  */
   /* There seems to be confusion about what CPATH should do,
      so for the moment it is not documented.  */
@@ -1703,6 +1718,7 @@
   cp = getenv ("CPATH");
   if (cp && ! no_standard_includes)
     path_include (cp);
+#endif
 
   /* Initialize output buffer */
 
@@ -1826,9 +1842,17 @@
     switch ((objc << 1) + cplusplus)
       {
       case 0:
+#ifdef atarist
+	epath = getenv("GNUINC");
+	if (epath == NULL)
+#endif
 	epath = getenv ("C_INCLUDE_PATH");
 	break;
       case 1:
+#ifdef atarist
+	epath = getenv("GXXINC");
+	if (epath == NULL)
+#endif
 	epath = getenv ("CPLUS_INCLUDE_PATH");
 	break;
       case 2:
@@ -2208,6 +2232,7 @@
   return 0;
 }
 
+#ifndef atarist
 /* Given a colon-separated list of file names PATH,
    add all the names to the search path for include files.  */
 
@@ -2241,6 +2266,7 @@
 	break;
     }
 }
+#endif /*atarist */
 
 /* Return the address of the first character in S that equals C.
    S is an array of length N, possibly containing '\0's, and followed by '\0'.
@@ -3889,7 +3915,10 @@
 		= skip_quoted_string (xp - 1, bp, ip->lineno,
 				      NULL_PTR, NULL_PTR, NULL_PTR);
 	      while (xp != bp1)
-		*cp++ = *xp++;
+		if (*xp == '\\' && xp + 1 != bp1 && xp[1] == '\n')
+			xp += 2;
+		else
+			*cp++ = *xp++;
 	    }
 	    break;
 
@@ -4646,7 +4675,7 @@
 absolute_filename (filename)
      char *filename;
 {
-#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN32__))
+#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN32__)) || (defined (atarist))
   if (isalpha (filename[0]) && filename[1] == ':') filename += 2;
 #endif
 #if defined (__CYGWIN32__)
diff -ur orig-2.8.1/cexp.y gcc-2.8.1/cexp.y
--- orig-2.8.1/cexp.y	Wed Feb 18 19:48:42 1998
+++ gcc-2.8.1/cexp.y	Wed Jun 17 16:25:08 1998
@@ -79,6 +79,10 @@
 /* Find the largest host integer type and set its size and type.
    Watch out: on some crazy hosts `long' is shorter than `int'.  */
 
+#ifdef atarist
+#define HOST_WIDE_INT long
+#endif
+
 #ifndef HOST_WIDE_INT
 # if HAVE_INTTYPES_H
 #  include <inttypes.h>
diff -ur orig-2.8.1/choose-temp.c gcc-2.8.1/choose-temp.c
--- orig-2.8.1/choose-temp.c	Thu Dec  4 14:17:56 1997
+++ gcc-2.8.1/choose-temp.c	Fri Jul 17 10:21:10 1998
@@ -123,6 +123,30 @@
   base = ":";
 #endif
 
+#ifdef atarist
+	if (base[1] == ':')			/* TOS path like c:\tmp */
+	{
+		char	*p;
+		
+		p = base;
+		while (*p != EOS)			/* convert it to c:/tmp */
+		{
+			if (*p == '\\')
+				*p = '/';
+			p++;
+		}
+		p--;
+		if (*p == '/')				/* deleting trailing '/' , e.g from c:/ */
+			*p = EOS;
+	}
+#if 0
+{
+	char *newbase = alloca(FILENAME_MAX);
+   dos2unx(base, newbase);
+   base = newbase;
+}
+#endif
+#endif
   len = strlen (base);
   temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
 			   + strlen (TEMP_FILE) + 1);
diff -ur orig-2.8.1/config/m68k/m68k.c gcc-2.8.1/config/m68k/m68k.c
--- orig-2.8.1/config/m68k/m68k.c	Fri Nov 21 10:53:06 1997
+++ gcc-2.8.1/config/m68k/m68k.c	Mon Apr 27 19:03:48 1998
@@ -133,7 +133,7 @@
 void
 finalize_pic ()
 {
-  if (flag_pic && current_function_uses_pic_offset_table)
+  if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
     {
       rtx insn = gen_rtx (USE, VOIDmode, pic_offset_table_rtx);
       emit_insn_after (insn, get_insns ());
@@ -473,7 +473,7 @@
 				  -cfa_store_offset + n_regs++ * 4);
 	}
     }
-  if (flag_pic && current_function_uses_pic_offset_table)
+  if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
     {
 #ifdef MOTOROLA
       asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
@@ -1305,12 +1305,20 @@
   /* First handle a simple SYMBOL_REF or LABEL_REF */
   if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
     {
+#ifdef LEGITIMATE_BASEREL_OPERAND_P
+      if (LEGITIMATE_BASEREL_OPERAND_P (orig))
+	return orig;
+#endif
+
       if (reg == 0)
 	abort ();
 
-      pic_ref = gen_rtx (MEM, Pmode,
-			 gen_rtx (PLUS, Pmode,
-				  pic_offset_table_rtx, orig));
+      if (flag_pic == 3)
+        pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
+      else
+        pic_ref = gen_rtx (MEM, Pmode,
+			   gen_rtx (PLUS, Pmode,
+				    pic_offset_table_rtx, orig));
       current_function_uses_pic_offset_table = 1;
       if (reload_in_progress)
 	regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
@@ -2778,6 +2786,9 @@
       output_address (XEXP (op, 0));
       if (letter == 'd' && ! TARGET_68020
 	  && CONSTANT_ADDRESS_P (XEXP (op, 0))
+	  && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+	       && SYMBOL_REF_FLAG (XEXP (op, 0))
+	       && !SYMBOL_REF_USED (XEXP (op, 0)))
 	  && !(GET_CODE (XEXP (op, 0)) == CONST_INT
 	       && INTVAL (XEXP (op, 0)) < 0x8000
 	       && INTVAL (XEXP (op, 0)) >= -0x8000))
@@ -3071,6 +3082,8 @@
 	          fprintf (file, ":w");
 	        if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
 	          fprintf (file, ":l");
+	        if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
+	          fprintf (file, ":w");
 	      }
 	    if (addr != 0 && ireg != 0)
 	      {
@@ -3135,6 +3148,18 @@
 	    fprintf (file, "%d:w", INTVAL (addr));
 #endif
 	  }
+	else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
+		 && SYMBOL_REF_FLAG (addr) && !SYMBOL_REF_USED (addr))
+	  {
+#ifdef MOTOROLA
+	    output_addr_const (file, addr);
+	    fputs ("(pc)", file);
+#else
+	    fputs ("pc@(", file);
+	    output_addr_const (file, addr);
+	    putc (')', file);
+#endif
+	  }
 	else
 	  {
 	    output_addr_const (file, addr);
@@ -3201,6 +3226,22 @@
 
   return 0;
 }
+
+#ifdef ENCODE_SECTION_INFO
+/* Does operand (which is a symbolic_operand) live in text space? If
+   so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
+
+int
+read_only_operand (operand)
+     rtx operand;
+{
+  if (GET_CODE (operand) == CONST)
+    operand = XEXP (XEXP (operand, 0), 0);
+  if (GET_CODE (operand) == SYMBOL_REF)
+    return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
+  return 1;
+}
+#endif
 
 /* Accept integer operands in the range 0..0xffffffff.  We have to check the
    range carefully since this predicate is used in DImode contexts.  Also, we
diff -ur orig-2.8.1/config/m68k/m68k.h gcc-2.8.1/config/m68k/m68k.h
--- orig-2.8.1/config/m68k/m68k.h	Thu Feb 19 23:23:52 1998
+++ gcc-2.8.1/config/m68k/m68k.h	Mon Apr 27 19:10:50 1998
@@ -112,6 +112,14 @@
 #define MASK_5200	2048
 #define TARGET_5200 (target_flags & MASK_5200)
 
+/* Use PC-relative addressing for refs to read-only data */
+#define MASK_PCREL 4096
+#define TARGET_PC_REL (target_flags & MASK_PCREL)
+
+/* Use base-relative addressing for refs to data&bss segments */
+#define MASK_BASEREL 8192
+#define TARGET_BASE_REL (target_flags & MASK_BASEREL)
+
 /* Align ints to a word boundary.  This breaks compatibility with the 
    published ABI's for structures containing ints, but produces faster
    code on cpus with 32 bit busses (020, 030, 040, 060, CPU32+, coldfire).
@@ -424,7 +432,18 @@
    the compiler won't touch since no instructions that use these
    registers will be valid.  */
 
-#ifdef SUPPORT_SUN_FPA
+#ifndef SUPPORT_SUN_FPA
+
+#define CONDITIONAL_REGISTER_USAGE \
+{                                               \
+  if (flag_pic)                                 \
+    fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
+  /* prevent saving/restoring of the base reg */ \
+  if (flag_pic == 3)				 \
+    call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
+}
+
+#else  /* defined SUPPORT_SUN_FPA */
 
 #define CONDITIONAL_REGISTER_USAGE \
 { 						\
@@ -1415,6 +1434,8 @@
        && GET_CODE (XEXP (X, 1)) == CONST_INT				\
        && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)		\
    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx 	\
+       && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))		\
+   || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx 	\
        && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)		\
    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx 	\
        && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))		\
@@ -1481,7 +1502,8 @@
 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
 { GO_IF_NONINDEXED_ADDRESS (X, ADDR);					\
   GO_IF_INDEXED_ADDRESS (X, ADDR);					\
-  if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS	\
+  if (flag_pic && flag_pic != 3						\
+      && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS		\
       && LEGITIMATE_INDEX_P (XEXP (X, 0))				\
       && GET_CODE (XEXP (X, 1)) == LABEL_REF)				\
     goto ADDR; }
diff -ur orig-2.8.1/config/m68k/m68k.md gcc-2.8.1/config/m68k/m68k.md
--- orig-2.8.1/config/m68k/m68k.md	Tue Oct 28 20:31:34 1997
+++ gcc-2.8.1/config/m68k/m68k.md	Mon Apr 27 19:21:16 1998
@@ -503,6 +503,9 @@
 {
   m68k_last_compare_had_fp_operands = 0;
   if (flag_pic && symbolic_operand (operands[1], SImode))
+#ifdef LEGITIMATE_BASEREL_OPERAND_P
+   if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
+#endif
     {
       /* The source is an address which requires PIC relocation.
          Call legitimize_pic_address with the source, mode, and a relocation
@@ -4506,7 +4509,7 @@
 (define_insn "ashlsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(ashift:SI (match_operand:SI 1 "register_operand" "0")
-		   (match_operand:SI 2 "general_operand" "dI")))]
+		   (match_operand:QI 2 "general_operand" "dI")))]
   ""
   "*
 {
@@ -4521,14 +4524,14 @@
 (define_insn "ashlhi3"
   [(set (match_operand:HI 0 "register_operand" "=d")
 	(ashift:HI (match_operand:HI 1 "register_operand" "0")
-		   (match_operand:HI 2 "general_operand" "dI")))]
+		   (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "lsl%.w %2,%0")
 
 (define_insn ""
   [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
 	(ashift:HI (match_dup 0)
-		   (match_operand:HI 1 "general_operand" "dI")))]
+		   (match_operand:QI 1 "general_operand" "dI")))]
   "!TARGET_5200"
   "lsl%.w %1,%0")
 
@@ -4685,21 +4688,21 @@
 (define_insn "ashrsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
-		     (match_operand:SI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   ""
   "asr%.l %2,%0")
 
 (define_insn "ashrhi3"
   [(set (match_operand:HI 0 "register_operand" "=d")
 	(ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
-		     (match_operand:HI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "asr%.w %2,%0")
 
 (define_insn ""
   [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
 	(ashiftrt:HI (match_dup 0)
-		     (match_operand:HI 1 "general_operand" "dI")))]
+		     (match_operand:QI 1 "general_operand" "dI")))]
   "!TARGET_5200"
   "asr%.w %1,%0")
 
@@ -4871,21 +4874,21 @@
 (define_insn "lshrsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
-		     (match_operand:SI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   ""
   "lsr%.l %2,%0")
 
 (define_insn "lshrhi3"
   [(set (match_operand:HI 0 "register_operand" "=d")
 	(lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
-		     (match_operand:HI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "lsr%.w %2,%0")
 
 (define_insn ""
   [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
 	(lshiftrt:HI (match_dup 0)
-		     (match_operand:HI 1 "general_operand" "dI")))]
+		     (match_operand:QI 1 "general_operand" "dI")))]
   "!TARGET_5200"
   "lsr%.w %1,%0")
 
@@ -4908,7 +4911,8 @@
 (define_insn "rotlsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(rotate:SI (match_operand:SI 1 "register_operand" "0")
-		   (match_operand:SI 2 "general_operand" "dINO")))]
+/*		   (match_operand:SI 2 "general_operand" "dINO")))]*/
+		   (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "*
 {
@@ -4926,7 +4930,8 @@
 (define_insn "rotlhi3"
   [(set (match_operand:HI 0 "register_operand" "=d")
 	(rotate:HI (match_operand:HI 1 "register_operand" "0")
-		   (match_operand:HI 2 "general_operand" "dIP")))]
+/*		   (match_operand:HI 2 "general_operand" "dIP")))] */
+		   (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "*
 {
@@ -4942,7 +4947,8 @@
 (define_insn ""
   [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
 	(rotate:HI (match_dup 0)
-		   (match_operand:HI 1 "general_operand" "dIP")))]
+/*		   (match_operand:HI 1 "general_operand" "dIP")))] */
+		   (match_operand:QI 1 "general_operand" "dI")))]
   "!TARGET_5200"
   "*
 {
@@ -4990,21 +4996,21 @@
 (define_insn "rotrsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(rotatert:SI (match_operand:SI 1 "register_operand" "0")
-		     (match_operand:SI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "ror%.l %2,%0")
 
 (define_insn "rotrhi3"
   [(set (match_operand:HI 0 "register_operand" "=d")
 	(rotatert:HI (match_operand:HI 1 "register_operand" "0")
-		     (match_operand:HI 2 "general_operand" "dI")))]
+		     (match_operand:QI 2 "general_operand" "dI")))]
   "!TARGET_5200"
   "ror%.w %2,%0")
 
 (define_insn ""
   [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
 	(rotatert:HI (match_dup 0)
-		     (match_operand:HI 1 "general_operand" "dI")))]
+		     (match_operand:QI 1 "general_operand" "dI")))]
   "!TARGET_5200"
   "ror%.w %1,%0")
 
@@ -5815,9 +5821,13 @@
   if (! ADDRESS_REG_P (operands[0]))
     {
 #ifdef MOTOROLA
-      return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
+#ifdef SGS_CMP_ORDER
+    return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\";
+#else
+    return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\";
+#endif
 #else
-      return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\";
+    return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\";
 #endif
     }
   operands[4] = gen_label_rtx();
@@ -6651,7 +6661,7 @@
   ""
   "
 {
-  if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+  if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
     SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
 }")
 
@@ -6661,7 +6671,7 @@
 	 (match_operand:SI 1 "general_operand" "g"))]
   ;; Operand 1 not really used on the m68000.
 
-  "! flag_pic"
+  "! flag_pic || flag_pic == 3"
   "*
 #if defined (MOTOROLA) && !defined (USE_GAS)
 #ifdef MOTOROLA_BSR
@@ -6681,7 +6691,7 @@
 	 (match_operand:SI 1 "general_operand" "g"))]
   ;; Operand 1 not really used on the m68000.
 
-  "flag_pic"
+  "flag_pic && flag_pic < 3"
   "*
   if (GET_CODE (operands[0]) == MEM
       && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
@@ -6714,7 +6724,7 @@
   ""
   "
 {
-  if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+  if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
     SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
 }")
 
@@ -6724,7 +6734,7 @@
 	(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"
+  "! flag_pic || flag_pic == 3"
   "*
 #if defined (MOTOROLA) && !defined (USE_GAS)
 #ifdef MOTOROLA_BSR
@@ -6744,7 +6754,7 @@
 	(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"
+  "flag_pic && flag_pic < 3"
   "*
   if (GET_CODE (operands[1]) == MEM
       && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
@@ -7105,6 +7115,52 @@
 	  (if_then_else
 	    (ge (plus:SI (match_operand:SI 0 "register_operand" "+d")
 		         (const_int -1))
+	        (const_int 0))
+	    (label_ref (match_operand 1 "" ""))
+	    (pc)))
+     (set (match_dup 0)
+	  (plus:SI (match_dup 0)
+		   (const_int -1)))])]
+  "DATA_REG_P (operands[0])"
+  "*
+{
+  CC_STATUS_INIT;
+  output_dbcc_and_branch (operands);
+  return \"\";
+}")
+
+(define_peephole
+  [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
+                             [(cc0) (const_int 0)])
+                           (label_ref (match_operand 2 "" ""))
+                           (pc)))
+   (parallel
+    [(set (pc)
+	  (if_then_else
+	    (ne (match_operand:HI 0 "register_operand" "+d")
+	        (const_int 0))
+	    (label_ref (match_operand 1 "" ""))
+	    (pc)))
+     (set (match_dup 0)
+	  (plus:HI (match_dup 0)
+		   (const_int -1)))])]
+  "DATA_REG_P (operands[0])"
+  "*
+{
+  CC_STATUS_INIT;
+  output_dbcc_and_branch (operands);
+  return \"\";
+}")
+
+(define_peephole
+  [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
+                             [(cc0) (const_int 0)])
+                           (label_ref (match_operand 2 "" ""))
+                           (pc)))
+   (parallel
+    [(set (pc)
+	  (if_then_else
+	    (ne (match_operand:SI 0 "register_operand" "+d")
 	        (const_int 0))
 	    (label_ref (match_operand 1 "" ""))
 	    (pc)))
diff -ur orig-2.8.1/config.guess gcc-2.8.1/config.guess
--- orig-2.8.1/config.guess	Tue Feb  3 18:27:42 1998
+++ gcc-2.8.1/config.guess	Sat May 23 17:38:02 1998
@@ -189,6 +189,9 @@
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
 	exit 0 ;;
+	*atari*:*MiNT*:*:*)
+	echo m68k-atari-mint
+	exit 0 ;;
     atari*:NetBSD:*:*)
 	echo m68k-atari-netbsd${UNAME_RELEASE}
 	exit 0 ;;
diff -ur orig-2.8.1/config.sub gcc-2.8.1/config.sub
--- orig-2.8.1/config.sub	Fri Feb 13 12:16:06 1998
+++ gcc-2.8.1/config.sub	Mon Apr 27 19:24:26 1998
@@ -221,6 +221,9 @@
 		basic_machine=m68k-apollo
 		os=-sysv
 		;;
+	atari)
+		basic_machine=m68k-atari
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -394,6 +397,10 @@
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
+	mint)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
 	mipsel*-linux*)
 		basic_machine=mipsel-unknown
 		os=-linux-gnu
@@ -714,7 +721,7 @@
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv*)
+	      | -mingw32* | -linux-gnu* | -uxpv* | -mint* )
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-linux*)
@@ -931,6 +938,9 @@
 				;;
 			-genix*)
 				vendor=ns
+				;;
+			-mint*)
+				vendor=atari
 				;;
 			-mvs*)
 				vendor=ibm
diff -ur orig-2.8.1/configure gcc-2.8.1/configure
--- orig-2.8.1/configure	Sun Mar  1 02:02:02 1998
+++ gcc-2.8.1/configure	Mon Apr 27 19:25:22 1998
@@ -3722,6 +3722,17 @@
 			exit 1
 		fi
 		extra_headers=math-68881.h
+		;;
+	m68k-atari-mint* | m68000-atari-mint*)	# Atari ST running MiNT
+		tm_file=m68k/mint.h
+		xm_file=m68k/xm-mint.h
+		tmake_file=m68k/t-mint
+		xmake_file=m68k/x-mint
+		fixincludes=Makefile.in
+		install_headers_dir=install-headers-tar
+		case $machine in
+		  m68000-*-*) target_cpu_default=0 ;;
+		esac
 	        ;;
 	m68k-bull-sysv*)		# Bull DPX/2
 		if [ x$gas = xyes ]
diff -ur orig-2.8.1/cp/lang-specs.h gcc-2.8.1/cp/lang-specs.h
--- orig-2.8.1/cp/lang-specs.h	Tue Nov 18 08:17:48 1997
+++ gcc-2.8.1/cp/lang-specs.h	Mon Apr 27 19:26:18 1998
@@ -44,7 +44,7 @@
 			    %{f*} %{+e*} %{aux-info*}\
 			    %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
 			    %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}}|\n\
-              %{!S:as %a %Y\
+             %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
                       %{!pipe:%g.s} %A\n }}}}"},
   {".ii", "@c++-cpp-output"},
@@ -55,6 +55,6 @@
 			    %{f*} %{+e*} %{aux-info*}\
 			    %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
 			    %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
-	            %{!S:as %a %Y\
+             %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 			    %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
 			    %{!pipe:%g.s} %A\n }}}}"},
diff -ur orig-2.8.1/cp/tree.c gcc-2.8.1/cp/tree.c
--- orig-2.8.1/cp/tree.c	Tue Feb  3 19:32:44 1998
+++ gcc-2.8.1/cp/tree.c	Mon Apr 27 19:27:34 1998
@@ -1673,6 +1673,7 @@
 #endif
 }
 
+#ifndef atarist
 /* This is used by the `assert' macro.  It is provided in libgcc.a,
    which `cc' doesn't know how to link.  Note that the C++ front-end
    no longer actually uses the `assert' macro (instead, it calls
@@ -1696,6 +1697,7 @@
   fflush (stderr);
   abort ();
 }
+#endif
 
 /* Return, as an INTEGER_CST node, the number of elements for TYPE
    (which is an ARRAY_TYPE).  This counts only elements of the top
diff -ur orig-2.8.1/dbxout.c gcc-2.8.1/dbxout.c
--- orig-2.8.1/dbxout.c	Thu Oct 23 12:03:02 1997
+++ gcc-2.8.1/dbxout.c	Mon Apr 27 19:28:32 1998
@@ -464,6 +464,10 @@
      and output them all, except for those already output.  */
 
   dbxout_typedefs (syms);
+
+  /* Make sure that gdb extensions, if desired, are used immediately for C++. */
+  if (use_gnu_debug_info_extensions && strcmp (lang_identify (), "cplusplus") == 0)
+    have_used_extensions = 1;
 }
 
 /* Output any typedef names for types described by TYPE_DECLs in SYMS,
diff -ur orig-2.8.1/gcc.c gcc-2.8.1/gcc.c
--- orig-2.8.1/gcc.c	Sat Feb 28 20:58:16 1998
+++ gcc-2.8.1/gcc.c	Tue Aug 11 16:07:22 1998
@@ -108,7 +108,9 @@
 
 /* By default there is no special suffix for executables.  */
 #ifdef EXECUTABLE_SUFFIX
+#ifndef atarist			/* do not append '.ttp' to the link name by default */
 #define HAVE_EXECUTABLE_SUFFIX
+#endif
 #else
 #define EXECUTABLE_SUFFIX ""
 #endif
@@ -279,6 +281,12 @@
 void fancy_abort ();
 char *xmalloc ();
 char *xrealloc ();
+
+#ifdef atarist
+#define read(fd,buf,size) \
+		_text_read(fd,buf,size)		/* this version of read() delete the CRs! */
+#endif
+
 
 /* Specs are strings containing lines, each of which (if not blank)
 is made up of a program name, and arguments separated by spaces.
@@ -612,7 +620,7 @@
 		   %{aux-info*}\
 		   %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
 		   %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
-              %{!S:as %a %Y\
+            %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
                       %{!pipe:%g.s} %A\n }}}}"},
   {"-",
@@ -647,7 +655,7 @@
 		   %{aux-info*}\
 		   %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
 		   %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
-              %{!S:as %a %Y\
+            %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
                       %{!pipe:%g.s} %A\n }}}}"},
   {".h", "@c-header"},
@@ -671,12 +679,12 @@
 			%{aux-info*}\
 			%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
 			%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
-		     %{!S:as %a %Y\
+	      %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 			     %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
 			     %{!pipe:%g.s} %A\n }}}}"},
   {".s", "@assembler"},
   {"@assembler",
-   "%{!M:%{!MM:%{!E:%{!S:as %a %Y\
+   "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
 		            %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
 			    %i %A\n }}}}"},
   {".S", "@assembler-with-cpp"},
@@ -689,7 +697,7 @@
         %{traditional-cpp:-traditional}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
-   "%{!M:%{!MM:%{!E:%{!S:as %a %Y\
+   "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
                     %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
 		    %{!pipe:%g.s} %A\n }}}}"},
 #include "specs.h"
@@ -714,7 +722,7 @@
 /* Don't generate -L options.  */
 static char *link_command_spec = "\
 %{!fsyntax-only: \
- %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
+ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{v} %{G} %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
 			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
 			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
 			%{static:} %{L*} %o\
@@ -726,14 +734,10 @@
 /* Use -L.  */
 static char *link_command_spec = "\
 %{!fsyntax-only: \
- %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
+ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{v} %{G} %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
 			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
-			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
-			%{static:} %{L*} %D %o\
-			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
-			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
-			%{T*}\
-			\n }}}}}}";
+			%{!A:%{!nostartfiles:%{!nostdlib:%S}}} %{static:}\
+			%{L*} %D %{T*} %o %{!nostdlib:%L %{!A:%E}}\n }}}}}}";
 #endif
 
 /* A vector of options to give to the linker.
@@ -2385,6 +2389,10 @@
   int have_o = 0;
   int lang_n_infiles = 0;
 
+#ifdef atarist
+  gcc_exec_prefix = getenv ("GNUEXEC");
+  if(gcc_exec_prefix == NULL)
+#endif
   gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX");
 
   n_switches = 0;
@@ -2476,8 +2484,12 @@
 	}
     }
 
+#ifdef atarist
+  temp = getenv ("GNULIB");
+#else
   /* Use LPATH like LIBRARY_PATH (for the CMU build program).  */
   temp = getenv ("LPATH");
+#endif
   if (temp && *cross_compile == '0')
     {
       char *startp, *endp;
@@ -3659,7 +3671,7 @@
 		    /* Copy the whole option.  */
 		    while (*y && *y != ' ' && *y != '\t')
 		      *x++ = *y++;
-		  else if (*y == ' ' || *y == '\t')
+		  else if ((*y == ' ') || (*y == '\t'))
 		    /* Copy whitespace to the result.  */
 		    *x++ = *y++;
 		  /* Don't copy other options.  */
@@ -3945,13 +3957,21 @@
 	    break;
 
 	  default:
+#if 1 /* atarist */
+	    fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
+		c, (p - spec - 1), spec);
+#endif
 	    abort ();
 	  }
 	break;
 
+#ifndef atarist
+      /* on the atari it is important to preserve backslash in spec */
+      /* so just let it go into default case */
       case '\\':
 	/* Backslash: treat next character as ordinary.  */
 	c = *p++;
+#endif
 
 	/* fall through */
       default:
@@ -4367,9 +4387,14 @@
   char *p;
   struct user_specs *uptr;
 
-  p = argv[0] + strlen (argv[0]);
-  while (p != argv[0] && p[-1] != '/' && p[-1] != DIR_SEPARATOR) --p;
-  programname = p;
+  if (argv[0][0] == '\0')
+  	 programname = "gcc";
+  else
+  {
+    p = argv[0] + strlen (argv[0]);
+    while (p != argv[0] && p[-1] != '/' && p[-1] != DIR_SEPARATOR) --p;
+    programname = p;
+  }
 
   if (signal (SIGINT, SIG_IGN) != SIG_IGN)
     signal (SIGINT, fatal_error);
@@ -4643,7 +4668,11 @@
 
       if (! strncmp (version_string, compiler_version, n)
 	  && compiler_version[n] == 0)
+#ifdef atarist
+	fprintf (stderr, "gcc version %s.%s\n", version_string, ATARI_PL);
+#else
 	fprintf (stderr, "gcc version %s\n", version_string);
+#endif
       else
 	fprintf (stderr, "gcc driver version %s executing gcc version %s\n",
 		 version_string, compiler_version);
diff -ur orig-2.8.1/toplev.c gcc-2.8.1/toplev.c
--- orig-2.8.1/toplev.c	Thu Feb 26 02:04:46 1998
+++ gcc-2.8.1/toplev.c	Tue Aug 11 16:06:54 1998
@@ -81,6 +81,11 @@
 #include "bc-emit.h"
 #include "except.h"
 
+#ifdef atarist
+#include <string.h>
+long _stksize = 1L;	/* 1 means malloc from own heap and keep 1/4 of memory */
+#endif
+
 #ifdef XCOFF_DEBUGGING_INFO
 #include "xcoffout.h"
 #endif
@@ -3859,6 +3864,18 @@
 	  else if (!strcmp (str, "dumpbase"))
 	    {
 	      dump_base_name = argv[++i];
+#ifdef atarist
+	      /* dump_base_name will typically be 'foo.c' here.
+	         Need to truncate at the '.', cause dots mean 
+	         something here
+	       */
+         {
+	        char * n = dump_base_name;
+           for ( ; ((*n) && (*n != '.')) ; )
+             n++;
+           *n = '\0';
+	      }
+#endif
 	    }
 	  else if (str[0] == 'd')
 	    {
@@ -4442,8 +4459,13 @@
      FILE *file;
      char *indent;
 {
+#ifdef atarist
+  fprintf (file, "%s%s%s version %s.%s", indent, *indent != 0 ? " " : "",
+	   language_string, version_string, ATARI_PL);
+#else
   fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
 	   language_string, version_string);
+#endif
   fprintf (file, " (%s)", TARGET_NAME);
 #ifdef __GNUC__
 #ifndef __VERSION__
@@ -4660,3 +4682,19 @@
     dwarf2out_undef (lineno, buffer);
 #endif /* DWARF2_DEBUGGING_INFO */
 }
+
+
+#ifdef atarist
+char *atari_filename_nondirectory(char *p)
+{
+    char *s;
+    
+    for(s = p + strlen(p); s != p; --s)
+    {
+	   if((*s == '/') || (*s == '\\'))
+	    break;
+    }
+    return (s == p) ? p : s+1;
+}
+
+#endif
