diff -2rcN gcc-2.2.2/Makefile.in my-gcc-2.2.2/Makefile.in *** gcc-2.2.2/Makefile.in Sun Jun 14 21:40:34 1992 --- my-gcc-2.2.2/Makefile.in Sat Jul 18 01:23:22 1992 *************** *** 385,389 **** _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ ! _varargs _eprintf _builtin_new _builtin_New _builtin_del \ _bb _shtab _clear_cache _trampoline __main _exit --- 385,389 ---- _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \ _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \ ! _varargs _eprintf _builtin_new _caps_New _builtin_del \ _bb _shtab _clear_cache _trampoline __main _exit diff -2rcN gcc-2.2.2/c-parse.y my-gcc-2.2.2/c-parse.y *** gcc-2.2.2/c-parse.y Wed Jun 10 04:25:30 1992 --- my-gcc-2.2.2/c-parse.y Fri Jul 17 22:37:53 1992 *************** *** 779,783 **** attrib : IDENTIFIER ! { if (strcmp (IDENTIFIER_POINTER ($1), "packed")) warning ("`%s' attribute directive ignored", IDENTIFIER_POINTER ($1)); --- 779,790 ---- attrib : IDENTIFIER ! { ! #ifdef HANDLE_ATTRIBUTE0 ! /* give the function a chance to validate further attributes */ ! if (HANDLE_ATTRIBUTE0 (IDENTIFIER_POINTER ($1)) || ! strcmp (IDENTIFIER_POINTER ($1), "packed")) ! #else ! if (strcmp (IDENTIFIER_POINTER ($1), "packed")) ! #endif warning ("`%s' attribute directive ignored", IDENTIFIER_POINTER ($1)); diff -2rcN gcc-2.2.2/cccp.c my-gcc-2.2.2/cccp.c *** gcc-2.2.2/cccp.c Sat Jun 6 21:46:01 1992 --- my-gcc-2.2.2/cccp.c Fri Jul 17 22:38:01 1992 *************** *** 40,43 **** --- 40,57 ---- #endif /* not EMACS */ + #ifdef amigados + /* since cpp uses alloca to store all its read files, this is quite deadly + on a system with non-automatic stackgrowth like amigados, so we better + turn it off now.. + + Note that it's not wise to generally inhibit __builtin_alloca, since + using the generic emulator entitels a serious (!) speed penalty, and + it's bad enough that we have to live with it in cccp, don't make cc1 + unbearably slow as well... */ + #undef alloca + + static int amigados_abs_file (); + #endif + #ifndef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/usr/include" *************** *** 137,141 **** --- 151,159 ---- extern struct tm *localtime (); extern int sys_nerr; + + #ifndef HAVE_STRERROR extern char *sys_errlist[]; + #define strerror(err) sys_errlist[err] + #endif #ifndef errno *************** *** 1683,1686 **** --- 1701,1707 ---- char *p1 = p; /* Discard all directory prefixes from P. */ + #ifdef FILE_NAME_NONDIRECTORY + p = FILE_NAME_NONDIRECTORY (p); + #else while (*p1) { if (*p1 == '/') *************** *** 1688,1691 **** --- 1709,1713 ---- p1++; } + #endif /* Output P, but remove known suffixes. */ len = strlen (p); *************** *** 3399,3403 **** if (!no_output && already_output == 0 && (kt->pass_thru ! || (kt->type == T_DEFINE && (dump_macros == dump_names || dump_macros == dump_definitions)))) { --- 3421,3425 ---- if (!no_output && already_output == 0 && (kt->pass_thru ! || ((kt->type == T_DEFINE || kt->type == T_UNDEF) && (dump_macros == dump_names || dump_macros == dump_definitions)))) { *************** *** 3702,3705 **** --- 3724,3739 ---- #ifndef VMS ep = rindex (nam, '/'); + + #ifdef amigados + /* amigados uses unix-style directory-filename separation, but + has VMS-style logicals as well */ + + if (ep == NULL) + { + ep = rindex (nam, ':'); + /* a ':' is part of the directory name, a '/' isn't ! */ + if (ep != NULL) ep++; + } + #endif /* amigados */ #else /* VMS */ ep = rindex (nam, ']'); *************** *** 3777,3781 **** --- 3811,3819 ---- /* If specified file name is absolute, just open it. */ + #ifndef amigados if (*fbeg == '/') { + #else + if (amigados_abs_filename (fbeg, flen)) { + #endif strncpy (fname, fbeg, flen); fname[flen] = 0; *************** *** 3800,3803 **** --- 3838,3845 ---- continue; strcpy (fname, searchptr->fname); + + #ifdef amigados + if (fname[strlen (fname) - 1] != ':') + #endif strcat (fname, "/"); fname[strlen (fname) + flen] = 0; *************** *** 7544,7548 **** if (errno < sys_nerr) ! fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]); else fprintf (stderr, "%s: undocumented I/O error\n", name); --- 7586,7590 ---- if (errno < sys_nerr) ! fprintf (stderr, "%s: %s\n", name, strerror (errno)); else fprintf (stderr, "%s: undocumented I/O error\n", name); *************** *** 8441,8447 **** char *name; { fprintf (stderr, "%s: ", progname); ! if (errno < sys_nerr) ! fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]); else fprintf (stderr, "%s: undocumented I/O error\n", name); --- 8483,8491 ---- char *name; { + int error = errno; + fprintf (stderr, "%s: ", progname); ! if (error < sys_nerr) ! fprintf (stderr, "%s: %s\n", name, strerror (error)); else fprintf (stderr, "%s: undocumented I/O error\n", name); *************** *** 8800,8801 **** --- 8844,8869 ---- #endif /* VMS */ + + + #ifdef amigados + + /* This function returns whether the LEN characters long filename FNAME + is an absolute path specification. */ + + static int + amigados_abs_filename (fname, len) + char *fname; + int len; + { + /* we're using ixemul.library, which treats `/foo' as `foo:', so + fname[0] is to be considered absolute as well */ + if (fname[0] == '/') + return 1; + + /* else do an index() on fname, but one which is limited to len characters */ + while (*fname && *fname != ':' && len) + fname++, len--; + + return *fname == ':'; + } + #endif /* amigados */ diff -2rcN gcc-2.2.2/config/amigados.c my-gcc-2.2.2/config/amigados.c *** gcc-2.2.2/config/amigados.c --- my-gcc-2.2.2/config/amigados.c Fri Jul 17 22:38:03 1992 *************** *** 0 **** --- 1,158 ---- + /* Definitions of target machine for GNU compiler. amiga 68000/68020 version. + Copyright (C) 1992 Free Software Foundation, Inc. + Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch). + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #include "m68k.c" + + /* 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. + + This function is used in base relative code generation. */ + + 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; + } + + + /* the rest of the file is to implement AmigaDOS specific keywords some day. + The approach used so far used __attribute__ for this, but this required + changes to c-parse.y as well as if we'd use the common keywords used + on commercial AmigaDOS C-compilers as well. So in the future I'll probably + switch to __saveds and __interrupt keywords as well. + + The rest of this file is currently ignored, because it's no longer + working with the current gcc version. */ + + #if not_yet_working + + #include "tree.h" + + struct attribute { + tree ident; + int saveds : 1, + interrupt : 1; + }; + + + static struct attribute *a_tab = 0; + static int a_index, a_size; + + void + add_attr_entry (attr) + struct attribute *attr; + { + if (! a_tab) + { + a_size = 10; + a_index = 0; + a_tab = (struct attribute *) xmalloc (a_size * sizeof (struct attribute)); + } + + if (a_index == a_size) + { + a_size <<= 1; + a_tab = (struct attribute *) xrealloc (a_tab, a_size * sizeof (struct attribute)); + } + + a_tab[a_index++] = *attr; + } + + + void + attr_do_saveds (function_ident) + tree function_ident; + { + struct attribute attr, *a; + int i; + + for (i = 0, a = a_tab; i < a_index; i++, a++) + if (a->ident == function_ident) + { + a->saveds = 1; + return; + } + + /* create a new entry for this function */ + attr.ident = function_ident; + attr.saveds = 1; + attr.interrupt = 0; + add_attr_entry (&attr); + } + + void + attr_do_interrupt (function_ident) + tree function_ident; + { + struct attribute attr, *a; + int i; + + for (i = 0, a = a_tab; i < a_index; i++, a++) + if (a->ident == function_ident) + { + /* __interrupt implies __saveds */ + a->saveds = 1; + a->interrupt = 1; + return; + } + + /* create a new entry for this function */ + attr.ident = function_ident; + attr.saveds = 1; + attr.interrupt = 1; + add_attr_entry (&attr); + } + + int + attr_does_saveds (function_name) + char *function_name; + { + tree ident = get_identifier (function_name); + struct attribute *attr; + int i; + + for (i = 0, attr = a_tab; i < a_index; i++, attr++) + if (attr->ident == ident) + return attr->saveds; + + return 0; + } + + int + attr_does_interrupt (function_name) + char *function_name; + { + tree ident = get_identifier (function_name); + struct attribute *attr; + int i; + + for (i = 0, attr = a_tab; i < a_index; i++, attr++) + if (attr->ident == ident) + return attr->interrupt; + + return 0; + } + + #endif diff -2rcN gcc-2.2.2/config/amigados.h my-gcc-2.2.2/config/amigados.h *** gcc-2.2.2/config/amigados.h --- my-gcc-2.2.2/config/amigados.h Fri Jul 17 22:38:05 1992 *************** *** 0 **** --- 1,377 ---- + /* Definitions of target machine for GNU compiler. amiga 68000/68020 version. + Copyright (C) 1992 Free Software Foundation, Inc. + Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch). + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #include "m68k.h" + + /* See tm-m68k.h. 0 means 68000 without 68881. */ + + #ifndef TARGET_DEFAULT + #define TARGET_DEFAULT 0 + #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. */ + + #if TARGET_DEFAULT & 02 + + /* -m68881 is the default */ + #define CPP_SPEC \ + "%{!msoft-float:-D__HAVE_68881__ }\ + %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}" + + #else + + /* -msoft-float is the default, assume -mc68000 as well */ + #define CPP_SPEC \ + "%{m68881:-D__HAVE_68881__ }\ + %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}" + + #endif + + /* -m68000 requires special flags to the assembler. */ + + #if TARGET_DEFAULT & 01 + + #define ASM_SPEC \ + "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}} %{msmall-code:-l} " + + #else + + #define ASM_SPEC \ + "%{m68020:-mc68020}%{mc68020:-mc68020}%{!mc68020:%{!m68020:-mc68010}} %{msmall-code:-l} " + + #endif + + /* amiga/amigados are the new "standard" defines for the Amiga, MCH_AMIGA + * was used before and is included for compatibility reasons */ + + #define CPP_PREDEFINES "-Dmc68000 -Damiga -Damigados -DMCH_AMIGA -DAMIGA" + + /* Chose the right startup file, depending on whether we use base relative code, + base relative code with automatic relocation (-resident), or plain crt0.o. + + Profiling is currently only available for plain startup. + mcrt0.o does not (yet) exist. */ + + #define STARTFILE_SPEC \ + "%{resident:%{!fbaserel:-L gcc:blib }}%{fbaserel:-L gcc:blib }\ + %{resident:rcrt0.o%s}%{!resident:%{!fbaserel:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}%{fbaserel:%{pg:bgcrt0.o%s}%{!pg:%{p:bmcrt0.o%s}%{!p:bcrt0.o%s}}}}" + + + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + + /* if debugging, tell the linker to output amiga-hunk symbols *and* + a BSD compatible debug hunk (which will probably change in the future, it's not + tremendously useful in its current state). */ + + #define LINK_SPEC "%{g:-amiga-debug-hunk} %{fbaserel:-databss-together} %{resident:-databss-together -datadata-reloc} " + + #define CC1_SPEC "%{resident:-fbaserel} " + + #define CC1PLUS_SPEC "%{resident:-fbaserel} " + + /* Omit frame pointer at high optimization levels. (This doesn't hurt, since + GDB doesn't work under AmigaDOS at the moment anyway..) */ + + #define OPTIMIZATION_OPTIONS(OPTIMIZE) \ + { \ + if (OPTIMIZE >= 2) \ + flag_omit_frame_pointer = 1; \ + } + + /* provide a dummy entry for the small-code switch. This is currently only + needed by the assembler (explanations: m68k.h), but will be used by cc1 + to output 16bit pc-relative code later. */ + + #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}, \ + { "fpa", 0100}, \ + { "nofpa", -0100}, \ + { "sky", 0200}, \ + { "nosky", -0200}, \ + { "68040", 0407}, \ + { "68030", -01400}, \ + { "68030", 7}, \ + { "68040-only", 01000}, \ + { "small-code", 0 }, \ + { "", TARGET_DEFAULT}} + + /* Every structure or union's size must be a multiple of 2 bytes. */ + + #define STRUCTURE_SIZE_BOUNDARY 16 + + /* This is (almost;-)) BSD, so it wants DBX format. */ + + #define DBX_DEBUGGING_INFO + + /* Allow folding division by zero. */ + #define REAL_INFINITY + + /* This is how to output an assembler line defining a `double' constant. */ + + #undef ASM_OUTPUT_DOUBLE + #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ + { \ + if (REAL_VALUE_ISINF (VALUE)) \ + fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \ + else if (isnan (VALUE)) \ + { \ + union { double d; long l[2];} t; \ + t.d = (VALUE); \ + fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \ + } \ + else \ + fprintf (FILE, "\t.double 0r%.17g\n", VALUE); \ + } + + /* This is how to output an assembler line defining a `float' constant. */ + + #undef ASM_OUTPUT_FLOAT + #define ASM_OUTPUT_FLOAT(FILE,VALUE) \ + { \ + if (REAL_VALUE_ISINF (VALUE)) \ + fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \ + else if (isnan (VALUE)) \ + { \ + union { float f; long l;} t; \ + t.f = (VALUE); \ + fprintf (FILE, "\t.long 0x%lx\n", t.l); \ + } \ + else \ + fprintf (FILE, "\t.single 0r%.9g\n", VALUE); \ + } + + /* This is how to output an assembler lines defining floating operands. + There's no way to output a NaN's fraction, so we lose it. */ + + #undef ASM_OUTPUT_FLOAT_OPERAND + #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \ + (REAL_VALUE_ISINF ((VALUE)) \ + ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \ + : (VALUE) == -0.0 \ + ? asm_fprintf (FILE, "%I0r-0.0") \ + : asm_fprintf (FILE, "%I0r%.9g", (VALUE))) + + #undef ASM_OUTPUT_DOUBLE_OPERAND + #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ + (REAL_VALUE_ISINF ((VALUE)) \ + ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \ + : (VALUE) == -0.0 \ + ? asm_fprintf (FILE, "%I0r-0.0") \ + : asm_fprintf (FILE, "%I0r%.17g", (VALUE))) + + + /* use A5 as framepointer instead of A6, this makes A6 available as a + general purpose register, and can thus be used without problems in + direct library calls. */ + + #undef FRAME_POINTER_REGNUM + #define FRAME_POINTER_REGNUM 13 + #undef ARG_POINTER_REGNUM + #define ARG_POINTER_REGNUM 13 + + /* we use A4 for this, not A5, which is the framepointer */ + #undef PIC_OFFSET_TABLE_REGNUM + #define PIC_OFFSET_TABLE_REGNUM 12 + + /* setup a default shell return value for those (gazillion..) programs that + (inspite of ANSI-C) declare main() to be void (or even VOID...) and thus + cause the shell to randomly caugh upon executing such programs (contrary + to Unix, AmigaDOS scripts are terminated with an error if a program returns + with an error code above the `error' or even `failure' level + (which is configurable with the FAILAT command) */ + + #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node) + + /* we do have an ansi-compliant c-library ;-) */ + #define HAVE_VPRINTF + #define HAVE_VFPRINTF + #define HAVE_PUTENV + #define HAVE_STRERROR + #define HAVE_ATEXIT + + /* given that symbolic_operand(X), return TRUE if no special + base relative relocation is necessary */ + + #define LEGITIMATE_BASEREL_OPERAND_P(X) \ + (flag_pic >= 3 && read_only_operand (X)) + + #undef LEGITIMATE_PIC_OPERAND_P + #define LEGITIMATE_PIC_OPERAND_P(X) \ + (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X)) + + + /* Define this macro if references to a symbol must be treated + differently depending on something about the variable or + function named by the symbol (such as what section it is in). + + The macro definition, if any, is executed immediately after the + rtl for DECL or other node is created. + The value of the rtl will be a `mem' whose address is a + `symbol_ref'. + + The usual thing for this macro to do is to a flag in the + `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified + name string in the `symbol_ref' (if one bit is not enough + information). + + On the Amiga we use this to indicate if a symbol is in text or + data space. */ + + #define ENCODE_SECTION_INFO(DECL)\ + do \ + { \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \ + else \ + { \ + rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ + ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ + if (RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl)) \ + SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; \ + } \ + } \ + while (0) + + #undef SELECT_RTX_SECTION + #define SELECT_RTX_SECTION(MODE, X) readonly_data_section (); + + /* according to varasm.c, RELOC referrs *only* to whether constants (!) + are addressed by address. This doesn't matter in baserelative code, + so we allow (inspite of flag_pic) readonly_data_section() in that + case */ + + #undef SELECT_SECTION + #define SELECT_SECTION(DECL, RELOC) \ + { \ + if (TREE_CODE (DECL) == STRING_CST) \ + { \ + if (! flag_writable_strings) \ + readonly_data_section (); \ + else \ + data_section (); \ + } \ + else if (TREE_CODE (DECL) == VAR_DECL) \ + { \ + if ((flag_pic && flag_pic < 3 && RELOC) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ + data_section (); \ + else \ + readonly_data_section (); \ + } \ + else \ + readonly_data_section (); \ + } + + + + #if not_yet_working + + /* starting support for amiga specific keywords + * -------------------------------------------- + */ + + /* validate attributes that don't take a parameter. Currently we support + * __attribute__ (saveds) and __attribute__ (interrupt) + */ + #define HANDLE_ATTRIBUTE0(attr) \ + (strcmp(attr, "saveds") != 0 && strcmp(attr, "interrupt") != 0) + + /* (c-common.c) + * install additional attributes + */ + #define HANDLE_EXTRA_ATTRIBUTES(a) \ + if (TREE_VALUE (a) != 0 \ + && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE \ + && TREE_VALUE (a) == get_identifier ("saveds")) \ + { \ + if (TREE_CODE (decl) != FUNCTION_DECL) \ + { \ + warning_with_decl (decl, \ + "saveds attribute specified for non-function `%s'"); \ + return; \ + } \ + \ + attr_do_saveds (DECL_NAME (decl)); \ + } \ + else if (TREE_VALUE (a) != 0 \ + && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE \ + && TREE_VALUE (a) == get_identifier ("interrupt")) \ + { \ + if (TREE_CODE (decl) != FUNCTION_DECL) \ + { \ + warning_with_decl (decl, \ + "saveds attribute specified for non-function `%s'"); \ + return; \ + } \ + \ + attr_do_interrupt (DECL_NAME (decl)); \ + } \ + + + #define PROLOGUE_EXTRA_SAVE(mask) \ + { extern char *current_function_name; \ + /* saveds makes the function preserve d1/a0/a1 as well */ \ + if (attr_does_saveds (current_function_name)) \ + mask |= 0x40c0; } \ + + + #define EPILOGUE_EXTRA_RESTORE(mask, nregs) \ + { extern char *current_function_name; \ + /* restore those extra registers */ \ + if (attr_does_saveds (current_function_name)) \ + { \ + mask |= 0x0302; \ + nregs += 3; \ + } } \ + + + #define EPILOGUE_EXTRA_BARRIER_KLUDGE(stream) \ + { extern char *current_function_name; \ + /* PLEASE Help! how is this done cleaner?? */ \ + if (attr_does_saveds (current_function_name)) \ + { \ + fprintf (stderr, \ + "warning: couldn't cleanup `saveds'-stack in `%s'.\n"); \ + fprintf (stderr, \ + " this is only ok, if the function never returns!\n"); \ + } } \ + + + #define EPILOGUE_EXTRA_TEST(stream) \ + { extern char *current_function_name; \ + /* with the interrupt-attribute, we have to set the cc before rts */ \ + if (attr_does_interrupt (current_function_name)) \ + asm_fprintf (stream, "\ttstl %s\n", reg_names[0]); } \ + + #endif diff -2rcN gcc-2.2.2/config/m68k.c my-gcc-2.2.2/config/m68k.c *** gcc-2.2.2/config/m68k.c Wed Jun 10 04:41:20 1992 --- my-gcc-2.2.2/config/m68k.c Fri Jul 17 22:38:08 1992 *************** *** 57,61 **** finalize_pic () { ! if (flag_pic && current_function_uses_pic_offset_table) emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); } --- 57,61 ---- finalize_pic () { ! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table) emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx)); } *************** *** 177,180 **** --- 177,183 ---- num_saved_regs--; } + #ifdef PROLOGUE_EXTRA_SAVE + PROLOGUE_EXTRA_SAVE (mask); + #endif if (num_saved_regs <= 2) { *************** *** 205,209 **** #endif } ! if (flag_pic && current_function_uses_pic_offset_table) { #ifdef MOTOROLA --- 208,212 ---- #endif } ! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table) { #ifdef MOTOROLA *************** *** 273,276 **** --- 276,282 ---- about which function the pc is in at this address. */ asm_fprintf (stream, "\tnop\n"); + #ifdef EPILOGUE_EXTRA_BARRIER_KLUDGE + EPILOGUE_EXTRA_BARRIER_KLUDGE(stream); + #endif return; } *************** *** 303,306 **** --- 309,315 ---- mask |= 1 << regno; } + #ifdef EPILOGUE_EXTRA_RESTORE + EPILOGUE_EXTRA_RESTORE(mask, nregs); + #endif offset = foffset + nregs * 4; if (offset + fsize >= 0x8000 *************** *** 505,508 **** --- 514,520 ---- } } + #ifdef EPILOGUE_EXTRA_TEST + EPILOGUE_EXTRA_TEST(stream); + #endif if (current_function_pops_args) asm_fprintf (stream, "\trtd %0I%d\n", current_function_pops_args); *************** *** 795,807 **** if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF) { if (reg == 0) abort (); ! pic_ref = gen_rtx (MEM, Pmode, ! gen_rtx (PLUS, Pmode, ! pic_offset_table_rtx, orig)); current_function_uses_pic_offset_table = 1; RTX_UNCHANGING_P (pic_ref) = 1; emit_move_insn (reg, pic_ref); return reg; } --- 807,829 ---- 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 (); ! 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; RTX_UNCHANGING_P (pic_ref) = 1; emit_move_insn (reg, pic_ref); + return reg; } *************** *** 832,835 **** --- 854,858 ---- /* Likewise, should we set special REG_NOTEs here? */ } + return pic_ref; } *************** *** 1884,1887 **** --- 1907,1914 ---- 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 ((flag_pic == 4) && (breg == pic_offset_table_rtx)) + fprintf (file, ":L"); } fprintf (file, "(%s", reg_names[REGNO (breg)]); *************** *** 1899,1902 **** --- 1926,1933 ---- 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 ((flag_pic == 4) && (breg == pic_offset_table_rtx)) + fprintf (file, ":L"); } if (addr != 0 && ireg != 0) diff -2rcN gcc-2.2.2/config/m68k.h my-gcc-2.2.2/config/m68k.h *** gcc-2.2.2/config/m68k.h Wed Jun 10 04:42:15 1992 --- my-gcc-2.2.2/config/m68k.h Fri Jul 17 22:38:11 1992 *************** *** 327,333 **** #define CONDITIONAL_REGISTER_USAGE \ ! { \ ! if (flag_pic) \ ! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } --- 327,336 ---- #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; \ } diff -2rcN gcc-2.2.2/config/m68k.md my-gcc-2.2.2/config/m68k.md *** gcc-2.2.2/config/m68k.md Wed Jun 10 04:43:59 1992 --- my-gcc-2.2.2/config/m68k.md Fri Jul 17 22:38:16 1992 *************** *** 705,715 **** if (flag_pic && symbolic_operand (operands[1], SImode)) { ! /* The source is an address which requires PIC relocation. ! Call legitimize_pic_address with the source, mode, and a relocation ! register (a new pseudo, or the final destination if reload_in_progress ! is set). Then fall through normally */ ! extern rtx legitimize_pic_address(); ! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); ! operands[1] = legitimize_pic_address (operands[1], SImode, temp); } }") --- 705,720 ---- 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 ! register (a new pseudo, or the final destination if reload_in_progress ! is set). Then fall through normally */ ! extern rtx legitimize_pic_address(); ! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); ! operands[1] = legitimize_pic_address (operands[1], SImode, temp); ! } } }") *************** *** 1712,1717 **** /* These insns can result from reloads to access stack slots over 64k from the frame pointer. */ ! if (GET_CODE (operands[2]) == CONST_INT ! && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000) return \"move%.l %2,%0\;add%.l %1,%0\"; #ifdef SGS --- 1717,1723 ---- /* These insns can result from reloads to access stack slots over 64k from the frame pointer. */ ! if (((GET_CODE (operands[2]) == CONST_INT ! && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)) ! || (flag_pic == 4 && operands[1] == pic_offset_table_rtx)) return \"move%.l %2,%0\;add%.l %1,%0\"; #ifdef SGS *************** *** 4645,4649 **** " { ! if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) operands[0] = gen_rtx (MEM, GET_MODE (operands[0]), force_reg (Pmode, XEXP (operands[0], 0))); --- 4651,4655 ---- " { ! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) operands[0] = gen_rtx (MEM, GET_MODE (operands[0]), force_reg (Pmode, XEXP (operands[0], 0))); *************** *** 4656,4660 **** ;; Operand 1 not really used on the m68000. ! "! flag_pic" "* #ifdef MOTOROLA --- 4662,4666 ---- ;; Operand 1 not really used on the m68000. ! "(! flag_pic || flag_pic >= 3)" "* #ifdef MOTOROLA *************** *** 4671,4675 **** ;; Operand 1 not really used on the m68000. ! "flag_pic" "* return \"jsr %0\"; --- 4677,4681 ---- ;; Operand 1 not really used on the m68000. ! "(flag_pic && flag_pic < 3)" "* return \"jsr %0\"; *************** *** 4687,4691 **** " { ! if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) operands[1] = gen_rtx (MEM, GET_MODE (operands[1]), force_reg (Pmode, XEXP (operands[1], 0))); --- 4693,4697 ---- " { ! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) operands[1] = gen_rtx (MEM, GET_MODE (operands[1]), force_reg (Pmode, XEXP (operands[1], 0))); *************** *** 4698,4702 **** (match_operand:SI 2 "general_operand" "g")))] ;; Operand 2 not really used on the m68000. ! "! flag_pic" "* #ifdef MOTOROLA --- 4704,4708 ---- (match_operand:SI 2 "general_operand" "g")))] ;; Operand 2 not really used on the m68000. ! "(! flag_pic || flag_pic >= 3)" "* #ifdef MOTOROLA *************** *** 4713,4717 **** (match_operand:SI 2 "general_operand" "g")))] ;; Operand 2 not really used on the m68000. ! "flag_pic" "* return \"jsr %1\"; --- 4719,4723 ---- (match_operand:SI 2 "general_operand" "g")))] ;; Operand 2 not really used on the m68000. ! "(flag_pic && flag_pic < 3)" "* return \"jsr %1\"; diff -2rcN gcc-2.2.2/config/t-amigados my-gcc-2.2.2/config/t-amigados *** gcc-2.2.2/config/t-amigados --- my-gcc-2.2.2/config/t-amigados Fri Jul 17 22:38:18 1992 *************** *** 0 **** --- 1,81 ---- + # compilation rules for target amigados. We generate two additional things: + # libngcc.a: a `normal' library, the automatically generated libgcc.a is + # base relative (which is the right thing, since it's used to + # generate further generations of compilers). + # gccs: a gcc calling ssytem() instead of forking. This makes it more + # system conformant, at the cost of reduced functionality (no + # -pipe option). + + # the provided file is POSIX compliant + LIMITS_H = + + # we don't need a libgcc1, it's all in ixemul.library + LIBGCC1 = libgcc1.null + + # use flags that don't generate base relative objects. So -resident + # would be a bad idea.. + LIBNGCC2_CFLAGS = -O2 $(INTERNAL_CFLAGS) $(CFLAGS) -B./ + + # this is later copied into gcc:compilers/amiga//libgcc.a, whereas + # libgcc.a is copied into gcc:blib/libgcc.a, which is searched first if we're + # compiling/linking base relative + EXTRA_PARTS = libngcc.a + + # this includes the knowledge that target amigados doesn't need + # libgcc1.a at all + libngcc.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \ + longlong.h gbl-ctors.h config.status + # Actually build it in tmplibngcc.a, then rename at end, + # so that libngcc.a itself remains nonexistent if compilation is aborted. + -rm -f tmplibngcc.a + # -e causes any failing command to make this rule fail. + # -e doesn't work in certain shells, so we test $$? as well. + set -e; \ + for name in $(LIB2FUNCS); \ + do \ + echo $${name}; \ + $(GCC_FOR_TARGET) $(LIBNGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ + $(srcdir)/libgcc2.c -o $${name}.o; \ + if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ + $(AR) $(AR_FLAGS) tmplibngcc.a $${name}.o; \ + rm -f $${name}.o; \ + done + # Some shells crash when a loop has no items. + # So make sure there is always at least one--`..'. + # Then ignore it. + # We don't use -e here because there are if statements + # that should not make the command give up when the if condition is false. + # Instead, we test for failure after each command where it matters. + -for file in .. $(LIB2FUNCS_EXTRA); \ + do \ + if [ x$${file} != x.. ]; then \ + name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \ + echo $${name}; \ + if [ $${name}.asm = $${file} ]; then \ + cp $${file} $${name}.s; file=$${name}.s; \ + if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ + else true; fi; \ + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \ + if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ + $(AR) $(AR_FLAGS) tmplibngcc.a $${name}.o; \ + rm -f $${name}.[so]; \ + else true; \ + fi; \ + done + mv tmplibngcc.a libngcc.a + ranlib libngcc.a + + T_CPPFLAGS = -DAMIGADOS_FORK_GCC + # the default gcc (xgcc) specifies -DAMIGADOS_FORK_GCC. This gcc (gccs) does not. + EXTRA_PASSES = gccs + + gccs: gccs.o version.o $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gccs gccs.o version.o $(LIBS) + + # omit the T_CPPFLAGS here on purpose to get rid of -DAMIGADOS_FORK_GCC + gccs.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h + $(CC) $(ALL_CFLAGS) $(CPPFLAGS) $(X_CPPFLAGS) $(INCLUDES) \ + -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \ + -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \ + -DDEFAULT_TARGET_MACHINE=\"$(target)\" \ + -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -o gccs.o diff -2rcN gcc-2.2.2/config/x-amigados my-gcc-2.2.2/config/x-amigados *** gcc-2.2.2/config/x-amigados --- my-gcc-2.2.2/config/x-amigados Fri Jul 17 22:38:20 1992 *************** *** 0 **** --- 1,50 ---- + # building under amigados requires an already working gcc. You can of course + # try to reinvent the wheel, get sun2manx and try to do a crosscompile from a + # sun3, like I did some years ago... + CC = gccv # this is a gcc compiled with AMIGADOS_FORK_GCC + # if your gcc has not been compiled with -DAMIGADOS_FORK_GCC, then don't use + # -pipe! (see also t-amigados !) + # The -fno-builtin is necessary, or gcc uses the builtin alloca() by default, + # and we can't undef it for cpp + X_CFLAGS = -O2 -resident -pipe -fno-builtin + + exec_prefix = gcc:compilers + bindir = gcc:bin + libdir = gcc:lib + manext = .0 + mandir = gcc:man/man1 + + # don't compile with debugging, as long as there is no debugger... + LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS) + + # we really shouldn't specify CFLAGS from here, but there's no other way + # to get rid of the `-g' indoctrinated by Makefile.in... + CFLAGS = + + RANLIB_TEST = true + RANLIB = ranlib + + # override the default compilation rule for libgcc.a, since the original + # rule doesn't work well with the amigados ksh (the subshell cd'ing into + # tmplibgcc is still running when the rm -fr tmplibgcc is started, and at + # that point trying to remove the directory fails because the previous + # process still keeps a lock (its current directory) to that directory). + + # Combine the various libraries into a single library, libgcc.a. + libgcc.a: $(LIBGCC1) $(LIBGCC2) + -rm -rf tmplibgcc.a libgcc.a tmpcopy + mkdir tmpcopy + -if [ x$(LIBGCC1) != x ]; \ + then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \ + else true; \ + fi + # the cd .. make sure there's no lock left on tmpcopy (this is actually a + # bug in ixemul.library, but I can't get around it currently because it + # involves an OS bug which is beyond my capabilities to fix...) + (cd tmpcopy; $(AR) x ../$(LIBGCC2); cd ..; /c/wait 2) + (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o; cd ..; /c/wait 2) + rm -rf tmpcopy + -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi + # Actually build it in tmplibgcc.a, then rename at end, + # so that libgcc.a itself remains nonexistent if compilation is aborted. + mv tmplibgcc.a libgcc.a diff -2rcN gcc-2.2.2/config/xm-amigados.h my-gcc-2.2.2/config/xm-amigados.h *** gcc-2.2.2/config/xm-amigados.h --- my-gcc-2.2.2/config/xm-amigados.h Fri Jul 17 22:38:22 1992 *************** *** 0 **** --- 1,234 ---- + /* Configuration for GNU C-compiler for Commodore Amiga, running AmigaDOS. + Copyright (C) 1992 Free Software Foundation, Inc. + Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch). + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + /* first include the generic header, then modify some parts.. */ + + #include "xm-m68k.h" + + #undef GCC_INCLUDE_DIR + #define GCC_INCLUDE_DIR ":GCC_INCLUDE_DIR is not used under AmigaDOS!:" + + /* use this list of header files instead of the Unix'ish default */ + #define INCLUDE_DEFAULTS \ + { \ + { "gcc:g++-include", 1}, \ + { "gcc:gcc-include", 0}, /* gcc-specific changes to system headers. none currently.. */ \ + { "gcc:os-include", 0}, /* here go amiga specific headers */ \ + { "gcc:include", 0}, /* here go the usual headers */ \ + { 0, 0} \ + } + + + /* here live the compiler passes like cc1, cc1plus, cpp etc */ + #undef STANDARD_EXEC_PREFIX + #define STANDARD_EXEC_PREFIX "gcc:compilers/" + + /* here live (%|b|r)crt0.o and different flavors of link-libraries */ + #undef STANDARD_STARTFILE_PREFIX + #define STANDARD_STARTFILE_PREFIX "gcc:lib/" + + /* the `compilers' place looks better, since we have the machine/version tree + there, and not in `lib'. */ + #undef STD_PROTO_DIR + #define STD_PROTO_DIR STANDARD_EXEC_PREFIX + + /* Fork one piped subcommand. SEARCH_FLAG is the system call to use + (either execv or execvp). ARGV is the arg vector to use. + NOT_LAST is nonzero if this is not the last subcommand + (i.e. its output should be piped to the next one.) */ + + #ifndef AMIGADOS_FORK_GCC + /* this version uses a more or less amigados-conformant way of running a + program (in the context of the parent). If you want to use -pipe however, + you'll have to use the vfork() version afterwards. */ + + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \ + ({char *_argline; \ + int _arglinelength, _i; \ + \ + for (_i = 1, _arglinelength=0; ARGV[_i]; ++_i) \ + _arglinelength += strlen(ARGV[_i]) + 1; \ + \ + _arglinelength += strlen(PROGRAM) + 1; \ + \ + if (!(_argline = (char *)alloca(_arglinelength))) \ + pfatal_with_name ("alloca"); \ + \ + strcpy(_argline, PROGRAM); \ + for (_i = 1; ARGV[_i]; ++_i) \ + { \ + strcat(_argline, " "); \ + strcat(_argline, ARGV[_i]); \ + } \ + \ + ssystem(_argline); }) \ + + #define PEXECUTE_RESULT(STATUS, COMMAND) \ + ({ STATUS = COMMAND.pid; }) + + #else + + /* the vfork() version. This one has the drawback, that gcc is not + interruptible when started from make, since ixemul.library doesn't yet + propagate ^C to subprocesses. */ + + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \ + ({int (*_func)() = (SEARCH_FLAG ? execv : execvp); \ + int _pid; \ + int _pdes[2]; \ + int _input_desc = last_pipe_input; \ + int _output_desc = STDOUT_FILE_NO; \ + int _retries, _sleep_interval, _result; \ + \ + /* If this isn't the last process, make a pipe for its output, \ + and record it as waiting to be the input to the next process. */ \ + \ + if (NOT_LAST) \ + { \ + if (pipe (_pdes) < 0) \ + pfatal_with_name ("pipe"); \ + _output_desc = _pdes[WRITE_PORT]; \ + last_pipe_input = _pdes[READ_PORT]; \ + } \ + else \ + last_pipe_input = STDIN_FILE_NO; \ + \ + /* Fork a subprocess; wait and retry if it fails. */ \ + _sleep_interval = 1; \ + for (_retries = 0; _retries < 4; _retries++) \ + { \ + _pid = vfork (); \ + if (_pid >= 0) \ + break; \ + sleep (_sleep_interval); \ + _sleep_interval *= 2; \ + } \ + \ + switch (_pid) \ + { \ + case -1: \ + pfatal_with_name ("vfork"); \ + /* NOTREACHED */ \ + _result = 0; \ + break; \ + \ + case 0: /* child */ \ + /* Move the input and output pipes into place, if nec. */ \ + if (_input_desc != STDIN_FILE_NO) \ + { \ + close (STDIN_FILE_NO); \ + dup (_input_desc); \ + close (_input_desc); \ + } \ + if (_output_desc != STDOUT_FILE_NO) \ + { \ + close (STDOUT_FILE_NO); \ + dup (_output_desc); \ + close (_output_desc); \ + } \ + \ + /* Close the parent's descs that aren't wanted here. */ \ + if (last_pipe_input != STDIN_FILE_NO) \ + close (last_pipe_input); \ + \ + /* Exec the program. */ \ + (*_func) (PROGRAM, ARGV); \ + perror_exec (PROGRAM); \ + exit (-1); \ + /* NOTREACHED */ \ + _result = 0; \ + break; \ + \ + default: \ + /* In the parent, after forking. \ + Close the descriptors that we made for this child. */ \ + if (_input_desc != STDIN_FILE_NO) \ + close (_input_desc); \ + if (_output_desc != STDOUT_FILE_NO) \ + close (_output_desc); \ + \ + /* Return child's process number. */ \ + _result = _pid; \ + break; \ + } \ + _result; }) \ + + #define PEXECUTE_RESULT(STATUS, COMMAND) \ + ({ wait (& STATUS); }) + + #endif /* AMIGADOS_FORK_GCC */ + + /* the following macros are stolen more or less from xm-vms.h ... */ + + /* This macro is used to help compare filenames in cp-lex.c. + + We also need to make sure that the names are all lower case, because + we must be able to compare filenames to determine if a file implements + a class. */ + + #define FILE_NAME_NONDIRECTORY(C) \ + ({ \ + char * pnt_ = (C), * pnt1_; \ + pnt1_ = pnt_ - 1; \ + while (*++pnt1_) \ + if ((*pnt1_ >= 'A' && *pnt1_ <= 'Z')) *pnt1_ |= 0x20; \ + pnt1_ = rindex (pnt_, '/'); \ + pnt1_ = (pnt1_ == 0 ? rindex (pnt_, ':') : pnt1_); \ + (pnt1_ == 0 ? pnt_ : pnt1_ + 1); \ + }) + + /* Macro to generate the name of the cross reference file. The standard + one does not work, since it was written assuming that the conventions + of a unix style filesystem will work on the host system. + + Contrary to VMS, I'm using the original unix filename, there's no reason + not to use this under AmigaDOS. */ + + #define XREF_FILE_NAME(BUFF, NAME) \ + s = FILE_NAME_NONDIRECTORY (NAME); \ + if (s == NAME) sprintf(BUFF, ".%s.gxref", NAME); \ + else { \ + unsigned char ch = *s; /* could be Latin1 char.. */ \ + /* temporary: cut the filename from the directory */\ + *s = 0; \ + sprintf (BUFF, "%s.%c%s.gxref", NAME, ch, s+1); \ + /* and restore the filename */ \ + *s = ch; \ + } \ + + /* Macro that is used in cp-xref.c to determine whether a file name is + absolute or not. + + This checks for both, '/' as first character, since we're running under + ixemul.library which provides for this unix'ism, and for the usual + logical-terminator, ':', somewhere in the filename. */ + + #define FILE_NAME_ABSOLUTE_P(NAME) (NAME[0] == '/' || index(NAME, ':')) + + + /* the colon conflicts with the name space of logicals */ + + #define PATH_SEPARATOR ',' + + /* AmigaDOS handles rename(2) *much* better than any link(2)/unlink(2) + hacks. It's actually the inverse case as on Unix. rename(2) was always + there, link(2) is new with OS 2.0 */ + + #define HAVE_rename 1 diff -2rcN gcc-2.2.2/configure my-gcc-2.2.2/configure *** gcc-2.2.2/configure Thu Jun 11 19:46:42 1992 --- my-gcc-2.2.2/configure Fri Jul 17 22:38:41 1992 *************** *** 359,362 **** --- 359,369 ---- xmake_file=x-sparcv4 ;; + m68k-*-amigados) + xm_file=xm-amigados.h + out_file=amigados.c + tm_file=amigados.h + tmake_file=t-amigados + xmake_file=x-amigados + ;; sparc-*-solaris2*) xm_file=xm-spcv4.h diff -2rcN gcc-2.2.2/expr.c my-gcc-2.2.2/expr.c *** gcc-2.2.2/expr.c Wed Jun 3 19:42:57 1992 --- my-gcc-2.2.2/expr.c Fri Jul 17 22:38:46 1992 *************** *** 1697,1700 **** --- 1697,1706 ---- argvec = (struct arg *) alloca (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, (tree)0, fun); diff -2rcN gcc-2.2.2/gcc.c my-gcc-2.2.2/gcc.c *** gcc-2.2.2/gcc.c Wed Jun 10 21:23:54 1992 --- my-gcc-2.2.2/gcc.c Fri Jul 17 22:38:52 1992 *************** *** 87,91 **** --- 87,95 ---- extern int errno, sys_nerr; + #ifndef HAVE_STRERROR + /* provide a cheap strerror() emulator for those that don't have it */ extern char *sys_errlist[]; + #define strerror(err) sys_errlist[err] + #endif extern int execv (), execvp (); *************** *** 1058,1061 **** --- 1062,1068 ---- if (base == (char *)0) { + #ifdef amigados + base = "ram:"; + #else if (access ("/usr/tmp", R_OK | W_OK) == 0) base = "/usr/tmp/"; *************** *** 1062,1065 **** --- 1069,1073 ---- else base = "/tmp/"; + #endif } } *************** *** 1068,1072 **** temp_filename = xmalloc (len + sizeof("/ccXXXXXX")); strcpy (temp_filename, base); ! if (len > 0 && temp_filename[len-1] != '/') temp_filename[len++] = '/'; strcpy (temp_filename + len, "ccXXXXXX"); --- 1076,1084 ---- temp_filename = xmalloc (len + sizeof("/ccXXXXXX")); strcpy (temp_filename, base); ! if (len > 0 && temp_filename[len-1] != '/' ! #ifdef amigados ! && temp_filename[len-1] != ':' ! #endif ! ) temp_filename[len++] = '/'; strcpy (temp_filename + len, "ccXXXXXX"); *************** *** 1140,1143 **** --- 1152,1156 ---- int first_time = TRUE; struct prefix_list *pprefix; + char path_sep[] = { PATH_SEPARATOR, 0 }; obstack_grow (&collect_obstack, env_var, strlen (env_var)); *************** *** 1150,1154 **** { if (!first_time) ! obstack_grow (&collect_obstack, ":", 1); first_time = FALSE; --- 1163,1167 ---- { if (!first_time) ! obstack_grow (&collect_obstack, path_sep, 1); first_time = FALSE; *************** *** 1160,1164 **** { if (!first_time) ! obstack_grow (&collect_obstack, ":", 1); first_time = FALSE; --- 1173,1177 ---- { if (!first_time) ! obstack_grow (&collect_obstack, path_sep, 1); first_time = FALSE; *************** *** 1193,1197 **** /* Determine the filename to execute (special case for absolute paths). */ ! if (*name == '/') { if (access (name, mode)) --- 1206,1214 ---- /* Determine the filename to execute (special case for absolute paths). */ ! if (*name == '/' ! #ifdef amigados ! || index (name, ':') ! #endif ! ) { if (access (name, mode)) *************** *** 1369,1372 **** --- 1386,1390 ---- (i.e. its output should be piped to the next one.) */ + #ifndef PEXECUTE #ifndef OS2 #ifdef __MSDOS__ *************** *** 1500,1505 **** return pid; } - } - #endif /* not __MSDOS__ */ #else /* not OS2 */ --- 1518,1521 ---- *************** *** 1515,1518 **** --- 1531,1536 ---- } #endif /* not OS2 */ + } + #endif /* !defined(PEXECUTE) */ /* Execute the command specified by the arguments on the current line of spec. *************** *** 1609,1615 **** --- 1627,1639 ---- char *string = commands[i].argv[0]; + #ifdef PEXECUTE + commands[i].pid = PEXECUTE (string != commands[i].prog, + string, commands[i].argv, + i + 1 < n_commands); + #else commands[i].pid = pexecute (string != commands[i].prog, string, commands[i].argv, i + 1 < n_commands); + #endif if (string != commands[i].prog) *************** *** 1632,1635 **** --- 1656,1662 ---- char *prog; + #ifdef PEXECUTE_RESULT + pid = PEXECUTE_RESULT (status, commands[i]); + #else /* PEXECUTE_RESULT */ #ifdef __MSDOS__ status = pid = commands[i].pid; *************** *** 1637,1640 **** --- 1664,1668 ---- pid = wait (&status); #endif + #endif /* PEXECUTE_RESULT */ if (pid < 0) abort (); *************** *** 1722,1726 **** /* COMPILER_PATH and LIBRARY_PATH have values ! that are lists of directory names with colons. */ temp = getenv ("COMPILER_PATH"); --- 1750,1754 ---- /* COMPILER_PATH and LIBRARY_PATH have values ! that are lists of directory names with PATH_SEPARATOR. */ temp = getenv ("COMPILER_PATH"); *************** *** 1733,1739 **** while (1) { ! if (*endp == PATH_SEPARATOR || *endp == 0) { strncpy (nstore, startp, endp-startp); if (endp == startp) { --- 1761,1768 ---- while (1) { ! if ((*endp == PATH_SEPARATOR) || (*endp == 0)) { strncpy (nstore, startp, endp-startp); + #ifndef amigados if (endp == startp) { *************** *** 1747,1750 **** --- 1776,1788 ---- else nstore[endp-startp] = 0; + #else + if (endp[-1] != '/' && endp[-1] != ':') + { + nstore[endp-startp] = '/'; + nstore[endp-startp+1] = 0; + } + else + nstore[endp-startp] = 0; + #endif add_prefix (&exec_prefix, nstore, 0, 0, 0); if (*endp == 0) *************** *** 1766,1772 **** while (1) { ! if (*endp == PATH_SEPARATOR || *endp == 0) { strncpy (nstore, startp, endp-startp); if (endp == startp) { --- 1804,1811 ---- while (1) { ! if ((*endp == PATH_SEPARATOR) || (*endp == 0)) { strncpy (nstore, startp, endp-startp); + #ifndef amigados if (endp == startp) { *************** *** 1780,1783 **** --- 1819,1831 ---- else nstore[endp-startp] = 0; + #else + if (endp[-1] != '/' && endp[-1] != ':') + { + nstore[endp-startp] = '/'; + nstore[endp-startp+1] = 0; + } + else + nstore[endp-startp] = 0; + #endif add_prefix (&startfile_prefix, nstore, 0, 0, 0); /* Make separate list of dirs that came from LIBRARY_PATH. */ *************** *** 1802,1808 **** while (1) { ! if (*endp == PATH_SEPARATOR || *endp == 0) { strncpy (nstore, startp, endp-startp); if (endp == startp) { --- 1850,1857 ---- while (1) { ! if ((*endp == PATH_SEPARATOR) || (*endp == 0)) { strncpy (nstore, startp, endp-startp); + #ifndef amigados if (endp == startp) { *************** *** 1816,1819 **** --- 1865,1877 ---- else nstore[endp-startp] = 0; + #else + if (endp[-1] != '/' && endp[-1] != ':') + { + nstore[endp-startp] = '/'; + nstore[endp-startp+1] = 0; + } + else + nstore[endp-startp] = 0; + #endif add_prefix (&startfile_prefix, nstore, 0, 0, 0); /* Make separate list of dirs that came from LIBRARY_PATH. */ *************** *** 3159,3162 **** --- 3217,3223 ---- register char *p; + #ifdef FILE_NAME_NONDIRECTORY + input_basename = FILE_NAME_NONDIRECTORY (input_filename); + #else input_basename = input_filename; for (p = input_filename; *p; p++) *************** *** 3163,3166 **** --- 3224,3228 ---- if (*p == '/') input_basename = p + 1; + #endif /* Find a suffix starting with the last period, *************** *** 3384,3388 **** if (errno < sys_nerr) ! s = concat ("%s: ", sys_errlist[errno], ""); else s = "cannot open %s"; --- 3446,3450 ---- if (errno < sys_nerr) ! s = concat ("%s: ", strerror (errno), ""); else s = "cannot open %s"; *************** *** 3397,3401 **** if (errno < sys_nerr) ! s = concat ("%s: ", sys_errlist[errno], ""); else s = "cannot open %s"; --- 3459,3463 ---- if (errno < sys_nerr) ! s = concat ("%s: ", strerror (errno), ""); else s = "cannot open %s"; *************** *** 3411,3415 **** if (errno < sys_nerr) s = concat ("installation problem, cannot exec %s: ", ! sys_errlist[errno], ""); else s = "installation problem, cannot exec %s"; --- 3473,3477 ---- if (errno < sys_nerr) s = concat ("installation problem, cannot exec %s: ", ! strerror (errno), ""); else s = "installation problem, cannot exec %s"; diff -2rcN gcc-2.2.2/genconfig.c my-gcc-2.2.2/genconfig.c *** gcc-2.2.2/genconfig.c Sat May 23 18:15:06 1992 --- my-gcc-2.2.2/genconfig.c Fri Jul 17 22:38:53 1992 *************** *** 278,283 **** --- 278,291 ---- from the machine description file `md'. */\n\n"); + #ifdef amigados + /* this constant probably better be 14 in general, or a cross compiling + host might choke on some amigados header files... */ + + /* Allow at least 14 operands for the sake of asm constructs. */ + max_recog_operands = 14; + #else /* Allow at least 10 operands for the sake of asm constructs. */ max_recog_operands = 9; /* We will add 1 later. */ + #endif max_dup_operands = 1; diff -2rcN gcc-2.2.2/gstddef.h my-gcc-2.2.2/gstddef.h *** gcc-2.2.2/gstddef.h Thu Jun 11 19:08:00 1992 --- my-gcc-2.2.2/gstddef.h Sat Jul 18 01:18:17 1992 *************** *** 2,5 **** --- 2,19 ---- #ifndef _STDDEF_H_ + #ifdef amigados + /* GNU libc has special support in this file, 4.3bsd-net2 libc deserves that + just as well. The system headers are ANSI compliant, the used compiler IS + gcc, so it's really ok to use the system header, no reason to hassle + with a jungle of ifdefs. Besides, amigados is only defined if compiling + with host=amigados, it doesn't apply if compiling with target=amigados + on a different host with possibly different system headers. Same thing + would apply to gstdarg.h and gvarargs.h, but those headers are more + easily fixable than this one and I'm sick of writing the same comment + there as well. MW */ + #include + + #else /* not amigados */ + /* Any one of these symbols __need_* means that GNU libc wants us just to define one data type. So don't define *************** *** 146,149 **** --- 160,165 ---- #endif /* _STDDEF_H was defined this time */ + + #endif /* not amigados */ #endif /* _STDDEF_H_ was not defined before */ #endif /* _STDDEF_H was not defined before */ diff -2rcN gcc-2.2.2/gvarargs.h my-gcc-2.2.2/gvarargs.h *** gcc-2.2.2/gvarargs.h Tue May 5 17:22:07 1992 --- my-gcc-2.2.2/gvarargs.h Fri Jul 17 23:15:00 1992 *************** *** 68,72 **** /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */ /* But in 4.3bsd-net2, _VA_LIST_ has another meaning. So ignore it. */ ! #if !defined (_VA_LIST_) || defined (_ANSI_H) /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST --- 68,72 ---- /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */ /* But in 4.3bsd-net2, _VA_LIST_ has another meaning. So ignore it. */ ! #if !defined (_VA_LIST_) || defined (_ANSI_H) || defined (_ANSI_H_) /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST *************** *** 79,83 **** typedef char * __va___list; #endif /* _VA_LIST */ ! #endif /* !defined (_VA_LIST_) || defined (_ANSI_H) */ /* In 4.3bsd-net2, it is said we must #undef this. --- 79,83 ---- typedef char * __va___list; #endif /* _VA_LIST */ ! #endif /* !defined (_VA_LIST_) || defined (_ANSI_H) || defined (_ANSI_H_) */ /* In 4.3bsd-net2, it is said we must #undef this. *************** *** 84,88 **** I hope this successfully identifies that system. I don't know why this works--rms. */ ! #ifdef _ANSI_H #undef _VA_LIST_ #endif --- 84,88 ---- I hope this successfully identifies that system. I don't know why this works--rms. */ ! #if defined(_ANSI_H) || defined (_ANSI_H_) #undef _VA_LIST_ #endif diff -2rcN gcc-2.2.2/machmode.h my-gcc-2.2.2/machmode.h *** gcc-2.2.2/machmode.h Tue Mar 10 22:11:09 1992 --- my-gcc-2.2.2/machmode.h Fri Jul 17 22:38:54 1992 *************** *** 56,60 **** /* Get the name of mode MODE as a string. */ ! extern char *mode_name[]; #define GET_MODE_NAME(MODE) (mode_name[(int)(MODE)]) --- 56,60 ---- /* Get the name of mode MODE as a string. */ ! extern char * const mode_name[]; #define GET_MODE_NAME(MODE) (mode_name[(int)(MODE)]) *************** *** 65,69 **** (integer, floating, complex, etc.) */ ! extern enum mode_class mode_class[]; #define GET_MODE_CLASS(MODE) (mode_class[(int)(MODE)]) --- 65,69 ---- (integer, floating, complex, etc.) */ ! extern const enum mode_class mode_class[]; #define GET_MODE_CLASS(MODE) (mode_class[(int)(MODE)]) *************** *** 70,74 **** /* Get the size in bytes of an object of mode MODE. */ ! extern int mode_size[]; #define GET_MODE_SIZE(MODE) (mode_size[(int)(MODE)]) --- 70,74 ---- /* Get the size in bytes of an object of mode MODE. */ ! extern const int mode_size[]; #define GET_MODE_SIZE(MODE) (mode_size[(int)(MODE)]) *************** *** 75,79 **** /* Get the size in bytes of the basic parts of an object of mode MODE. */ ! extern int mode_unit_size[]; #define GET_MODE_UNIT_SIZE(MODE) (mode_unit_size[(int)(MODE)]) --- 75,79 ---- /* Get the size in bytes of the basic parts of an object of mode MODE. */ ! extern const int mode_unit_size[]; #define GET_MODE_UNIT_SIZE(MODE) (mode_unit_size[(int)(MODE)]) *************** *** 96,100 **** /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */ ! extern enum machine_mode mode_wider_mode[]; #define GET_MODE_WIDER_MODE(MODE) (mode_wider_mode[(int)(MODE)]) --- 96,100 ---- /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */ ! extern const enum machine_mode mode_wider_mode[]; #define GET_MODE_WIDER_MODE(MODE) (mode_wider_mode[(int)(MODE)]) diff -2rcN gcc-2.2.2/print-tree.c my-gcc-2.2.2/print-tree.c *** gcc-2.2.2/print-tree.c Mon Apr 27 16:54:16 1992 --- my-gcc-2.2.2/print-tree.c Fri Jul 17 22:38:56 1992 *************** *** 25,29 **** extern char **tree_code_name; ! extern char *mode_name[]; void print_node (); --- 25,29 ---- extern char **tree_code_name; ! extern char *const mode_name[]; void print_node (); diff -2rcN gcc-2.2.2/protoize.c my-gcc-2.2.2/protoize.c *** gcc-2.2.2/protoize.c Sun Jun 14 21:11:55 1992 --- my-gcc-2.2.2/protoize.c Fri Jul 17 22:39:01 1992 *************** *** 787,792 **** --- 787,797 ---- struct default_include *p; + #ifdef FILE_NAME_ABSOLUTE_P + if (! FILE_NAME_ABSOLUTE_P (path)) + abort (); + #else if (path[0] != '/') abort (); /* Must be an absolutized filename. */ + #endif for (p = include_defaults; p->fname; p++) *************** *** 1215,1219 **** --- 1220,1228 ---- const char *src_p; + #ifdef FILE_NAME_ABSOLUTE_P + if (! FILE_NAME_ABSOLUTE_P (rel_filename)) + #else if (rel_filename[0] != '/') + #endif { src_p = cwd2; *************** *** 1478,1481 **** --- 1487,1509 ---- } + /* Use this macro to advance a char * over the filename part in a line + read from an aux-info file. */ + + #ifndef amigados + /* Version for file systems where the colon has no special meaning */ + #define ADVANCE_PAST_FILENAME(CP) \ + while (* (CP) != ':') (CP)++ + #else + /* Have to heuristically decide whether the colon is part of the filename + or whether it serves to delimit the filename from the line number. If + it's the latter case, then the character following the colon *must* + be a digit. Note that this heuristic fails if the filename starts + with a digit. */ + #define ADVANCE_PAST_FILENAME(CP) \ + while ((CP)[0] != ':' || !isdigit ((CP)[1])) \ + (CP)++; + #endif + + /* Given a line from an aux info file, and a time at which the aux info file it came from was created, check to see if the item described in *************** *** 1499,1504 **** const char *filename_start = p = l + 3; ! while (*p != ':') ! p++; filename = (char *) alloca ((size_t) (p - filename_start) + 1); strncpy (filename, filename_start, (size_t) (p - filename_start)); --- 1527,1531 ---- const char *filename_start = p = l + 3; ! ADVANCE_PAST_FILENAME (p); filename = (char *) alloca ((size_t) (p - filename_start) + 1); strncpy (filename, filename_start, (size_t) (p - filename_start)); *************** *** 1557,1562 **** char *filename; ! while (*p != ':') ! p++; filename = (char *) alloca ((size_t) (p - filename_start) + 1); strncpy (filename, filename_start, (size_t) (p - filename_start)); --- 1584,1588 ---- char *filename; ! ADVANCE_PAST_FILENAME (p); filename = (char *) alloca ((size_t) (p - filename_start) + 1); strncpy (filename, filename_start, (size_t) (p - filename_start)); *************** *** 2227,2231 **** char *p = aux_info_base; ! while (*p != ':') p++; p++; --- 2253,2259 ---- char *p = aux_info_base; ! /* have to make sure at least one space is following the colon to make ! sure the colon is not part of the filename */ ! while (*p != ':' && p[1] != ' ') p++; p++; *************** *** 2241,2245 **** --- 2269,2277 ---- aux_info_second_line = p; aux_info_relocated_name = 0; + #ifdef FILE_NAME_ABSOLUTE_P + if (! FILE_NAME_ABSOLUTE_P (invocation_filename)) + #else if (invocation_filename[0] != '/') + #endif { /* INVOCATION_FILENAME is relative; *************** *** 2329,2333 **** /* Check an individual filename for a .c suffix. If the filename has this ! suffix, rename the file such that its suffix is changed to .C. This function implements the -C option. */ --- 2361,2365 ---- /* Check an individual filename for a .c suffix. If the filename has this ! suffix, rename the file such that its suffix is changed to .cc. This function implements the -C option. */ *************** *** 2338,2342 **** const char *filename = hp->symbol; int last_char_index = strlen (filename) - 1; ! char *const new_filename = (char *) alloca (strlen (filename) + 1); /* Note that we don't care here if the given file was converted or not. It --- 2370,2374 ---- const char *filename = hp->symbol; int last_char_index = strlen (filename) - 1; ! char *const new_filename = (char *) alloca (strlen (filename) + 2); /* Note that we don't care here if the given file was converted or not. It *************** *** 2350,2355 **** strcpy (new_filename, filename); ! new_filename[last_char_index] = 'C'; if (my_link (filename, new_filename) == -1) { --- 2382,2404 ---- strcpy (new_filename, filename); ! strcat (new_filename + last_char_index, "cc"); ! ! /* use rename(2) if available !! Update config files to include HAVE_rename ! if the used OS provides it. Advantages are: it's atomic, it's one ! system call compared to two. */ ! ! #ifdef HAVE_rename ! /* if the mentioned systems (POSIX 1003.1-1988) have rename(2), this has ! to be changed to `my_rename' as well. */ + if (rename (filename, new_filename) == -1) + { + fprintf (stderr, "%s: warning: can't rename file `%s' to `%s': %s\n", + pname, shortpath (NULL, filename), + shortpath (NULL, new_filename), sys_errlist[errno]); + errors++; + return; + } + #else if (my_link (filename, new_filename) == -1) { *************** *** 2368,2371 **** --- 2417,2421 ---- return; } + #endif } diff -2rcN gcc-2.2.2/rtl.c my-gcc-2.2.2/rtl.c *** gcc-2.2.2/rtl.c Wed May 13 22:27:52 1992 --- my-gcc-2.2.2/rtl.c Fri Jul 17 22:39:03 1992 *************** *** 50,54 **** #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME , ! char *rtx_name[] = { #include "rtl.def" /* rtl expressions are documented here */ }; --- 50,54 ---- #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME , ! char * const rtx_name[] = { #include "rtl.def" /* rtl expressions are documented here */ }; *************** *** 61,65 **** #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) NAME, ! char *mode_name[(int) MAX_MACHINE_MODE] = { #include "machmode.def" --- 61,65 ---- #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) NAME, ! char * const mode_name[(int) MAX_MACHINE_MODE] = { #include "machmode.def" *************** *** 77,81 **** #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) CLASS, ! enum mode_class mode_class[(int) MAX_MACHINE_MODE] = { #include "machmode.def" }; --- 77,81 ---- #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) CLASS, ! const enum mode_class mode_class[(int) MAX_MACHINE_MODE] = { #include "machmode.def" }; *************** *** 88,92 **** #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) SIZE, ! int mode_size[(int) MAX_MACHINE_MODE] = { #include "machmode.def" }; --- 88,92 ---- #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) SIZE, ! const int mode_size[(int) MAX_MACHINE_MODE] = { #include "machmode.def" }; *************** *** 99,103 **** #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) UNIT, ! int mode_unit_size[(int) MAX_MACHINE_MODE] = { #include "machmode.def" /* machine modes are documented here */ }; --- 99,103 ---- #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) UNIT, ! const int mode_unit_size[(int) MAX_MACHINE_MODE] = { #include "machmode.def" /* machine modes are documented here */ }; *************** *** 112,116 **** (enum machine_mode) WIDER, ! enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = { #include "machmode.def" /* machine modes are documented here */ }; --- 112,116 ---- (enum machine_mode) WIDER, ! const enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = { #include "machmode.def" /* machine modes are documented here */ }; *************** *** 131,135 **** each character describes one operand. */ ! char *rtx_format[] = { /* "*" undefined. can cause a warning message --- 131,135 ---- each character describes one operand. */ ! char *const rtx_format[] = { /* "*" undefined. can cause a warning message *************** *** 160,164 **** that rtx code. See rtl.def for documentation on the defined classes. */ ! char rtx_class[] = { #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS, #include "rtl.def" /* rtl expressions are defined here */ --- 160,164 ---- that rtx code. See rtl.def for documentation on the defined classes. */ ! const char rtx_class[] = { #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS, #include "rtl.def" /* rtl expressions are defined here */ *************** *** 168,172 **** /* Names for kinds of NOTEs and REG_NOTEs. */ ! char *note_insn_name[] = { "NOTE_INSN_FUNCTION_BEG", "NOTE_INSN_DELETED", "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END", "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END", --- 168,173 ---- /* Names for kinds of NOTEs and REG_NOTEs. */ ! char * const note_insn_name[] = ! { "NOTE_INSN_FUNCTION_BEG", "NOTE_INSN_DELETED", "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END", "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END", *************** *** 174,178 **** "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP" }; ! char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0", "REG_EQUAL", "REG_RETVAL", "REG_LIBCALL", "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED", --- 175,180 ---- "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP" }; ! char * const reg_note_name[] = ! { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0", "REG_EQUAL", "REG_RETVAL", "REG_LIBCALL", "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED", diff -2rcN gcc-2.2.2/rtl.h my-gcc-2.2.2/rtl.h *** gcc-2.2.2/rtl.h Thu May 7 06:37:55 1992 --- my-gcc-2.2.2/rtl.h Fri Jul 17 22:39:05 1992 *************** *** 43,53 **** #define GET_RTX_LENGTH(CODE) (rtx_length[(int)(CODE)]) ! extern char *rtx_name[]; #define GET_RTX_NAME(CODE) (rtx_name[(int)(CODE)]) ! extern char *rtx_format[]; #define GET_RTX_FORMAT(CODE) (rtx_format[(int)(CODE)]) ! extern char rtx_class[]; #define GET_RTX_CLASS(CODE) (rtx_class[(int)(CODE)]) --- 43,53 ---- #define GET_RTX_LENGTH(CODE) (rtx_length[(int)(CODE)]) ! extern char * const rtx_name[]; #define GET_RTX_NAME(CODE) (rtx_name[(int)(CODE)]) ! extern char * const rtx_format[]; #define GET_RTX_FORMAT(CODE) (rtx_format[(int)(CODE)]) ! extern const char rtx_class[]; #define GET_RTX_CLASS(CODE) (rtx_class[(int)(CODE)]) *************** *** 292,296 **** /* Names for REG_NOTE's in EXPR_LIST insn's. */ ! extern char *reg_note_name[]; #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)]) --- 292,296 ---- /* Names for REG_NOTE's in EXPR_LIST insn's. */ ! extern char *const reg_note_name[]; #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)]) *************** *** 347,351 **** /* Names for NOTE insn's other than line numbers. */ ! extern char *note_insn_name[]; #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)]) --- 347,351 ---- /* Names for NOTE insn's other than line numbers. */ ! extern char *const note_insn_name[]; #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)]) diff -2rcN gcc-2.2.2/toplev.c my-gcc-2.2.2/toplev.c *** gcc-2.2.2/toplev.c Thu May 28 05:36:37 1992 --- my-gcc-2.2.2/toplev.c Fri Jul 17 22:39:10 1992 *************** *** 471,474 **** --- 471,475 ---- {"writable-strings", &flag_writable_strings, 1}, {"peephole", &flag_no_peephole, 0}, + {"large-baserel", &flag_pic, 4}, {"force-mem", &flag_force_mem, 1}, {"force-addr", &flag_force_addr, 1}, *************** *** 488,491 **** --- 489,493 ---- {"pic", &flag_pic, 1}, {"PIC", &flag_pic, 2}, + {"baserel", &flag_pic, 3}, {"fast-math", &flag_fast_math, 1}, {"common", &flag_no_common, 0}, *************** *** 1290,1293 **** --- 1292,1298 ---- char *input_name; { + #ifdef FILE_NAME_NONDIRECTORY + char *na = FILE_NAME_NONDIRECTORY (input_name); + #else int len = strlen (input_name); char *na = input_name + len; *************** *** 1300,1303 **** --- 1305,1309 ---- na--; } + #endif #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME *************** *** 3057,3060 **** --- 3063,3067 ---- #ifndef OS2 #ifndef VMS + #ifndef amigados if (flag_print_mem) { *************** *** 3071,3074 **** --- 3078,3082 ---- #endif /* not USG */ } + #endif /* not amigados */ #endif /* not VMS */ #endif /* not OS2 */ diff -2rcN gcc-2.2.2/tree.c my-gcc-2.2.2/tree.c *** gcc-2.2.2/tree.c Tue May 12 02:51:10 1992 --- my-gcc-2.2.2/tree.c Fri Jul 17 22:39:13 1992 *************** *** 218,222 **** static int do_identifier_warnings; ! extern char *mode_name[]; void gcc_obstack_init (); --- 218,222 ---- static int do_identifier_warnings; ! extern char *const mode_name[]; void gcc_obstack_init ();