This patch is designed to be applied to a directory named g77-0.5.23 that is a (renamed) copy of the g77-0.5.22 directory that you already have. Apply this patch using GNU patch 2.5: patch -E -p1 -d g77-0.5.23 < g77-0.5.22-0.5.23.diff IMPORTANT: After applying this patch, you must rebuild the Info documentation derived from the Texinfo files in the g77 distribution, as this patch does not include patches to any derived files (to keep the size of the patch file down). Use the following command sequence after applying this patch to the `g77' directory: cd g77-0.5.23 make -f f/Make-lang.in g77-patch cd .. If that fails due to `makeinfo' not being installed, obtain texinfo-3.11.tar.gz from a GNU distribution site, unpack, build, and install it, and try the above command sequence again. If that fails due to `autoconf' not being installed, obtain autoconf-2.12.tar.gz from a GNU distribution site, unpack, build, and install it, and try the above command sequence again. Alternately, instead of using this patch, obtain the full g77 distribution named g77-0.5.23.tar.gz. This distribution contains the derived Info documentation, plus other derived files like f/BUGS, f/INSTALL, f/NEWS, f/runtime/configure, and f/runtime/libU77/configure. diff -rcp2N g77-0.5.22/README.g77 g77-0.5.23/README.g77 *** g77-0.5.22/README.g77 Sun Mar 8 21:18:29 1998 --- g77-0.5.23/README.g77 Tue Apr 21 01:16:54 1998 *************** *** 1,20 **** ! 1998-03-08 ! This directory contains the version 0.5.22 release of the GNU Fortran compiler. The GNU Fortran compiler is free software. See the file COPYING.g77 for copying permission. ! * IMPORTANT: Things you *must* do are marked with a * at the beginning of the line in this file!!! - * DO NOT send any email (reporting bugs, asking questions, etc.) to - without *first* reading the g77 documentation, - using `info', Info mode in GNU Emacs, or a text viewer such as `more'. - The g77 documentation is in the files named `g77.info', `g77.info-1', - `g77.info-2', and so on in g77 `f' directory. If these files are - not present or you can't find them, contact the person or organization - that put together the g77 distribution you are using (probably not the - FSF), or ask your system administrator for help. - This README is for GNU Fortran, and describes the files in the f/ directory. The f/ directory is intended to be a subdirectory of a --- 1,11 ---- ! 1998-04-20 ! This directory contains the version 0.5.23 release of the GNU Fortran compiler. The GNU Fortran compiler is free software. See the file COPYING.g77 for copying permission. ! * IMPORTANT: Things you _must_ do are marked with a * at the beginning of the line in this file!!! This README is for GNU Fortran, and describes the files in the f/ directory. The f/ directory is intended to be a subdirectory of a *************** contains all of the Fortran files. *** 25,36 **** * To build GNU Fortran, you must have a source distribution of gcc ! version 2.7.2.3. Do not attempt to use any other version of gcc, because this version of g77 is designed to work only with ! gcc version 2.7.2.3. * Note that you must have source copies of these gcc distributions!! You cannot build g77 just using binaries of gcc. Also, unless you are an expert, avoid using any distribution of gcc not identical to ! the one distributed by the FSF. If you have just unpacked the g77 distribution, before proceeding, --- 16,28 ---- * To build GNU Fortran, you must have a source distribution of gcc ! version 2.8. Do not attempt to use any other version of gcc, because this version of g77 is designed to work only with ! gcc version 2.8. * Note that you must have source copies of these gcc distributions!! You cannot build g77 just using binaries of gcc. Also, unless you are an expert, avoid using any distribution of gcc not identical to ! the one distributed by the FSF (via or ! one of its many mirrors). If you have just unpacked the g77 distribution, before proceeding, *************** you must merge the contents of the g77 d *** 38,56 **** gcc distribution on your system before proceeding. ! * Read and follow the instructions in g77-0.5.22/f/INSTALL that explain how to merge a g77 source directory into a gcc source directory. You can use Info to read the same installation instructions via: ! info -f g77-0.5.22/f/g77.info -n Unpacking The resulting directory layout includes the following, where gcc/ might be ! a link to, for example, gcc-2.7.2.3/: gcc/ Non-Fortran files in gcc (not part of g77*.tar) gcc/README.g77 This file gcc/f/ GNU Fortran front end ! gcc/f/gbe/ Patches required for gcc back end versions ! gcc/f/runtime/ libf2c configuration and f2c.h file generation gcc/f/runtime/libF77/ Non-I/O portion of libf2c gcc/f/runtime/libI77/ I/O portion of libf2c --- 30,47 ---- gcc distribution on your system before proceeding. ! * Read and follow the instructions in g77-0.5.23/f/INSTALL that explain how to merge a g77 source directory into a gcc source directory. You can use Info to read the same installation instructions via: ! info -f g77-0.5.23/f/g77.info -n Unpacking The resulting directory layout includes the following, where gcc/ might be ! a link to, for example, gcc-2.8.1/: gcc/ Non-Fortran files in gcc (not part of g77*.tar) gcc/README.g77 This file gcc/f/ GNU Fortran front end ! gcc/f/runtime/ libg2c configuration and g2c.h file generation gcc/f/runtime/libF77/ Non-I/O portion of libf2c gcc/f/runtime/libI77/ I/O portion of libf2c *************** a link to, for example, gcc-2.7.2.3/: *** 58,62 **** gcc/f/ as a whole contains the program GNU Fortran (g77), plus a portion ! of the separate program f2c, which is in gcc/f/runtime. NOTE: The libf2c code is not part of the program g77, just distributed with it. --- 49,53 ---- gcc/f/ as a whole contains the program GNU Fortran (g77), plus a portion ! of the separate program f2c, which is in gcc/f/runtime. NOTE: The f2c code is not part of the program g77, just distributed with it. *************** distribution, normally in a gcc director *** 75,105 **** and installing g77. - Applying g77 patches in the form of .diff files is done by typing - `patch -p1 -d gcc' (where gcc/f/ is the active version). That is, - g77 patches are distributed in the same form, and at the same directory - level, as patches to the gcc distribution. (Note: make sure you're - using GNU patch, version 2.5 or later! Other versions of patch - have trouble with g77-related patches.) - gcc/f/ has text files that document the Fortran compiler, source files for the GNU Fortran Front End (FFE), and some other stuff. - gcc/f/gbe/ has patch files for various versions of gcc, primarily - needed to patch the GNU compiler Back End (GBE) to fix and improve it - for use with g77. If a patch file exists for the version of gcc you - want to build along with g77, you MUST apply the patch before building - g77 with that version or g77 will not build or work properly.* - - * Read gcc/f/gbe/README for more information. - gcc/f/runtime/ contains the run-time libraries for the f2c program, also used ! by g77, and referred to as libf2c (though libf2c is really a combination of ! two distinct libraries, libF77 and libI77 -- in g77, this distinction is ! not made, and, further, Dave Love's implementation of libU77 is added ! to the mix). This separate subdirectory is not part of the program g77, just ! distributed with it. Some new files have been added to this subdirectory ! and some minor changes made to the files contained therein, to fix some ! bugs and facilitate automatic configuration, building, and installation of ! libf2c for use by g77 users. See gcc/f/runtime/README for more information. gcc/f/BUGS lists some important bugs known to be in g77. Or: --- 66,83 ---- and installing g77. gcc/f/ has text files that document the Fortran compiler, source files for the GNU Fortran Front End (FFE), and some other stuff. gcc/f/runtime/ contains the run-time libraries for the f2c program, also used ! by g77, normally referred to as libf2c, but built by g77 under the name ! libg2c to avoid conflict with any existing version of libf2c. libf2c is ! really a combination of two distinct libraries, libF77 and libI77. ! In g77, this distinction is not made, and, further, Dave Love's ! implementation of libU77 is added to the mix. This separate subdirectory ! is not part of the program g77, just distributed with it. Some new files ! have been added to this subdirectory and some minor changes made to the ! files contained therein, to fix some bugs and facilitate automatic ! configuration, building, and installation of libg2c for use by g77 users. ! See gcc/f/runtime/README for more information. gcc/f/BUGS lists some important bugs known to be in g77. Or: *************** gcc/f/BUGS lists some important bugs kno *** 109,112 **** --- 87,92 ---- gcc/f/ChangeLog lists recent changes to g77 internals. + gcc/f/runtime/ChangeLog lists recent changes to libg2c internals. + gcc/f/INSTALL describes how to build and install GNU Fortran. Or: *************** seen in gcc/f/DOC) listed in the ~fortra *** 120,126 **** * Read gcc/f/BUGS, gcc/f/INSTALL, and gcc/f/NEWS at the very least! All users of g77 (not just installers) should read gcc/f/g77.info* ! as well, using the `more' command if neither the `info' command, ! nor GNU Emacs (with its Info mode), are available, or if they ! aren't yet accustomed to using these tools. If you want to get into the FFE code, which lives entirely in gcc/f/, here --- 100,105 ---- * Read gcc/f/BUGS, gcc/f/INSTALL, and gcc/f/NEWS at the very least! All users of g77 (not just installers) should read gcc/f/g77.info* ! as well, using the "more" command if the "info" command is ! unavailable or they aren't accustomed to using it. If you want to get into the FFE code, which lives entirely in gcc/f/, here *************** the compiler is in the second pass, othe *** 174,176 **** a bug in g77 until a fix is available.) ! Any questions or comments on these topics, email . --- 153,155 ---- a bug in g77 until a fix is available.) ! Any questions or comments on these topics, email fortran@gnu.org. diff -rcp2N g77-0.5.22/f/ChangeLog g77-0.5.23/f/ChangeLog *** g77-0.5.22/f/ChangeLog Mon Mar 16 20:42:46 1998 --- g77-0.5.23/f/ChangeLog Wed May 20 17:08:19 1998 *************** *** 1,2 **** --- 1,334 ---- + Wed May 20 12:12:55 1998 Craig Burley + + * Version 0.5.23 released. + + * Make-lang.in ($(srcdir)/f/g77.info): Before running + makeinfo, delete g77.info-*, to ensure no old files + are left over (as the result of a reduction in doc + size, for example, as happened in this release). + + * Make-lang.in (g77-patch): New rule to simplify + applying g77 patch distribution. + + Tue May 19 14:52:41 1998 Craig Burley + + * bad.def (FFEBAD_OPEN_UNSUPPORTED, FFEBAD_INQUIRE_UNSUPPORTED, + FFEBAD_READ_UNSUPPORTED, FFEBAD_WRITE_UNSUPPORTED, + FFEBAD_QUAD_UNSUPPORTED, FFEBAD_BLOCKDATA_STMT, + FFEBAD_TRUNCATING_CHARACTER, FFEBAD_TRUNCATING_HOLLERITH, + FFEBAD_TRUNCATING_NUMERIC, FFEBAD_TRUNCATING_TYPELESS, + FFEBAD_TYPELESS_OVERFLOW): Change these from warnings + to errors. + + Tue May 19 14:51:59 1998 Craig Burley + + * Make-lang.in (f77.install-info, f77.uninstall): + Use install-info as appropriate. + + Tue May 19 12:56:54 1998 Craig Burley + + * com.c (ffecom_init_0): Rename xargc to f__xargc, + in accord with same-dated change to f/runtime. + + Fri May 15 13:50:39 1998 Craig Burley + + * Makefile.in: Use f771$(exeext) instead of f771 + throughout. + * Make-lang.in: Ditto. + + * Make-lang.in: Have gnumake-check target depended + upon by f77, F77, c, and C, instead of the entire + $(LANGUAGES) macro, to avoid gratuitous rebuilds + of `gcov'. + + Fri May 15 10:52:49 1998 Craig Burley + + * com.c (ffecom_convert_narrow_, ffecom_convert_widen_): + Be even more persnickety in checking for internal bugs. + Also, if precision isn't changing, just return the expr. + + * expr.c (ffeexpr_token_number_): Call + ffeexpr_make_float_const_ to make an integer. + (ffeexpr_make_float_const_): Handle making an integer. + + * intrin.c (ffeintrin_init_0): Distinguish between + crashes on bad arg base and kind types. + + Thu May 14 13:30:59 1998 Craig Burley + + * Make-lang.in (f/expr.c): Now depends on f/stamp-str. + * expr.c: Use ffestrOther in place of ffeexprDotdot_. + * str-ot.fin: Add more keywords for expr.c. + + * intdoc.c (dumpimp): Trivial fix. + + * com.c (ffecom_expr_): Add ltkt variable for clarity. + + Wed May 13 13:05:34 1998 Craig Burley + + * Make-lang.in (G77STAGESTUFF): Add g77.o, g77spec.o, + and g77version.o. + (f77.clean): Add removal of g77.c, g77.o, g77spec.o, + and g77version.o. + (f77.distclean): Delete removal of g77.c. + + Tue May 12 11:21:20 1998 Craig Burley + + Restore circa-0.5.22 capabilities of `g77' driver: + * Make-lang.in (g77spec.o): Depend on f/version.h. + (g77version.o): New rule to compile g77 version info. + (g77$(exeext)): Depend on and link in g77version.o. + * g77spec.c: Rewrite to be more like 0.5.22 version + of g77.c, making filtering of command line smarter + so mixed Fortran and C (etc.) can be compiled, verbose + version info can be obtained, etc. + * lang-specs.h (f77-version): New "language" to support + "g77 -v" command under new gcc 2.8 regime. + * lex.c (ffelex_file_fixed): If -fnull-version, just + substitute a "source file" that prints out version info. + * top.c, top.h: Support -fnull-version. + + * lang-specs.h: Use "%O" instead of OO macro to specify + object extension. + + Mon May 4 02:19:19 1998 Craig Burley + + * Make-lang.in (gnumake-check): Trivial changes. + + 1998-05-03 Dave Love + + * Make-lang.in (gnumake-check): New target. + ($(LANGUAGES)): Use it. + + Sat May 2 14:07:52 1998 Dave Love + + * Make-lang.in ($(srcdir)/f/runtime/configure, + $(srcdir)/f/runtime/libU77/configure): Don't rm f2c.h, + rm g2c.h instead. + + 1998-04-30 Jim Wilson + + * f/Make-lang.in (g77.info, g77.dvi, BUGS, INSTALL, NEWS): Put -o + option before input file. + + Wed Apr 29 15:23:16 1998 Craig Burley + + * proj.c (strtoul, bsearch): Compile these only + if NEED_* is defined, instead of unless HAVE_* is + defined, since gcc 2.8.1 does not define them either + way, and there could be conflicts between the definitions + here and a declaration in the system's header files. + + Tue Apr 28 09:23:10 1998 Craig Burley + + * Make-lang.in (g77.c, g77spec.o, g77.o, g77$(exeext), + g77-cross$(exeext), f771, f77-runtime, stamp-g2c, + $(srcdir)/f/g77.info, $(srcdir)/f/g77.dvi, + $(srcdir)/f/intdoc.texi, $(srcdir)/f/runtime/configure, + $(srcdir)/f/runtime/libU77/configure, install-libf77, + f77.install-common, f77.install-info, f77.install-man, + f77.uninstall, $(G77STAGESTUFF), f77.stage1, f77.stage2, + f77.stage3, f77.stage4, f77.distdir): Don't do anything + unless user specified "f77" or "F77" in $LANGUAGES either + during configuration or explicitly. For convenience of + various tests and to work around lack of the assignment + "LANGUAGES=$(BOOT_LANGUAGES)" in the "make stage1" command + of "make bootstrap" in gcc, use a touch file named "lang-f77" + to communicate whether this is the case. + + Fix 980427-0.f: + * global.c (ffeglobal_ref_progunit_): When transitioning + from EXT to FUNC, discard hook, since the decl, if any, is + probably wrong. + + Mon Apr 27 11:26:11 1998 Craig Burley + + * Makefile.in (../f771): If the link fails, print + a diagnostic that would likely explain the failure, + pointing to further info in the docs. + + Sun Apr 26 09:05:50 1998 Craig Burley + + * com.c (ffecom_char_enhance_arg_): Wrap the upper bound + (the PARM_DECL specifying the length of the CHARACTER*(*) + dummy arg) in a variable_size invocation, to prevent + dwarf2out.c crashing when compiling code with -g. + + * Make-lang.in (F77_FLAGS_TO_PASS): Delete this macro, + replace with minimal expansion of its former self in + each of the two instances where it was used. + (f77-runtime): This one builds the library, so needs + compiler, header, and library-archive-related macros. + Rename GCC_FOR_TARGET to CC and GCC_CFLAGS to CFLAGS + for the recursive make. + (stamp-g2c): This one needs only CFLAGS for the configure. + (install-libf77): For AR and RANLIB stuff, don't use the + _FOR_TARGET versions; the regular versions are set to + identify the target apparently, but in any case the + _FOR_TARGET versions are incorrect for a non-cross build + (from gcc-2.8.1/Makefile). + + Fri Apr 24 06:55:49 1998 Craig Burley + + * Make-lang.in (F77_FLAGS_TO_PASS): Pass HOST_CC, + HOST_CFLAGS, and HOST_CPPFLAGS down, in case they're + needed. + (f771): Ditto, as they are needed (for fini.o, proj-h.o). + * Makefile.in (HOST_CC): Delete this definition. + + * com.c (index, rindex): Delete these declarations. + + * proj.c (strtoul, bsearch): Insert gratuitous declarations, + so warnings are printed when these routines are compiled in, + so as to encourage people to find a way to define the + relevant macros when suitable. (These implementations + are not ideal, they're just substitutes for when the machine + doesn't have them.) + + * proj.h: Add a bunch of declarations per the auto-config.h + stuff gcc's configure script produces, including the + declarations for index and rindex that used to be in + com.c, except, use prototypes. + (isascii): Delete this. Might already exist but as a + function (is that allowed?), find out about systems + that have ctype.h but don't provide isascii!. + + Mon Apr 20 15:17:57 1998 Craig Burley + + * Make-lang.in (f77.distclean): Also delete g77.c. + (install-libf77): Warn if `f2c-install-ok' flag-file + exists, since it no longer triggers any activity. + (f77.install-common): Warn if `f77-install-ok' flag-file + exists, since it no longer triggers any activity. + + Rename libf2c.a and f2c.h to libg2c.a and g2c.h, + normalize and simplify g77/libg2c build process: + * Make-lang.in: Remove all support for overwriting + /usr/bin/f77, /usr/lib/libf2c.a, and /usr/include/f2c.h, + or whatever the actual names are via $(prefix) and + $(local_prefix). (g++ overwrites /usr/bin/c++, but + then it's often the only C++ compiler on the system; + f77 often exists on systems that are installing g77.) + (f77.realclean): Remove obsolete target. + (f77.mostlyclean, f77.clean, f77.distclean, + f77.maintainer-clean): Do all cleaning for entire + heirarchy, so no subdirectory Makefile's need do any. + (g77.c, g77$(exeext)): Minor changes to look more like g++'s + stuff. + (f771): Now built with srcdir=gcc/f, not srcdir=gcc, to be + more like g++ and such. + (f/Makefile): Removed, as g++ doesn't need this rule. + (f77-runtime): Fix up spacing. Add f2c.h and g2c.h and remove + include/f2c.h dependencies. Pass absolute pathnames for + gcc/f/runtime source and build dirs, and for gcc/include dir. + (stamp-g2c): Renamed from stmp-f2c.h. Rename dependency on + f2c.h.in to g2c.h.in. Do actual work only if "f77" is + in $LANGUAGES. Don't explicitly configure libU77, as the + libf2c configuration handles that now. + (f/runtime/g2c.h): Rename from f/runtime/f2c.h. + (f/runtime/Makefile, f/runtime/libF77/Makefile, + f/runtime/libI77/Makefile, f/runtime/libU77/Makefile): + Depend on stamp-g2c instead of stmp-f2c.h, due to renaming. + (f77.all.build, f77.all.cross): Remove f77-runtime. + ($(srcdir)/f/runtime/configure, + $(srcdir)/f/runtime/libU77/configure): Do the work here, + not by calling on runtime/Makefile. + (f77.install-normal, install-f2c-all, install-f2c-header, + install-f2c-lib): Remove all install-f2c-* stuff. + (install-libf77): No longer check for previously installed + stuff, as installation now done only to gcc-lib/.../libg2c.a + and gcc-lib/.../g2c.h. + (f77.install-common): No longer install f77, etc. + (f77.install-man): No longer install f77.1. + (f77.uninstall): No longer uninstall f77, f77.1, etc. + Uninstall libg2c.a and g2c.h from new, correct locations. + ($(G77STAGESTUFF)): Add stamp-g2c. + ($(RUNTIMESTAGESTUFF)): Add g2c.h, stamp-*77, etc. + ($(LIBE77STAGESTUFF)): New macro, now that we're keeping + these objects around. + (f77.stage1, f77.stage2, f77.stage3, f77.stage4): Do work + only if "f77" appears in $(LANGUAGES). Create the runtime + and lib?77 subdirs if needed. Move $(LIBE77STAGESTUFF) too. + (Note: gcc's Makefile.in's bootstraptarget should set + LANGUAGES=$(BOOT_LANGUAGES) when making the stage1 target.) + * Makefile.in: Update vis-a-vis gcc/cp/Makefile.in. + (none): Remove. + (g77-only): Relocate. + (all.indirect, f771, *.o): Now assumes current directory + is this dir (gcc/f), not the parent directory. + (TAGS): Remove "echo 'parse.y,0' >> TAGS ;" line. + * config-lang.in: Delete commented-out code. + Fix stagestuff definition. Add more stuff to + diff_excludes definition. Don't create any directories. + Set outputs to f/Makefile, to get variable substition + to happen (what does that really do, anyway?!). + * g77spec.c: Rename libf2c to libg2c. + + Sat Apr 18 05:03:21 1998 Craig Burley + + * com.h: Update all of the gcc back-end decls + that have to be copied here to avoid warnings. + + * com.c: Include "proj.h" before anything else, + as that's how things are supposed to work. + * ste.c: Ditto. + + * com.c (ffecom_check_size_overflow_): Ignore overflow + as well if dummy argument. + + * bad.c: Include "flags.j" here, since some diagnostics + check flag_pedantic_errors. + + * Makefile.in (f/*.o): Rebuild dependencies via + deps-kinda. + + * output.j: New source file. + * Make-lang.in (F77_SRCS): Update accordingly. + * Makefile.in (OUTPUT_H): Ditto. + (deps-kinda): Ditto. + * com.c: Include "output.j" here. + * lex.c: Ditto. + * ste.c: Ditto, and include "tree.j" first, as it's needed. + + * target.c, target.h (ereal_unto_float, ereal_unto_double, + REAL_VALUE_UNTO_TARGET_SINGLE, REAL_VALUE_UNTO_TARGET_DOUBLE): + Add all this cruft from g77's patched version of gcc 2.7, along + with all the cruft they need from real.h and real.c. + This is to avoid having to ship a patch to gcc with g77, + while coping with g77's unfortunate handling of constants + (to be fixed in version 0.6). + + Fri Apr 17 17:18:04 1998 Craig Burley + + * version.h: Get rid of the overly large headers + here too, as done in version.c. + + Tue Apr 14 14:40:40 1998 Craig Burley + + * com.c (ffecom_start_progunit_): Mark function decl + as used, to avoid spurious warning (-Wunused) for ENTRY. + + Tue Apr 14 14:19:34 1998 Craig Burley + + * sta.c (ffesta_second_): Check for CASE DEFAULT + as well as CASE, or it won't be recognized. + + Thu Mar 26 21:09:46 1998 Craig Burley + + * Make-lang.in (f77-runtime): Move inclusion of F77_FLAGS_TO_PASS + to before other overrides, in case that matters. + + Mon Mar 23 21:20:35 1998 Craig Burley + + * version.c: Reduce to a one-line file, like + gcc's version.c, since there's really no content + there. + + Mon Mar 16 21:20:35 1998 Craig Burley + + * expr.c (ffeexpr_sym_impdoitem_): Don't blindly + reset symbol info after calling ffesymbol_error, + to avoid crash. + Mon Mar 16 15:38:50 1998 Craig Burley *************** Sun Mar 15 05:48:49 1998 Craig Burley *** 17,20 **** --- 349,370 ---- of `CPU_Time' (was `Cpu_Time'). + Thu Mar 12 13:50:21 1998 Craig Burley + + * Make-lang.in (g77.c): Use LN instead of LN_S, since + gcc 2.8.1 doesn't provide the latter. + + * top.c (ffe_decode_option): Disable setting of + Tooning and aliasing options for gcc 2.8 and + later. + + * com.c (ffecom_expr_): Put in some of the changes + done in egcs, but essentially just those that have + no actual effect, to make comparisons between + versions easier. Original egcs changes done by + Richard Henderson . + + * lang-options.h: Sort all -f*-intrinsics-* options, + for consistency with other g77 versions. + 1998-03-09 Dave Love *************** Fri Feb 20 12:45:53 1998 Craig Burley *** 42,45 **** --- 392,444 ---- * Makefile.in (f/fini): Don't use -W -Wall with HOST_CC. + Fri Feb 13 00:14:56 1998 Kaveh R. Ghazi + + * com.c (type_for_mode): Add explicit braces to avoid ambiguous `else'. + + * expr.c (ffeexpr_type_combine): Likewise. + (ffeexpr_reduce_): Likewise. + (ffeexpr_declare_parenthesized_): Likewise. + + * src.c (ffesrc_strcmp_1ns2i): Likewise. + (ffesrc_strcmp_2c): Likewise. + (ffesrc_strncmp_2c): Likewise. + + * stb.c (ffestb_halt1_): Likewise. + (ffestb_R90910_): Likewise. + (ffestb_R9109_): Likewise. + + * stc.c (ffestc_R544_equiv_): Likewise. + + * std.c (ffestd_subr_copy_easy_): Likewise. + (ffestd_R1001dump_): Likewise. + (ffestd_R1001dump_1005_1_): Likewise. + (ffestd_R1001dump_1005_2_): Likewise. + (ffestd_R1001dump_1005_3_): Likewise. + (ffestd_R1001dump_1005_4_): Likewise. + (ffestd_R1001dump_1005_5_): Likewise. + (ffestd_R1001dump_1010_2_): Likewise. + + * ste.c (ffeste_R840): Likewise. + + * sts.c (ffests_puttext): Likewise. + + * symbol.c (ffesymbol_check_token_): Likewise. + + * target.c (ffetarget_real1): Likewise. + (ffetarget_real2): Likewise. + + Wed Feb 11 01:44:48 1998 Richard Henderson (rth@cygnus.com) + + * com.c (ffecom_ptr_to_expr) [FFEBLD_opARRAYREF]: Do upper - lower + in the native type, so as to properly handle negative indices. + + Sun Jan 25 12:32:15 1998 Kaveh R. Ghazi + + * Make-lang.in (f77.stage1): Depend on stage1-start so parallel + make works better. + * (f77.stage2): Likewise for stage2-start. + * (f77.stage3): Likewise for stage3-start. + * (f77.stage4): Likewise for stage4-start. + Sun Jan 11 02:14:47 1998 Craig Burley *************** Tue Dec 9 16:20:57 1997 Richard Hender *** 148,151 **** --- 547,554 ---- * com.c (ffecom_type_vardesc_): Vardesc.dims is a `ftnlen*'. + Tue Dec 2 09:57:16 1997 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (f77.clean): Remove g77.c. + Mon Dec 1 19:12:36 1997 Craig Burley *************** Sun Nov 30 22:22:22 1997 Craig Burley *** 168,171 **** --- 571,584 ---- * intrin.def: Fix up spacing a bit. + Tue Nov 25 15:33:28 1997 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (f77.all.build): Add $(exeext) to binary files. + (f77.all.cross, f77.start.encap): Simliarly. + + Fri Nov 21 09:35:20 1997 Fred Fish + + * Make-lang.in (stmp-f2c.h): Move inclusion of F77_FLAGS_TO_PASS + to before override of CC so that the override works. + 1997-11-17 Dave Love *************** Sat Oct 25 23:43:36 1997 Craig Burley *** 203,206 **** --- 616,625 ---- component in braces, to avoid compiler warning. + Mon Oct 13 12:12:41 1997 Richard Henderson + + * Make-lang.in (g77*): Copied from cp/Make-lang.in g++*. + * g77spec.c: New file, mostly copied from g++spec.c + * g77.c: Removed. + Fri Oct 10 13:00:48 1997 Craig Burley *************** Mon Sep 29 16:18:21 1997 Craig Burley *** 228,231 **** --- 647,654 ---- from lex.c. + Mon Sep 29 10:37:07 1997 Jeffrey A Law (law@cygnus.com) + + * intdoc.c (main): Remove unused attribute for main's arguments. + Fri Sep 19 01:12:27 1997 Craig Burley *************** Fri Sep 19 01:12:27 1997 Craig Burley *** 235,238 **** --- 658,671 ---- * fini.c (main): Change return type to `int'. + Thu Sep 18 17:31:38 1997 Jeffrey A Law (law@cygnus.com) + + * proj.h (FFEPROJ_BSEARCH): Delete all references. + (FFEPROJ_STRTOUL): Likewise. + * proj.c (bsearch): Compile this if no bsearch is provided by the + host system. + (strtoul): Similarly. + + * com.c (lang_printable_name): Use verbosity argument. + Wed Sep 17 10:47:08 1997 Craig Burley *************** Wed Sep 17 10:47:08 1997 Craig Burley *** 242,245 **** --- 675,694 ---- * expr.c (ffeexpr_cb_comma_c_): Trivial fixes. + Sun Sep 14 21:01:23 1997 Jeffrey A Law (law@cygnus.com) + + * proj.h: Include ctype.h. + + Sun Sep 14 12:35:20 1997 Fred Fish (fnf@ninemoons.com) + + * proj.h (isascii): Provide a default definition if none is available. + + Thu Sep 11 19:26:10 1997 Dave Love + + * config-lang.in: Remove the messages about possible build problems. + + Wed Sep 10 16:39:47 1997 Jim Wilson + + * Make-lang.in (LN, LN_S): New macros, use where appropriate. + Tue Sep 9 01:59:35 1997 Craig Burley *************** Mon Aug 25 23:48:17 1997 Craig Burley *** 293,296 **** --- 742,750 ---- * f/intrin.h (ffeintrinFamily): Fix to conform to ANSI C. + Sun Aug 24 17:00:27 1997 Jim Wilson + + * Make-lang.in (f77.install-info): Don't cd into srcdir. Add srcdir + to filenames. Use sed to extract base filename for install. + Sun Aug 24 06:52:48 1997 Craig Burley *************** Sun Aug 24 06:52:48 1997 Craig Burley *** 306,309 **** --- 760,768 ---- FFECOM_rttypeFTNINT_; add FFECOM_rttypeDOUBLEREAL_. + Thu Aug 21 13:15:29 1997 Jim Wilson + + * Make-lang.in (f77): Delete f77-runtime. + (f77.all.build, f77.all.cross, f77.rest.encap): Add f77-runtime. + Wed Aug 20 17:18:40 1997 Craig Burley *************** Mon Aug 18 14:27:18 1997 Craig Burley *** 328,331 **** --- 787,806 ---- `void'. + Mon Aug 18 09:01:54 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (F77_OBJS): Re-alphabetize. + * Make-lang.in (F77_SRCS): Likewise. + + Sun Aug 17 08:35:11 1997 Jeffrey A Law (law@cygnus.com) + + * INSTALL: Rebuilt. + * install.texi: Remove "Object File Differences" section. Remove + all references to zzz.o failing comparison tests. + * version.c, version.h: Renamed from zzz.c and zzz.h. Remove + date and time stamps so a 3 stage build reports no differences. + * Make-lang.in: Corresponding changes. + * Makefile.in: Likewise. + * g77.c, parse.c: Likewise. + Sun Aug 17 03:32:44 1997 Craig Burley *************** Sat Aug 16 19:41:33 1997 Craig Burley *** 344,347 **** --- 819,834 ---- _real_type_node. + Sat Aug 16 16:39:33 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * Make-lang.in ($(srcdir)/f/runtime/configure, + $(srcdir)/f/runtime/libU77/configure, f77.mostlyclean, + f77.clean, f77.distclean, f77.maintainer-clean, f77.realclean): + Handle absolute pathname of $(srcdir). + (stmp-f2c.h): New. + (include/f2c.h, f/runtime/Makefile, f/runtime/libF77/Makefile, + f/runtime/libI77/Makefile, f/runtime/libU77/Makefile): Only + depend on stmp-f2c.h. + (f77.maintainer-clean): Don't make itself. + 1997-08-13 Dave Love *************** Sat Aug 16 19:41:33 1997 Craig Burley *** 352,355 **** --- 839,848 ---- * intdoc.h: Document `alarm'. + + Tue Aug 12 10:23:02 1997 Jeffrey A Law (law@cygnus.com) + + * config-lang.in: Don't demand the backend patch. + * com.c (lang_printable_name): Second argument is now an int. Don't + store into the value of the second argument. Mon Aug 11 21:19:22 1997 Craig Burley diff -rcp2N g77-0.5.22/f/Make-lang.in g77-0.5.23/f/Make-lang.in *** g77-0.5.22/f/Make-lang.in Sun Mar 15 10:56:31 1998 --- g77-0.5.23/f/Make-lang.in Wed May 20 17:06:44 1998 *************** *** 1,4 **** ! # Top level makefile fragment for GNU Fortran. -*-makefile-*- ! # Copyright (C) 1995-1997 Free Software Foundation, Inc. #This file is part of GNU Fortran. --- 1,4 ---- ! # Top level makefile fragment for GNU Fortran. ! # Copyright (C) 1995-1998 Free Software Foundation, Inc. #This file is part of GNU Fortran. *************** *** 16,21 **** #You should have received a copy of the GNU General Public License #along with GNU Fortran; see the file COPYING. If not, write to ! #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA ! #02111-1307, USA. # This file provides the language dependent support in the main Makefile. --- 16,21 ---- #You should have received a copy of the GNU General Public License #along with GNU Fortran; see the file COPYING. If not, write to ! #the Free Software Foundation, 59 Temple Place - Suite 330, ! #Boston, MA 02111-1307, USA. # This file provides the language dependent support in the main Makefile. *************** *** 33,96 **** # It should also provide rules for: # ! # - making any compiler driver (eg: g77) ! # - the compiler proper (eg: f771) # - define the names for selecting the language in LANGUAGES. # # $(srcdir) must be set to the gcc/ source directory (not gcc/f/). # ! # Extra flags to pass to recursive makes (and to sub-configure). ! # Use different quoting rules compared with FLAGS_TO_PASS so we can use ! # this to set environment variables as well ! # Note that GCC_FOR_TARGET, GCC_FLAGS aren't in here -- treated separately. ! F77_FLAGS_TO_PASS = \ ! CROSS="$(CROSS)" \ ! AR_FLAGS="$(AR_FLAGS)" \ ! AR_FOR_TARGET="$(AR_FOR_TARGET)" \ ! BISON="$(BISON)" \ ! BISONFLAGS="$(BISONFLAGS)" \ ! CC="$(CC)" \ ! CFLAGS="$(CFLAGS)" \ ! X_CFLAGS="$(X_CFLAGS)" \ ! LDFLAGS="$(LDFLAGS)" \ ! LEX="$(LEX)" \ ! LEXFLAGS="$(LEXFLAGS)" \ ! MAKEINFO="$(MAKEINFO)" \ ! MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \ ! RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \ ! RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \ ! SHELL="$(SHELL)" \ ! exec_prefix="$(exec_prefix)" \ ! prefix="$(prefix)" \ ! tooldir="$(tooldir)" \ ! bindir="$(bindir)" \ ! libsubdir="$(libsubdir)" ! # "F77_FOR_BUILD=$(F77_FOR_BUILD)" \ ! # "F77FLAGS=$(F77FLAGS)" \ ! # "F77_FOR_TARGET=$(F77_FOR_TARGET)" ! ! # This flag controls whether to install (overwrite) f77 on this system, ! # and also whether to uninstall it when using the uninstall target. ! # As shipped, the flag is a test of whether the `f77_install_ok' ! # file exists in the build or source directories (top level), but ! # you can just change it here if you like. ! F77_INSTALL_FLAG = [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ] ! ! # This flag is similar to F77_INSTALL_FLAG, but controls whether ! # to install (ovewrite) f2c-related items on this system. Currently ! # these are `include/f2c.h' and `lib/libf2c.a', though at some point ! # `bin/f2c' itself might be added to the g77 distribution. ! F2C_INSTALL_FLAG = [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ] ! ! # This flag controls whether it is safe to install gcc's libf2c.a ! # even when there's already a lib/libf2c.a installed (which, unless ! # F2C_INSTALL_FLAG is set, will be left alone). ! F2CLIBOK = [ -f f2c-exists-ok -o -f $(srcdir)/f2c-exists-ok ] ! ! # Actual names to use when installing a native compiler. ! F77_INSTALL_NAME = `t='$(program_transform_name)'; echo f77 | sed $$t` G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t` ! # Actual names to use when installing a cross-compiler. ! F77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo f77 | sed $$t` G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t` # --- 33,46 ---- # It should also provide rules for: # ! # - making any compiler driver (eg: g++) ! # - the compiler proper (eg: cc1plus) # - define the names for selecting the language in LANGUAGES. # # $(srcdir) must be set to the gcc/ source directory (not gcc/f/). # ! # Actual name to use when installing a native compiler. G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t` ! # Actual name to use when installing a cross-compiler. G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t` # *************** G77_CROSS_NAME = `t='$(program_transform *** 99,130 **** # into the F77 rule, but that needs a little bit of work # to do the right thing within all.cross. ! F77 f77: f771 f77-runtime # Tell GNU make to ignore these if they exist. .PHONY: F77 f77 f77-runtime f77-runtime-unsafe f77.all.build f77.all.cross \ ! f77.start.encap f77.rest.encap f77.info f77.dvi maybe-f2c \ ! f77.install-normal install-libf77 install-f2c-all install-f2c-header \ ! install-f2c-lib f77.install-common f77.install-info f77.install-man \ ! f77.uninstall f77.mostlyclean f77.clean f77.distclean f77.extraclean \ ! f77.maintainer-clean f77.realclean f77.stage1 f77.stage2 f77.stage3 \ ! f77.stage4 f77.distdir f77.rebuilt ! ! # Create the compiler driver for g77 (only if `f77' is in LANGUAGES). ! g77: $(srcdir)/f/g77.c $(srcdir)/f/zzz.c $(CONFIG_H) $(LIBDEPS) ! case '$(LANGUAGES)' in \ ! *f77*) \ ! $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) \ ! -o $@ $(srcdir)/f/g77.c $(srcdir)/f/zzz.c $(LIBS) ;; \ ! esac ! ! # Create a version of the g77 driver which calls the cross-compiler ! # (only if `f77' is in LANGUAGES). ! g77-cross: $(srcdir)/f/g77.c $(srcdir)/f/zzz.c version.o $(LIBDEPS) ! case '$(LANGUAGES)' in \ ! *f77*) \ ! $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) \ ! -DGCC_NAME=\"$(GCC_CROSS_NAME)\" \ ! -o $@ $(srcdir)/f/g77.c $(srcdir)/f/zzz.c $(LIBS) ;; \ esac F77_SRCS = \ --- 49,135 ---- # into the F77 rule, but that needs a little bit of work # to do the right thing within all.cross. ! F77 f77: f771$(exeext) # Tell GNU make to ignore these if they exist. .PHONY: F77 f77 f77-runtime f77-runtime-unsafe f77.all.build f77.all.cross \ ! f77.start.encap f77.rest.encap f77.info f77.dvi \ ! f77.install-normal install-libf77 \ ! f77.install-common f77.install-info f77.install-man \ ! f77.uninstall f77.mostlyclean f77.clean f77.distclean \ ! f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \ ! f77.stage1 f77.stage2 f77.stage3 f77.stage4 gnumake-check g77-patch ! ! # We want to try to catch the common trap of building outside srcdir ! # without GNU make. We do that by adding a phony target to the ! # the C and Fortran language dependencies, and doing the check in the ! # phony target. (If we used $(LANGUAGES), that'd include `gcov', ! # and `gcov's dependency includes an explicit relink, so we don't ! # do that.) ! f77 F77 c C: gnumake-check ! gnumake-check: ! @if [ $(srcdir) != . ]; then \ ! case `$(MAKE) --version 2>/dev/null` in \ ! *GNU*) true ;; \ ! *) echo 1>&2 ''; \ ! echo 1>&2 'You must use GNU make to build outside the source directory.'; \ ! echo 1>&2 ''; \ ! false;; \ ! esac; \ ! else true; \ ! fi ! ! g77.c: $(srcdir)/gcc.c ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ esac + if [ -f lang-f77 ]; then \ + rm -f g77.c; \ + $(LN) $(srcdir)/gcc.c g77.c; \ + fi + + g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h + case "$(LANGUAGES)" in \ + *[fF]77*) touch lang-f77;; \ + *) rm -f lang-f77;; \ + esac + if [ -f lang-f77 ]; then \ + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/f/g77spec.c; \ + fi + + g77version.o: $(srcdir)/f/version.c + case "$(LANGUAGES)" in \ + *[fF]77*) touch lang-f77;; \ + *) rm -f lang-f77;; \ + esac + if [ -f lang-f77 ]; then \ + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o g77version.o \ + $(srcdir)/f/version.c; \ + fi + + # N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added. + # It'd be nice if we could find an easier way to do this---rather than have + # to track changes to the toplevel gcc Makefile as well. + # We depend on g77.c last, to make it obvious where it came from. + g77.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g77.c + if [ -f lang-f77 ]; then \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(DRIVER_DEFINES) \ + -DLANG_SPECIFIC_DRIVER -c g77.c; \ + fi + + # Create the compiler driver for g77. + g77$(exeext): g77.o g77spec.o g77version.o version.o choose-temp.o pexecute.o prefix.o \ + $(LIBDEPS) $(EXTRA_GCC_OBJS) + if [ -f lang-f77 ]; then \ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g77.o g77spec.o g77version.o \ + version.o choose-temp.o pexecute.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS); \ + fi + + # Create a version of the g77 driver which calls the cross-compiler. + g77-cross$(exeext): g77$(exeext) + if [ -f lang-f77 ]; then \ + rm -f g77-cross$(exeext); \ + cp g77$(exeext) g77-cross$(exeext); \ + fi F77_SRCS = \ *************** F77_SRCS = \ *** 174,177 **** --- 179,183 ---- $(srcdir)/f/name.c \ $(srcdir)/f/name.h \ + $(srcdir)/f/output.j \ $(srcdir)/f/parse.c \ $(srcdir)/f/proj.c \ *************** F77_SRCS = \ *** 227,240 **** $(srcdir)/f/type.c \ $(srcdir)/f/type.h \ $(srcdir)/f/where.c \ ! $(srcdir)/f/where.h \ ! $(srcdir)/f/zzz.c \ ! $(srcdir)/f/zzz.h ! f771: $(P) $(F77_SRCS) $(LIBDEPS) stamp-objlist f/Makefile ! $(MAKE) -f f/Makefile $(FLAGS_TO_PASS) VPATH=$(srcdir) srcdir=$(srcdir) f771 ! ! f/Makefile: $(srcdir)/f/Makefile.in $(srcdir)/configure ! $(SHELL) config.status # Note that the runtime is built in the top-level directory rather --- 233,246 ---- $(srcdir)/f/type.c \ $(srcdir)/f/type.h \ + $(srcdir)/f/version.c \ + $(srcdir)/f/version.h \ $(srcdir)/f/where.c \ ! $(srcdir)/f/where.h ! f771$(exeext): $(P) $(F77_SRCS) $(LIBDEPS) stamp-objlist ! touch lang-f77 ! cd f; $(MAKE) $(FLAGS_TO_PASS) \ ! HOST_CC="$(HOST_CC)" HOST_CFLAGS="$(HOST_CFLAGS)" HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \ ! ../f771$(exeext) # Note that the runtime is built in the top-level directory rather *************** f/Makefile: $(srcdir)/f/Makefile.in $(sr *** 245,262 **** # We depend on GCC_PASSES through f/runtime/Makefile. stmp-headers = stmp-headers # to be overrideable in unsafe version # Depend on stmp-headers, not stmp-int-hdrs, since libF77 needs float.h. ! f77-runtime: f/runtime/Makefile include/f2c.h $(stmp-headers) \ f/runtime/libF77/Makefile f/runtime/libI77/Makefile f/runtime/libU77/Makefile case "$(LANGUAGES)" in \ ! *f77*) top=`pwd`; \ cd f/runtime && $(MAKE) \ ! GCC_FOR_TARGET="`case '$(GCC_FOR_TARGET)' in \ './xgcc -B./') echo $${top}/xgcc -B$${top}/;; \ *) echo '$(GCC_FOR_TARGET)';; esac`" \ ! GCC_FLAGS="$(GCC_FLAGS)" $(F77_FLAGS_TO_PASS) \ ! all ;; \ ! esac ! # This one doesn't depend on cc1 etc. but f2c.h may not be found, # in particular, at present... f77-runtime-unsafe: --- 251,284 ---- # We depend on GCC_PASSES through f/runtime/Makefile. stmp-headers = stmp-headers # to be overrideable in unsafe version + # Depend on stmp-headers, not stmp-int-hdrs, since libF77 needs float.h. ! f77-runtime: f/runtime/Makefile f/runtime/g2c.h f/runtime/f2c.h \ ! $(stmp-headers) \ f/runtime/libF77/Makefile f/runtime/libI77/Makefile f/runtime/libU77/Makefile case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! top=`pwd`; \ ! src=`cd $(srcdir); pwd`; \ cd f/runtime && $(MAKE) \ ! AR="$(AR)" \ ! AR_FLAGS="$(AR_FLAGS)" \ ! CC="`case '$(GCC_FOR_TARGET)' in \ './xgcc -B./') echo $${top}/xgcc -B$${top}/;; \ *) echo '$(GCC_FOR_TARGET)';; esac`" \ ! CFLAGS="$(GCC_CFLAGS)" \ ! LIBG2C="$${top}/libg2c.a" \ ! F2C_H_DIR="$${src}/f/runtime" \ ! G2C_H_DIR="$${top}/f/runtime" \ ! GCC_H_DIR="$${top}/include" \ ! RANLIB="$(RANLIB)" \ ! RANLIB_TEST="$(RANLIB_TEST)" \ ! SHELL="$(SHELL)" \ ! all; \ ! fi ! # This one doesn't depend on cc1 etc. but f2c.h (g2c.h?) may not be found, # in particular, at present... f77-runtime-unsafe: *************** f77-runtime-unsafe: *** 273,282 **** # current autoconf and bash 2.0. Rather than create an empty one to # read, we may as well use a non-existent one, `no-such-file' below. ! include/f2c.h \ ! f/runtime/Makefile \ ! f/runtime/libF77/Makefile \ ! f/runtime/libI77/Makefile \ ! f/runtime/libU77/Makefile: \ ! $(srcdir)/f/runtime/f2c.h.in \ $(srcdir)/f/com.h $(srcdir)/f/proj.h \ $(srcdir)/f/runtime/Makefile.in \ --- 295,300 ---- # current autoconf and bash 2.0. Rather than create an empty one to # read, we may as well use a non-existent one, `no-such-file' below. ! stamp-g2c: \ ! $(srcdir)/f/runtime/g2c.h.in \ $(srcdir)/f/com.h $(srcdir)/f/proj.h \ $(srcdir)/f/runtime/Makefile.in \ *************** f/runtime/libU77/Makefile: \ *** 288,330 **** $(GCC_PARTS) # The make "stage?" in compiler spec. is fully qualified as above ! top=`pwd`; \ ! src=`cd $(srcdir); pwd`; \ cd f/runtime; \ rm -f no-such-file; \ - $(F77_FLAGS_TO_PASS) \ CC="`case '$(GCC_FOR_TARGET)' in \ './xgcc -B./') echo $${top}/xgcc -B$${top}/;; \ *) echo '$(GCC_FOR_TARGET)';; esac`" \ CONFIG_SITE=no-such-file $(SHELL) \ ! $${src}/f/runtime/configure --srcdir=$${src}/f/runtime ! top=`pwd`; \ ! src=`cd $(srcdir); pwd`; \ ! cd f/runtime/libU77; \ ! rm -f no-such-file; \ ! $(F77_FLAGS_TO_PASS) \ ! CC="`case '$(GCC_FOR_TARGET)' in \ ! './xgcc -B./') echo $${top}/xgcc -B$${top}/;; \ ! *) echo '$(GCC_FOR_TARGET)';; esac`" \ ! CONFIG_SITE=no-such-file $(SHELL) \ ! $${src}/f/runtime/libU77/configure --srcdir=$${src}/f/runtime/libU77 - #For now, omit f2c stuff. -- burley - #f2c: stmp-headers f/f2c/Makefile - # cd f/f2c; $(MAKE) all - # - #f/f2c/Makefile: $(srcdir)/f/f2c/Makefile.in $(GCC_PARTS) \ - # $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) - # top=`pwd`; cd f/f2c; \ - # $${top}/f/f2c/configure --srcdir=$${top}/f/f2c # # Build hooks: ! # I'm not sure there's a way of getting f2c into here conditionally on ! # the --enable-f2c flag detected by config-lang.in so kluge it with the ! # maybe-f2c target by looking at STAGESTUFF. ! f77.all.build: g77 maybe-f2c ! f77.all.cross: g77-cross maybe-f2c ! f77.start.encap: g77 maybe-f2c ! f77.rest.encap: f77.info: $(srcdir)/f/g77.info --- 306,351 ---- $(GCC_PARTS) # The make "stage?" in compiler spec. is fully qualified as above ! # libU77 now is configured automatically by this step. ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! rm -f stamp-g2c; \ ! test -d f || mkdir f; \ ! test -d f/runtime || mkdir f/runtime; \ ! test -d f/runtime/libF77 || mkdir f/runtime/libF77; \ ! test -d f/runtime/libI77 || mkdir f/runtime/libI77; \ ! test -d f/runtime/libU77 || mkdir f/runtime/libU77; \ ! fi ! if [ -f lang-f77 ]; then \ ! top=`pwd`; src=`cd $(srcdir); pwd`; \ cd f/runtime; \ rm -f no-such-file; \ CC="`case '$(GCC_FOR_TARGET)' in \ './xgcc -B./') echo $${top}/xgcc -B$${top}/;; \ *) echo '$(GCC_FOR_TARGET)';; esac`" \ + CFLAGS="-I$${top}/include $(GCC_CFLAGS)" \ CONFIG_SITE=no-such-file $(SHELL) \ ! $${src}/f/runtime/configure --srcdir=$${src}/f/runtime; \ ! fi ! if [ -f lang-f77 ]; then \ ! touch stamp-g2c; \ ! fi ! ! # Support parallel build. ! f/runtime/g2c.h \ ! f/runtime/Makefile \ ! f/runtime/libF77/Makefile \ ! f/runtime/libI77/Makefile \ ! f/runtime/libU77/Makefile: stamp-g2c # # Build hooks: ! f77.all.build: g77$(exeext) ! f77.all.cross: g77-cross$(exeext) ! f77.start.encap: g77$(exeext) ! f77.rest.encap: f77-runtime f77.info: $(srcdir)/f/g77.info *************** f77.dvi: $(srcdir)/f/g77.dvi *** 332,340 **** # g77 documentation. ! $(srcdir)/f/g77.info: f/g77.texi f/bugs.texi f/install.texi f/news.texi f/intdoc.texi ! cd $(srcdir)/f; $(MAKEINFO) g77.texi ! $(srcdir)/f/g77.dvi: f/g77.texi f/bugs.texi f/install.texi f/news.texi f/intdoc.texi ! cd $(srcdir)/f; $(TEXI2DVI) g77.texi # This dance is all about producing accurate documentation for g77's --- 353,374 ---- # g77 documentation. ! $(srcdir)/f/g77.info: f/g77.texi f/bugs.texi f/g77install.texi f/news.texi f/intdoc.texi ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! rm $(srcdir)/f/g77.info-*; \ ! $(MAKEINFO) -I$(srcdir)/f -o $(srcdir)/f/g77.info $(srcdir)/f/g77.texi; \ ! fi ! $(srcdir)/f/g77.dvi: f/g77.texi f/bugs.texi f/g77install.texi f/news.texi f/intdoc.texi ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! $(TEXI2DVI) -I$(srcdir)/f -o f/g77.dvi $(srcdir)/f/g77.texi; \ ! fi # This dance is all about producing accurate documentation for g77's *************** $(srcdir)/f/g77.dvi: f/g77.texi f/bugs.t *** 358,385 **** # produced from it. $(srcdir)/f/intdoc.texi: f/intdoc.c f/intdoc.in f/ansify.c f/intrin.def f/intrin.h ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \ ! `echo $(srcdir)/f/ansify.c | sed 's,^\./,,'` -o f/ansify ! f/ansify < $(srcdir)/f/intdoc.in > f/intdoc.h0 $(srcdir)/f/intdoc.in ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -I./f \ ! `echo $(srcdir)/f/intdoc.c | sed 's,^\./,,'` -o f/intdoc ! f/intdoc > $(srcdir)/f/intdoc.texi ! rm f/intdoc f/ansify f/intdoc.h0 $(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi cd $(srcdir)/f; $(MAKEINFO) -D BUGSONLY --no-header --no-split \ ! --no-validate bugs0.texi -o BUGS ! $(srcdir)/f/INSTALL: f/install0.texi f/install.texi cd $(srcdir)/f; $(MAKEINFO) -D INSTALLONLY --no-header --no-split \ ! --no-validate install0.texi -o INSTALL $(srcdir)/f/NEWS: f/news0.texi f/news.texi cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \ ! --no-validate news0.texi -o NEWS ! $(srcdir)/f/runtime/configure: $(srcdir)/f/runtime/configure.in ! cd $(srcdir)/f/runtime && $(MAKE) srcdir=. -f Makefile.in rebuilt $(srcdir)/f/runtime/libU77/configure: $(srcdir)/f/runtime/libU77/configure.in ! cd $(srcdir)/f/runtime && $(MAKE) srcdir=. -f Makefile.in rebuilt f77.rebuilt: $(srcdir)/f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \ --- 392,440 ---- # produced from it. $(srcdir)/f/intdoc.texi: f/intdoc.c f/intdoc.in f/ansify.c f/intrin.def f/intrin.h ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \ ! `echo $(srcdir)/f/ansify.c | sed 's,^\./,,'` -o f/ansify; \ ! f/ansify < $(srcdir)/f/intdoc.in > f/intdoc.h0 $(srcdir)/f/intdoc.in; \ ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -I./f \ ! `echo $(srcdir)/f/intdoc.c | sed 's,^\./,,'` -o f/intdoc; \ ! f/intdoc > $(srcdir)/f/intdoc.texi; \ ! rm f/intdoc f/ansify f/intdoc.h0; \ ! fi $(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi cd $(srcdir)/f; $(MAKEINFO) -D BUGSONLY --no-header --no-split \ ! --no-validate -o BUGS bugs0.texi ! $(srcdir)/f/INSTALL: f/install0.texi f/g77install.texi cd $(srcdir)/f; $(MAKEINFO) -D INSTALLONLY --no-header --no-split \ ! --no-validate -o INSTALL install0.texi $(srcdir)/f/NEWS: f/news0.texi f/news.texi cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \ ! --no-validate -o NEWS news0.texi ! $(srcdir)/f/runtime/configure: $(srcdir)/f/runtime/configure.in ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! rm -f f/runtime/config.cache f/runtime/Makefile f/runtime/g2c.h \ ! && cd $(srcdir)/f/runtime && autoconf && rm -f config.cache; \ ! fi $(srcdir)/f/runtime/libU77/configure: $(srcdir)/f/runtime/libU77/configure.in ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 ]; then \ ! rm -f f/runtime/libU77/config.cache f/runtime/libU77/Makefile \ ! f/runtime/g2c.h \ ! && cd $(srcdir)/f/runtime/libU77 && autoconf && rm -f config.cache; \ ! fi f77.rebuilt: $(srcdir)/f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \ *************** f77.rebuilt: $(srcdir)/f/g77.info $(srcd *** 387,521 **** $(srcdir)/f/runtime/libU77/configure ! maybe-f2c: ! #For now, omit f2c stuff. -- burley ! # case "$(STAGESTUFF)" in *f2c*) $(MAKE) f2c;; esac # # Install hooks: # f771 is installed elsewhere as part of $(COMPILERS). ! f77.install-normal: install-libf77 install-f2c-all # Install the F77 run time library. install-libf77: f77-runtime ! # Check for the presence of other versions of the library and includes. ! # Test libf2c.* in case of a shared version, for instance. ! @if test -z "$(F2CLIBOK)" && \ ! test -z "$(F2C_INSTALL_FLAG)" && \ ! test "`echo $(libdir)/libf2c.*`" != "$(libdir)/libf2c.*"; then \ ! echo ; \ ! echo 'You already have a version of libf2c installed as' $(libdir)/libf2c.*; \ ! echo 'To use g77 this must be consistent with the one that will be built.'; \ ! echo 'You should probably delete it and/or install ./libf2c.a in its place.'; \ ! echo 'Resume the "make install" after removing the existing library or'; \ ! echo 'define the make variable F2CLIBOK to avoid this test.'; \ ! echo 'Check also for' $(includedir)/f2c.h 'per INSTALL instructions.'; \ ! echo '(Note that a quick and easy way to resume "make -k install" is to'; \ ! echo 'use "make install-libf77".)'; \ ! exit 1; else true; fi ! if [ -f libf2c.a ] ; then \ ! $(INSTALL_DATA) libf2c.a $(libsubdir)/libf2c.a; \ ! if $(RANLIB_TEST) ; then \ ! (cd $(libsubdir); $(RANLIB) libf2c.a); else true; fi; \ ! chmod a-x $(libsubdir)/libf2c.a; \ ! else true; fi ! if [ -f include/f2c.h ] ; then \ ! $(INSTALL_DATA) include/f2c.h $(libsubdir)/include/f2c.h; \ ! else true; fi ! ! # Install the f2c-related stuff in the directories ! # where f2c and vanilla ld might look for them. ! ! install-f2c-all: install-f2c-header install-f2c-lib ! ! install-f2c-header: ! -if test -n "$(F2C_INSTALL_FLAG)" && test -f include/f2c.h; then \ ! $(INSTALL_DATA) include/f2c.h $(includedir)/f2c.h; \ ! chmod a+r $(includedir)/f2c.h; \ else true; fi ! ! install-f2c-lib: ! -if test -n "$(F2C_INSTALL_FLAG)" && test -f libf2c.a; then \ ! $(INSTALL_DATA) libf2c.a $(libdir)/libf2c.a; \ ! if $(RANLIB_TEST) ; then \ ! (cd $(libdir); $(RANLIB) libf2c.a); else true; fi; \ ! chmod a-x $(libdir)/libf2c.a; \ else true; fi # Install the driver program as $(target)-g77 # and also as either g77 (if native) or $(tooldir)/bin/g77. f77.install-common: ! -if [ -f f771$(exeext) ] ; then \ if [ -f g77-cross$(exeext) ] ; then \ rm -f $(bindir)/$(G77_CROSS_NAME)$(exeext); \ $(INSTALL_PROGRAM) g77-cross$(exeext) $(bindir)/$(G77_CROSS_NAME)$(exeext); \ chmod a+x $(bindir)/$(G77_CROSS_NAME)$(exeext); \ - if $(F77_INSTALL_FLAG) ; then \ - rm -f $(bindir)/$(F77_CROSS_NAME)$(exeext); \ - ln $(bindir)/$(G77_CROSS_NAME)$(exeext) $(bindir)/$(F77_CROSS_NAME)$(exeext) \ - > /dev/null 2>&1 \ - || cp $(bindir)/$(G77_CROSS_NAME)$(exeext) $(bindir)/$(F77_CROSS_NAME)$(exeext) ; \ - fi ; \ else \ rm -f $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) g77$(exeext) $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ chmod a+x $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ - if $(F77_INSTALL_FLAG) ; then \ - rm -f $(bindir)/$(F77_INSTALL_NAME)$(exeext); \ - ln $(bindir)/$(G77_INSTALL_NAME)$(exeext) $(bindir)/$(F77_INSTALL_NAME)$(exeext) \ - > /dev/null 2>&1 \ - || cp $(bindir)/$(G77_INSTALL_NAME)$(exeext) $(bindir)/$(F77_INSTALL_NAME)$(exeext) ; \ - fi ; \ fi ; \ else true; fi f77.install-info: f77.info ! if [ -f $(srcdir)/f/g77.info ] ; then \ rm -f $(infodir)/g77.info*; \ ! cd $(srcdir)/f; for f in g77.info*; \ ! do $(INSTALL_DATA) $$f $(infodir)/$$f; done; \ chmod a-x $(infodir)/g77.info*; \ fi f77.install-man: $(srcdir)/f/g77.1 ! -if [ -f f771$(exeext) ] ; then \ if [ -f g77-cross$(exeext) ] ; then \ rm -f $(mandir)/$(G77_CROSS_NAME)$(manext); \ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_CROSS_NAME)$(manext); \ chmod a-x $(mandir)/$(G77_CROSS_NAME)$(manext); \ - if $(F77_INSTALL_FLAG) ; then \ - rm -f $(mandir)/$(F77_CROSS_NAME)$(manext); \ - ln $(mandir)/$(G77_CROSS_NAME)$(manext) $(mandir)/$(F77_CROSS_NAME)$(manext) \ - > /dev/null 2>&1 \ - || cp $(mandir)/$(F77_CROSS_NAME)$(manext) $(mandir)/$(F77_CROSS_NAME)$(manext) ; \ - fi ;\ else \ rm -f $(mandir)/$(G77_INSTALL_NAME)$(manext); \ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_INSTALL_NAME)$(manext); \ chmod a-x $(mandir)/$(G77_INSTALL_NAME)$(manext); \ - if $(F77_INSTALL_FLAG) ; then \ - rm -f $(mandir)/$(F77_INSTALL_NAME)$(manext); \ - ln $(mandir)/$(G77_INSTALL_NAME)$(manext) $(mandir)/$(F77_INSTALL_NAME)$(manext) \ - > /dev/null 2>&1 \ - || cp $(mandir)/$(F77_INSTALL_NAME)$(manext) $(mandir)/$(F77_INSTALL_NAME)$(manext) ; \ - fi ;\ fi; \ else true; fi f77.uninstall: ! -if $(F77_INSTALL_FLAG) ; then \ ! rm -rf $(bindir)/$(F77_INSTALL_NAME)$(exeext) ; \ ! rm -rf $(bindir)/$(F77_CROSS_NAME)$(exeext) ; \ ! rm -rf $(mandir)/$(F77_INSTALL_NAME)$(manext) ; \ ! rm -rf $(mandir)/$(F77_CROSS_NAME)$(manext) ; \ ! fi ! -rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext) ! -rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext) ! -rm -rf $(mandir)/$(G77_INSTALL_NAME)$(manext) ! -rm -rf $(mandir)/$(G77_CROSS_NAME)$(manext) ! -rm -rf $(infodir)/g77.info* ! -rm -rf $(libsubdir)/libf2c.a ! -if $(F2C_INSTALL_FLAG) ; then \ ! rm -rf include/f2c.h ; \ ! rm -rf $(libdir)/libf2c.a ; \ fi # --- 442,568 ---- $(srcdir)/f/runtime/libU77/configure ! g77-patch: ! touch lang-f77 ! $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g LANGUAGES=f77 \ ! -f f/Make-lang.in f77.rebuilt ! rm lang-f77 ! # # Install hooks: # f771 is installed elsewhere as part of $(COMPILERS). ! f77.install-normal: install-libf77 # Install the F77 run time library. install-libf77: f77-runtime ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 -a -f libg2c.a ] ; then \ ! $(INSTALL_DATA) libg2c.a $(libsubdir)/libg2c.a; \ ! if $(RANLIB_TEST_FOR_TARGET) ; then \ ! (cd $(libsubdir); $(RANLIB_FOR_TARGET) libg2c.a); else true; fi; \ ! chmod a-x $(libsubdir)/libg2c.a; \ else true; fi ! if [ -f lang-f77 -a -f f/runtime/g2c.h ] ; then \ ! $(INSTALL_DATA) f/runtime/g2c.h $(libsubdir)/include/g2c.h; \ else true; fi + @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \ + echo ''; \ + echo 'Warning: g77 no longer installs libf2c.a or f2c.h.'; \ + echo ' You must do so yourself. For more information,'; \ + echo ' read "Distributing Binaries" in the g77 docs.'; \ + echo ' (To turn off this warning, delete the file'; \ + echo ' f2c-install-ok in the source or build directory.)'; \ + echo ''; \ + fi # Install the driver program as $(target)-g77 # and also as either g77 (if native) or $(tooldir)/bin/g77. f77.install-common: ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! -if [ -f lang-f77 -a -f f771$(exeext) ] ; then \ if [ -f g77-cross$(exeext) ] ; then \ rm -f $(bindir)/$(G77_CROSS_NAME)$(exeext); \ $(INSTALL_PROGRAM) g77-cross$(exeext) $(bindir)/$(G77_CROSS_NAME)$(exeext); \ chmod a+x $(bindir)/$(G77_CROSS_NAME)$(exeext); \ else \ rm -f $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) g77$(exeext) $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ chmod a+x $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ fi ; \ else true; fi + @if [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]; then \ + echo ''; \ + echo 'Warning: g77 no longer installs an f77 command.'; \ + echo ' You must do so yourself. For more information,'; \ + echo ' read "Distributing Binaries" in the g77 docs.'; \ + echo ' (To turn off this warning, delete the file'; \ + echo ' f77-install-ok in the source or build directory.)'; \ + echo ''; \ + fi + # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir + # to do the install. The sed rule was copied from stmp-int-hdrs. f77.install-info: f77.info ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! if [ -f lang-f77 -a -f $(srcdir)/f/g77.info ] ; then \ rm -f $(infodir)/g77.info*; \ ! for f in $(srcdir)/f/g77.info*; do \ ! realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ ! $(INSTALL_DATA) $$f $(infodir)/$$realfile; \ ! done; \ chmod a-x $(infodir)/g77.info*; \ fi + @if [ -f lang-f77 -a -f $(srcdir)/f/g77.info ] ; then \ + if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + echo " install-info --info-dir=$(infodir) $(infodir)/g77.info"; \ + install-info --info-dir=$(infodir) $(infodir)/g77.info || : ; \ + else : ; fi; \ + else : ; fi f77.install-man: $(srcdir)/f/g77.1 ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! -if [ -f lang-f77 -a -f f771$(exeext) ] ; then \ if [ -f g77-cross$(exeext) ] ; then \ rm -f $(mandir)/$(G77_CROSS_NAME)$(manext); \ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_CROSS_NAME)$(manext); \ chmod a-x $(mandir)/$(G77_CROSS_NAME)$(manext); \ else \ rm -f $(mandir)/$(G77_INSTALL_NAME)$(manext); \ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_INSTALL_NAME)$(manext); \ chmod a-x $(mandir)/$(G77_INSTALL_NAME)$(manext); \ fi; \ else true; fi f77.uninstall: ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! @if [ -f lang-f77 ] ; then \ ! if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ ! echo " install-info --delete --info-dir=$(infodir) $(infodir)/g77.info"; \ ! install-info --delete --info-dir=$(infodir) $(infodir)/g77.info || : ; \ ! else : ; fi; \ ! else : ; fi ! -if [ -f lang-f77 ]; then \ ! rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext); \ ! rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext); \ ! rm -rf $(mandir)/$(G77_INSTALL_NAME)$(manext); \ ! rm -rf $(mandir)/$(G77_CROSS_NAME)$(manext); \ ! rm -rf $(infodir)/g77.info*; \ ! rm -rf $(libsubdir)/libg2c.a; \ ! rm -rf $(libsubdir)/include/g2c.h; \ fi # *************** f77.uninstall: *** 526,592 **** f77.mostlyclean: -rm -f f/*$(objext) ! -rm -f f/fini f/f771 f/stamp-str f/str-*.h f/str-*.j f/intdoc f/ansify f/intdoc.h0 ! -cd f/runtime; $(MAKE) -f ../../$(srcdir)/f/runtime/Makefile.in mostlyclean f77.clean: ! -cd f/runtime; $(MAKE) -f ../../$(srcdir)/f/runtime/Makefile.in clean f77.distclean: ! -cd f/runtime; $(MAKE) -f ../../$(srcdir)/f/runtime/Makefile.in distclean ! -rm -f f/Makefile ! # like gcc's extraclean, which does clean f/ for us, but not f/gbe, ! # f/runtime, f/runtime/libF77, f/runtime/libI77, and f/runtime/libU77, ! # so do those. ! f77.extraclean: f77.distclean ! -rm -f f/*/=* f/*/"#"* f/*/*~* ! -rm -f f/*/patch* f/*/*.orig f/*/*.rej ! -rm -f f/*/*.dvi f/*/*.oaux f/*/*.d f/*/*.[zZ] f/*/*.gz ! -rm -f f/*/*.tar f/*/*.xtar f/*/*diff f/*/*.diff.* f/*/*.tar.* f/*/*.xtar.* f/*/*diffs ! -rm -f f/*/*lose f/*/*.s f/*/*.s[0-9] f/*/*.i ! -rm -f f/*/*/=* f/*/*/"#"* f/*/*/*~* ! -rm -f f/*/*/patch* f/*/*/*.orig f/*/*/*.rej ! -rm -f f/*/*/*.dvi f/*/*/*.oaux f/*/*/*.d f/*/*/*.[zZ] f/*/*/*.gz ! -rm -f f/*/*/*.tar f/*/*/*.xtar f/*/*/*diff f/*/*/*.diff.* f/*/*/*.tar.* f/*/*/*.xtar.* f/*/*/*diffs ! -rm -f f/*/*/*lose f/*/*/*.s f/*/*/*.s[0-9] f/*/*/*.i ! # realclean is the pre-2.7.0 name for maintainer-clean ! f77.maintainer-clean f77.realclean: f77.distclean ! -cd f/runtime; $(MAKE) -f ../../$(srcdir)/f/runtime/Makefile.in maintainer-clean ! -$(MAKE) f77.maintainer-clean -rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi # # Stage hooks: # The main makefile has already created stage?/f. ! G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j RUNTIMESTAGESTUFF = f/runtime/config.cache f/runtime/config.log \ ! f/runtime/config.status f/runtime/Makefile f/runtime/stamp-lib ! LIBF77STAGESTUFF = f/runtime/libF77/*$(objext) f/runtime/libF77/Makefile ! LIBI77STAGESTUFF = f/runtime/libI77/*$(objext) f/runtime/libI77/Makefile ! LIBU77STAGESTUFF = f/runtime/libU77/*$(objext) f/runtime/libU77/Makefile \ ! f/runtime/libU77/config.cache f/runtime/libU77/config.log \ ! f/runtime/libU77/config.status ! ! f77.stage1: ! -mv $(G77STAGESTUFF) stage1/f ! -mv $(RUNTIMESTAGESTUFF) stage1/f/runtime ! -mv $(LIBF77STAGESTUFF) stage1/f/runtime/libF77 ! -mv $(LIBI77STAGESTUFF) stage1/f/runtime/libI77 ! -mv $(LIBU77STAGESTUFF) stage1/f/runtime/libU77 ! f77.stage2: ! -mv $(G77STAGESTUFF) stage2/f ! -mv $(RUNTIMESTAGESTUFF) stage2/f/runtime ! -mv $(LIBF77STAGESTUFF) stage2/f/runtime/libF77 ! -mv $(LIBI77STAGESTUFF) stage2/f/runtime/libI77 ! -mv $(LIBU77STAGESTUFF) stage2/f/runtime/libU77 ! f77.stage3: ! -mv $(G77STAGESTUFF) stage3/f ! -mv $(RUNTIMESTAGESTUFF) stage3/f/runtime ! -mv $(LIBF77STAGESTUFF) stage3/f/runtime/libF77 ! -mv $(LIBI77STAGESTUFF) stage3/f/runtime/libI77 ! -mv $(LIBU77STAGESTUFF) stage3/f/runtime/libU77 ! f77.stage4: ! -mv $(G77STAGESTUFF) stage4/f ! -mv $(RUNTIMESTAGESTUFF) stage4/f/runtime ! -mv $(LIBF77STAGESTUFF) stage4/f/runtime/libF77 ! -mv $(LIBI77STAGESTUFF) stage4/f/runtime/libI77 ! -mv $(LIBU77STAGESTUFF) stage4/f/runtime/libU77 # # Maintenance hooks: --- 573,670 ---- f77.mostlyclean: -rm -f f/*$(objext) ! -rm -f f/fini f/stamp-str f/str-*.h f/str-*.j ! -rm -f f/intdoc f/ansify f/intdoc.h0 ! -rm -f f/runtime/stamp-*77 ! -rm -f f/runtime/libF77/*.o ! -rm -f f/runtime/libI77/*.o ! -rm -f f/runtime/libU77/*.o ! -rm -fr f/runtime/libE77 f77.clean: ! -rm -f g77.c g77.o g77spec.o g77version.o ! -rm -f f/runtime/config.log f/runtime/stamp-* ! -rm -f f/runtime/libU77/config.log f/runtime/libU77/a.out f77.distclean: ! -rm -f stamp-g2c lang-f77 f/Makefile ! -rm -f f/runtime/Makefile f/runtime/g2c.h ! -rm -f f/runtime/config.status f/runtime/config.cache ! -rm -f f/runtime/libF77/Makefile f/runtime/libI77/Makefile ! -rm -f f/runtime/libU77/Makefile f/runtime/libU77/config.h ! -rm -f f/runtime/libU77/config.status f/runtime/libU77/config.cache ! f77.extraclean: ! f77.maintainer-clean: -rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi + -rm -f f/runtime/configure + -rm -f f/runtime/libU77/configure # # Stage hooks: # The main makefile has already created stage?/f. ! G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j \ ! stamp-g2c lang-f77 g77.o g77spec.o g77version.o RUNTIMESTAGESTUFF = f/runtime/config.cache f/runtime/config.log \ ! f/runtime/config.status f/runtime/Makefile f/runtime/g2c.h \ ! f/runtime/stamp-*77 ! LIBF77STAGESTUFF = f/runtime/libF77/*.o f/runtime/libF77/Makefile ! LIBI77STAGESTUFF = f/runtime/libI77/*.o f/runtime/libI77/Makefile ! LIBU77STAGESTUFF = f/runtime/libU77/*.o f/runtime/libU77/Makefile \ ! f/runtime/libU77/config.log f/runtime/libU77/config.status ! LIBE77STAGESTUFF = f/runtime/libE77/*.o ! ! f77.stage1: stage1-start ! -if [ -f lang-f77 ]; then \ ! mv $(G77STAGESTUFF) stage1/f; \ ! test -d stage1/f/runtime || mkdir stage1/f/runtime; \ ! test -d stage1/f/runtime/libF77 || mkdir stage1/f/runtime/libF77; \ ! test -d stage1/f/runtime/libI77 || mkdir stage1/f/runtime/libI77; \ ! test -d stage1/f/runtime/libU77 || mkdir stage1/f/runtime/libU77; \ ! test -d stage1/f/runtime/libE77 || mkdir stage1/f/runtime/libE77; \ ! mv $(RUNTIMESTAGESTUFF) stage1/f/runtime; \ ! mv $(LIBF77STAGESTUFF) stage1/f/runtime/libF77; \ ! mv $(LIBI77STAGESTUFF) stage1/f/runtime/libI77; \ ! mv $(LIBU77STAGESTUFF) stage1/f/runtime/libU77; \ ! mv $(LIBE77STAGESTUFF) stage1/f/runtime/libE77; \ ! fi ! f77.stage2: stage2-start ! -if [ -f lang-f77 ]; then \ ! mv $(G77STAGESTUFF) stage2/f; \ ! test -d stage2/f/runtime || mkdir stage2/f/runtime; \ ! test -d stage2/f/runtime/libF77 || mkdir stage2/f/runtime/libF77; \ ! test -d stage2/f/runtime/libI77 || mkdir stage2/f/runtime/libI77; \ ! test -d stage2/f/runtime/libU77 || mkdir stage2/f/runtime/libU77; \ ! test -d stage2/f/runtime/libE77 || mkdir stage2/f/runtime/libE77; \ ! mv $(RUNTIMESTAGESTUFF) stage2/f/runtime; \ ! mv $(LIBF77STAGESTUFF) stage2/f/runtime/libF77; \ ! mv $(LIBI77STAGESTUFF) stage2/f/runtime/libI77; \ ! mv $(LIBU77STAGESTUFF) stage2/f/runtime/libU77; \ ! mv $(LIBE77STAGESTUFF) stage2/f/runtime/libE77; \ ! fi ! f77.stage3: stage3-start ! -if [ -f lang-f77 ]; then \ ! mv $(G77STAGESTUFF) stage3/f; \ ! test -d stage3/f/runtime || mkdir stage3/f/runtime; \ ! test -d stage3/f/runtime/libF77 || mkdir stage3/f/runtime/libF77; \ ! test -d stage3/f/runtime/libI77 || mkdir stage3/f/runtime/libI77; \ ! test -d stage3/f/runtime/libU77 || mkdir stage3/f/runtime/libU77; \ ! test -d stage3/f/runtime/libE77 || mkdir stage3/f/runtime/libE77; \ ! mv $(RUNTIMESTAGESTUFF) stage3/f/runtime; \ ! mv $(LIBF77STAGESTUFF) stage3/f/runtime/libF77; \ ! mv $(LIBI77STAGESTUFF) stage3/f/runtime/libI77; \ ! mv $(LIBU77STAGESTUFF) stage3/f/runtime/libU77; \ ! mv $(LIBE77STAGESTUFF) stage3/f/runtime/libE77; \ ! fi ! f77.stage4: stage4-start ! -if [ -f lang-f77 ]; then \ ! mv $(G77STAGESTUFF) stage4/f; \ ! test -d stage4/f/runtime || mkdir stage4/f/runtime; \ ! test -d stage4/f/runtime/libF77 || mkdir stage4/f/runtime/libF77; \ ! test -d stage4/f/runtime/libI77 || mkdir stage4/f/runtime/libI77; \ ! test -d stage4/f/runtime/libU77 || mkdir stage4/f/runtime/libU77; \ ! test -d stage4/f/runtime/libE77 || mkdir stage4/f/runtime/libE77; \ ! mv $(RUNTIMESTAGESTUFF) stage4/f/runtime; \ ! mv $(LIBF77STAGESTUFF) stage4/f/runtime/libF77; \ ! mv $(LIBI77STAGESTUFF) stage4/f/runtime/libI77; \ ! mv $(LIBU77STAGESTUFF) stage4/f/runtime/libU77; \ ! mv $(LIBE77STAGESTUFF) stage4/f/runtime/libE77; \ ! fi # # Maintenance hooks: *************** f77.stage4: *** 595,601 **** # distribution anyway. It then copies the files to the distdir directory. f77.distdir: f77.rebuilt ! mkdir tmp/f ! cd f; \ ! for file in *[0-9a-zA-Z+]; do \ ! ln $$file ../tmp/f >/dev/null 2>&1 || cp $$file ../tmp/f; \ ! done --- 673,685 ---- # distribution anyway. It then copies the files to the distdir directory. f77.distdir: f77.rebuilt ! case "$(LANGUAGES)" in \ ! *[fF]77*) touch lang-f77;; \ ! *) rm -f lang-f77;; \ ! esac ! -if [ -f lang-f77 ]; then \ ! mkdir tmp/f; \ ! cd f; \ ! for file in *[0-9a-zA-Z+]; do \ ! ($LN) $$file ../tmp/f; \ ! done; \ ! fi diff -rcp2N g77-0.5.22/f/Makefile.in g77-0.5.23/f/Makefile.in *** g77-0.5.22/f/Makefile.in Thu Feb 26 21:27:50 1998 --- g77-0.5.23/f/Makefile.in Wed May 20 15:16:08 1998 *************** *** 1,4 **** # Makefile for GNU F77 compiler. ! # Copyright (C) 1995-1997 Free Software Foundation, Inc. #This file is part of GNU Fortran. --- 1,4 ---- # Makefile for GNU F77 compiler. ! # Copyright (C) 1995-1998 Free Software Foundation, Inc. #This file is part of GNU Fortran. *************** X_CPPFLAGS = *** 55,60 **** T_CPPFLAGS = ! CC = cc ! HOST_CC = $(CC) BISON = bison BISONFLAGS = --- 55,59 ---- T_CPPFLAGS = ! CC = @CC@ BISON = bison BISONFLAGS = *************** GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS *** 85,97 **** # to the makefile when making a cross-compiler. ! target= ... `configure' substitutes actual target name here. ! xmake_file= ... `configure' substitutes actual x- file name here. ! tmake_file= ... `configure' substitutes actual t- file name here. ! ! # Directory where gcc sources are (gcc/), from where we are. ! # Note that this should be overridden when building f771, which happens ! # at the top level, not in f. Likewise for VPATH (if added). ! srcdir = . ! VPATH = . # Additional system libraries to link with. --- 84,94 ---- # to the makefile when making a cross-compiler. ! target=@target@ ! xmake_file=@dep_host_xmake_file@ ! tmake_file=@dep_tmake_file@ ! ! # Directory where sources are, from where we are. ! srcdir = @srcdir@ ! VPATH = @srcdir@ # Additional system libraries to link with. *************** ALL=all *** 107,130 **** # End of variables for you to override. ! # Definition of `none' is here so that new rules inserted by sed # do not specify the default target. - none: - @echo '' - @echo 'Do not use this makefile to build anything other than the' - @echo 'g77 derived files via the "make g77-only" target.' - @echo 'Instead, use the documented procedures to build gcc itself,' - @echo 'which will build g77 as well when done properly.' - @echo '' - @exit 1 - - # This rule is just a handy way to build the g77 derived files without - # having the gcc source tree around. - g77-only: force - if [ -f g77.texi ] ; then \ - (cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \ - else \ - $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \ - fi - all: all.indirect --- 104,109 ---- # End of variables for you to override. ! # Definition of `all' is here so that new rules inserted by sed # do not specify the default target. all: all.indirect *************** all: all.indirect *** 134,147 **** # sed inserts variable overrides after the following line. ####target overrides ####host overrides ####cross overrides ####build overrides # # Now figure out from those variables how to compile and link. ! all.indirect: f/Makefile f771 # IN_GCC tells obstack.h that we are using gcc's file. ! INTERNAL_CFLAGS = $(CROSS) -DIN_GCC # This is the variable actually used when we compile. --- 113,131 ---- # sed inserts variable overrides after the following line. ####target overrides + @target_overrides@ ####host overrides + @host_overrides@ ####cross overrides + @cross_defines@ + @cross_overrides@ ####build overrides + @build_overrides@ # # Now figure out from those variables how to compile and link. ! all.indirect: Makefile ../f771$(exeext) # IN_GCC tells obstack.h that we are using gcc's file. ! INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@ # This is the variable actually used when we compile. *************** ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) *** 152,157 **** # f771 is so big, need to tell linker on m68k-next-nextstep* to make enough ! # room for it. On AIX, linking f771 overflows the linker TOC. -bbigtoc is ! # appropriate for the linker on AIX 4.1 and above. F771_LDFLAGS = `case "${target}" in\ m68k-next-nextstep*) echo -segaddr __DATA 6000000;;\ --- 136,141 ---- # f771 is so big, need to tell linker on m68k-next-nextstep* to make enough ! # room for it. On AIX, linking f771 overflows the linker TOC; ! # `-bbigtoc' is appropriate for the linker on AIX 4.1 and above. F771_LDFLAGS = `case "${target}" in\ m68k-next-nextstep*) echo -segaddr __DATA 6000000;;\ *************** F771_LDFLAGS = `case "${target}" in\ *** 160,166 **** # Even if ALLOCA is set, don't use it if compiling with GCC. ! SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo $(OBSTACK); else true; fi` ! SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo $(ALLOCA); else true; fi ;; esac` ! SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo $(MALLOC); else true; fi` # How to link with both our special library facilities --- 144,150 ---- # Even if ALLOCA is set, don't use it if compiling with GCC. ! SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi` ! SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac` ! SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi` # How to link with both our special library facilities *************** LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_AL *** 171,206 **** # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation ! # directory rather than in the source directory. ! INCLUDES = -If -I$(srcdir)/f -I. -I$(srcdir) -I$(srcdir)/config ! ! # Flags_to_pass to recursive makes. ! # Note that we don't need to distinguish the `_FOR_TARGET' cross tools ! # as AR and RANLIB are set appropriately by configure iff cross compiling. ! FLAGS_TO_PASS = \ ! "CROSS=$(CROSS)" \ ! "AR_FLAGS=$(AR_FLAGS)" \ ! "AR=$(AR)" \ ! "BISON=$(BISON)" \ ! "BISONFLAGS=$(BISONFLAGS)" \ ! "CC=$(CC)" \ ! "CFLAGS=$(CFLAGS)" \ ! "GCCFLAGS=$(GCCFLAGS)" \ ! "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ ! "LDFLAGS=$(LDFLAGS)" \ ! "LEX=$(LEX)" \ ! "LEXFLAGS=$(LEXFLAGS)" \ ! "MAKEINFO=$(MAKEINFO)" \ ! "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ ! "RANLIB=$(RANLIB)" \ ! "RANLIB_TEST=$(RANLIB_TEST)" \ ! "SHELL=$(SHELL)" \ ! "exec_prefix=$(exec_prefix)" \ ! "prefix=$(prefix)" \ ! "tooldir=$(tooldir)" \ ! "bindir=$(bindir)" \ ! "libsubdir=$(libsubdir)" .c.o: ! $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ # # Lists of files for various purposes. --- 155,165 ---- # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation ! # subdirectory rather than in the source directory. ! INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config + # Always use -I$(srcdir)/config when compiling. .c.o: ! $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< ! # # Lists of files for various purposes. *************** FLAGS_TO_PASS = \ *** 209,271 **** F77_OBJS = \ ! f/bad.o \ ! f/bit.o \ ! f/bld.o \ ! f/com.o \ ! f/data.o \ ! f/equiv.o \ ! f/expr.o \ ! f/global.o \ ! f/implic.o \ ! f/info.o \ ! f/intrin.o \ ! f/lab.o \ ! f/lex.o \ ! f/malloc.o \ ! f/name.o \ ! f/parse.o \ ! f/proj.o \ ! f/src.o \ ! f/st.o \ ! f/sta.o \ ! f/stb.o \ ! f/stc.o \ ! f/std.o \ ! f/ste.o \ ! f/storag.o \ ! f/stp.o \ ! f/str.o \ ! f/sts.o \ ! f/stt.o \ ! f/stu.o \ ! f/stv.o \ ! f/stw.o \ ! f/symbol.o \ ! f/target.o \ ! f/top.o \ ! f/type.o \ ! f/where.o \ ! f/zzz.o # Language-independent object files. ! OBJS = `cat stamp-objlist | sed -e "s: : :g" -e "s: : f/:g"` ! OBJDEPS = stamp-objlist ! compiler: f771 ! # This is now meant to be built in the top level directory, not `f': ! f771: $(P) f/Makefile $(F77_OBJS) $(OBJDEPS) $(LIBDEPS) rm -f f771$(exeext) ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(F771_LDFLAGS) -o $@ \ $(F77_OBJS) $(OBJS) $(LIBS) ! # Check in case anyone expects to build in this directory: ! f/Makefile: ! @if test ! -f f/Makefile ; \ ! then echo "Build f771 only at the top level." 2>&1; exit 1; \ ! else true; fi ! ! Makefile: $(srcdir)/f/Makefile.in $(srcdir)/configure ! native: f771 # # Compiling object files from source files. --- 168,237 ---- F77_OBJS = \ ! bad.o \ ! bit.o \ ! bld.o \ ! com.o \ ! data.o \ ! equiv.o \ ! expr.o \ ! global.o \ ! implic.o \ ! info.o \ ! intrin.o \ ! lab.o \ ! lex.o \ ! malloc.o \ ! name.o \ ! parse.o \ ! proj.o \ ! src.o \ ! st.o \ ! sta.o \ ! stb.o \ ! stc.o \ ! std.o \ ! ste.o \ ! storag.o \ ! stp.o \ ! str.o \ ! sts.o \ ! stt.o \ ! stu.o \ ! stv.o \ ! stw.o \ ! symbol.o \ ! target.o \ ! top.o \ ! type.o \ ! version.o \ ! where.o # Language-independent object files. ! OBJS = `cat ../stamp-objlist` ! OBJDEPS = ../stamp-objlist ! compiler: ../f771$(exeext) ! ../f771$(exeext): $(P) $(F77_OBJS) $(OBJDEPS) $(LIBDEPS) rm -f f771$(exeext) ! @echo $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(F771_LDFLAGS) -o $@ \ $(F77_OBJS) $(OBJS) $(LIBS) + @$(CC) $(ALL_CFLAGS) $(LDFLAGS) $(F771_LDFLAGS) -o $@ \ + $(F77_OBJS) $(OBJS) $(LIBS); \ + errcode=$$?; \ + if [ $$errcode != 0 ]; then \ + echo ""; \ + echo "If the above command failed due to an unresolved reference"; \ + echo "to strtoul, _strtoul, bsearch, _bsearch, or similar, see"; \ + echo "[info -f g77 M LINKFAIL] (a node in the g77 documentation)"; \ + echo "for information on what causes this, how to work around"; \ + echo "the problem by editing ${srcdir}/proj.c, and what else to do."; \ + echo ""; \ + exit $$errcode; \ + fi ! Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure ! cd ..; $(SHELL) config.status ! native: config.status ../f771$(exeext) # # Compiling object files from source files. *************** native: f771 *** 283,299 **** # prefixes, while the others don't because they'll be created # only in the build directory. ! ASSERT_H = $(srcdir)/f/assert.j $(srcdir)/assert.h ! CONFIG_H = $(srcdir)/f/config.j config.h ! CONVERT_H = $(srcdir)/f/convert.j $(srcdir)/convert.h ! FLAGS_H = $(srcdir)/f/flags.j $(srcdir)/flags.h ! GLIMITS_H = $(srcdir)/f/glimits.j $(srcdir)/glimits.h ! HCONFIG_H = $(srcdir)/f/hconfig.j hconfig.h ! INPUT_H = $(srcdir)/f/input.j $(srcdir)/input.h ! RTL_H = $(srcdir)/f/rtl.j $(srcdir)/rtl.h $(srcdir)/rtl.def \ ! $(srcdir)/machmode.h $(srcdir)/machmode.def ! TCONFIG_H = $(srcdir)/f/tconfig.j tconfig.h ! TM_H = $(srcdir)/f/tm.j tm.h ! TREE_H = $(srcdir)/f/tree.j $(srcdir)/tree.h $(srcdir)/real.h \ ! $(srcdir)/tree.def $(srcdir)/machmode.h $(srcdir)/machmode.def #Build the first part of this list with the command line: --- 249,266 ---- # prefixes, while the others don't because they'll be created # only in the build directory. ! ASSERT_H = $(srcdir)/assert.j $(srcdir)/../assert.h ! CONFIG_H = $(srcdir)/config.j ../config.h ! CONVERT_H = $(srcdir)/convert.j $(srcdir)/../convert.h ! FLAGS_H = $(srcdir)/flags.j $(srcdir)/../flags.h ! GLIMITS_H = $(srcdir)/glimits.j $(srcdir)/../glimits.h ! HCONFIG_H = $(srcdir)/hconfig.j ../hconfig.h ! INPUT_H = $(srcdir)/input.j $(srcdir)/../input.h ! OUTPUT_H = $(srcdir)/output.j $(srcdir)/../output.h ! RTL_H = $(srcdir)/rtl.j $(srcdir)/../rtl.h $(srcdir)/../rtl.def \ ! $(srcdir)/../machmode.h $(srcdir)/../machmode.def ! TCONFIG_H = $(srcdir)/tconfig.j ../tconfig.h ! TM_H = $(srcdir)/tm.j ../tm.h ! TREE_H = $(srcdir)/tree.j $(srcdir)/../tree.h $(srcdir)/../real.h \ ! $(srcdir)/../tree.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def #Build the first part of this list with the command line: *************** TREE_H = $(srcdir)/f/tree.j $(srcdir)/tr *** 306,514 **** # substitutions, plus others for elegance. ! f/bad.o: f/bad.c f/proj.h $(ASSERT_H) f/bad.h f/bad.def f/where.h $(GLIMITS_H) \ ! f/top.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def f/bit.h \ ! f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/lex.h f/type.h \ ! f/intrin.h f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h \ ! f/global.h f/name.h ! f/bit.o: f/bit.c f/proj.h $(ASSERT_H) $(GLIMITS_H) f/bit.h f/malloc.h ! f/bld.o: f/bld.c f/proj.h $(ASSERT_H) f/bld.h f/bld-op.def f/bit.h f/malloc.h \ ! f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h f/type.h \ ! f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h \ ! f/intrin.h f/intrin.def ! f/com.o: f/com.c $(CONFIG_H) $(FLAGS_H) $(RTL_H) $(TREE_H) $(CONVERT_H) f/proj.h \ ! $(ASSERT_H) f/com.h f/com-rt.def f/bld.h f/bld-op.def f/bit.h f/malloc.h \ ! f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def \ ! f/where.h $(GLIMITS_H) f/top.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h \ ! f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h f/expr.h \ ! f/implic.h f/src.h f/st.h ! f/data.o: f/data.c f/proj.h $(ASSERT_H) f/data.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/expr.h f/st.h ! f/equiv.o: f/equiv.c f/proj.h $(ASSERT_H) f/equiv.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/global.h f/name.h \ ! f/intrin.h f/intrin.def f/data.h ! f/expr.o: f/expr.c f/proj.h $(ASSERT_H) f/expr.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/implic.h f/src.h f/st.h ! f/fini.o: f/fini.c f/proj.h $(ASSERT_H) f/malloc.h ! f/g77.o: f/g77.c $(CONFIG_H) ! f/global.o: f/global.c f/proj.h $(ASSERT_H) f/global.h f/lex.h f/top.h f/malloc.h \ ! f/where.h $(GLIMITS_H) f/name.h f/symbol.h f/symbol.def f/bad.h f/bad.def \ ! f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) f/info.h \ ! f/info-b.def f/info-k.def f/info-w.def f/target.h f/type.h f/lab.h f/storag.h \ ! f/intrin.h f/intrin.def f/equiv.h ! f/implic.o: f/implic.c f/proj.h $(ASSERT_H) f/implic.h f/info.h f/info-b.def \ ! f/info-k.def f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h f/lex.h f/type.h f/symbol.h f/symbol.def f/bld.h \ ! f/bld-op.def f/bit.h f/com.h f/com-rt.def f/lab.h f/storag.h f/intrin.h \ ! f/intrin.def f/equiv.h f/global.h f/name.h f/src.h ! f/info.o: f/info.c f/proj.h $(ASSERT_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def f/where.h $(GLIMITS_H) \ ! f/top.h f/malloc.h f/lex.h f/type.h ! f/intrin.o: f/intrin.c f/proj.h $(ASSERT_H) f/intrin.h f/intrin.def f/bld.h \ ! f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h \ ! f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \ ! f/equiv.h f/global.h f/name.h f/src.h ! f/lab.o: f/lab.c f/proj.h $(ASSERT_H) f/lab.h f/com.h f/com-rt.def $(TREE_H) f/bld.h \ ! f/bld-op.def f/bit.h f/malloc.h f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/intrin.h f/intrin.def f/symbol.h f/symbol.def f/equiv.h f/storag.h \ ! f/global.h f/name.h ! f/lex.o: f/lex.c f/proj.h $(ASSERT_H) f/top.h f/malloc.h f/where.h $(GLIMITS_H) \ ! f/bad.h f/bad.def f/com.h f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def f/bit.h \ ! f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/lex.h f/type.h \ ! f/intrin.h f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h \ ! f/global.h f/name.h f/src.h $(CONFIG_H) $(FLAGS_H) $(INPUT_H) ! f/malloc.o: f/malloc.c f/proj.h $(ASSERT_H) f/malloc.h ! f/name.o: f/name.c f/proj.h $(ASSERT_H) f/bad.h f/bad.def f/where.h $(GLIMITS_H) \ ! f/top.h f/malloc.h f/name.h f/global.h f/lex.h f/symbol.h f/symbol.def f/bld.h \ ! f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \ ! f/info-k.def f/info-w.def f/target.h f/type.h f/lab.h f/storag.h f/intrin.h \ ! f/intrin.def f/equiv.h f/src.h ! f/parse.o: f/parse.c f/proj.h $(ASSERT_H) f/top.h f/malloc.h f/where.h $(GLIMITS_H) \ ! f/com.h f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def f/bit.h f/info.h \ ! f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/lex.h \ ! f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h \ ! f/storag.h f/global.h f/name.h f/zzz.h $(FLAGS_H) ! f/proj.o: f/proj.c f/proj.h $(ASSERT_H) $(GLIMITS_H) ! f/src.o: f/src.c f/proj.h $(ASSERT_H) f/src.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h ! f/st.o: f/st.c f/proj.h $(ASSERT_H) f/st.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) \ ! f/top.h f/malloc.h f/lex.h f/symbol.h f/symbol.def f/bld.h f/bld-op.def f/bit.h \ ! f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/type.h f/lab.h f/storag.h f/intrin.h f/intrin.def f/equiv.h \ ! f/global.h f/name.h f/sta.h f/stamp-str f/stb.h f/expr.h f/stp.h f/stt.h f/stc.h \ ! f/std.h f/stv.h f/stw.h f/ste.h f/sts.h f/stu.h ! f/sta.o: f/sta.c f/proj.h $(ASSERT_H) f/sta.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h f/lex.h f/stamp-str f/symbol.h f/symbol.def f/bld.h \ ! f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \ ! f/info-k.def f/info-w.def f/target.h f/type.h f/lab.h f/storag.h f/intrin.h \ ! f/intrin.def f/equiv.h f/global.h f/name.h f/implic.h f/stb.h f/expr.h f/stp.h \ ! f/stt.h f/stc.h f/std.h f/stv.h f/stw.h ! f/stb.o: f/stb.c f/proj.h $(ASSERT_H) f/stb.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h f/expr.h f/bld.h f/bld-op.def f/bit.h f/com.h \ ! f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \ ! f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/stp.h f/stt.h f/stamp-str \ ! f/src.h f/sta.h f/stc.h ! f/stc.o: f/stc.c f/proj.h $(ASSERT_H) f/stc.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h f/bld.h f/bld-op.def f/bit.h f/com.h \ ! f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \ ! f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/expr.h f/stp.h f/stt.h \ ! f/stamp-str f/data.h f/implic.h f/src.h f/sta.h f/std.h f/stv.h f/stw.h ! f/std.o: f/std.c f/proj.h $(ASSERT_H) f/std.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/stp.h f/stt.h f/stamp-str f/stv.h f/stw.h f/sta.h \ ! f/ste.h f/sts.h ! f/ste.o: f/ste.c $(CONFIG_H) $(RTL_H) f/proj.h $(ASSERT_H) f/ste.h f/bld.h \ ! f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h \ ! f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \ ! f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/stp.h f/stt.h f/stamp-str \ ! f/sts.h f/stv.h f/stw.h f/sta.h ! f/storag.o: f/storag.c f/proj.h $(ASSERT_H) f/storag.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h \ ! f/intrin.h f/intrin.def f/data.h ! f/stp.o: f/stp.c f/proj.h $(ASSERT_H) f/stp.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/stt.h ! f/str.o: f/str.c f/proj.h $(ASSERT_H) f/src.h f/bad.h f/bad.def f/where.h \ ! $(GLIMITS_H) f/top.h f/malloc.h f/stamp-str f/lex.h ! f/sts.o: f/sts.c f/proj.h $(ASSERT_H) f/sts.h f/malloc.h f/com.h f/com-rt.def \ ! $(TREE_H) f/bld.h f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h \ ! f/storag.h f/global.h f/name.h ! f/stt.o: f/stt.c f/proj.h $(ASSERT_H) f/stt.h f/top.h f/malloc.h f/where.h \ ! $(GLIMITS_H) f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) f/info.h \ ! f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/stp.h f/expr.h f/sta.h f/stamp-str ! f/stu.o: f/stu.c f/proj.h $(ASSERT_H) f/bld.h f/bld-op.def f/bit.h f/malloc.h \ ! f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h f/type.h \ ! f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h \ ! f/intrin.h f/intrin.def f/implic.h f/stu.h f/sta.h f/stamp-str ! f/stv.o: f/stv.c f/proj.h $(ASSERT_H) f/stv.h f/lab.h f/com.h f/com-rt.def $(TREE_H) \ ! f/bld.h f/bld-op.def f/bit.h f/malloc.h f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/intrin.h f/intrin.def f/symbol.h f/symbol.def f/equiv.h f/storag.h \ ! f/global.h f/name.h ! f/stw.o: f/stw.c f/proj.h $(ASSERT_H) f/stw.h f/bld.h f/bld-op.def f/bit.h \ ! f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/target.h f/bad.h f/bad.def f/where.h $(GLIMITS_H) f/top.h f/lex.h \ ! f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \ ! f/name.h f/intrin.h f/intrin.def f/stv.h f/sta.h f/stamp-str ! f/symbol.o: f/symbol.c f/proj.h $(ASSERT_H) f/symbol.h f/symbol.def f/bad.h \ ! f/bad.def f/where.h $(GLIMITS_H) f/top.h f/malloc.h f/bld.h f/bld-op.def f/bit.h \ ! f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \ ! f/target.h f/lex.h f/type.h f/lab.h f/storag.h f/intrin.h f/intrin.def \ ! f/equiv.h f/global.h f/name.h f/src.h f/st.h ! f/target.o: f/target.c f/proj.h $(ASSERT_H) $(GLIMITS_H) f/target.h $(TREE_H) f/bad.h \ ! f/bad.def f/where.h f/top.h f/malloc.h f/info.h f/info-b.def f/info-k.def \ ! f/info-w.def f/type.h f/lex.h ! f/top.o: f/top.c f/proj.h $(ASSERT_H) f/top.h f/malloc.h f/where.h $(GLIMITS_H) \ ! f/bad.h f/bad.def f/bit.h f/bld.h f/bld-op.def f/com.h f/com-rt.def $(TREE_H) \ ! f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/lex.h f/type.h \ ! f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h \ ! f/intrin.h f/intrin.def f/data.h f/expr.h f/implic.h f/src.h f/st.h $(FLAGS_H) ! f/type.o: f/type.c f/proj.h $(ASSERT_H) f/type.h f/malloc.h ! f/where.o: f/where.c f/proj.h $(ASSERT_H) f/where.h $(GLIMITS_H) f/top.h f/malloc.h \ ! f/lex.h ! f/zzz.o: f/zzz.c f/proj.h $(ASSERT_H) f/zzz.h # The rest of this list (Fortran 77 language-specific files) is hand-generated. ! f/stamp-str: f/str-1t.h f/str-1t.j f/str-2t.h f/str-2t.j \ ! f/str-fo.h f/str-fo.j f/str-io.h f/str-io.j f/str-nq.h f/str-nq.j \ ! f/str-op.h f/str-op.j f/str-ot.h f/str-ot.j ! touch f/stamp-str ! f/str-1t.h f/str-1t.j: f/fini f/str-1t.fin ! ./f/fini `echo $(srcdir)/f/str-1t.fin | sed 's,^\./,,'` f/str-1t.j f/str-1t.h ! f/str-2t.h f/str-2t.j: f/fini f/str-2t.fin ! ./f/fini `echo $(srcdir)/f/str-2t.fin | sed 's,^\./,,'` f/str-2t.j f/str-2t.h ! f/str-fo.h f/str-fo.j: f/fini f/str-fo.fin ! ./f/fini `echo $(srcdir)/f/str-fo.fin | sed 's,^\./,,'` f/str-fo.j f/str-fo.h ! f/str-io.h f/str-io.j: f/fini f/str-io.fin ! ./f/fini `echo $(srcdir)/f/str-io.fin | sed 's,^\./,,'` f/str-io.j f/str-io.h ! f/str-nq.h f/str-nq.j: f/fini f/str-nq.fin ! ./f/fini `echo $(srcdir)/f/str-nq.fin | sed 's,^\./,,'` f/str-nq.j f/str-nq.h ! f/str-op.h f/str-op.j: f/fini f/str-op.fin ! ./f/fini `echo $(srcdir)/f/str-op.fin | sed 's,^\./,,'` f/str-op.j f/str-op.h ! f/str-ot.h f/str-ot.j: f/fini f/str-ot.fin ! ./f/fini `echo $(srcdir)/f/str-ot.fin | sed 's,^\./,,'` f/str-ot.j f/str-ot.h ! f/fini: f/fini.o f/proj-h.o ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini f/fini.o f/proj-h.o ! f/fini.o: $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ ! `echo $(srcdir)/f/fini.c | sed 's,^\./,,'` -o $@ ! f/proj-h.o: f/proj.o $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ ! `echo $(srcdir)/f/proj.c | sed 's,^\./,,'` -o $@ # Other than str-*.j, the *.j files are dummy #include files --- 273,481 ---- # substitutions, plus others for elegance. ! ansify.o: ansify.c $(ASSERT_H) ! bad.o: bad.c proj.h $(CONFIG_H) $(ASSERT_H) bad.h bad.def where.h $(GLIMITS_H) \ ! top.h malloc.h $(FLAGS_H) com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h \ ! info.h info-b.def info-k.def info-w.def target.h lex.h type.h \ ! intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \ ! global.h name.h $(RTL_H) ! bit.o: bit.c proj.h $(CONFIG_H) $(ASSERT_H) $(GLIMITS_H) bit.h malloc.h ! bld.o: bld.c proj.h $(CONFIG_H) $(ASSERT_H) bld.h bld-op.def bit.h malloc.h \ ! com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def \ ! target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h type.h lab.h \ ! storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \ ! intrin.def $(RTL_H) ! com.o: com.c proj.h $(CONFIG_H) $(ASSERT_H) $(FLAGS_H) $(RTL_H) $(TREE_H) $(OUTPUT_H) \ ! $(CONVERT_H) com.h com-rt.def bld.h bld-op.def bit.h malloc.h info.h \ ! info-b.def info-k.def info-w.def target.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h lex.h type.h intrin.h intrin.def lab.h symbol.h \ ! symbol.def equiv.h storag.h global.h name.h expr.h implic.h src.h \ ! st.h ! data.o: data.c proj.h $(CONFIG_H) $(ASSERT_H) data.h bld.h bld-op.def bit.h \ ! malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \ ! intrin.h intrin.def $(RTL_H) expr.h st.h ! equiv.o: equiv.c proj.h $(CONFIG_H) $(ASSERT_H) equiv.h bld.h bld-op.def \ ! bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def global.h name.h intrin.h \ ! intrin.def $(RTL_H) data.h ! expr.o: expr.c proj.h $(CONFIG_H) $(ASSERT_H) expr.h bld.h bld-op.def bit.h \ ! malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \ ! intrin.h intrin.def $(RTL_H) implic.h src.h st.h stamp-str ! fini.o: fini.c proj.h $(CONFIG_H) $(ASSERT_H) malloc.h ! global.o: global.c proj.h $(CONFIG_H) $(ASSERT_H) global.h info.h info-b.def \ ! info-k.def info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) \ ! top.h malloc.h lex.h type.h name.h symbol.h symbol.def bld.h \ ! bld-op.def bit.h com.h com-rt.def lab.h storag.h $(RTL_H) intrin.h \ ! intrin.def equiv.h ! implic.o: implic.c proj.h $(CONFIG_H) $(ASSERT_H) implic.h info.h info-b.def \ ! info-k.def info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) \ ! top.h malloc.h lex.h type.h symbol.h symbol.def bld.h bld-op.def \ ! bit.h com.h com-rt.def lab.h storag.h $(RTL_H) intrin.h intrin.def \ ! equiv.h global.h name.h src.h ! info.o: info.c proj.h $(CONFIG_H) $(ASSERT_H) info.h info-b.def info-k.def \ ! info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) top.h \ ! malloc.h lex.h type.h ! intdoc.o: intdoc.c $(ASSERT_H) intrin.h intrin.def intdoc.h0 intdoc.h0 ! intrin.o: intrin.c proj.h $(CONFIG_H) $(ASSERT_H) intrin.h intrin.def bld.h \ ! bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \ ! info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \ ! lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \ ! name.h $(RTL_H) expr.h src.h ! lab.o: lab.c proj.h $(CONFIG_H) $(ASSERT_H) lab.h com.h com-rt.def $(TREE_H) \ ! bld.h bld-op.def bit.h malloc.h info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \ ! global.h name.h $(RTL_H) ! lex.o: lex.c proj.h $(CONFIG_H) $(ASSERT_H) top.h malloc.h where.h $(GLIMITS_H) \ ! bad.h bad.def com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h info.h \ ! info-b.def info-k.def info-w.def target.h lex.h type.h intrin.h \ ! intrin.def lab.h symbol.h symbol.def equiv.h storag.h global.h name.h \ ! $(RTL_H) src.h $(FLAGS_H) $(INPUT_H) $(OUTPUT_H) ! malloc.o: malloc.c proj.h $(CONFIG_H) $(ASSERT_H) malloc.h ! name.o: name.c proj.h $(CONFIG_H) $(ASSERT_H) bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h name.h global.h info.h info-b.def info-k.def \ ! info-w.def target.h $(TREE_H) lex.h type.h symbol.h symbol.def bld.h \ ! bld-op.def bit.h com.h com-rt.def lab.h storag.h $(RTL_H) intrin.h \ ! intrin.def equiv.h src.h ! parse.o: parse.c proj.h $(CONFIG_H) $(ASSERT_H) top.h malloc.h where.h \ ! $(GLIMITS_H) com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h info.h \ ! info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h type.h \ ! intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \ ! global.h name.h $(RTL_H) version.h $(FLAGS_H) ! proj.o: proj.c proj.h $(CONFIG_H) $(ASSERT_H) $(GLIMITS_H) ! src.o: src.c proj.h $(CONFIG_H) $(ASSERT_H) src.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h ! st.o: st.c proj.h $(CONFIG_H) $(ASSERT_H) st.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h lex.h symbol.h symbol.def bld.h bld-op.def \ ! bit.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def \ ! target.h type.h lab.h storag.h $(RTL_H) intrin.h intrin.def equiv.h \ ! global.h name.h sta.h stamp-str stb.h expr.h stp.h stt.h stc.h std.h \ ! stv.h stw.h ste.h sts.h stu.h ! sta.o: sta.c proj.h $(CONFIG_H) $(ASSERT_H) sta.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h lex.h stamp-str symbol.h symbol.def bld.h \ ! bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h type.h lab.h storag.h $(RTL_H) intrin.h intrin.def \ ! equiv.h global.h name.h implic.h stb.h expr.h stp.h stt.h stc.h std.h \ ! stv.h stw.h ! stb.o: stb.c proj.h $(CONFIG_H) $(ASSERT_H) stb.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h expr.h bld.h bld-op.def bit.h com.h \ ! com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \ ! lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \ ! name.h intrin.h intrin.def $(RTL_H) stp.h stt.h stamp-str src.h sta.h stc.h ! stc.o: stc.c proj.h $(CONFIG_H) $(ASSERT_H) stc.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h bld.h bld-op.def bit.h com.h com-rt.def \ ! $(TREE_H) info.h info-b.def info-k.def info-w.def target.h lex.h type.h \ ! lab.h storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \ ! intrin.def $(RTL_H) expr.h stp.h stt.h stamp-str data.h implic.h src.h sta.h \ ! std.h stv.h stw.h ! std.o: std.c proj.h $(CONFIG_H) $(ASSERT_H) std.h bld.h bld-op.def bit.h \ ! malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \ ! intrin.h intrin.def $(RTL_H) stp.h stt.h stamp-str stv.h stw.h sta.h ste.h \ ! sts.h ! ste.o: ste.c proj.h $(CONFIG_H) $(ASSERT_H) $(RTL_H) $(TREE_H) $(OUTPUT_H) ste.h \ ! bld.h bld-op.def bit.h malloc.h com.h com-rt.def info.h info-b.def \ ! info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \ ! lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \ ! name.h intrin.h intrin.def stp.h stt.h stamp-str sts.h stv.h stw.h expr.h \ ! sta.h ! storag.o: storag.c proj.h $(CONFIG_H) $(ASSERT_H) storag.h bld.h bld-op.def \ ! bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h symbol.h symbol.def equiv.h global.h name.h intrin.h \ ! intrin.def $(RTL_H) data.h ! stp.o: stp.c proj.h $(CONFIG_H) $(ASSERT_H) stp.h bld.h bld-op.def bit.h \ ! malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \ ! intrin.h intrin.def $(RTL_H) stt.h ! str.o: str.c proj.h $(CONFIG_H) $(ASSERT_H) src.h bad.h bad.def where.h \ ! $(GLIMITS_H) top.h malloc.h stamp-str lex.h ! sts.o: sts.c proj.h $(CONFIG_H) $(ASSERT_H) sts.h malloc.h com.h com-rt.def \ ! $(TREE_H) bld.h bld-op.def bit.h info.h info-b.def info-k.def info-w.def \ ! target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h type.h intrin.h \ ! intrin.def lab.h symbol.h symbol.def equiv.h storag.h global.h name.h \ ! $(RTL_H) ! stt.o: stt.c proj.h $(CONFIG_H) $(ASSERT_H) stt.h top.h malloc.h where.h \ ! $(GLIMITS_H) bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h \ ! info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h type.h \ ! lab.h storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \ ! intrin.def $(RTL_H) stp.h expr.h sta.h stamp-str ! stu.o: stu.c proj.h $(CONFIG_H) $(ASSERT_H) bld.h bld-op.def bit.h malloc.h \ ! com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def \ ! target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h type.h lab.h \ ! storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \ ! intrin.def $(RTL_H) implic.h stu.h sta.h stamp-str ! stv.o: stv.c proj.h $(CONFIG_H) $(ASSERT_H) stv.h lab.h com.h com-rt.def \ ! $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \ ! global.h name.h $(RTL_H) ! stw.o: stw.c proj.h $(CONFIG_H) $(ASSERT_H) stw.h bld.h bld-op.def bit.h \ ! malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \ ! info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \ ! type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \ ! intrin.h intrin.def $(RTL_H) stv.h sta.h stamp-str ! symbol.o: symbol.c proj.h $(CONFIG_H) $(ASSERT_H) symbol.h symbol.def bld.h \ ! bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \ ! info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \ ! lex.h type.h lab.h storag.h $(RTL_H) intrin.h intrin.def equiv.h \ ! global.h name.h src.h st.h ! target.o: target.c proj.h $(CONFIG_H) $(ASSERT_H) $(GLIMITS_H) target.h $(TREE_H) \ ! bad.h bad.def where.h top.h malloc.h info.h info-b.def info-k.def \ ! info-w.def type.h lex.h ! top.o: top.c proj.h $(CONFIG_H) $(ASSERT_H) top.h malloc.h where.h $(GLIMITS_H) \ ! bad.h bad.def bit.h bld.h bld-op.def com.h com-rt.def $(TREE_H) info.h \ ! info-b.def info-k.def info-w.def target.h lex.h type.h lab.h storag.h \ ! symbol.h symbol.def equiv.h global.h name.h intrin.h intrin.def $(RTL_H) \ ! data.h expr.h implic.h src.h st.h $(FLAGS_H) ! type.o: type.c proj.h $(CONFIG_H) $(ASSERT_H) type.h malloc.h ! version.o: version.c ! where.o: where.c proj.h $(CONFIG_H) $(ASSERT_H) where.h $(GLIMITS_H) top.h \ ! malloc.h lex.h # The rest of this list (Fortran 77 language-specific files) is hand-generated. ! stamp-str: str-1t.h str-1t.j str-2t.h str-2t.j \ ! str-fo.h str-fo.j str-io.h str-io.j str-nq.h str-nq.j \ ! str-op.h str-op.j str-ot.h str-ot.j ! touch stamp-str ! str-1t.h str-1t.j: fini str-1t.fin ! ./fini `echo $(srcdir)/str-1t.fin | sed 's,^\./,,'` str-1t.j str-1t.h ! str-2t.h str-2t.j: fini str-2t.fin ! ./fini `echo $(srcdir)/str-2t.fin | sed 's,^\./,,'` str-2t.j str-2t.h ! str-fo.h str-fo.j: fini str-fo.fin ! ./fini `echo $(srcdir)/str-fo.fin | sed 's,^\./,,'` str-fo.j str-fo.h ! str-io.h str-io.j: fini str-io.fin ! ./fini `echo $(srcdir)/str-io.fin | sed 's,^\./,,'` str-io.j str-io.h ! str-nq.h str-nq.j: fini str-nq.fin ! ./fini `echo $(srcdir)/str-nq.fin | sed 's,^\./,,'` str-nq.j str-nq.h ! str-op.h str-op.j: fini str-op.fin ! ./fini `echo $(srcdir)/str-op.fin | sed 's,^\./,,'` str-op.j str-op.h ! str-ot.h str-ot.j: fini str-ot.fin ! ./fini `echo $(srcdir)/str-ot.fin | sed 's,^\./,,'` str-ot.j str-ot.h ! fini: fini.o proj-h.o ! $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o fini fini.o proj-h.o ! fini.o: $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ ! `echo $(srcdir)/fini.c | sed 's,^\./,,'` -o $@ ! proj-h.o: proj.o $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ ! `echo $(srcdir)/proj.c | sed 's,^\./,,'` -o $@ # Other than str-*.j, the *.j files are dummy #include files *************** f/proj-h.o: f/proj.o *** 531,549 **** MG=-MG deps-kinda: ! $(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) -I -If f/*.c | \ ! sed -e 's: \([.]/\)*f/assert[.]j: $$(ASSERT_H):g' \ ! -e 's: \([.]/\)*f/config[.]j: $$(CONFIG_H):g' \ ! -e 's: \([.]/\)*f/convert[.]j: $$(CONVERT_H):g' \ ! -e 's: \([.]/\)*f/flags[.]j: $$(FLAGS_H):g' \ ! -e 's: \([.]/\)*f/glimits[.]j: $$(GLIMITS_H):g' \ ! -e 's: \([.]/\)*f/hconfig[.]j: $$(HCONFIG_H):g' \ ! -e 's: \([.]/\)*f/input[.]j: $$(INPUT_H):g' \ ! -e 's: \([.]/\)*f/rtl[.]j: $$(RTL_H):g' \ ! -e 's: \([.]/\)*f/tconfig[.]j: $$(TCONFIG_H):g' \ ! -e 's: \([.]/\)*f/tm[.]j: $$(TM_H):g' \ ! -e 's: \([.]/\)*f/tree[.]j: $$(TREE_H):g' \ ! -e 's: proj[.]h: f/proj.h:g' \ ! -e 's: \([.]/\)*f/str[.]h: f/stamp-str:g' \ ! -e 's%^\(.*\)[ ]*: %f/\1: %g' # --- 498,526 ---- MG=-MG deps-kinda: ! $(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) *.c | \ ! sed -e 's: \([.]/\)*assert[.]j: $$(ASSERT_H):g' \ ! -e 's: \([.]/\)*config[.]j: $$(CONFIG_H):g' \ ! -e 's: \([.]/\)*convert[.]j: $$(CONVERT_H):g' \ ! -e 's: \([.]/\)*flags[.]j: $$(FLAGS_H):g' \ ! -e 's: \([.]/\)*glimits[.]j: $$(GLIMITS_H):g' \ ! -e 's: \([.]/\)*hconfig[.]j: $$(HCONFIG_H):g' \ ! -e 's: \([.]/\)*input[.]j: $$(INPUT_H):g' \ ! -e 's: \([.]/\)*output[.]j: $$(OUTPUT_H):g' \ ! -e 's: \([.]/\)*rtl[.]j: $$(RTL_H):g' \ ! -e 's: \([.]/\)*tconfig[.]j: $$(TCONFIG_H):g' \ ! -e 's: \([.]/\)*tm[.]j: $$(TM_H):g' \ ! -e 's: \([.]/\)*tree[.]j: $$(TREE_H):g' \ ! -e 's: \([.]/\)*str[.]h: stamp-str:g' \ ! -e 's:.*g77spec.*::g' \ ! -e 's%^\(.*\)[ ]*: %\1: %g' ! ! # This rule is just a handy way to build the g77 derived files without ! # having the gcc source tree around. ! g77-only: force ! if [ -f g77.texi ] ; then \ ! (cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \ ! else \ ! $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \ ! fi # *************** TAGS: force *** 555,562 **** etags *.c *.h ; \ echo 'l' | tr 'l' '\f' >> TAGS ; \ - echo 'parse.y,0' >> TAGS ; \ etags -a ../*.h ../*.c; ! .PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda TAGS g77-only force: --- 532,538 ---- etags *.c *.h ; \ echo 'l' | tr 'l' '\f' >> TAGS ; \ etags -a ../*.h ../*.c; ! .PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda g77-only TAGS force force: diff -rcp2N g77-0.5.22/f/ansify.c g77-0.5.23/f/ansify.c *** g77-0.5.22/f/ansify.c Tue Sep 2 21:25:24 1997 --- g77-0.5.23/f/ansify.c Tue Apr 21 01:23:30 1998 *************** *** 1,5 **** /* ansify.c Copyright (C) 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* ansify.c Copyright (C) 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/assert.j g77-0.5.23/f/assert.j *** g77-0.5.22/f/assert.j Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/assert.j Tue Apr 21 01:23:30 1998 *************** *** 1,5 **** /* assert.j -- Wrapper for GCC's assert.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* assert.j -- Wrapper for GCC's assert.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bad.c g77-0.5.23/f/bad.c *** g77-0.5.22/f/bad.c Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/bad.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bad.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bad.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 40,43 **** --- 40,44 ---- #include #include "bad.h" + #include "flags.j" #include "com.h" #include "where.h" diff -rcp2N g77-0.5.22/f/bad.def g77-0.5.23/f/bad.def *** g77-0.5.22/f/bad.def Sun Jan 11 20:55:49 1998 --- g77-0.5.23/f/bad.def Tue May 19 21:47:57 1998 *************** *** 1,5 **** /* bad.def -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bad.def -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** FFEBAD_MSGS1 (FFEBAD_FORMAT_UNSUPPORTED, *** 552,565 **** FFEBAD_MSGS1 (FFEBAD_FORMAT_VARIABLE, FATAL, "Variable-expression FORMAT specifier at %0 -- unsupported") ! FFEBAD_MSGS2 (FFEBAD_OPEN_UNSUPPORTED, WARN, "Unsupported OPEN control item at %0 -- ACTION=, ASSOCIATEVARIABLE=, BLOCKSIZE=, BUFFERCOUNT=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, DISPOSE=, EXTENDSIZE=, INITIALSIZE=, KEY=, MAXREC=, NOSPANBLOCKS, ORGANIZATION=, PAD=, POSITION=, READONLY=, RECORDTYPE=, SHARED=, and USEROPEN= are not supported", "Unsupported OPEN control item at %0") ! FFEBAD_MSGS2 (FFEBAD_INQUIRE_UNSUPPORTED, WARN, "Unsupported INQUIRE control item at %0 -- ACTION=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, KEYED=, ORGANIZATION=, PAD=, POSITION=, READ=, READWRITE=, RECORDTYPE=, and WRITE= are not supported", "Unsupported INQUIRE control item at %0") ! FFEBAD_MSGS2 (FFEBAD_READ_UNSUPPORTED, WARN, "Unsupported READ control item at %0 -- ADVANCE=, EOR=, KEYEQ=, KEYGE=, KEYGT=, KEYID=, NULLS=, and SIZE= are not supported", "Unsupported READ control item at %0") ! FFEBAD_MSGS2 (FFEBAD_WRITE_UNSUPPORTED, WARN, "Unsupported WRITE control item at %0 -- ADVANCE= and EOR= are not supported", "Unsupported WRITE control item at %0") --- 552,565 ---- FFEBAD_MSGS1 (FFEBAD_FORMAT_VARIABLE, FATAL, "Variable-expression FORMAT specifier at %0 -- unsupported") ! FFEBAD_MSGS2 (FFEBAD_OPEN_UNSUPPORTED, FATAL, "Unsupported OPEN control item at %0 -- ACTION=, ASSOCIATEVARIABLE=, BLOCKSIZE=, BUFFERCOUNT=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, DISPOSE=, EXTENDSIZE=, INITIALSIZE=, KEY=, MAXREC=, NOSPANBLOCKS, ORGANIZATION=, PAD=, POSITION=, READONLY=, RECORDTYPE=, SHARED=, and USEROPEN= are not supported", "Unsupported OPEN control item at %0") ! FFEBAD_MSGS2 (FFEBAD_INQUIRE_UNSUPPORTED, FATAL, "Unsupported INQUIRE control item at %0 -- ACTION=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, KEYED=, ORGANIZATION=, PAD=, POSITION=, READ=, READWRITE=, RECORDTYPE=, and WRITE= are not supported", "Unsupported INQUIRE control item at %0") ! FFEBAD_MSGS2 (FFEBAD_READ_UNSUPPORTED, FATAL, "Unsupported READ control item at %0 -- ADVANCE=, EOR=, KEYEQ=, KEYGE=, KEYGT=, KEYID=, NULLS=, and SIZE= are not supported", "Unsupported READ control item at %0") ! FFEBAD_MSGS2 (FFEBAD_WRITE_UNSUPPORTED, FATAL, "Unsupported WRITE control item at %0 -- ADVANCE= and EOR= are not supported", "Unsupported WRITE control item at %0") *************** FFEBAD_MSGS2 (FFEBAD_ACTUALARG, WARN, *** 657,661 **** "Invalid actual argument at %0 -- replace hollerith constants with %%REF('string') and typeless constants with INTEGER constant equivalents, or use -fugly-args or -fugly", "Invalid actual argument at %0") ! FFEBAD_MSGS2 (FFEBAD_QUAD_UNSUPPORTED, WARN, "Quadruple-precision floating-point unsupported -- treating constant at %0 as double-precision", "Quadruple-precision floating-point unsupported") --- 657,661 ---- "Invalid actual argument at %0 -- replace hollerith constants with %%REF('string') and typeless constants with INTEGER constant equivalents, or use -fugly-args or -fugly", "Invalid actual argument at %0") ! FFEBAD_MSGS2 (FFEBAD_QUAD_UNSUPPORTED, FATAL, "Quadruple-precision floating-point unsupported -- treating constant at %0 as double-precision", "Quadruple-precision floating-point unsupported") *************** FFEBAD_MSGS2 (FFEBAD_TOO_BIG_INIT, WARN, *** 663,677 **** "Initialization of large (%B-unit) aggregate area `%A' at %0 currently very slow and takes lots of memory during g77 compile -- to be improved in 0.6", "This could take a while (initializing `%A' at %0)...") ! FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_STMT, WARN, "Statement at %0 invalid in BLOCK DATA program unit at %1") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_CHARACTER, WARN, "Truncating characters on right side of character constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_HOLLERITH, WARN, "Truncating characters on right side of hollerith constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_NUMERIC, WARN, "Truncating non-zero data on left side of numeric constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_TYPELESS, WARN, "Truncating non-zero data on left side of typeless constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TYPELESS_OVERFLOW, WARN, "Typeless constant at %0 too large") FFEBAD_MSGS1 (FFEBAD_AMPERSAND, WARN, --- 663,677 ---- "Initialization of large (%B-unit) aggregate area `%A' at %0 currently very slow and takes lots of memory during g77 compile -- to be improved in 0.6", "This could take a while (initializing `%A' at %0)...") ! FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_STMT, FATAL, "Statement at %0 invalid in BLOCK DATA program unit at %1") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_CHARACTER, FATAL, "Truncating characters on right side of character constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_HOLLERITH, FATAL, "Truncating characters on right side of hollerith constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_NUMERIC, FATAL, "Truncating non-zero data on left side of numeric constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TRUNCATING_TYPELESS, FATAL, "Truncating non-zero data on left side of typeless constant at %0") ! FFEBAD_MSGS1 (FFEBAD_TYPELESS_OVERFLOW, FATAL, "Typeless constant at %0 too large") FFEBAD_MSGS1 (FFEBAD_AMPERSAND, WARN, diff -rcp2N g77-0.5.22/f/bad.h g77-0.5.23/f/bad.h *** g77-0.5.22/f/bad.h Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/bad.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bad.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bad.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bit.c g77-0.5.23/f/bit.c *** g77-0.5.22/f/bit.c Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/bit.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bit.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bit.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bit.h g77-0.5.23/f/bit.h *** g77-0.5.22/f/bit.h Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/bit.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bit.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bit.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bld-op.def g77-0.5.23/f/bld-op.def *** g77-0.5.22/f/bld-op.def Wed Aug 30 19:53:38 1995 --- g77-0.5.23/f/bld-op.def Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bld-op.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bld-op.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bld.c g77-0.5.23/f/bld.c *** g77-0.5.22/f/bld.c Sat Mar 1 04:20:55 1997 --- g77-0.5.23/f/bld.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bld.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bld.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bld.h g77-0.5.23/f/bld.h *** g77-0.5.22/f/bld.h Sat Mar 1 04:21:00 1997 --- g77-0.5.23/f/bld.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* bld.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* bld.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/bugs.texi g77-0.5.23/f/bugs.texi *** g77-0.5.22/f/bugs.texi Sun Mar 15 10:12:06 1998 --- g77-0.5.23/f/bugs.texi Fri May 8 04:08:21 1998 *************** *** 6,10 **** @c in the G77 distribution, as well as in the G77 manual. ! @c 1998-03-15 @ifclear BUGSONLY --- 6,10 ---- @c in the G77 distribution, as well as in the G77 manual. ! @c 1998-05-08 @ifclear BUGSONLY *************** configure, port, build, and install @cod *** 26,43 **** @itemize @bullet ! @cindex Alpha @cindex -O2 @item ! @code{g77}'s version of @code{gcc}, and probably @code{g77} ! itself, cannot be reliably used with the @samp{-O2} option ! (or higher) on Digital Semiconductor Alpha AXP machines. ! The problem is most immediately noticed in differences ! discovered by @kbd{make compare} following a bootstrap ! build using @samp{-O2}. ! It also manifests itself as a failure to compile ! @samp{DATA} statements such as @samp{DATA R/7./} correctly; ! in this case, @samp{R} might be initialized to @samp{4.0}. ! ! Until this bug is fixed, use only @samp{-O1} or no optimization. @item --- 26,72 ---- @itemize @bullet ! @item ! @c Toon Moene discovered these. ! Some Fortran code has been found to be miscompiled ! by @code{g77} built on @code{gcc} version 2.8.1 ! on m68k-next-nextstep3 configurations ! when using the @samp{-O2} option. ! Even a C function is known to miscompile ! on that configuration ! when using the @samp{-O2 -funroll-loops} options. ! ! Whether these problems exist on other configurations ! is not yet known. ! Similarly, when these problems will be fixed is ! not yet known. ! We believe they do not occur in @code{egcs} ! version 1.0.3. ! ! @cindex DNRM2 ! @cindex stack, 387 coprocessor ! @cindex ix86 @cindex -O2 @item ! A code-generation bug afflicts ! Intel x86 targets when @samp{-O2} is specified ! compiling, for example, an old version of ! the @samp{DNRM2} routine. ! The x87 coprocessor stack is being ! mismanaged in cases where assigned @code{GOTO} ! and @code{ASSIGN} are involved. ! ! Version 0.5.22 of @code{g77} fixed this problem ! by patching the version of @code{gcc} on which it ! is based. ! Version 1.1 of @code{egcs} will fix ! this problem as well. ! It is not known when a version of @code{gcc} ! that fixes this problem will be made available. ! ! @item ! A compiler crash, or apparently infinite run time, ! can result when compiling complicated expressions ! involving @code{COMPLEX} arithmetic ! (especially multiplication). @item *************** form instead, and so on. *** 51,60 **** @item - The @code{g77} command itself should more faithfully process - options the way the @code{gcc} command does. - For example, @code{gcc} accepts abbreviated forms of long options, - @code{g77} generally doesn't. - - @item Some confusion in diagnostics concerning failing @code{INCLUDE} statements from within @code{INCLUDE}'d or @code{#include}'d files. --- 80,83 ---- *************** compilers. *** 190,213 **** @cindex support, Alpha @item ! @code{g77} doesn't work perfectly on 64-bit configurations such as the Alpha. ! This problem is expected to be largely resolved as of version 0.5.20, ! and further addressed by 0.5.21. ! Version 0.6 should solve most or all related problems (such as ! 64-bit machines other than Digital Semiconductor (``DEC'') Alphas). ! ! One known bug that causes a compile-time crash occurs when compiling ! code such as the following with optimization: ! ! @example ! SUBROUTINE CRASH (TEMP) ! INTEGER*2 HALF(2) ! REAL TEMP ! HALF(1) = NINT (TEMP) ! END ! @end example ! ! It is expected that a future version of @code{g77} will have a fix for this ! problem, almost certainly by the time @code{g77} supports the forthcoming ! version 2.8.0 of @code{gcc}. @cindex COMPLEX support --- 213,221 ---- @cindex support, Alpha @item ! @code{g77} doesn't work perfectly on 64-bit configurations ! such as the Digital Semiconductor (``DEC'') Alpha. ! This problem is expected to be largely resolved as of version 0.5.23. ! Version 0.6 should solve most or all remaining problems (such as ! cross-compiling involving 64-bit machines). @cindex COMPLEX support diff -rcp2N g77-0.5.22/f/com-rt.def g77-0.5.23/f/com-rt.def *** g77-0.5.22/f/com-rt.def Wed Dec 24 04:03:30 1997 --- g77-0.5.23/f/com-rt.def Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* com-rt.def -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* com-rt.def -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/com.c g77-0.5.23/f/com.c *** g77-0.5.22/f/com.c Mon Mar 16 19:33:32 1998 --- g77-0.5.23/f/com.c Tue May 19 16:56:50 1998 *************** *** 1,5 **** /* com.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* com.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 86,89 **** --- 86,90 ---- /* Include files. */ + #include "proj.h" #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "config.j" *************** the Free Software Foundation, 59 Temple *** 91,94 **** --- 92,96 ---- #include "rtl.j" #include "tree.j" + #include "output.j" /* Must follow tree.j so TREE_CODE is defined! */ #include "convert.j" #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ *************** char *getenv (); *** 155,161 **** #endif - char *index (); - char *rindex (); - #if HAVE_UNISTD_H # include --- 157,160 ---- *************** typedef struct { unsigned :16, :16, :16; *** 196,200 **** /* END stuff from gcc/cccp.c. */ - #include "proj.h" #define FFECOM_DETERMINE_TYPES 1 /* for com.h */ #include "com.h" --- 195,198 ---- *************** static int duplicate_decls (tree newdecl *** 508,512 **** static void finish_decl (tree decl, tree init, bool is_top_level); static void finish_function (int nested); ! static char *lang_printable_name (tree decl, char **kind); static tree lookup_name_current_level (tree name); static struct binding_level *make_binding_level (void); --- 506,510 ---- static void finish_decl (tree decl, tree init, bool is_top_level); static void finish_function (int nested); ! static char *lang_printable_name (tree decl, int v); static tree lookup_name_current_level (tree name); static struct binding_level *make_binding_level (void); *************** ffecom_convert_narrow_ (type, expr) *** 955,960 **** --- 953,964 ---- { assert (TREE_CODE (TREE_TYPE (e)) == RECORD_TYPE); + /* Check that at least the first field name agrees. */ + assert (DECL_NAME (TYPE_FIELDS (type)) + == DECL_NAME (TYPE_FIELDS (TREE_TYPE (e)))); assert (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type))) <= TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e))))); + if (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type))) + == TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e))))) + return e; return fold (ffecom_convert_to_complex_ (type, e)); } *************** ffecom_convert_widen_ (type, expr) *** 1019,1024 **** --- 1023,1034 ---- { assert (TREE_CODE (TREE_TYPE (e)) == RECORD_TYPE); + /* Check that at least the first field name agrees. */ + assert (DECL_NAME (TYPE_FIELDS (type)) + == DECL_NAME (TYPE_FIELDS (TREE_TYPE (e)))); assert (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type))) >= TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e))))); + if (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type))) + == TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e))))) + return e; return fold (ffecom_convert_to_complex_ (type, e)); } *************** ffecom_check_size_overflow_ (ffesymbol s *** 2034,2039 **** if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0) ! || (!dummy && (TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0)) ! || TREE_OVERFLOW (TYPE_SIZE (type))) { ffebad_start (FFEBAD_ARRAY_LARGE); --- 2044,2049 ---- if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0) ! || (!dummy && (((TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0)) ! || TREE_OVERFLOW (TYPE_SIZE (type))))) { ffebad_start (FFEBAD_ARRAY_LARGE); *************** ffecom_char_enhance_arg_ (tree *xtype, f *** 2081,2085 **** { assert (tlen != NULL_TREE); ! highval = tlen; } else --- 2091,2095 ---- { assert (tlen != NULL_TREE); ! highval = variable_size (tlen); } else *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2742,2745 **** --- 2752,2756 ---- tree tree_type; tree dt; /* decl_tree for an ffesymbol. */ + tree left, right; ffesymbol s; enum tree_code code; *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2752,2760 **** bt = ffeinfo_basictype (ffebld_info (expr)); kt = ffeinfo_kindtype (ffebld_info (expr)); switch (ffebld_op (expr)) { case FFEBLD_opACCTER: - tree_type = ffecom_tree_type[bt][kt]; { ffebitCount i; --- 2763,2771 ---- bt = ffeinfo_basictype (ffebld_info (expr)); kt = ffeinfo_kindtype (ffebld_info (expr)); + tree_type = ffecom_tree_type[bt][kt]; switch (ffebld_op (expr)) { case FFEBLD_opACCTER: { ffebitCount i; *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2820,2824 **** case FFEBLD_opARRTER: - tree_type = ffecom_tree_type[bt][kt]; { ffetargetOffset i; --- 2831,2834 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2856,2860 **** case FFEBLD_opCONTER: - tree_type = ffecom_tree_type[bt][kt]; item = ffecom_constantunion (&ffebld_constant_union (ffebld_conter (expr)), --- 2866,2869 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2990,2994 **** TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (t))), t, ! ffecom_expr (dims[--i])); #endif --- 2999,3004 ---- TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (t))), t, ! ffecom_expr_ (dims[--i], NULL, NULL, ! NULL, FALSE)); #endif *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2997,3041 **** case FFEBLD_opUPLUS: ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_1 (NOP_EXPR, tree_type, ffecom_expr (ffebld_left (expr))); case FFEBLD_opPAREN: /* ~~~Make sure Fortran rules respected here */ ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_1 (NOP_EXPR, tree_type, ffecom_expr (ffebld_left (expr))); case FFEBLD_opUMINUS: ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_1 (NEGATE_EXPR, tree_type, ! ffecom_expr (ffebld_left (expr))); case FFEBLD_opADD: ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_2 (PLUS_EXPR, tree_type, ! ffecom_expr (ffebld_left (expr)), ! ffecom_expr (ffebld_right (expr))); ! break; case FFEBLD_opSUBTRACT: ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_2 (MINUS_EXPR, tree_type, ! ffecom_expr (ffebld_left (expr)), ! ffecom_expr (ffebld_right (expr))); case FFEBLD_opMULTIPLY: ! tree_type = ffecom_tree_type[bt][kt]; ! return ffecom_2 (MULT_EXPR, tree_type, ! ffecom_expr (ffebld_left (expr)), ! ffecom_expr (ffebld_right (expr))); case FFEBLD_opDIVIDE: ! tree_type = ffecom_tree_type[bt][kt]; ! return ! ffecom_tree_divide_ (tree_type, ! ffecom_expr (ffebld_left (expr)), ! ffecom_expr (ffebld_right (expr)), ! dest_tree, dest, dest_used); case FFEBLD_opPOWER: - tree_type = ffecom_tree_type[bt][kt]; { ffebld left = ffebld_left (expr); --- 3007,3054 ---- case FFEBLD_opUPLUS: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_1 (NOP_EXPR, tree_type, left); case FFEBLD_opPAREN: /* ~~~Make sure Fortran rules respected here */ ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_1 (NOP_EXPR, tree_type, left); case FFEBLD_opUMINUS: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_1 (NEGATE_EXPR, tree_type, left); case FFEBLD_opADD: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! right = ffecom_expr_ (ffebld_right (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_2 (PLUS_EXPR, tree_type, left, right); case FFEBLD_opSUBTRACT: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! right = ffecom_expr_ (ffebld_right (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_2 (MINUS_EXPR, tree_type, left, right); case FFEBLD_opMULTIPLY: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! right = ffecom_expr_ (ffebld_right (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_2 (MULT_EXPR, tree_type, left, right); case FFEBLD_opDIVIDE: ! left = ffecom_expr_ (ffebld_left (expr), NULL, NULL, ! NULL, FALSE); ! right = ffecom_expr_ (ffebld_right (expr), NULL, NULL, ! NULL, FALSE); ! return ffecom_tree_divide_ (tree_type, left, right, ! dest_tree, dest, dest_used); case FFEBLD_opPOWER: { ffebld left = ffebld_left (expr); *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3043,3046 **** --- 3056,3060 ---- ffecomGfrt code; ffeinfoKindtype rtkt; + ffeinfoKindtype ltkt; switch (ffeinfo_basictype (ffebld_info (right))) *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3054,3057 **** --- 3068,3072 ---- } + ltkt = FFEINFO_kindtypeINTEGER1; rtkt = FFEINFO_kindtypeINTEGER1; switch (ffeinfo_basictype (ffebld_info (left))) *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3064,3067 **** --- 3079,3083 ---- { code = FFECOM_gfrtPOW_QQ; + ltkt = FFEINFO_kindtypeINTEGER4; rtkt = FFEINFO_kindtypeINTEGER4; } *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3091,3098 **** break; } ! if (ffeinfo_kindtype (ffebld_info (left)) != rtkt) left = ffeexpr_convert (left, NULL, NULL, FFEINFO_basictypeINTEGER, ! rtkt, 0, FFETARGET_charactersizeNONE, FFEEXPR_contextLET); --- 3107,3114 ---- break; } ! if (ffeinfo_kindtype (ffebld_info (left)) != ltkt) left = ffeexpr_convert (left, NULL, NULL, FFEINFO_basictypeINTEGER, ! ltkt, 0, FFETARGET_charactersizeNONE, FFEEXPR_contextLET); *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3153,3162 **** case FFEBLD_opNOT: - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { case FFEINFO_basictypeLOGICAL: ! item ! = ffecom_truth_value_invert (ffecom_expr (ffebld_left (expr))); return convert (tree_type, item); --- 3169,3176 ---- case FFEBLD_opNOT: switch (bt) { case FFEINFO_basictypeLOGICAL: ! item = ffecom_truth_value_invert (ffecom_expr (ffebld_left (expr))); return convert (tree_type, item); *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3178,3182 **** /* Fall through. */ case FFEBLD_opSUBRREF: - tree_type = ffecom_tree_type[bt][kt]; if (ffeinfo_where (ffebld_info (ffebld_left (expr))) == FFEINFO_whereINTRINSIC) --- 3192,3195 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3221,3225 **** case FFEBLD_opAND: - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { --- 3234,3237 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3245,3249 **** case FFEBLD_opOR: - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { --- 3257,3260 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3270,3274 **** case FFEBLD_opXOR: case FFEBLD_opNEQV: - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { --- 3281,3284 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3294,3298 **** case FFEBLD_opEQV: - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { --- 3304,3307 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3323,3327 **** return error_mark_node; - tree_type = ffecom_tree_type[bt][kt]; switch (bt) { --- 3332,3335 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3388,3393 **** relational: /* :::::::::::::::::::: */ - - tree_type = ffecom_tree_type[bt][kt]; switch (ffeinfo_basictype (ffebld_info (ffebld_left (expr)))) { --- 3396,3399 ---- *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 3531,3535 **** case FFEBLD_opPERCENT_LOC: - tree_type = ffecom_tree_type[bt][kt]; item = ffecom_arg_ptr_to_expr (ffebld_left (expr), &list); return convert (tree_type, item); --- 3537,3540 ---- *************** ffecom_expr_power_integer_ (ffebld left, *** 6225,6230 **** ({ typeof (r) rtmp = r; ! typeof (l) ltmp = l; ! typeof (l) result; if (rtmp == 0) --- 6230,6235 ---- ({ typeof (r) rtmp = r; ! typeof (l) ltmp = l; ! typeof (l) result; if (rtmp == 0) *************** ffecom_start_progunit_ () *** 7859,7862 **** --- 7864,7869 ---- !altentries); /* TREE_PUBLIC */ + TREE_USED (current_function_decl) = 1; /* Avoid spurious warning if altentries. */ + if (!altentries && ((g = ffesymbol_global (fn)) != NULL) *************** ffecom_sym_transform_ (ffesymbol s) *** 8303,8313 **** if ((ffebld_op (ffebld_right (dim)) == FFEBLD_opSTAR) || ffecom_doing_entry_) ! /* Used to just do high=low. But for ffecom_tree_ ! canonize_ref_, it probably is important to correctly ! assess the size. E.g. given COMPLEX C(*),CFUNC and ! C(2)=CFUNC(C), overlap can happen, while it can't ! for, say, C(1)=CFUNC(C(2)). */ ! high = convert (TREE_TYPE (low), ! TYPE_MAX_VALUE (TREE_TYPE (low))); else high = ffecom_expr (ffebld_right (dim)); --- 8310,8322 ---- if ((ffebld_op (ffebld_right (dim)) == FFEBLD_opSTAR) || ffecom_doing_entry_) ! { ! /* Used to just do high=low. But for ffecom_tree_ ! canonize_ref_, it probably is important to correctly ! assess the size. E.g. given COMPLEX C(*),CFUNC and ! C(2)=CFUNC(C), overlap can happen, while it can't ! for, say, C(1)=CFUNC(C(2)). */ ! high = convert (TREE_TYPE (low), ! TYPE_MAX_VALUE (TREE_TYPE (low))); ! } else high = ffecom_expr (ffebld_right (dim)); *************** ffecom_sym_transform_ (ffesymbol s) *** 8449,8453 **** if (!adjustable && ((TREE_CODE (low) != INTEGER_CST) ! || (TREE_CODE (high) != INTEGER_CST))) adjustable = TRUE; --- 8458,8462 ---- if (!adjustable && ((TREE_CODE (low) != INTEGER_CST) ! || (high && TREE_CODE (high) != INTEGER_CST))) adjustable = TRUE; *************** ffecom_sym_transform_ (ffesymbol s) *** 8459,8463 **** ffecom_integer_zero_node); ! if (TREE_CODE (high) != INTEGER_CST) high = ffecom_3 (COND_EXPR, integer_type_node, ffecom_adjarray_passed_ (s), --- 8468,8472 ---- ffecom_integer_zero_node); ! if (high && TREE_CODE (high) != INTEGER_CST) high = ffecom_3 (COND_EXPR, integer_type_node, ffecom_adjarray_passed_ (s), *************** ffecom_sym_transform_ (ffesymbol s) *** 8475,8479 **** does this, which is why dumb0.c would work. */ ! if (TREE_CODE (high) != INTEGER_CST) high = variable_size (high); --- 8484,8488 ---- does this, which is why dumb0.c would work. */ ! if (high && TREE_CODE (high) != INTEGER_CST) high = variable_size (high); *************** ffecom_tree_canonize_ptr_ (tree *decl, t *** 9497,9502 **** (presumably bits). */ *offset = size_binop (MULT_EXPR, ! *offset, ! TYPE_SIZE (TREE_TYPE (TREE_TYPE (t)))); break; } --- 9506,9511 ---- (presumably bits). */ *offset = size_binop (MULT_EXPR, ! TYPE_SIZE (TREE_TYPE (TREE_TYPE (t))), ! *offset); break; } *************** ffecom_init_0 () *** 12497,12501 **** ffecom_tree_xargc_ = build_decl (VAR_DECL, ! get_identifier ("xargc"), integer_type_node); DECL_EXTERNAL (ffecom_tree_xargc_) = 1; --- 12506,12510 ---- ffecom_tree_xargc_ = build_decl (VAR_DECL, ! get_identifier ("f__xargc"), integer_type_node); DECL_EXTERNAL (ffecom_tree_xargc_) = 1; *************** ffecom_ptr_to_expr (ffebld expr) *** 13106,13109 **** --- 13115,13120 ---- --i, array = TYPE_MAIN_VARIANT (TREE_TYPE (array))) { + /* The initial subtraction should happen in the original type so + that (possible) negative values are handled appropriately. */ item = ffecom_2 (PLUS_EXPR, *************** ffecom_ptr_to_expr (ffebld expr) *** 13112,13118 **** size_binop (MULT_EXPR, size_in_bytes (TREE_TYPE (array)), ! size_binop (MINUS_EXPR, ! ffecom_expr (dims[i]), ! TYPE_MIN_VALUE (TYPE_DOMAIN (array))))); } } --- 13123,13131 ---- size_binop (MULT_EXPR, size_in_bytes (TREE_TYPE (array)), ! convert (sizetype, ! fold (build (MINUS_EXPR, ! TREE_TYPE (TYPE_MIN_VALUE (TYPE_DOMAIN (array))), ! ffecom_expr (dims[i]), ! TYPE_MIN_VALUE (TYPE_DOMAIN (array))))))); } } *************** finish_function (int nested) *** 14263,14272 **** static char * ! lang_printable_name (tree decl, char **kind) { ! *kind = "program unit"; ! if (TREE_CODE (decl) == ERROR_MARK) ! return "erroneous code"; ! return IDENTIFIER_POINTER (DECL_NAME (decl)); } --- 14276,14291 ---- static char * ! lang_printable_name (tree decl, int v) { ! /* Just to keep GCC quiet about the unused variable. ! In theory, differing values of V should produce different ! output. */ ! switch (v) ! { ! default: ! if (TREE_CODE (decl) == ERROR_MARK) ! return "erroneous code"; ! return IDENTIFIER_POINTER (DECL_NAME (decl)); ! } } *************** type_for_mode (mode, unsignedp) *** 15574,15581 **** if (((t = ffecom_tree_type[i][j]) != NULL_TREE) && (mode == TYPE_MODE (t))) ! if ((i == FFEINFO_basictypeINTEGER) && unsignedp) ! return ffecom_tree_type[FFEINFO_basictypeHOLLERITH][j]; ! else ! return t; } --- 15593,15602 ---- if (((t = ffecom_tree_type[i][j]) != NULL_TREE) && (mode == TYPE_MODE (t))) ! { ! if ((i == FFEINFO_basictypeINTEGER) && unsignedp) ! return ffecom_tree_type[FFEINFO_basictypeHOLLERITH][j]; ! else ! return t; ! } } diff -rcp2N g77-0.5.22/f/com.h g77-0.5.23/f/com.h *** g77-0.5.22/f/com.h Mon Sep 29 20:18:18 1997 --- g77-0.5.23/f/com.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* com.h -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* com.h -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** tree ffecom_truth_value (tree expr); *** 339,342 **** --- 339,347 ---- tree ffecom_truth_value_invert (tree expr); tree ffecom_which_entrypoint_decl (void); + + /* These need to be in the front end with exactly these interfaces, + as they're called by the back end. */ + + int mark_addressable (tree expr); #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ *************** tree ffecom_which_entrypoint_decl (void) *** 345,389 **** #if FFECOM_targetCURRENT == FFECOM_targetGCC ! extern int flag_pedantic_errors; ! void emit_nop (void); ! void announce_function (tree decl); ! extern FILE *asm_out_file; ! void assemble_string (char *, int); ! void assemble_variable (tree decl, int top_level, int at_end, ! int dont_output_data); ! void assemble_zeros (int size); ! int count_error (int warningp); ! void error (char *s, ...); ! void expand_decl (tree decl); ! void expand_computed_goto (tree exp); ! void expand_function_end (char *filename, int line, int end_bindings); ! void expand_function_start (tree subr, int parms_have_cleanups); ! void expand_main_function (void); ! void fatal (char *s, ...); ! void init_function_start (tree subr, char *filename, int line); ! void make_function_rtl (tree decl); ! void make_decl_rtl (tree decl, char *asmspec, int top_level); ! void make_var_volatile (tree var); ! int mark_addressable (tree expr); ! void output_inline_function (tree fndecl); ! void pedwarn (char *s, ...); ! void pop_function_context (void); ! void pop_momentary_nofree (void); ! void preserve_initializer (void); ! void print_node (FILE *file, char *prefix, tree node, int indent); ! void push_function_context (void); ! void push_obstacks (struct obstack *current, struct obstack *saveable); ! void put_var_into_stack (tree decl); ! void remember_end_note (tree block); ! void report_error_function (char *file); ! void rest_of_compilation (tree decl); void rest_of_decl_compilation (tree decl, char *asmspec, int top_level, ! int at_end); ! void resume_temporary_allocation (void); ! void set_identifier_size (int size); ! void temporary_allocation (void); ! tree truthvalue_conversion (tree expr); ! void warning_with_decl (tree decl, char *s, ...); ! void warning (char *s, ...); #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ --- 350,386 ---- #if FFECOM_targetCURRENT == FFECOM_targetGCC ! #include "rtl.j" ! extern rtx emit_line_note (char *, int); /* From rtl.h. */ ! void emit_nop (void); /* From stmt.c (no .h file). */ ! void announce_function (tree decl); /* From toplev.c (no .h file). */ ! int count_error (int warningp); /* From toplev.c (no .h file). */ ! void error (char *s, ...); /* From toplev.c (no .h file). */ ! void expand_decl (tree decl); /* From stmt.c (no .h file). */ ! void expand_computed_goto (tree exp); /* From stmt.c (no .h file). */ ! void expand_function_end (char *filename, int line, int end_bindings); /* From function.c (no .h file). */ ! void expand_function_start (tree subr, int parms_have_cleanups); /* From function.c (no .h file). */ ! void expand_main_function (void); /* From function.c (no .h file). */ ! void fatal (char *s, ...); /* From toplev.c (no .h file). */ ! void init_function_start (tree subr, char *filename, int line); /* From function.c (no .h file). */ ! void output_inline_function (tree fndecl); /* From integrate.c (no .h file). */ ! void pedwarn (char *s, ...); /* From toplev.c (no .h file). */ ! void pop_function_context (void); /* From function.c (no .h file). */ ! void pop_momentary_nofree (void); /* From tree.c (no .h file). */ ! void preserve_initializer (void); /* From tree.c (no .h file). */ ! void print_node (FILE *file, char *prefix, tree node, int indent); /* From print-tree.c (no .h file). */ ! void push_function_context (void); /* From function.c (no .h file). */ ! void push_obstacks (struct obstack *current, struct obstack *saveable); /* From tree.c (no .h file). */ ! void put_var_into_stack (tree decl); /* From function.c (no .h file). */ ! void remember_end_note (tree block); /* From stmt.c (no .h file). */ ! void report_error_function (char *file); /* From toplev.c (no .h file). */ ! void rest_of_compilation (tree decl); /* From toplev.c (no .h file). */ void rest_of_decl_compilation (tree decl, char *asmspec, int top_level, ! int at_end); /* From toplev.c (no .h file). */ ! void resume_temporary_allocation (void); /* From tree.c (no .h file). */ ! void set_identifier_size (int size); /* From tree.c (no .h file). */ ! void temporary_allocation (void); /* From tree.c (no .h file). */ ! tree truthvalue_conversion (tree expr); /* !!! From expr.c (s/b tree.h). */ ! void warning_with_decl (tree decl, char *s, ...); /* From toplev.c (no .h file). */ ! void warning (char *s, ...); /* From toplev.c (no .h file). */ #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ diff -rcp2N g77-0.5.22/f/config-lang.in g77-0.5.23/f/config-lang.in *** g77-0.5.22/f/config-lang.in Tue Sep 2 21:25:26 1997 --- g77-0.5.23/f/config-lang.in Sun Apr 19 22:27:28 1998 *************** *** 27,130 **** # diff_excludes - files to ignore when building diffs between two versions. - if grep DECL_STATIC_CONSTRUCTOR $srcdir/tree.h >/dev/null; then - if grep flag_move_all_movables $srcdir/toplev.c >/dev/null; then true - else - echo "You haven't applied the patches to the GCC 2.7.x distribution in" - echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README." - echo "" - exit 1 - fi - else - if grep put_pending_sizes $srcdir/stor-layout.c >/dev/null; then true - else - echo "You haven't applied the patches to the GCC 2.6.x distribution in" - echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README." - echo "" - exit 1 - fi - fi - language="f77" compilers="f771\$(exeext)" ! case "$arguments" in ! # *--enable-f2c* | *-enable-f2c*) ! # echo "f77: enabling f2c." ! # stagestuff="g77 g77-cross f771 libf2c.a f2c fc" ;; ! # stagestuff="g77 g77-cross f771 libf2c.a f2c" ;; ! *) ! stagestuff="g77\$(exeext) g77-cross\$(exeext) f771\$(exeext) libf2c.a" ;; ! esac ! ! diff_excludes="-x \"f/g77.info*\"" ! ! # Create the runtime library directory tree if necessary. ! test -d f || mkdir f ! test -d f/runtime || mkdir f/runtime ! test -d f/runtime/libF77 || mkdir f/runtime/libF77 ! test -d f/runtime/libI77 || mkdir f/runtime/libI77 ! test -d f/runtime/libU77 || mkdir f/runtime/libU77 ! ! # Need to make top-level stageN directory trees, else if needed ! # later by gcc/Makefile, it'll make only the first levels and ! # the language subdirectory levels, not the runtime stuff. ! for stageN in stage1 stage2 stage3 stage4 ! do ! test -d $stageN || mkdir $stageN ! test -d $stageN/f || mkdir $stageN/f ! test -d $stageN/f/runtime || mkdir $stageN/f/runtime ! test -d $stageN/f/runtime/libF77 || mkdir $stageN/f/runtime/libF77 ! test -d $stageN/f/runtime/libI77 || mkdir $stageN/f/runtime/libI77 ! test -d $stageN/f/runtime/libU77 || mkdir $stageN/f/runtime/libU77 ! done ! ! # Make links into top-level stageN from target trees. ! for stageN in stage1 stage2 stage3 stage4 include ! do ! $remove -f f/$stageN f/runtime/$stageN f/runtime/libF77/$stageN \ ! f/runtime/libI77/$stageN f/runtime/libU77/$stageN ! (cd f; $symbolic_link ../$stageN . 2>/dev/null) ! (cd f/runtime; $symbolic_link ../$stageN . 2>/dev/null) ! (cd f/runtime/libF77; $symbolic_link ../$stageN . 2>/dev/null) ! (cd f/runtime/libI77; $symbolic_link ../$stageN . 2>/dev/null) ! (cd f/runtime/libU77; $symbolic_link ../$stageN . 2>/dev/null) ! done ! case "$srcdir" in ! .) ;; ! *) echo ! echo "Building f77 outside the source directory is likely to not work" ! echo "unless you are using GNU make or a compatible VPATH mechanism." ! echo ;; ! esac ! case "$host" in ! hppa*-*-hpux10) ! echo ! echo "The GCC \`fixincludes' step (which involves running a sed script)" ! echo "typically fails on HP-UX 10 because of a bug in the vendor's" ! echo "implementation of sed. Currently the only known workaround is to" ! echo "install GNU sed before building gcc. The file sed-2.05.bin.hpux10" ! echo "in mirrors of the GNU distribution is a suitable precompiled" ! echo "binary." ! echo ;; ! rs6000-ibm-aix4.1*) ! echo ! echo "G77 has been observed to not build on (at least) the configuration" ! echo "rs6000-ibm-aix4.1.4.0 with the native linker -- it crashes. There" ! echo "may be an IBM bug fix for this (we don't know) but the build should" ! echo "work if you add \`-mminimal-toc' to the compilation flags, i.e. add" ! echo "something like \`BOOT_CFLAGS=\"-O2 -mminimal-toc -g\"' to the \`make" ! echo "bootstrap' command line. Probably building with the GNU linker (from" ! echo "the binutils package) installed and configuring \`--with-gnu-ld' will work." ! echo ;; ! mips-sgi-irix6*) ! echo ! echo Consult ! echo "" ! echo "regarding building under IRIX-6.2/6.3/6.4. Note that you *must*" ! echo "have the SGI IDO bought and installed (sigh)." ! echo ;; ! *) ;; ! esac --- 27,37 ---- # diff_excludes - files to ignore when building diffs between two versions. language="f77" compilers="f771\$(exeext)" ! stagestuff="g77\$(exeext) g77-cross\$(exeext) f771\$(exeext) libg2c.a" ! diff_excludes="-x \"f/g77.info*\" -x f/BUGS -x f/NEWS -x f/INSTALL -x f/intdoc.texi -x f/runtime/configure -x f/runtime/libU77/configure" ! outputs=f/Makefile diff -rcp2N g77-0.5.22/f/config.j g77-0.5.23/f/config.j *** g77-0.5.22/f/config.j Wed Aug 30 19:53:37 1995 --- g77-0.5.23/f/config.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* config.j -- Wrapper for GCC's config.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* config.j -- Wrapper for GCC's config.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/convert.j g77-0.5.23/f/convert.j *** g77-0.5.22/f/convert.j Wed Aug 30 19:53:37 1995 --- g77-0.5.23/f/convert.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* convert.j -- Wrapper for GCC's convert.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* convert.j -- Wrapper for GCC's convert.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/data.c g77-0.5.23/f/data.c *** g77-0.5.22/f/data.c Sat Mar 1 04:22:32 1997 --- g77-0.5.23/f/data.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* data.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* data.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/data.h g77-0.5.23/f/data.h *** g77-0.5.22/f/data.h Wed Aug 30 19:53:37 1995 --- g77-0.5.23/f/data.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* data.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* data.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/equiv.c g77-0.5.23/f/equiv.c *** g77-0.5.22/f/equiv.c Fri Jul 11 00:07:51 1997 --- g77-0.5.23/f/equiv.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* equiv.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* equiv.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/equiv.h g77-0.5.23/f/equiv.h *** g77-0.5.22/f/equiv.h Wed Feb 5 05:54:20 1997 --- g77-0.5.23/f/equiv.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* equiv.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* equiv.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/expr.c g77-0.5.23/f/expr.c *** g77-0.5.22/f/expr.c Sun Mar 8 21:37:20 1998 --- g77-0.5.23/f/expr.c Fri May 15 17:27:19 1998 *************** *** 1,5 **** /* expr.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* expr.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 46,49 **** --- 46,50 ---- #include "st.h" #include "symbol.h" + #include "str.h" #include "target.h" #include "where.h" *************** the Free Software Foundation, 59 Temple *** 56,79 **** typedef enum { - FFEEXPR_dotdotNONE_, - FFEEXPR_dotdotTRUE_, - FFEEXPR_dotdotFALSE_, - FFEEXPR_dotdotNOT_, - FFEEXPR_dotdotAND_, - FFEEXPR_dotdotOR_, - FFEEXPR_dotdotXOR_, - FFEEXPR_dotdotEQV_, - FFEEXPR_dotdotNEQV_, - FFEEXPR_dotdotLT_, - FFEEXPR_dotdotLE_, - FFEEXPR_dotdotEQ_, - FFEEXPR_dotdotNE_, - FFEEXPR_dotdotGT_, - FFEEXPR_dotdotGE_, - FFEEXPR_dotdot - } ffeexprDotdot_; - - typedef enum - { FFEEXPR_exprtypeUNKNOWN_, FFEEXPR_exprtypeOPERAND_, --- 57,60 ---- *************** struct _ffeexpr_find_ *** 243,247 **** static ffeexprStack_ ffeexpr_stack_; /* Expression stack for semantic. */ static ffelexToken ffeexpr_tokens_[10]; /* Scratchpad tokens for syntactic. */ ! static ffeexprDotdot_ ffeexpr_current_dotdot_; /* Current .FOO. keyword. */ static long ffeexpr_hollerith_count_; /* ffeexpr_token_number_ and caller. */ static int ffeexpr_level_; /* Level of DATA implied-DO construct. */ --- 224,228 ---- static ffeexprStack_ ffeexpr_stack_; /* Expression stack for semantic. */ static ffelexToken ffeexpr_tokens_[10]; /* Scratchpad tokens for syntactic. */ ! static ffestrOther ffeexpr_current_dotdot_; /* Current .FOO. keyword. */ static long ffeexpr_hollerith_count_; /* ffeexpr_token_number_ and caller. */ static int ffeexpr_level_; /* Level of DATA implied-DO construct. */ *************** static void ffeexpr_update_impdo_ (ffebl *** 287,291 **** static void ffeexpr_update_impdo_sym_ (ffebld expr, ffesymbol dovar); static ffeexprContext ffeexpr_context_outer_ (ffeexprStack_ s); - static ffeexprDotdot_ ffeexpr_dotdot_ (ffelexToken t); static ffeexprExpr_ ffeexpr_expr_new_ (void); static void ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t); --- 268,271 ---- *************** ffeexpr_context_outer_ (ffeexprStack_ s) *** 8531,8652 **** } - /* ffeexpr_dotdot_ -- Look up name in list of .FOO. possibilities - - ffeexprDotdot_ d; - ffelexToken t; - d = ffeexpr_dotdot_(t); - - Returns the identifier for the name, or the NONE identifier. */ - - static ffeexprDotdot_ - ffeexpr_dotdot_ (ffelexToken t) - { - char *p; - - switch (ffelex_token_length (t)) - { - case 2: - switch (*(p = ffelex_token_text (t))) - { - case FFESRC_CASE_MATCH_INIT ('E', 'e', match_2e, no_match_2): - if (ffesrc_char_match_noninit (*++p, 'Q', 'q')) - return FFEEXPR_dotdotEQ_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('G', 'g', match_2g, no_match_2): - if (ffesrc_char_match_noninit (*++p, 'E', 'e')) - return FFEEXPR_dotdotGE_; - if (ffesrc_char_match_noninit (*p, 'T', 't')) - return FFEEXPR_dotdotGT_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('L', 'l', match_2l, no_match_2): - if (ffesrc_char_match_noninit (*++p, 'E', 'e')) - return FFEEXPR_dotdotLE_; - if (ffesrc_char_match_noninit (*p, 'T', 't')) - return FFEEXPR_dotdotLT_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('N', 'n', match_2n, no_match_2): - if (ffesrc_char_match_noninit (*++p, 'E', 'e')) - return FFEEXPR_dotdotNE_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('O', 'o', match_2o, no_match_2): - if (ffesrc_char_match_noninit (*++p, 'R', 'r')) - return FFEEXPR_dotdotOR_; - return FFEEXPR_dotdotNONE_; - - default: - no_match_2: /* :::::::::::::::::::: */ - return FFEEXPR_dotdotNONE_; - } - - case 3: - switch (*(p = ffelex_token_text (t))) - { - case FFESRC_CASE_MATCH_INIT ('A', 'a', match_3a, no_match_3): - if ((ffesrc_char_match_noninit (*++p, 'N', 'n')) - && (ffesrc_char_match_noninit (*++p, 'D', 'd'))) - return FFEEXPR_dotdotAND_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('E', 'e', match_3e, no_match_3): - if ((ffesrc_char_match_noninit (*++p, 'Q', 'q')) - && (ffesrc_char_match_noninit (*++p, 'V', 'v'))) - return FFEEXPR_dotdotEQV_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('N', 'n', match_3n, no_match_3): - if ((ffesrc_char_match_noninit (*++p, 'O', 'o')) - && (ffesrc_char_match_noninit (*++p, 'T', 't'))) - return FFEEXPR_dotdotNOT_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('X', 'x', match_3x, no_match_3): - if ((ffesrc_char_match_noninit (*++p, 'O', 'o')) - && (ffesrc_char_match_noninit (*++p, 'R', 'r'))) - return FFEEXPR_dotdotXOR_; - return FFEEXPR_dotdotNONE_; - - default: - no_match_3: /* :::::::::::::::::::: */ - return FFEEXPR_dotdotNONE_; - } - - case 4: - switch (*(p = ffelex_token_text (t))) - { - case FFESRC_CASE_MATCH_INIT ('N', 'n', match_4n, no_match_4): - if ((ffesrc_char_match_noninit (*++p, 'E', 'e')) - && (ffesrc_char_match_noninit (*++p, 'Q', 'q')) - && (ffesrc_char_match_noninit (*++p, 'V', 'v'))) - return FFEEXPR_dotdotNEQV_; - return FFEEXPR_dotdotNONE_; - - case FFESRC_CASE_MATCH_INIT ('T', 't', match_4t, no_match_4): - if ((ffesrc_char_match_noninit (*++p, 'R', 'r')) - && (ffesrc_char_match_noninit (*++p, 'U', 'u')) - && (ffesrc_char_match_noninit (*++p, 'E', 'e'))) - return FFEEXPR_dotdotTRUE_; - return FFEEXPR_dotdotNONE_; - - default: - no_match_4: /* :::::::::::::::::::: */ - return FFEEXPR_dotdotNONE_; - } - - case 5: - if (ffesrc_strcmp_2c (ffe_case_match (), ffelex_token_text (t), "FALSE", - "false", "False") - == 0) - return FFEEXPR_dotdotFALSE_; - return FFEEXPR_dotdotNONE_; - - default: - return FFEEXPR_dotdotNONE_; - } - } - /* ffeexpr_percent_ -- Look up name in list of %FOO possibilities --- 8511,8514 ---- *************** ffeexpr_type_combine (ffeinfoBasictype * *** 8762,8769 **** { /* The normal stuff. */ if (nbt == lbt) ! if (nbt == rbt) ! nkt = ffeinfo_kindtype_max (nbt, lkt, rkt); ! else ! nkt = lkt; else if (nbt == rbt) nkt = rkt; --- 8624,8633 ---- { /* The normal stuff. */ if (nbt == lbt) ! { ! if (nbt == rbt) ! nkt = ffeinfo_kindtype_max (nbt, lkt, rkt); ! else ! nkt = lkt; ! } else if (nbt == rbt) nkt = rkt; *************** ffeexpr_reduce_ () *** 10023,10035 **** && (left_operand->previous->u.operator.op == FFEEXPR_operatorSUBTRACT_)) ! if (left_operand->previous->type == FFEEXPR_exprtypeUNARY_) ! ffetarget_integer_bad_magical_precedence (left_operand->token, ! left_operand->previous->token, ! operator->token); ! else ! ffetarget_integer_bad_magical_precedence_binary ! (left_operand->token, ! left_operand->previous->token, ! operator->token); else ffetarget_integer_bad_magical (left_operand->token); --- 9887,9901 ---- && (left_operand->previous->u.operator.op == FFEEXPR_operatorSUBTRACT_)) ! { ! if (left_operand->previous->type == FFEEXPR_exprtypeUNARY_) ! ffetarget_integer_bad_magical_precedence (left_operand->token, ! left_operand->previous->token, ! operator->token); ! else ! ffetarget_integer_bad_magical_precedence_binary ! (left_operand->token, ! left_operand->previous->token, ! operator->token); ! } else ffetarget_integer_bad_magical (left_operand->token); *************** ffeexpr_reduce_ () *** 10038,10046 **** && (ffebld_conter_orig (expr) == NULL) && ffebld_constant_is_magical (constnode = ffebld_conter (expr))) ! if (submag) ! ffetarget_integer_bad_magical_binary (operand->token, ! operator->token); ! else ! ffetarget_integer_bad_magical (operand->token); ffeexpr_stack_->exprstack = left_operand->previous; /* Pops binary-op operands off stack. */ --- 9904,9914 ---- && (ffebld_conter_orig (expr) == NULL) && ffebld_constant_is_magical (constnode = ffebld_conter (expr))) ! { ! if (submag) ! ffetarget_integer_bad_magical_binary (operand->token, ! operator->token); ! else ! ffetarget_integer_bad_magical (operand->token); ! } ffeexpr_stack_->exprstack = left_operand->previous; /* Pops binary-op operands off stack. */ *************** ffeexpr_nil_period_ (ffelexToken t) *** 11669,11681 **** case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t); switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotNONE_: return (ffelexHandler) ffeexpr_nil_rhs_ (t); ! case FFEEXPR_dotdotTRUE_: ! case FFEEXPR_dotdotFALSE_: ! case FFEEXPR_dotdotNOT_: return (ffelexHandler) ffeexpr_nil_end_period_; --- 11537,11549 ---- case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffestr_other (t); switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherNone: return (ffelexHandler) ffeexpr_nil_rhs_ (t); ! case FFESTR_otherTRUE: ! case FFESTR_otherFALSE: ! case FFESTR_otherNOT: return (ffelexHandler) ffeexpr_nil_end_period_; *************** ffeexpr_nil_end_period_ (ffelexToken t) *** 11698,11708 **** switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotNOT_: if (ffelex_token_type (t) != FFELEX_typePERIOD) return (ffelexHandler) ffeexpr_nil_rhs_ (t); return (ffelexHandler) ffeexpr_nil_rhs_; ! case FFEEXPR_dotdotTRUE_: ! case FFEEXPR_dotdotFALSE_: if (ffelex_token_type (t) != FFELEX_typePERIOD) return (ffelexHandler) ffeexpr_nil_binary_ (t); --- 11566,11576 ---- switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherNOT: if (ffelex_token_type (t) != FFELEX_typePERIOD) return (ffelexHandler) ffeexpr_nil_rhs_ (t); return (ffelexHandler) ffeexpr_nil_rhs_; ! case FFESTR_otherTRUE: ! case FFESTR_otherFALSE: if (ffelex_token_type (t) != FFELEX_typePERIOD) return (ffelexHandler) ffeexpr_nil_binary_ (t); *************** ffeexpr_nil_binary_period_ (ffelexToken *** 11974,11983 **** case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t); switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotTRUE_: ! case FFEEXPR_dotdotFALSE_: ! case FFEEXPR_dotdotNOT_: return (ffelexHandler) ffeexpr_nil_binary_sw_per_; --- 11842,11851 ---- case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffestr_other (t); switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherTRUE: ! case FFESTR_otherFALSE: ! case FFESTR_otherNOT: return (ffelexHandler) ffeexpr_nil_binary_sw_per_; *************** ffeexpr_token_period_ (ffelexToken t) *** 13554,13561 **** case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t); switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotNONE_: if (ffest_ffebad_start (FFEBAD_IGNORING_PERIOD)) { --- 13422,13429 ---- case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffestr_other (t); switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherNone: if (ffest_ffebad_start (FFEBAD_IGNORING_PERIOD)) { *************** ffeexpr_token_period_ (ffelexToken t) *** 13567,13573 **** return (ffelexHandler) ffeexpr_token_rhs_ (t); ! case FFEEXPR_dotdotTRUE_: ! case FFEEXPR_dotdotFALSE_: ! case FFEEXPR_dotdotNOT_: ffeexpr_tokens_[1] = ffelex_token_use (t); return (ffelexHandler) ffeexpr_token_end_period_; --- 13435,13441 ---- return (ffelexHandler) ffeexpr_token_rhs_ (t); ! case FFESTR_otherTRUE: ! case FFESTR_otherFALSE: ! case FFESTR_otherNOT: ffeexpr_tokens_[1] = ffelex_token_use (t); return (ffelexHandler) ffeexpr_token_end_period_; *************** ffeexpr_token_end_period_ (ffelexToken t *** 13636,13640 **** switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotNOT_: e->type = FFEEXPR_exprtypeUNARY_; e->u.operator.op = FFEEXPR_operatorNOT_; --- 13504,13508 ---- switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherNOT: e->type = FFEEXPR_exprtypeUNARY_; e->u.operator.op = FFEEXPR_operatorNOT_; *************** ffeexpr_token_end_period_ (ffelexToken t *** 13646,13650 **** return (ffelexHandler) ffeexpr_token_rhs_; ! case FFEEXPR_dotdotTRUE_: e->type = FFEEXPR_exprtypeOPERAND_; e->u.operand --- 13514,13518 ---- return (ffelexHandler) ffeexpr_token_rhs_; ! case FFESTR_otherTRUE: e->type = FFEEXPR_exprtypeOPERAND_; e->u.operand *************** ffeexpr_token_end_period_ (ffelexToken t *** 13658,13662 **** return (ffelexHandler) ffeexpr_token_binary_; ! case FFEEXPR_dotdotFALSE_: e->type = FFEEXPR_exprtypeOPERAND_; e->u.operand --- 13526,13530 ---- return (ffelexHandler) ffeexpr_token_binary_; ! case FFESTR_otherFALSE: e->type = FFEEXPR_exprtypeOPERAND_; e->u.operand *************** ffeexpr_token_number_ (ffelexToken t) *** 13926,13940 **** current token to the binary state. */ ! e = ffeexpr_expr_new_ (); ! e->type = FFEEXPR_exprtypeOPERAND_; ! e->token = ffeexpr_tokens_[0]; ! e->u.operand = ffebld_new_conter (ffebld_constant_new_integerdefault ! (ffeexpr_tokens_[0])); ! ffebld_set_info (e->u.operand, ! ffeinfo_new (FFEINFO_basictypeINTEGER, ! FFEINFO_kindtypeINTEGERDEFAULT, 0, ! FFEINFO_kindENTITY, FFEINFO_whereCONSTANT, ! FFETARGET_charactersizeNONE)); ! ffeexpr_exprstack_push_operand_ (e); return (ffelexHandler) ffeexpr_token_binary_ (t); } --- 13794,13799 ---- current token to the binary state. */ ! ffeexpr_make_float_const_ ('I', ffeexpr_tokens_[0], NULL, NULL, ! NULL, NULL, NULL); return (ffelexHandler) ffeexpr_token_binary_ (t); } *************** ffeexpr_token_binary_period_ (ffelexToke *** 14594,14603 **** case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t); switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotTRUE_: ! case FFEEXPR_dotdotFALSE_: ! case FFEEXPR_dotdotNOT_: if (ffest_ffebad_start (FFEBAD_MISSING_BINARY_OPERATOR)) { --- 14453,14462 ---- case FFELEX_typeNAME: case FFELEX_typeNAMES: ! ffeexpr_current_dotdot_ = ffestr_other (t); switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherTRUE: ! case FFESTR_otherFALSE: ! case FFESTR_otherNOT: if (ffest_ffebad_start (FFEBAD_MISSING_BINARY_OPERATOR)) { *************** ffeexpr_token_binary_period_ (ffelexToke *** 14613,14626 **** return (ffelexHandler) ffeexpr_token_binary_sw_per_; - case FFEEXPR_dotdotNONE_: - if (ffest_ffebad_start (FFEBAD_INVALID_DOTDOT)) - { - ffebad_string (ffelex_token_text (t)); - ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]), - ffelex_token_where_column (ffeexpr_tokens_[0])); - ffebad_finish (); - } - ffeexpr_current_dotdot_ = FFEEXPR_dotdotEQ_; - /* Fall through here, pretending we got a .EQ. operator. */ default: ffeexpr_tokens_[1] = ffelex_token_use (t); --- 14472,14475 ---- *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14656,14673 **** ffeexprExpr_ e; - if (ffelex_token_type (t) != FFELEX_typePERIOD) - { - if (ffest_ffebad_start (FFEBAD_INSERTING_PERIOD)) - { - ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]), - ffelex_token_where_column (ffeexpr_tokens_[0])); - ffebad_here (1, ffelex_token_where_line (t), ffelex_token_where_column (t)); - ffebad_string (ffelex_token_text (ffeexpr_tokens_[1])); - ffebad_finish (); - } - } - - ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */ - e = ffeexpr_expr_new_ (); e->type = FFEEXPR_exprtypeBINARY_; --- 14505,14508 ---- *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14676,14680 **** switch (ffeexpr_current_dotdot_) { ! case FFEEXPR_dotdotAND_: e->u.operator.op = FFEEXPR_operatorAND_; e->u.operator.prec = FFEEXPR_operatorprecedenceAND_; --- 14511,14515 ---- switch (ffeexpr_current_dotdot_) { ! case FFESTR_otherAND: e->u.operator.op = FFEEXPR_operatorAND_; e->u.operator.prec = FFEEXPR_operatorprecedenceAND_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14682,14686 **** break; ! case FFEEXPR_dotdotOR_: e->u.operator.op = FFEEXPR_operatorOR_; e->u.operator.prec = FFEEXPR_operatorprecedenceOR_; --- 14517,14521 ---- break; ! case FFESTR_otherOR: e->u.operator.op = FFEEXPR_operatorOR_; e->u.operator.prec = FFEEXPR_operatorprecedenceOR_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14688,14692 **** break; ! case FFEEXPR_dotdotXOR_: e->u.operator.op = FFEEXPR_operatorXOR_; e->u.operator.prec = FFEEXPR_operatorprecedenceXOR_; --- 14523,14527 ---- break; ! case FFESTR_otherXOR: e->u.operator.op = FFEEXPR_operatorXOR_; e->u.operator.prec = FFEEXPR_operatorprecedenceXOR_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14694,14698 **** break; ! case FFEEXPR_dotdotEQV_: e->u.operator.op = FFEEXPR_operatorEQV_; e->u.operator.prec = FFEEXPR_operatorprecedenceEQV_; --- 14529,14533 ---- break; ! case FFESTR_otherEQV: e->u.operator.op = FFEEXPR_operatorEQV_; e->u.operator.prec = FFEEXPR_operatorprecedenceEQV_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14700,14704 **** break; ! case FFEEXPR_dotdotNEQV_: e->u.operator.op = FFEEXPR_operatorNEQV_; e->u.operator.prec = FFEEXPR_operatorprecedenceNEQV_; --- 14535,14539 ---- break; ! case FFESTR_otherNEQV: e->u.operator.op = FFEEXPR_operatorNEQV_; e->u.operator.prec = FFEEXPR_operatorprecedenceNEQV_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14706,14710 **** break; ! case FFEEXPR_dotdotLT_: e->u.operator.op = FFEEXPR_operatorLT_; e->u.operator.prec = FFEEXPR_operatorprecedenceLT_; --- 14541,14545 ---- break; ! case FFESTR_otherLT: e->u.operator.op = FFEEXPR_operatorLT_; e->u.operator.prec = FFEEXPR_operatorprecedenceLT_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14712,14716 **** break; ! case FFEEXPR_dotdotLE_: e->u.operator.op = FFEEXPR_operatorLE_; e->u.operator.prec = FFEEXPR_operatorprecedenceLE_; --- 14547,14551 ---- break; ! case FFESTR_otherLE: e->u.operator.op = FFEEXPR_operatorLE_; e->u.operator.prec = FFEEXPR_operatorprecedenceLE_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14718,14722 **** break; ! case FFEEXPR_dotdotEQ_: e->u.operator.op = FFEEXPR_operatorEQ_; e->u.operator.prec = FFEEXPR_operatorprecedenceEQ_; --- 14553,14557 ---- break; ! case FFESTR_otherEQ: e->u.operator.op = FFEEXPR_operatorEQ_; e->u.operator.prec = FFEEXPR_operatorprecedenceEQ_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14724,14728 **** break; ! case FFEEXPR_dotdotNE_: e->u.operator.op = FFEEXPR_operatorNE_; e->u.operator.prec = FFEEXPR_operatorprecedenceNE_; --- 14559,14563 ---- break; ! case FFESTR_otherNE: e->u.operator.op = FFEEXPR_operatorNE_; e->u.operator.prec = FFEEXPR_operatorprecedenceNE_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14730,14734 **** break; ! case FFEEXPR_dotdotGT_: e->u.operator.op = FFEEXPR_operatorGT_; e->u.operator.prec = FFEEXPR_operatorprecedenceGT_; --- 14565,14569 ---- break; ! case FFESTR_otherGT: e->u.operator.op = FFEEXPR_operatorGT_; e->u.operator.prec = FFEEXPR_operatorprecedenceGT_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14736,14740 **** break; ! case FFEEXPR_dotdotGE_: e->u.operator.op = FFEEXPR_operatorGE_; e->u.operator.prec = FFEEXPR_operatorprecedenceGE_; --- 14571,14575 ---- break; ! case FFESTR_otherGE: e->u.operator.op = FFEEXPR_operatorGE_; e->u.operator.prec = FFEEXPR_operatorprecedenceGE_; *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14743,14747 **** default: ! assert ("Bad unary dotdot in ffeexpr_current_dotdot_" == NULL); } --- 14578,14592 ---- default: ! if (ffest_ffebad_start (FFEBAD_INVALID_DOTDOT)) ! { ! ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]), ! ffelex_token_where_column (ffeexpr_tokens_[0])); ! ffebad_string (ffelex_token_text (ffeexpr_tokens_[1])); ! ffebad_finish (); ! } ! e->u.operator.op = FFEEXPR_operatorEQ_; ! e->u.operator.prec = FFEEXPR_operatorprecedenceEQ_; ! e->u.operator.as = FFEEXPR_operatorassociativityEQ_; ! break; } *************** ffeexpr_token_binary_end_per_ (ffelexTok *** 14749,14753 **** if (ffelex_token_type (t) != FFELEX_typePERIOD) ! return (ffelexHandler) ffeexpr_token_rhs_ (t); return (ffelexHandler) ffeexpr_token_rhs_; } --- 14594,14611 ---- if (ffelex_token_type (t) != FFELEX_typePERIOD) ! { ! if (ffest_ffebad_start (FFEBAD_INSERTING_PERIOD)) ! { ! ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]), ! ffelex_token_where_column (ffeexpr_tokens_[0])); ! ffebad_here (1, ffelex_token_where_line (t), ffelex_token_where_column (t)); ! ffebad_string (ffelex_token_text (ffeexpr_tokens_[1])); ! ffebad_finish (); ! } ! ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */ ! return (ffelexHandler) ffeexpr_token_rhs_ (t); ! } ! ! ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */ return (ffelexHandler) ffeexpr_token_rhs_; } *************** ffeexpr_make_float_const_ (char exp_lett *** 15848,15851 **** --- 15706,15719 ---- #endif + case 'I': /* Make an integer. */ + e->u.operand = ffebld_new_conter (ffebld_constant_new_integerdefault + (ffeexpr_tokens_[0])); + ffebld_set_info (e->u.operand, + ffeinfo_new (FFEINFO_basictypeINTEGER, + FFEINFO_kindtypeINTEGERDEFAULT, 0, + FFEINFO_kindENTITY, FFEINFO_whereCONSTANT, + FFETARGET_charactersizeNONE)); + break; + default: no_match: /* :::::::::::::::::::: */ *************** ffeexpr_sym_impdoitem_ (ffesymbol sp, ff *** 16462,16478 **** if (!ffeimplic_establish_symbol (sp)) ffesymbol_error (sp, t); ! ffesymbol_set_info (sp, ! ffeinfo_new (ffesymbol_basictype (sp), ! ffesymbol_kindtype (sp), ! ffesymbol_rank (sp), ! kind, ! where, ! ffesymbol_size (sp))); ! ffesymbol_set_attrs (sp, na); ! ffesymbol_set_state (sp, ns); ! ffesymbol_resolve_intrin (sp); ! if (!ffesymbol_state_is_specable (ns)) ! sp = ffecom_sym_learned (sp); ! ffesymbol_signal_unreported (sp); /* For debugging purposes. */ } } --- 16330,16349 ---- if (!ffeimplic_establish_symbol (sp)) ffesymbol_error (sp, t); ! else ! { ! ffesymbol_set_info (sp, ! ffeinfo_new (ffesymbol_basictype (sp), ! ffesymbol_kindtype (sp), ! ffesymbol_rank (sp), ! kind, ! where, ! ffesymbol_size (sp))); ! ffesymbol_set_attrs (sp, na); ! ffesymbol_set_state (sp, ns); ! ffesymbol_resolve_intrin (sp); ! if (!ffesymbol_state_is_specable (ns)) ! sp = ffecom_sym_learned (sp); ! ffesymbol_signal_unreported (sp); /* For debugging purposes. */ ! } } } *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 17902,17912 **** case FFEINFO_kindENTITY: if (ffesymbol_rank (s) == 0) ! if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER) ! *paren_type = FFEEXPR_parentypeSUBSTRING_; ! else ! { ! bad = TRUE; ! *paren_type = FFEEXPR_parentypeANY_; ! } else *paren_type = FFEEXPR_parentypeARRAY_; --- 17773,17785 ---- case FFEINFO_kindENTITY: if (ffesymbol_rank (s) == 0) ! { ! if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER) ! *paren_type = FFEEXPR_parentypeSUBSTRING_; ! else ! { ! bad = TRUE; ! *paren_type = FFEEXPR_parentypeANY_; ! } ! } else *paren_type = FFEEXPR_parentypeARRAY_; *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 18029,18041 **** case FFEINFO_kindENTITY: if (ffesymbol_rank (s) == 0) ! if (ffeexpr_stack_->context == FFEEXPR_contextEQUIVALENCE) ! *paren_type = FFEEXPR_parentypeEQUIVALENCE_; ! else if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER) ! *paren_type = FFEEXPR_parentypeSUBSTRING_; ! else ! { ! bad = TRUE; ! *paren_type = FFEEXPR_parentypeANY_; ! } else *paren_type = FFEEXPR_parentypeARRAY_; --- 17902,17916 ---- case FFEINFO_kindENTITY: if (ffesymbol_rank (s) == 0) ! { ! if (ffeexpr_stack_->context == FFEEXPR_contextEQUIVALENCE) ! *paren_type = FFEEXPR_parentypeEQUIVALENCE_; ! else if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER) ! *paren_type = FFEEXPR_parentypeSUBSTRING_; ! else ! { ! bad = TRUE; ! *paren_type = FFEEXPR_parentypeANY_; ! } ! } else *paren_type = FFEEXPR_parentypeARRAY_; diff -rcp2N g77-0.5.22/f/expr.h g77-0.5.23/f/expr.h *** g77-0.5.22/f/expr.h Wed Feb 5 05:54:35 1997 --- g77-0.5.23/f/expr.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* expr.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* expr.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/fini.c g77-0.5.23/f/fini.c *** g77-0.5.22/f/fini.c Fri Sep 19 05:12:12 1997 --- g77-0.5.23/f/fini.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* fini.c Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* fini.c Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/flags.j g77-0.5.23/f/flags.j *** g77-0.5.22/f/flags.j Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/flags.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* flags.j -- Wrapper for GCC's flags.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* flags.j -- Wrapper for GCC's flags.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/g77.1 g77-0.5.23/f/g77.1 *** g77-0.5.22/f/g77.1 Sun Mar 8 21:33:05 1998 --- g77-0.5.23/f/g77.1 Fri Apr 17 21:41:06 1998 *************** *** 2,6 **** .\" See section COPYING for conditions for redistribution .\" FIXME: no info here on predefines. Should there be? extra for F77... ! .TH G77 1 "1998-03-08" "GNU Tools" "GNU Tools" .de BP .sp --- 2,6 ---- .\" See section COPYING for conditions for redistribution .\" FIXME: no info here on predefines. Should there be? extra for F77... ! .TH G77 1 "1998-04-17" "GNU Tools" "GNU Tools" .de BP .sp *************** *** 9,13 **** .. .SH NAME ! g77 \- GNU project Fortran Compiler (v0.5.22) .SH SYNOPSIS .RB g77 " [" \c --- 9,13 ---- .. .SH NAME ! g77 \- GNU project Fortran Compiler (v0.5.23) .SH SYNOPSIS .RB g77 " [" \c *************** g77 \- GNU project Fortran Compiler (v0. *** 15,19 **** .SH WARNING The information in this man page is an extract from the full ! documentation of the GNU Fortran compiler (version 0.5.22), and is limited to the meaning of some of the options. .PP --- 15,19 ---- .SH WARNING The information in this man page is an extract from the full ! documentation of the GNU Fortran compiler (version 0.5.23), and is limited to the meaning of some of the options. .PP *************** software, please check the Info file, wh *** 23,28 **** documentation. .\" .PP ! .\" The version of GNU Fortran documented by the Info file is 0.5.22, ! .\" which includes substantial improvements and changes since 0.5.22, .\" the version documented in this man page. .PP --- 23,28 ---- documentation. .\" .PP ! .\" The version of GNU Fortran documented by the Info file is 0.5.23, ! .\" which includes substantial improvements and changes since 0.5.23, .\" the version documented in this man page. .PP *************** For complete and current documentation, *** 38,42 **** \&\|' or the manual .I ! Using and Porting GNU Fortran (for version 0.5.22)\c \&. Both are made from the Texinfo source file .BR g77.texi . --- 38,42 ---- \&\|' or the manual .I ! Using and Porting GNU Fortran (for version 0.5.23)\c \&. Both are made from the Texinfo source file .BR g77.texi . *************** Define macro \c *** 153,169 **** \&. .TP - .BI \-\-driver= command - Specifies that - .IR command , - rather than - .RB ` gcc ', - is to be invoked by - .RB ` g77 ' - to do its job. Example: Within the gcc build directory after building - GNU Fortran (but without having to install it), - .nf - ./g77 \-\-driver=./xgcc -B./ foo.f - .fi - .TP .B \-E Stop after the preprocessing stage; do not run the compiler proper. The --- 153,156 ---- *************** stages of compilation. Also print the v *** 248,261 **** driver program and of the preprocessor and the compiler proper. The version numbers of g77 itself and the GCC distribution on which it is ! based are distinct. Use ! .RB ` \-\-driver=true ' ! to disable actual invocation of ! .RB ` gcc ' ! (since ! .RB ` true ' ! is the name of a UNIX command that simply returns success status). ! The command ! .RB ` "g77 -v" ' ! is the appropriate one to determine the g77 and GCC version numbers. .TP .B \-Wall --- 235,239 ---- driver program and of the preprocessor and the compiler proper. The version numbers of g77 itself and the GCC distribution on which it is ! based are distinct. .TP .B \-Wall *************** entries in *** 334,338 **** .br .I ! Using and Porting GNU Fortran (for version 0.5.22)\c , James Craig Burley; .I --- 312,316 ---- .br .I ! Using and Porting GNU Fortran (for version 0.5.23)\c , James Craig Burley; .I *************** For instructions on how to report bugs, *** 358,362 **** .SH COPYING ! Copyright (c) 1991-1997 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of --- 336,340 ---- .SH COPYING ! Copyright (c) 1991-1998 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of diff -rcp2N g77-0.5.22/f/g77.c g77-0.5.23/f/g77.c *** g77-0.5.22/f/g77.c Fri Jul 11 00:07:55 1997 --- g77-0.5.23/f/g77.c Thu Jan 1 00:00:00 1970 *************** *** 1,1557 **** - /* G77 preliminary semantic processing for the compiler driver. - Copyright (C) 1993-1997 Free Software Foundation, Inc. - Contributed by Brendan Kehoe (brendan@cygnus.com), with significant - modifications for GNU Fortran by James Craig Burley (burley@gnu.ai.mit.edu). - - This file is part of GNU Fortran. - - GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - - /* This program is a wrapper to the main `gcc' driver. The generic - goal of this program is to be basically identical to gcc (in that - it faithfully passes all of the original arguments to gcc) but, - unless explicitly overridden by the user in certain ways, ensure - that the needs of the language supported by this wrapper are met. - - For GNU Fortran (g77), we do the following to the argument list - before passing it to `gcc': - - 1. Put `-xf77', `-xf77-cpp-input' or `-xratfor' before each list - of foo.f, foo.F or foo.r source files and put `-xnone' after - that list, if necessary. This shouldn't normally be necessary, - but it is done in case gcc.c normally treats .f/.F files as, - say, to be compiled by f2c. - - 2. Make sure `-lf2c -lm' is at the end of the list. - - 3. Make sure each time `-lf2c' or `-lm' is seen, it forms - part of the series `-lf2c -lm'. - - #1 is not done if `-xfoo' is in effect (where foo is not "none"). - #2 and #3 are not done if `-nostdlib' or any option that disables - the linking phase is present, or if `-xfoo' is in effect. Note that - -v by itself disables linking. - - This program was originally made out of gcc/cp/g++.c, but the - way it builds the new argument list was rewritten so it is much - easier to maintain, improve the way it decides to add or not add - extra arguments, etc. And several improvements were made in the - handling of arguments, primarily to make it more consistent with - `gcc' itself. */ - - #ifndef LANGUAGE_F77 - #define LANGUAGE_F77 1 /* Assume f77 language wanted. */ - #endif - - #if LANGUAGE_F77 != 1 - #include - - int - main (argc, argv) - int argc; - char **argv; - { - fprintf (stderr, "\ - g77: `f77' language not included in list of languages\n\ - built with this installation of gcc.\n"); - exit (1); - } - - #else /* LANGUAGE_F77 == 1 */ - #include "config.j" - #include "zzz.h" - #include - #include - - #ifndef _WIN32 - #include /* May get R_OK, etc. on some systems. */ - #else - #include - #endif - - #ifdef __STDC__ - #include - #else - #include - #endif - #include - - /* Include multi-lib information. */ - #include "multilib.h" - - #ifndef R_OK - #define R_OK 4 - #define W_OK 2 - #define X_OK 1 - #endif - - #ifndef WIFSIGNALED - #define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f) - #endif - #ifndef WTERMSIG - #define WTERMSIG(S) ((S) & 0x7f) - #endif - #ifndef WIFEXITED - #define WIFEXITED(S) (((S) & 0xff) == 0) - #endif - #ifndef WEXITSTATUS - #define WEXITSTATUS(S) (((S) & 0xff00) >> 8) - #endif - - /* Defined to the name of the compiler; if using a cross compiler, the - Makefile should compile this file with the proper name - (e.g., "i386-aout-gcc"). */ - #ifndef GCC_NAME - #define GCC_NAME "gcc" - #endif - - /* On MSDOS, write temp files in current dir - because there's no place else we can expect to use. */ - #ifdef __MSDOS__ - #ifndef P_tmpdir - #define P_tmpdir "." - #endif - #ifndef R_OK - #define R_OK 4 - #define W_OK 2 - #define X_OK 1 - #endif - #endif - - /* Add prototype support. */ - #ifndef PROTO - #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) - #define PROTO(ARGS) ARGS - #else - #define PROTO(ARGS) () - #endif - #endif - - #ifndef VPROTO - #ifdef __STDC__ - #define PVPROTO(ARGS) ARGS - #define VPROTO(ARGS) ARGS - #define VA_START(va_list,var) va_start(va_list,var) - #else - #define PVPROTO(ARGS) () - #define VPROTO(ARGS) (va_alist) va_dcl - #define VA_START(va_list,var) va_start(va_list) - #endif - #endif - - /* Define a generic NULL if one hasn't already been defined. */ - - #ifndef NULL - #define NULL 0 - #endif - - /* Define O_RDONLY if the system hasn't defined it for us. */ - #ifndef O_RDONLY - #define O_RDONLY 0 - #endif - - #ifndef GENERIC_PTR - #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) - #define GENERIC_PTR void * - #else - #define GENERIC_PTR char * - #endif - #endif - - #ifndef NULL_PTR - #define NULL_PTR ((GENERIC_PTR)0) - #endif - - #ifdef USG - #define vfork fork - #endif /* USG */ - - /* On MSDOS, write temp files in current dir - because there's no place else we can expect to use. */ - #ifdef __MSDOS__ - #ifndef P_tmpdir - #define P_tmpdir "." - #endif - #endif - - /* By default there is no special suffix for executables. */ - #ifndef EXECUTABLE_SUFFIX - #define EXECUTABLE_SUFFIX "" - #endif - - /* By default, colon separates directories in a path. */ - #ifndef PATH_SEPARATOR - #define PATH_SEPARATOR ':' - #endif - - #ifndef DIR_SEPARATOR - #define DIR_SEPARATOR '/' - #endif - - static char dir_separator_str[] = {DIR_SEPARATOR, 0}; - - extern char *getenv (); - - #ifndef errno - extern int errno; - #endif - - extern int sys_nerr; - #ifndef HAVE_STRERROR - #if defined(bsd4_4) - extern const char *const sys_errlist[]; - #else - extern char *sys_errlist[]; - #endif - #else - extern char *strerror(); - #endif - - /* Name with which this program was invoked. */ - static char *programname; - - /* argc, argv from main(). */ - static int xargc; - static char **xargv; - - /* The new argument list will be contained in these, though if identical - to the original list, these will be == xargc, xargv. */ - static int newargc; - static char **newargv; - - /* Options this driver needs to recognize, not just know how to - skip over. */ - typedef enum - { - OPTION_b, /* Aka --prefix. */ - OPTION_B, /* Aka --target. */ - OPTION_c, /* Aka --compile. */ - OPTION_driver, /* Wrapper-specific option. */ - OPTION_E, /* Aka --preprocess. */ - OPTION_for_linker, /* Aka `-Xlinker' and `-Wl,'. */ - OPTION_help, /* --help. */ - OPTION_i, /* -imacros, -include, -include-*. */ - OPTION_l, - OPTION_L, /* Aka --library-directory. */ - OPTION_M, /* Aka --dependencies. */ - OPTION_MM, /* Aka --user-dependencies. */ - OPTION_nostdlib, /* Aka --no-standard-libraries, or - -nodefaultlibs. */ - OPTION_o, /* Aka --output. */ - OPTION_P, /* Aka --print-*-name. */ - OPTION_S, /* Aka --assemble. */ - OPTION_syntax_only, /* -fsyntax-only. */ - OPTION_v, /* Aka --verbose. */ - OPTION_version, /* --version. */ - OPTION_V, /* Aka --use-version. */ - OPTION_x, /* Aka --language. */ - OPTION_ /* Unrecognized or unimportant. */ - } Option; - - /* THE FOLLOWING COMES STRAIGHT FROM prerelease gcc-2.8.0/gcc.c: */ - - /* This defines which switch letters take arguments. */ - - #define DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ - || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ - || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ - || (CHAR) == 'L' || (CHAR) == 'A') - - #ifndef SWITCH_TAKES_ARG - #define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR) - #endif - - /* This defines which multi-letter switches take arguments. */ - - #define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \ - (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \ - || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \ - || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ - || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ - || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ - || !strcmp (STR, "isystem")) - - #ifndef WORD_SWITCH_TAKES_ARG - #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) - #endif - - /* This is the common prefix we use to make temp file names. - It is chosen once for each run of this program. - It is substituted into a spec by %g. - Thus, all temp file names contain this prefix. - In practice, all temp file names start with this prefix. - - This prefix comes from the envvar TMPDIR if it is defined; - otherwise, from the P_tmpdir macro if that is defined; - otherwise, in /usr/tmp or /tmp. */ - - static char *temp_filename; - static char *temp_filename_f; /* Same with ".f" appended. */ - - /* Length of the prefix. */ - - static int temp_filename_length; - - /* The number of errors that have occurred; the link phase will not be - run if this is non-zero. */ - static int error_count = 0; - - /* Number of commands that exited with a signal. */ - - static int signal_count = 0; - - /* END OF STUFF FROM gcc-2.7.0/gcc.c. */ - - char * - my_strerror(e) - int e; - { - - #ifdef HAVE_STRERROR - return strerror(e); - - #else - - static char buffer[30]; - if (!e) - return ""; - - if (e > 0 && e < sys_nerr) - return sys_errlist[e]; - - sprintf (buffer, "Unknown error %d", e); - return buffer; - #endif - } - - #ifdef HAVE_VPRINTF - /* Output an error message and exit */ - - static void - fatal VPROTO((char *format, ...)) - { - #ifndef __STDC__ - char *format; - #endif - va_list ap; - - VA_START (ap, format); - - #ifndef __STDC__ - format = va_arg (ap, char*); - #endif - - fprintf (stderr, "%s: ", programname); - vfprintf (stderr, format, ap); - va_end (ap); - fprintf (stderr, "\n"); - #if 0 - /* XXX Not needed for g77 driver. */ - delete_temp_files (); - #endif - exit (1); - } - - static void - error VPROTO((char *format, ...)) - { - #ifndef __STDC__ - char *format; - #endif - va_list ap; - - VA_START (ap, format); - - #ifndef __STDC__ - format = va_arg (ap, char*); - #endif - - fprintf (stderr, "%s: ", programname); - vfprintf (stderr, format, ap); - va_end (ap); - - fprintf (stderr, "\n"); - } - - #else /* not HAVE_VPRINTF */ - - static void - error (msg, arg1, arg2) - char *msg, *arg1, *arg2; - { - fprintf (stderr, "%s: ", programname); - fprintf (stderr, msg, arg1, arg2); - fprintf (stderr, "\n"); - } - - static void - fatal (msg, arg1, arg2) - char *msg, *arg1, *arg2; - { - error (msg, arg1, arg2); - #if 0 - /* XXX Not needed for g77 driver. */ - delete_temp_files (); - #endif - exit (1); - } - - #endif /* not HAVE_VPRINTF */ - - /* More 'friendly' abort that prints the line and file. - config.h can #define abort fancy_abort if you like that sort of thing. */ - - void - fancy_abort () - { - fatal ("Internal g77 abort."); - } - - char * - xmalloc (size) - unsigned size; - { - register char *value = (char *) malloc (size); - if (value == 0) - fatal ("virtual memory exhausted"); - return value; - } - - static char * - concat (s1, s2) - char *s1, *s2; - { - int len1 = strlen (s1); - int len2 = strlen (s2); - char *result = xmalloc (len1 + len2 + 1); - - strcpy (result, s1); - strcpy (result + len1, s2); - *(result + len1 + len2) = 0; - - return result; - } - - static char * - concat3 (s1, s2, s3) - char *s1, *s2, *s3; - { - return concat (concat (s1, s2), s3); - } - - static char * - concat4 (s1, s2, s3, s4) - char *s1, *s2, *s3, *s4; - { - return concat (concat (s1, s2), concat (s3, s4)); - } - - static char * - concat6 (s1, s2, s3, s4, s5, s6) - char *s1, *s2, *s3, *s4, *s5, *s6; - { - return concat3 (concat (s1, s2), concat (s3, s4), concat (s5, s6)); - } - - static void - pfatal_with_name (name) - char *name; - { - char *s; - - if (errno < sys_nerr) - s = concat ("%s: ", my_strerror (errno)); - else - s = "cannot open `%s'"; - fatal (s, name); - } - - static void - perror_exec (name) - char *name; - { - char *s; - - if (errno < sys_nerr) - s = concat ("installation problem, cannot exec `%s': ", - my_strerror (errno)); - else - s = "installation problem, cannot exec `%s'"; - error (s, name); - } - - /* Compute a string to use as the base of all temporary file names. - It is substituted for %g. */ - - static char * - choose_temp_base_try (try, base) - char *try; - char *base; - { - char *rv; - if (base) - rv = base; - else if (try == (char *)0) - rv = 0; - else if (access (try, R_OK | W_OK) != 0) - rv = 0; - else - rv = try; - return rv; - } - - static void - choose_temp_base () - { - char *base = 0; - int len; - - base = choose_temp_base_try (getenv ("TMPDIR"), base); - base = choose_temp_base_try (getenv ("TMP"), base); - base = choose_temp_base_try (getenv ("TEMP"), base); - - #ifdef P_tmpdir - base = choose_temp_base_try (P_tmpdir, base); - #endif - - base = choose_temp_base_try (concat4 (dir_separator_str, "usr", - dir_separator_str, "tmp"), - base); - base = choose_temp_base_try (concat (dir_separator_str, "tmp"), base); - - /* If all else fails, use the current directory! */ - if (base == (char *)0) - base = concat (".", dir_separator_str); - - len = strlen (base); - temp_filename = xmalloc (len + strlen (concat (dir_separator_str, - "gfXXXXXX")) + 1); - strcpy (temp_filename, base); - if (len > 0 && temp_filename[len-1] != '/' - && temp_filename[len-1] != DIR_SEPARATOR) - temp_filename[len++] = DIR_SEPARATOR; - strcpy (temp_filename + len, "gfXXXXXX"); - - mktemp (temp_filename); - temp_filename_length = strlen (temp_filename); - if (temp_filename_length == 0) - abort (); - - temp_filename_f = xmalloc (temp_filename_length + 2); - strcpy (temp_filename_f, temp_filename); - temp_filename_f[temp_filename_length] = '.'; - temp_filename_f[temp_filename_length + 1] = 'f'; - temp_filename_f[temp_filename_length + 2] = '\0'; - } - - /* This structure describes one mapping. */ - struct option_map - { - /* The long option's name. */ - char *name; - /* The equivalent short option. */ - char *equivalent; - /* Argument info. A string of flag chars; NULL equals no options. - a => argument required. - o => argument optional. - j => join argument to equivalent, making one word. - * => require other text after NAME as an argument. */ - char *arg_info; - }; - - /* This is the table of mappings. Mappings are tried sequentially - for each option encountered; the first one that matches, wins. */ - - struct option_map option_map[] = - { - {"--all-warnings", "-Wall", 0}, - {"--ansi", "-ansi", 0}, - {"--assemble", "-S", 0}, - {"--assert", "-A", "a"}, - {"--comments", "-C", 0}, - {"--compile", "-c", 0}, - {"--debug", "-g", "oj"}, - {"--define-macro", "-D", "a"}, - {"--dependencies", "-M", 0}, - {"--driver", "", 0}, /* Wrapper-specific. */ - {"--dump", "-d", "a"}, - {"--dumpbase", "-dumpbase", "a"}, - {"--entry", "-e", 0}, - {"--extra-warnings", "-W", 0}, - {"--for-assembler", "-Wa", "a"}, - {"--for-linker", "-Xlinker", "a"}, - {"--force-link", "-u", "a"}, - {"--imacros", "-imacros", "a"}, - {"--include", "-include", "a"}, - {"--include-barrier", "-I-", 0}, - {"--include-directory", "-I", "a"}, - {"--include-directory-after", "-idirafter", "a"}, - {"--include-prefix", "-iprefix", "a"}, - {"--include-with-prefix", "-iwithprefix", "a"}, - {"--include-with-prefix-before", "-iwithprefixbefore", "a"}, - {"--include-with-prefix-after", "-iwithprefix", "a"}, - {"--language", "-x", "a"}, - {"--library-directory", "-L", "a"}, - {"--machine", "-m", "aj"}, - {"--machine-", "-m", "*j"}, - {"--no-line-commands", "-P", 0}, - {"--no-precompiled-includes", "-noprecomp", 0}, - {"--no-standard-includes", "-nostdinc", 0}, - {"--no-standard-libraries", "-nostdlib", 0}, - {"--no-warnings", "-w", 0}, - {"--optimize", "-O", "oj"}, - {"--output", "-o", "a"}, - {"--pedantic", "-pedantic", 0}, - {"--pedantic-errors", "-pedantic-errors", 0}, - {"--pipe", "-pipe", 0}, - {"--prefix", "-B", "a"}, - {"--preprocess", "-E", 0}, - {"--print-file-name", "-print-file-name=", "aj"}, - {"--print-libgcc-file-name", "-print-libgcc-file-name", 0}, - {"--print-missing-file-dependencies", "-MG", 0}, - {"--print-multi-lib", "-print-multi-lib", 0}, - {"--print-multi-directory", "-print-multi-directory", 0}, - {"--print-prog-name", "-print-prog-name=", "aj"}, - {"--profile", "-p", 0}, - {"--profile-blocks", "-a", 0}, - {"--quiet", "-q", 0}, - {"--save-temps", "-save-temps", 0}, - {"--shared", "-shared", 0}, - {"--silent", "-q", 0}, - {"--static", "-static", 0}, - {"--symbolic", "-symbolic", 0}, - {"--target", "-b", "a"}, - {"--trace-includes", "-H", 0}, - {"--traditional", "-traditional", 0}, - {"--traditional-cpp", "-traditional-cpp", 0}, - {"--trigraphs", "-trigraphs", 0}, - {"--undefine-macro", "-U", "a"}, - {"--use-version", "-V", "a"}, - {"--user-dependencies", "-MM", 0}, - {"--verbose", "-v", 0}, - {"--version", "-dumpversion", 0}, - {"--warn-", "-W", "*j"}, - {"--write-dependencies", "-MD", 0}, - {"--write-user-dependencies", "-MMD", 0}, - {"--", "-f", "*j"} - }; - - /* Compares --options that take one arg. */ - - static int - opteq (xskip, xarg, opt, name) - int *xskip; - char **xarg; - char *opt; - char *name; - { - int optlen; - int namelen; - int complen; - int i; - int cmp = strcmp (opt, name); - int skip = 1; - char *arg = NULL; - - if (cmp == 0) - { - /* Easy, a straight match. */ - *xskip = skip; - *xarg = arg; - return cmp; - } - - optlen = strlen (opt); - - for (i = 0; i < sizeof (option_map) / sizeof (option_map[0]); ++i) - { - char *arginfo; - int j; - - arginfo = option_map[i].arg_info; - if (arginfo == NULL) - arginfo = ""; - - namelen = strlen (option_map[i].name); - complen = optlen > namelen ? namelen : optlen; - - if (strncmp (opt, option_map[i].name, complen) == 0) - { - if (optlen < namelen) - { - for (j = i + 1; - j < sizeof (option_map) / sizeof (option_map[0]); - ++j) - if ((strlen (option_map[j].name) >= optlen) - && (strncmp (opt, option_map[j].name, optlen) == 0)) - fatal ("Ambiguous abbreviation `%s'", opt); - } - - if (optlen > namelen) - { - if (opt[namelen] == '=') - { - skip = 0; - arg = opt + namelen + 1; - } - else if (index (arginfo, '*') != 0) - ; - else - continue; - } - else if (index (arginfo, '*') != 0) - fatal ("Incomplete `%s' option", option_map[i].name); - - if (strcmp (name, option_map[i].name) != 0) - return 1; /* Not what is being looked for. */ - - *xskip = skip; - *xarg = arg; - return 0; - } - } - - return 1; - } - - /* Assumes text[0] == '-'. Returns number of argv items that belong to - (and follow) this one, an option id for options important to the - caller, and a pointer to the first char of the arg, if embedded (else - returns NULL, meaning no arg or it's the next argv). */ - - static void - lookup_option (xopt, xskip, xarg, text) - Option *xopt; - int *xskip; - char **xarg; - char *text; - { - Option opt = OPTION_; - int skip; - char *arg = NULL; - - if ((skip = SWITCH_TAKES_ARG (text[1])) > (text[2] != '\0')) - skip -= (text[2] != '\0'); /* Usually one of "DUoeTuImLA". */ - - if (text[1] == 'B') - opt = OPTION_B, skip = (text[2] == '\0'), arg = text + 2; - else if (text[1] == 'b') - opt = OPTION_b, skip = (text[2] == '\0'), arg = text + 2; - else if ((text[1] == 'c') && (text[2] == '\0')) - opt = OPTION_c, skip = 0; - else if ((text[1] == 'E') && (text[2] == '\0')) - opt = OPTION_E, skip = 0; - else if (text[1] == 'i') - opt = OPTION_i, skip = 0; - else if (text[1] == 'l') - opt = OPTION_l; - else if (text[1] == 'L') - opt = OPTION_L, skip = (text[2] == '\0'), arg = text + 2; - else if (text[1] == 'o') - opt = OPTION_o; - else if ((text[1] == 'S') && (text[2] == '\0')) - opt = OPTION_S, skip = 0; - else if (text[1] == 'V') - opt = OPTION_V, skip = (text[2] == '\0'); - else if ((text[1] == 'v') && (text[2] == '\0')) - opt = OPTION_v, skip = 0; - else if ((text[1] == 'W') && (text[2] == 'l') && (text[3] == ',')) - opt = OPTION_for_linker, skip = 0; - else if (text[1] == 'x') - opt = OPTION_x, skip = (text[2] == '\0'), arg = text + 2; - else - { - if ((skip = WORD_SWITCH_TAKES_ARG (text + 1)) != 0) - /* Usually one of "Tdata", "Ttext", "Tbss", "include", - "imacros", "aux-info", "idirafter", "iprefix", - "iwithprefix", "iwithprefixbefore", "isystem". */ - ; - - if (strcmp (text, "--assemble") == 0) - opt = OPTION_S; - else if (strcmp (text, "--compile") == 0) - opt = OPTION_c; - else if (opteq (&skip, &arg, text, "--driver") == 0) - opt = OPTION_driver; - else if (strcmp (text, "--help") == 0) - opt = OPTION_help; - else if ((opteq (&skip, &arg, text, "--imacros") == 0) - || (opteq (&skip, &arg, text, "--include") == 0) - || (opteq (&skip, &arg, text, "--include-directory-after") == 0) - || (opteq (&skip, &arg, text, "--include-prefix") == 0) - || (opteq (&skip, &arg, text, "--include-with-prefix") == 0) - || (opteq (&skip, &arg, text, "--include-with-prefix-before") == 0) - || (opteq (&skip, &arg, text, "--include-with-prefix-after") == 0)) - opt = OPTION_i; - else if (opteq (&skip, &arg, text, "--language") == 0) - opt = OPTION_x; - else if (opteq (&skip, &arg, text, "--library-directory") == 0) - opt = OPTION_L; - else if ((strcmp (text, "-M") == 0) - || (strcmp (text, "--dependencies") == 0)) - opt = OPTION_M; - else if ((strcmp (text, "-MM") == 0) - || (strcmp (text, "--user-dependencies") == 0)) - opt = OPTION_MM; - else if (strcmp (text, "--output") == 0) - opt = OPTION_o; - else if (opteq (&skip, &arg, text, "--prefix") == 0) - opt = OPTION_B; - else if (strcmp (text, "--preprocess") == 0) - opt = OPTION_E; - else if ((opteq (&skip, &arg, text, "--print-file-name") == 0) - || (strcmp (text, "--print-libgcc-file-name") == 0) - || (strcmp (text, "--print-multi-lib") == 0) - || (strcmp (text, "--print-multi-directory") == 0) - || (opteq (&skip, &arg, text, "--print-prog-name") == 0)) - opt = OPTION_P; - else if ((strcmp (text, "-nostdlib") == 0) - || (strcmp (text, "--no-standard-libraries") == 0) - || (strcmp (text, "-nodefaultlibs") == 0)) - opt = OPTION_nostdlib; - else if (strcmp (text, "-fsyntax-only") == 0) - opt = OPTION_syntax_only; - else if (opteq (&skip, &arg, text, "--use-version") == 0) - opt = OPTION_V; - else if (strcmp (text, "--verbose") == 0) - opt = OPTION_v; - else if (strcmp (text, "--version") == 0) - opt = OPTION_version; - else if (strcmp (text, "-Xlinker") == 0) - skip = 1; - else if ((opteq (&skip, &arg, text, "--assert") == 0) - || (opteq (&skip, &arg, text, "--define-macro") == 0) - || (opteq (&skip, &arg, text, "--dump") == 0) - || (opteq (&skip, &arg, text, "--dumpbase") == 0) - || (opteq (&skip, &arg, text, "--for-assembler") == 0) - || (opteq (&skip, &arg, text, "--for-linker") == 0) - || (opteq (&skip, &arg, text, "--force-link") == 0) - || (opteq (&skip, &arg, text, "--machine") == 0) - || (opteq (&skip, &arg, text, "--target") == 0) - || (opteq (&skip, &arg, text, "--undefine-macro") == 0)) - ; - else - skip = 0; - } - - if (xopt != NULL) - *xopt = opt; - if (xskip != NULL) - *xskip = skip; - if (xarg != NULL) - { - if ((arg != NULL) - && (arg[0] == '\0')) - *xarg = NULL; - else - *xarg = arg; - } - } - - static void - append_arg (arg) - char *arg; - { - static int newargsize; - - #if 0 - fprintf (stderr, "`%s'\n", arg); - #endif - - if ((newargv == xargv) - && (arg == xargv[newargc])) - { - ++newargc; - return; /* Nothing new here. */ - } - - if (newargv == xargv) - { /* Make new arglist. */ - int i; - - newargsize = (xargc << 2) + 20; - newargv = (char **) malloc (newargsize * sizeof (char *)); - - /* Copy what has been done so far. */ - for (i = 0; i < newargc; ++i) - newargv[i] = xargv[i]; - } - - if (newargc == newargsize) - fatal ("overflowed output arg list for `%s'", arg); - newargv[newargc++] = arg; - } - - extern int execv (), execvp (); - - /* If a stage of compilation returns an exit status >= 1, - compilation of that file ceases. */ - - #define MIN_FATAL_STATUS 1 - - /* stdin file number. */ - #define STDIN_FILE_NO 0 - - /* stdout file number. */ - #define STDOUT_FILE_NO 1 - - /* value of `pipe': port index for reading. */ - #define READ_PORT 0 - - /* value of `pipe': port index for writing. */ - #define WRITE_PORT 1 - - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - - static int last_pipe_input; - - /* Fork one piped subcommand. FUNC 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.) */ - - #ifdef __MSDOS__ - - #include - static int - pexecute (search_flag, program, argv, not_last) - int search_flag; - char *program; - char *argv[]; - int not_last; - { - #ifdef __GO32__ - int i = (search_flag ? spawnv : spawnvp) (1, program, argv); - #else - char *scmd, *rf; - FILE *argfile; - int i, el = search_flag ? 0 : 4; - - scmd = (char *)malloc (strlen (program) + strlen (temp_filename) + 6 + el); - rf = scmd + strlen(program) + 2 + el; - sprintf (scmd, "%s%s @%s.gp", program, - (search_flag ? "" : ".exe"), temp_filename); - argfile = fopen (rf, "w"); - if (argfile == 0) - pfatal_with_name (rf); - - for (i=1; argv[i]; i++) - { - char *cp; - for (cp = argv[i]; *cp; cp++) - { - if (*cp == '"' || *cp == '\'' || *cp == '\\' || isspace (*cp)) - fputc ('\\', argfile); - fputc (*cp, argfile); - } - fputc ('\n', argfile); - } - fclose (argfile); - - i = system (scmd); - - remove (rf); - #endif - - if (i == -1) - { - perror_exec (program); - return MIN_FATAL_STATUS << 8; - } - return i << 8; - } - - #endif - - #if !defined(__MSDOS__) && !defined(OS2) && !defined(_WIN32) - - static int - pexecute (search_flag, program, argv, not_last) - int search_flag; - char *program; - char *argv[]; - int 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; - - /* 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: - #ifdef vfork - pfatal_with_name ("fork"); - #else - pfatal_with_name ("vfork"); - #endif - /* NOTREACHED */ - return 0; - - 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 */ - return 0; - - 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. */ - return pid; - } - } - - #endif /* not __MSDOS__ and not OS2 and not _WIN32 */ - - #if defined(OS2) - - static int - pexecute (search_flag, program, argv, not_last) - int search_flag; - char *program; - char *argv[]; - int not_last; - { - return (search_flag ? spawnv : spawnvp) (1, program, argv); - } - #endif /* OS2 */ - - #if defined(_WIN32) - - static int - pexecute (search_flag, program, argv, not_last) - int search_flag; - char *program; - char *argv[]; - int not_last; - { - return (search_flag ? __spawnv : __spawnvp) (1, program, argv); - } - #endif /* _WIN32 */ - - static int - doit (char *program, char **argv) - { - int pid; - int status; - int ret_code = 0; - - pid = pexecute (0, program, argv, 0); - - #ifdef __MSDOS__ - status = pid; - #else - #ifdef _WIN32 - pid = cwait (&status, pid, WAIT_CHILD); - #else - pid = wait (&status); - #endif - #endif - if (pid < 0) - abort (); - - if (status != 0) - { - if (WIFSIGNALED (status)) - { - fatal ("Internal compiler error: program %s got fatal signal %d", - program, WTERMSIG (status)); - signal_count++; - ret_code = -1; - } - else if (WIFEXITED (status) - && WEXITSTATUS (status) >= MIN_FATAL_STATUS) - ret_code = -1; - } - - return ret_code; - } - - int - main (argc, argv) - int argc; - char **argv; - { - register int i = 0; - register char *p; - int verbose = 0; - Option opt; - int skip; - char *arg; - int n_infiles = 0; - int n_outfiles = 0; - - /* This will be NULL if we encounter a situation where we should not - link in libf2c. */ - char *library = "-lf2c"; - - /* This will become 0 if anything other than -v and kin (like -V) - is seen, meaning the user is trying to accomplish something. - If it remains nonzero, and the user wants version info, add stuff to - the command line to make gcc invoke all the appropriate phases - to get all the version info. */ - int add_version_magic = 1; - - /* The name of the compiler we will want to run---by default, it - will be the definition of `GCC_NAME', e.g., `gcc'. */ - char *gcc = GCC_NAME; - - /* 0 => -xnone in effect on input/output - 1 => -xfoo in effect on input/output - 2 => -xnone in effect on input, -xf77 on output - 3 => -xnone in effect on input, -xf77-cpp-input on output. - 4 => -xnone in effect on input, -xratfor on output. */ - int saw_speclang = 0; - - /* 0 => initial/reset state - 1 => last arg was -l - 2 => last two args were -l -lm. */ - int saw_library = 0; - - /* Initialize for append_arg(). */ - xargc = argc; - newargv = xargv = argv; - newargc = 0; - - append_arg (argv[0]); - - p = argv[0] + strlen (argv[0]); - while (p != argv[0] && p[-1] != '/') - --p; - programname = p; - - if (argc == 1) - fatal ("No input files specified.\n"); - - #ifndef __MSDOS__ - /* We do a little magic to find out where the main gcc executable - is. If they ran us as /usr/local/bin/g77, then we will look - for /usr/local/bin/gcc; similarly, if they just ran us as `g77', - we'll just look for `gcc'. */ - if (p != argv[0]) - { - *--p = '\0'; - gcc = (char *) malloc ((strlen (argv[0]) + 1 + strlen (GCC_NAME) + 1) - * sizeof (char)); - sprintf (gcc, "%s/%s", argv[0], GCC_NAME); - } - #endif - - /* First pass through arglist. - - If -nostdlib or a "turn-off-linking" option is anywhere in the - command line, don't do any library-option processing (except - relating to -x). Also, if -v is specified, but no other options - that do anything special (allowing -V version, etc.), remember - to add special stuff to make gcc command actually invoke all - the different phases of the compilation process so all the version - numbers can be seen. - - Also, here is where all problems with missing arguments to options - are caught. If this loop is exited normally, it means all options - have the appropriate number of arguments as far as the rest of this - program is concerned. */ - - for (i = 1; i < argc; ++i) - { - if ((argv[i][0] == '+') && (argv[i][1] == 'e')) - { - add_version_magic = 0; - continue; - } - else if ((argv[i][0] != '-') || (argv[i][1] == 0)) - { - ++n_infiles; - add_version_magic = 0; - continue; - } - - lookup_option (&opt, &skip, NULL, argv[i]); - - switch (opt) - { - case OPTION_nostdlib: - case OPTION_c: - case OPTION_S: - case OPTION_syntax_only: - case OPTION_E: - case OPTION_M: - case OPTION_MM: - /* These options disable linking entirely or linking of the - standard libraries. */ - library = NULL; - add_version_magic = 0; - break; - - case OPTION_for_linker: - case OPTION_l: - ++n_infiles; - add_version_magic = 0; - break; - - case OPTION_o: - ++n_outfiles; - add_version_magic = 0; - break; - - case OPTION_v: - if (!verbose) - fprintf (stderr, "g77 version %s\n", ffezzz_version_string); - verbose = 1; - break; - - case OPTION_b: - case OPTION_B: - case OPTION_L: - case OPTION_driver: - case OPTION_i: - case OPTION_V: - /* These options are useful in conjunction with -v to get - appropriate version info. */ - break; - - case OPTION_version: - printf ("\ - GNU Fortran %s\n\ - Copyright (C) 1997 Free Software Foundation, Inc.\n\ - For more version information on components of the GNU Fortran\n\ - compilation system, especially useful when reporting bugs,\n\ - type the command `g77 --verbose'.\n\ - \n\ - GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\ - You may redistribute copies of GNU Fortran\n\ - under the terms of the GNU General Public License.\n\ - For more information about these matters, see the file named COPYING\n\ - or type the command `info -f g77 Copying'.\n\ - ", ffezzz_version_string); - exit (0); - break; - - case OPTION_help: - printf ("\ - Usage: g77 [OPTION]... FORTRAN-SOURCE...\n\ - \n\ - Compile and link Fortran source code to produce an executable program,\n\ - which by default is named `a.out', and can be invoked with the UNIX\n\ - command `./a.out'.\n\ - \n\ - Options:\n\ - --debug include debugging information in executable.\n\ - --driver=COMMAND specify preprocessor/compiler/linker driver\n\ - to use instead of the default `gcc'.\n\ - --help display this help and exit.\n\ - --optimize[=LEVEL] take extra time and memory to make generated\n\ - executable run faster. LEVEL is 0 for no\n\ - optimization, 1 for normal optimization, and\n\ - increases through 3 for more optimization.\n\ - --output=PROGRAM name the executable PROGRAM instead of a.out;\n\ - invoke with the command `./PROGRAM'.\n\ - --version display version information and exit.\n\ - \n\ - Many other options exist to tailor the compilation process, specify\n\ - the dialect of the Fortran source code, specify details of the\n\ - code-generation methodology, and so on.\n\ - \n\ - For more information on g77 and gcc, type the commands `info -f g77'\n\ - and `info -f gcc' to read the Info documentation on these commands.\n\ - \n\ - Report bugs to fortran@gnu.ai.mit.edu.\n"); - exit (0); - break; - - default: - add_version_magic = 0; - break; - } - - /* This is the one place we check for missing arguments in the - program. */ - - if (i + skip < argc) - i += skip; - else - fatal ("argument to `%s' missing\n", argv[i]); - } - - if ((n_outfiles != 0) && (n_infiles == 0)) - fatal ("No input files; unwilling to write output files"); - - /* Second pass through arglist, transforming arguments as appropriate. */ - - for (i = 1; i < argc; ++i) - { - if (argv[i][0] == '\0') - append_arg (argv[i]); /* Interesting. Just append as is. */ - - else if ((argv[i][0] == '-') && (argv[i][1] != 'l')) - { - /* Not a filename or library. */ - - if (saw_library == 1) /* -l. */ - append_arg ("-lm"); - saw_library = 0; - - lookup_option (&opt, &skip, &arg, argv[i]); - - if (argv[i][1] == '\0') - append_arg (argv[i]); /* "-" == Standard input. */ - - else if (opt == OPTION_x) - { - /* Track input language. */ - char *lang; - - if (arg == NULL) - lang = argv[i+1]; - else - lang = arg; - - saw_speclang = (strcmp (lang, "none") != 0); - } - else if (opt == OPTION_driver) - { - if (arg == NULL) - gcc = argv[i+1]; - else - gcc = arg; - i += skip; - continue; /* Don't append args to new list. */ - } - append_arg (argv[i]); - for (; skip != 0; --skip) - append_arg (argv[++i]); - } - else - { /* A filename/library, not an option. */ - int len; - int want_speclang; - - /* Here, always append the arg _after_ other stuff, possibly. */ - - if (saw_speclang == 1) - saw_library = 0; /* -xfoo currently active. */ - /* Put -xf77 and -xnone around list of filenames ending in - .F or .f, but don't include other filenames or libraries - in that list. */ - else if ((argv[i][0] != '-') /* Not a library. */ - && (len = strlen (argv[i])) > 2 - && ((argv[i][len - 1] == 'F') - || (argv[i][len - 1] == 'f') - || (argv[i][len - 1] == 'r')) - && argv[i][len - 2] == '.') - { /* filename.f or filename.F. or filename.r */ - if (saw_library == 1) /* -l. */ - append_arg ("-lm"); - saw_library = 0; - switch (argv[i][len - 1]) - { - case 'f': - want_speclang = 2; - break; - case 'F': - want_speclang = 3; - break; - case 'r': - want_speclang = 4; - break; - default: - break; - } - if (saw_speclang != want_speclang) - { - switch (want_speclang) - { - case 2: - append_arg ("-xf77"); - break; - case 3: - append_arg ("-xf77-cpp-input"); - break; - case 4: - append_arg ("-xratfor"); - break; - default: - break; - } - saw_speclang = want_speclang; - } - } - else - { /* -lfoo or "alien" filename. */ - if (saw_speclang) - append_arg ("-xnone"); - saw_speclang = 0; - - if (strcmp (argv[i], "-lm") == 0 - || strcmp (argv[i], "-lmath") == 0) - { - if (saw_library == 1) - saw_library = 2; /* -l -lm. */ - else if (library) - { - append_arg (library); - saw_library = 2; /* -l -lm. */ - } - } - else if ((library != NULL) - && (strcmp (argv[i], library) == 0)) - saw_library = 1; /* -l. */ - else - { /* "Alien" library or filename. */ - if (saw_library == 1) - append_arg ("-lm"); - saw_library = 0; - } - } - append_arg (argv[i]); - } - } - - /* Add -lf2c -lm as necessary. */ - - if (!add_version_magic && library) - { /* Doing a link and no -nostdlib. */ - if (saw_speclang) - append_arg ("-xnone"); - switch (saw_library) - { - case 0: - append_arg (library); - case 1: - append_arg ("-lm"); - default: - break; - } - } - else if (add_version_magic && verbose) - { - FILE *fsrc; - - choose_temp_base (); - - append_arg ("-fnull-version"); - append_arg ("-o"); - append_arg (temp_filename); - append_arg ("-xf77-cpp-input"); - append_arg (temp_filename_f); - append_arg ("-xnone"); - if (library) - { - append_arg (library); - append_arg ("-lm"); - } - - fsrc = fopen (temp_filename_f, "w"); - if (fsrc == 0) - pfatal_with_name (fsrc); - fputs (" call g77__fvers;call g77__ivers;call g77__uvers;end\n", fsrc); - fclose (fsrc); - } - - append_arg (NULL); - --newargc; /* Don't count null arg at end. */ - - newargv[0] = gcc; /* This is safe even if newargv == xargv. */ - - if (verbose) - { - #if 0 - if (newargv == xargv) - fprintf (stderr, "[Original:]"); - #endif - - for (i = 0; i < newargc; i++) - fprintf (stderr, " %s", newargv[i]); - fprintf (stderr, "\n"); - } - - if (doit (gcc, newargv) < 0) - ++error_count; - else if (add_version_magic && verbose) - { - char *outargv[2]; - - outargv[0] = temp_filename; - outargv[1] = 0; - - if (doit (temp_filename, outargv) < 0) - ++error_count; - - remove (temp_filename); - remove (temp_filename_f); - } - - exit (error_count > 0 ? (signal_count ? 2 : 1) : 0); - /* NOTREACHED */ - return 0; - } - - #endif /* LANGUAGE_F77 == 1 */ --- 0 ---- diff -rcp2N g77-0.5.22/f/g77.texi g77-0.5.23/f/g77.texi *** g77-0.5.22/f/g77.texi Sun Jan 11 21:22:38 1998 --- g77-0.5.23/f/g77.texi Wed May 20 16:20:15 1998 *************** *** 14,17 **** --- 14,21 ---- @c %**start of header @setfilename g77.info + + @set last-up-date 1998-05-20 + @set version-g77 0.5.23 + @c @setfilename useg77.info @c @setfilename portg77.info *************** was contributed to Craig by David Ronis *** 103,116 **** @center James Craig Burley @sp 3 ! @center Last updated 1998-01-11 @sp 1 @c The version number appears some more times in this file. ! @center for version 0.5.21 @page @vskip 0pt plus 1filll Copyright @copyright{} 1995-1997 Free Software Foundation, Inc. @sp 2 ! For GNU Fortran Version 0.5.21* @sp 1 Published by the Free Software Foundation @* --- 107,120 ---- @center James Craig Burley @sp 3 ! @center Last updated @value{last-up-date} @sp 1 @c The version number appears some more times in this file. ! @center for version @value{version-g77} @page @vskip 0pt plus 1filll Copyright @copyright{} 1995-1997 Free Software Foundation, Inc. @sp 2 ! For GNU Fortran Version @value{version-g77}* @sp 1 Published by the Free Software Foundation @* *************** original English. *** 145,151 **** @ifinfo ! @dircategory Fortran Programming @direntry ! * g77: (g77). The GNU Fortran compilation system. @end direntry @node Top, Copying,, (DIR) --- 149,155 ---- @ifinfo ! @dircategory Programming @direntry ! * g77: (g77). The GNU Fortran compiler. @end direntry @node Top, Copying,, (DIR) *************** original English. *** 157,161 **** This manual documents how to run, install and port the GNU Fortran compiler, as well as its new features and incompatibilities, and how to ! report bugs. It corresponds to GNU Fortran version 0.5.21. @end ifset @end ifset --- 161,165 ---- This manual documents how to run, install and port the GNU Fortran compiler, as well as its new features and incompatibilities, and how to ! report bugs. It corresponds to GNU Fortran version @value{version-g77}. @end ifset @end ifset *************** report bugs. It corresponds to GNU Fort *** 164,173 **** This manual documents how to run and install the GNU Fortran compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU Fortran version 0.5.21. @end ifclear @ifclear USING This manual documents how to port the GNU Fortran compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU Fortran version 0.5.21. @end ifclear --- 168,177 ---- This manual documents how to run and install the GNU Fortran compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU Fortran version @value{version-g77}. @end ifclear @ifclear USING This manual documents how to port the GNU Fortran compiler, as well as its new features and incompatibilities, and how to report ! bugs. It corresponds to GNU Fortran version @value{version-g77}. @end ifclear *************** experimental, options added by @code{g77 *** 692,695 **** --- 696,704 ---- compiler and its back end. + (These, in turn, have made their way into the @code{egcs} + version of the compiler, and do not exist in @code{gcc} + version 2.8 or versions of @code{g77} based on that version + of @code{gcc}.) + @item John Carr (@email{jfc@@mit.edu}) wrote the alias analysis improvements. *************** The FSF provides information on the best *** 773,777 **** development of GNU software (such as GNU Fortran) in documents such as the ``GNUS Bulletin''. ! Email @email{gnu@@prep.ai.mit.edu} for information on funding the FSF. To fund specific GNU Fortran work in particular, the FSF might --- 782,786 ---- development of GNU software (such as GNU Fortran) in documents such as the ``GNUS Bulletin''. ! Email @email{gnu@@gnu.org} for information on funding the FSF. To fund specific GNU Fortran work in particular, the FSF might *************** The @code{g77} command itself, which als *** 1036,1044 **** system's @code{f77} command. @cindex libf2c library @cindex libraries, libf2c @cindex run-time library @item ! The @code{libf2c} run-time library. This library contains the machine code needed to support capabilities of the Fortran language that are not directly --- 1045,1055 ---- system's @code{f77} command. + @cindex libg2c library @cindex libf2c library @cindex libraries, libf2c + @cindex libraries, libg2c @cindex run-time library @item ! The @code{libg2c} run-time library. This library contains the machine code needed to support capabilities of the Fortran language that are not directly *************** provided by the machine code generated b *** 1046,1049 **** --- 1057,1070 ---- compilation phase. + @code{libg2c} is just the unique name @code{g77} gives + to its version of @code{libf2c} to distinguish it from + any copy of @code{libf2c} installed from @code{f2c} + (or versions of @code{g77} that built @code{libf2c} under + that same name) + on the system. + + The maintainer of @code{libf2c} currently is + @email{dmg@@bell-labs.com}. + @cindex f771 program @cindex programs, f771 *************** Fortran users will normally use @code{g7 *** 1115,1119 **** because @code{g77} knows how to specify the libraries needed to link with Fortran programs ! (@code{libf2c} and @code{lm}). @code{g77} can still compile and link programs and source files written in other languages, just like @code{gcc}. --- 1136,1140 ---- because @code{g77} knows how to specify the libraries needed to link with Fortran programs ! (@code{libg2c} and @code{lm}). @code{g77} can still compile and link programs and source files written in other languages, just like @code{gcc}. *************** produces much more output than @samp{gcc *** 1128,1132 **** from the linker, usually @code{ld}---you might have an out-of-date @code{libf2c} that improperly handles ! complex arithmetic.)@ In the output of this command, the line beginning @samp{GNU Fortran Front End} identifies the version number of GNU Fortran; immediately --- 1149,1153 ---- from the linker, usually @code{ld}---you might have an out-of-date @code{libf2c} that improperly handles ! complex arithmetic.) In the output of this command, the line beginning @samp{GNU Fortran Front End} identifies the version number of GNU Fortran; immediately *************** Instead, operations like trigonometric *** 1151,1156 **** functions are compiled by the @code{f771} compiler (invoked by @code{g77} when compiling Fortran code) into machine ! code that, when run, calls on functions in @code{libf2c}, so ! @code{libf2c} must be linked with almost every useful program having any component compiled by GNU Fortran. (As mentioned above, the @code{g77} command takes --- 1172,1177 ---- functions are compiled by the @code{f771} compiler (invoked by @code{g77} when compiling Fortran code) into machine ! code that, when run, calls on functions in @code{libg2c}, so ! @code{libg2c} must be linked with almost every useful program having any component compiled by GNU Fortran. (As mentioned above, the @code{g77} command takes *************** care of all this for you.) *** 1158,1162 **** The @code{f771} program represents most of what is unique to GNU Fortran. ! While much of the @code{libf2c} component is really part of @code{f2c}, a free Fortran-to-C converter distributed by Bellcore (AT&T), plus @code{libU77}, provided by Dave Love, --- 1179,1184 ---- The @code{f771} program represents most of what is unique to GNU Fortran. ! While much of the @code{libg2c} component comes from ! the @code{libf2c} component of @code{f2c}, a free Fortran-to-C converter distributed by Bellcore (AT&T), plus @code{libU77}, provided by Dave Love, *************** appropriately before submitting it to th *** 1240,1252 **** @cindex g77 options, -v @cindex options, -v - @cindex -@w{}-driver option - @cindex g77 options, -@w{}-driver - @cindex options, -@w{}-driver Use the @samp{-v} option with @code{g77} to see what is going on---the first line of output is the invocation of the @code{gcc} command. - Use @samp{--driver=true} to disable actual invocation - of @code{gcc} (this works because @samp{true} is the name of a - UNIX command that simply returns success status). @node Invoking G77 --- 1262,1268 ---- *************** on the non-Fortran-specific aspects of t *** 1263,1285 **** therefore, the @code{g77} command). - The @code{g77} command supports one option not supported by - the @code{gcc} command: - - @table @code - @cindex -@w{}-driver option - @cindex g77 options, -@w{}-driver - @cindex options, -@w{}-driver - @item --driver=@var{command} - Specifies that @var{command}, rather than @code{gcc}, is to - be invoked by @code{g77} to do its job. - For example, within the @code{gcc} build directory after - building GNU Fortran (but without having to install it), - @kbd{./g77 --driver=./xgcc foo.f -B./}. - @end table - @cindex options, negative forms @cindex negative forms of options ! All other options are supported both by @code{g77} and by @code{gcc} as ! modified (and reinstalled) by the @code{g77} distribution. In some cases, options have positive and negative forms; the negative form of @samp{-ffoo} would be @samp{-fno-foo}. --- 1279,1292 ---- therefore, the @code{g77} command). @cindex options, negative forms @cindex negative forms of options ! All @code{gcc} and @code{g77} options ! are accepted both by @code{g77} and by @code{gcc} ! (as well as any other drivers built at the same time, ! such as @code{g++}), ! since adding @code{g77} to the @code{gcc} distribution ! enables acceptance of @code{g77}-specific options ! by all of the relevant drivers. ! In some cases, options have positive and negative forms; the negative form of @samp{-ffoo} would be @samp{-fno-foo}. *************** by type. Explanations are in the follow *** 1318,1322 **** @xref{Overall Options,,Options Controlling the Kind of Output}. @smallexample ! --driver -fversion -fset-g77-defaults -fno-silent @end smallexample --- 1325,1329 ---- @xref{Overall Options,,Options Controlling the Kind of Output}. @smallexample ! -fversion -fset-g77-defaults -fno-silent @end smallexample *************** by type. Explanations are in the follow *** 1385,1390 **** -fschedule-insns -fschedule-insn2 -fcaller-saves -funroll-loops -funroll-all-loops - -fno-move-all-movables -fno-reduce-all-givs - -fno-rerun-loop-opt @end smallexample --- 1392,1395 ---- *************** by type. Explanations are in the follow *** 1404,1409 **** -fzeros -fno-second-underscore -fdebug-kludge -fno-emulate-complex - -falias-check -fargument-alias - -fargument-noalias -fno-argument-noalias-global -fno-globals @end smallexample --- 1409,1412 ---- *************** by the @code{g77} and @code{gcc} command *** 1544,1553 **** @table @code - @item --driver=@var{command} - This works when invoking only the @code{g77} command, not - when invoking the @code{gcc} command. - @xref{Invoking G77,,GNU Fortran Command Options}, for - information on this option. - @cindex -fversion option @cindex options, -fversion --- 1547,1550 ---- *************** compilations, and avoid running internal *** 1568,1574 **** that might take some time. - As of version 0.5.20, this is equivalent to @samp{-fmove-all-movables - -freduce-all-givs -frerun-loop-opt -fargument-noalias-global}. - This option is supplied automatically when compiling Fortran code via the @code{g77} or @code{gcc} command. --- 1565,1568 ---- *************** specify that the body of an imperative @ *** 1901,1905 **** if the number of iterations calculated from the parameters of the loop is less than 1. ! (For example, @samp{DO 10 I = 1, 0}.)@ Such a loop is called a @dfn{zero-trip loop}. --- 1895,1899 ---- if the number of iterations calculated from the parameters of the loop is less than 1. ! (For example, @samp{DO 10 I = 1, 0}.) Such a loop is called a @dfn{zero-trip loop}. *************** Most Fortran users will want to use no o *** 2588,2591 **** --- 2582,2588 ---- developing and testing programs, and use @samp{-O} or @samp{-O2} when compiling programs for late-cycle testing and for production use. + However, note that certain diagnostics---such as for uninitialized + variables---depend on the flow analysis done by @samp{-O}, i.e.@: you + must use @samp{-O} or @samp{-O2} to get such diagnostics. The following flags have particular applicability when *************** compiling Fortran programs: *** 2596,2600 **** @cindex options, -malign-double @item -malign-double ! (Intel 386 architecture only.) Noticeably improves performance of @code{g77} programs making --- 2593,2597 ---- @cindex options, -malign-double @item -malign-double ! (Intel x86 architecture only.) Noticeably improves performance of @code{g77} programs making *************** this option does not apply, generally sp *** 2616,2622 **** code compiled by @code{g77}. ! @emph{Also note:} @code{g77} fixes a @code{gcc} backend bug to allow ! @samp{-malign-double} to work generally, not just with statically-allocated data. @emph{Also also note:} The negative form of @samp{-malign-double} --- 2613,2621 ---- code compiled by @code{g77}. ! @emph{Also note:} @samp{-malign-double} applies only to statically-allocated data. + Double-precision data on the stack can still + cause problems due to misalignment. + @xref{Aligned Data}. @emph{Also also note:} The negative form of @samp{-malign-double} *************** Might improve optimization of loops. *** 2646,2649 **** --- 2645,2649 ---- @cindex in-line compilation @cindex compilation, in-line + @c DL: Only relevant for -O3? Don't compile statement functions inline. Might reduce the size of a program unit---which might be at *************** on IEEE behavior for floating-point to r *** 2664,2667 **** --- 2664,2668 ---- @cindex loops, speeding up @cindex speeding up loops + @c DL: normally defaulted? Might make some loops run faster. *************** Might make some loops run faster. *** 2671,2674 **** --- 2672,2676 ---- @cindex -fexpensive-optimizations option @cindex options, -fexpensive-optimizations + @c DL: This is -O2? @item -fexpensive-optimizations @cindex -fdelayed-branch option *************** Definitely improves performance on some *** 2696,2726 **** @cindex options, -funroll-all-loops @item -funroll-all-loops ! Definitely improves performance on some code. ! ! @item -fno-move-all-movables ! @cindex -fno-move-all-movables option ! @cindex options, -fno-move-all-movables ! @item -fno-reduce-all-givs ! @cindex -fno-reduce-all-givs option ! @cindex options, -fno-reduce-all-givs ! @item -fno-rerun-loop-opt ! @cindex -fno-rerun-loop-opt option ! @cindex options, -fno-rerun-loop-opt ! Each of these might improve performance on some code. ! ! Analysis of Fortran code optimization and the resulting ! optimizations triggered by the above options were ! contributed by Toon Moene (@email{toon@@moene.indiv.nluug.nl}). ! ! These three options are intended to be removed someday, once ! they have helped determine the efficacy of various ! approaches to improving the performance of Fortran code. ! ! Please let us know how use of these options affects ! the performance of your production code. ! We're particularly interested in code that runs faster ! when these options are @emph{disabled}, and in ! non-Fortran code that benefits when they are ! @emph{enabled} via the above @code{gcc} command-line options. @end table --- 2698,2703 ---- @cindex options, -funroll-all-loops @item -funroll-all-loops ! @c DL: Is this really true? What _are_ the semantics of this option? ! Improves performance on some code. @end table *************** equivalent). *** 2874,2880 **** This does not affect the generation of code that interfaces with the ! @code{libf2c} library. ! However, because the @code{libf2c} library uses @code{f2c} calling conventions, @code{g77} rejects attempts to pass intrinsics implemented by routines in this library as actual --- 2851,2857 ---- This does not affect the generation of code that interfaces with the ! @code{libg2c} library. ! However, because the @code{libg2c} library uses @code{f2c} calling conventions, @code{g77} rejects attempts to pass intrinsics implemented by routines in this library as actual *************** source file used in a program, it must b *** 2901,2905 **** @cindex options, -ff2c-library @item -ff2c-library ! Specify that use of @code{libf2c} is required. This is the default for the current version of @code{g77}. --- 2878,2883 ---- @cindex options, -ff2c-library @item -ff2c-library ! Specify that use of @code{libg2c} (or the original @code{libf2c}) ! is required. This is the default for the current version of @code{g77}. *************** But, this is generally true of compilers *** 3141,3175 **** the programs you compile before assuming they are working. - @cindex -falias-check option - @cindex options, -falias-check - @cindex -fargument-alias option - @cindex options, -fargument-alias - @cindex -fargument-noalias option - @cindex options, -fargument-noalias - @cindex -fno-argument-noalias-global option - @cindex options, -fno-argument-noalias-global - @item -falias-check - @item -fargument-alias - @item -fargument-noalias - @item -fno-argument-noalias-global - These options specify to what degree aliasing - (overlap) - is permitted between - arguments (passed as pointers) and @code{COMMON} (external, or - public) storage. - - The default for Fortran code, as mandated by the FORTRAN 77 and - Fortran 90 standards, is @samp{-fargument-noalias-global}. - The default for code written in the C language family is - @samp{-fargument-alias}. - - Note that, on some systems, compiling with @samp{-fforce-addr} in - effect can produce more optimal code when the default aliasing - options are in effect (and when optimization is enabled). - - @xref{Aliasing Assumed To Work}, for detailed information on the implications - of compiling Fortran code that depends on the ability to alias dummy - arguments. - @cindex -fno-globals option @cindex options, -fno-globals --- 3119,3122 ---- *************** Some of these do @emph{not} work when co *** 3227,3231 **** @item -freg-struct-return You should not use these except strictly the same way as you ! used them to build the version of @code{libf2c} with which you will be linking all code compiled by @code{g77} with the same option. --- 3174,3178 ---- @item -freg-struct-return You should not use these except strictly the same way as you ! used them to build the version of @code{libg2c} with which you will be linking all code compiled by @code{g77} with the same option. *************** or there will be Trouble. *** 3246,3250 **** @cindex options, -fpack-struct @item -fpack-struct ! This probably will break any calls to the @code{libf2c} library, at the very least, even if it is built with the same option. @end table --- 3193,3197 ---- @cindex options, -fpack-struct @item -fpack-struct ! This probably will break any calls to the @code{libg2c} library, at the very least, even if it is built with the same option. @end table *************** or, if you cannot do that, email *** 3287,3290 **** --- 3234,3378 ---- GNU Fortran @file{.plan} file. + @heading In 0.5.23: + @itemize @bullet + @item + This release contains several regressions against + version 0.5.22 of @code{g77}, due to using the + ``vanilla'' @code{gcc} back end instead of patching + it to fix a few bugs and improve performance in a + few cases. + + @xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet}, + available in plain-text format in @code{gcc/f/BUGS}, + for information on the known bugs in this version, + including the regressions. + + Features that have been dropped from this version + of @code{g77} due to their being implemented + via @code{g77}-specific patches to the @code{gcc} + back end in previous releases include: + + @itemize -- + @item + Support for @code{__restrict__} keyword, + the options @samp{-fargument-alias}, @samp{-fargument-noalias}, + and @samp{-fargument-noalias-global}, + and the corresponding alias-analysis code. + + (Version 1.0.1 of @code{egcs} has the alias-analysis + code, but not the @code{__restrict__} keyword. + @code{egcs} @code{g77} users benefit from the alias-analysis + code despite the lack of the @code{__restrict__} keyword, + which is a C-language construct.) + + @item + Support for the GNU compiler options + @samp{-fmove-all-movables}, + @samp{-freduce-all-givs}, + and @samp{-frerun-loop-opt}. + + (Version 1.0.1 of @code{egcs} supports these options. + @code{g77} users of @code{egcs} benefit from them even if + they are not explicitly specified, + because the defaults are optimized for @code{g77} users.) + + @item + Support for the @samp{-W} option warning about + integer division by zero. + + @item + The Intel x86-specific option @samp{-malign-double} + applying to stack-allocated data + as well as statically-allocate data. + @end itemize + + @item + Support @code{gcc} version 2.8, + and remove support for prior versions of @code{gcc}. + + @cindex -@w{}-driver option + @cindex g77 options, -@w{}-driver + @cindex options, -@w{}-driver + @item + Remove support for the @samp{--driver} option, + as @code{g77} now does all the driving, + just like @code{gcc}. + + @item + The @code{g77} command now expects the run-time library + to be named @code{libg2c.a} instead of @code{libf2c.a}, + to ensure that a version other than the one built and + installed as part of the same @code{g77} version is picked up. + + @item + @code{g77}'s version of @code{libf2c} separates out + the setting of global state + (such as command-line arguments and signal handling) + from @file{main.o} into distinct, new library + archive members. + + This should make it easier to write portable applications + that have their own (non-Fortran) @code{main()} routine + properly set up the @code{libf2c} environment, even + when @code{libf2c} (now @code{libg2c}) is a shared library. + + @item + Some diagnostics have been changed from warnings to errors, + to prevent inadvertent use of the resulting, probably buggy, + programs. + These mostly include diagnostics about use of unsupported features + in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and + @code{WRITE} statements, + and about truncations of various sorts of constants. + @end itemize + + @heading In 0.5.22: + @itemize @bullet + @item + Fix @code{SIGNAL} intrinsic so it offers portable + support for 64-bit systems (such as Digital Alphas + running GNU/Linux). + + @item + Support @samp{FORMAT(I<@var{expr}>)} when @var{expr} is a + compile-time constant @code{INTEGER} expression. + + @item + Fix @code{g77} @samp{-g} option so procedures that + use @samp{ENTRY} can be stepped through, line by line, + in @code{gdb}. + + @item + Allow any @code{REAL} argument to intrinsics + @code{Second} and @code{CPU_Time}. + + @item + Allow any numeric argument to intrinsics + @code{Int2} and @code{Int8}. + + @item + Use @code{tempnam}, if available, to open scratch files + (as in @samp{OPEN(STATUS='SCRATCH')} + so that the @code{TMPDIR} environment variable, + if present, is used. + + @item + Rename the @code{gcc} keyword @code{restrict} to + @code{__restrict__}, to avoid rejecting valid, existing, + C programs. + Support for @code{restrict} is now more like support + for @code{complex}. + + @item + Fix @samp{-fugly-comma} to affect invocations of + only external procedures. + Restore rejection of gratuitous trailing omitted + arguments to intrinsics, as in @samp{I=MAX(3,4,,)}. + + @item + Fix compiler so it accepts @samp{-fgnu-intrinsics-*} and + @samp{-fbadu77-intrinsics-*} options. + @end itemize + @heading In 0.5.21: @itemize @bullet *************** This type is wide enough *** 3453,3457 **** as the character-pointer type on the machine. ! On most systems, this won't make a noticable difference, whereas on Alphas and other systems with 64-bit pointers, the @code{INTEGER(KIND=0)} type is equivalent to @code{INTEGER(KIND=2)} --- 3541,3545 ---- as the character-pointer type on the machine. ! On most systems, this won't make a noticeable difference, whereas on Alphas and other systems with 64-bit pointers, the @code{INTEGER(KIND=0)} type is equivalent to @code{INTEGER(KIND=2)} *************** GNU Fortran supports a variety of extens *** 3730,3735 **** of, the Fortran language. Its primary base is the ANSI FORTRAN 77 standard, currently available on ! the network at @uref{http://kumo.swcp.com/fortran/F77_std/f77_std.html} ! or in @uref{ftp://ftp.ast.cam.ac.uk/pub/michael/}. It offers some extensions that are popular among users of UNIX @code{f77} and @code{f2c} compilers, some that --- 3818,3825 ---- of, the Fortran language. Its primary base is the ANSI FORTRAN 77 standard, currently available on ! the network at ! @uref{http://www.fortran.com/fortran/F77_std/rjcnf0001.html} ! or as monolithic text at ! @uref{http://www.fortran.com/fortran/F77_std/f77_std.html}. It offers some extensions that are popular among users of UNIX @code{f77} and @code{f2c} compilers, some that *************** implementation choices are available tha *** 5653,5657 **** pass-by-reference semantics without passing a pointer to the argument, @var{arg}. ! (For example, a copy-in/copy-out implementation.)@ And, future versions of @code{g77} might change the way descriptors are implemented, such as passing a --- 5743,5747 ---- pass-by-reference semantics without passing a pointer to the argument, @var{arg}. ! (For example, a copy-in/copy-out implementation.) And, future versions of @code{g77} might change the way descriptors are implemented, such as passing a *************** expected to meet the same requirements a *** 6439,6443 **** of matching symbol names and keywords (for the exponent letters). ! Currently, however, @code{NAMELIST} is supported by @code{libf2c}, which uppercases @code{NAMELIST} input and symbol names for matching. This means not only that @code{NAMELIST} output currently shows symbol --- 6529,6533 ---- of matching symbol names and keywords (for the exponent letters). ! Currently, however, @code{NAMELIST} is supported by @code{libg2c}, which uppercases @code{NAMELIST} input and symbol names for matching. This means not only that @code{NAMELIST} output currently shows symbol *************** These rules are based on the configurati *** 7392,7396 **** version of @code{gcc} built in the same release as @code{g77} (and which was therefore used to build both the @code{g77} compiler ! components and the @code{libf2c} run-time library): @table @code --- 7482,7486 ---- version of @code{gcc} built in the same release as @code{g77} (and which was therefore used to build both the @code{g77} compiler ! components and the @code{libg2c} run-time library): @table @code *************** Two @code{REAL(KIND=2)} scalars. *** 7465,7469 **** @cindex *@var{n} notation @item @var{numeric-type}*@var{n} ! (Where @var{numeric-type} is any type other than @code{CHARACTER}.)@ Same as whatever @code{gcc} type occupies @var{n} times the storage space of a @code{gcc} @code{char} item. --- 7555,7559 ---- @cindex *@var{n} notation @item @var{numeric-type}*@var{n} ! (Where @var{numeric-type} is any type other than @code{CHARACTER}.) Same as whatever @code{gcc} type occupies @var{n} times the storage space of a @code{gcc} @code{char} item. *************** and an @code{int} length. *** 7735,7743 **** Much of this compatibility results from the fact that ! @code{g77} uses the same run-time library, @code{libf2c}, used by ! @code{f2c}. Other compilers might or might not generate code that ! is object-compatible with @code{libf2c} and current @code{g77}, and some might offer such compatibility only when explicitly selected via a command-line option to the compiler. --- 7825,7837 ---- Much of this compatibility results from the fact that ! @code{g77} uses the same run-time library, ! @code{libf2c}, used by @code{f2c}, ! though @code{g77} gives its version the name @code{libg2c} ! so as to avoid conflicts when linking, ! installing them in the same directories, ! and so on. Other compilers might or might not generate code that ! is object-compatible with @code{libg2c} and current @code{g77}, and some might offer such compatibility only when explicitly selected via a command-line option to the compiler. *************** compatible code (at the expense of the a *** 7810,7813 **** --- 7904,7912 ---- performance), or at the very least, to produce diagnostics. + (The library @code{g77} produces will no longer be named @file{libg2c} + when it is no longer generally compatible with @file{libf2c}. + It will likely be referred to, and, if installed as a distinct + library, named @code{libg77}, or some other as-yet-unused name.) + @node Compilers Other Than f2c @section Compilers Other Than @code{f2c} *************** On systems with Fortran compilers other *** 7816,7820 **** code compiled by @code{g77} is not expected to work well with code compiled by the native compiler. ! (This is true for @code{f2c}-compiled objects as well.)@ Libraries compiled with the native compiler probably will have to be recompiled with @code{g77} to be used with @code{g77}-compiled code. --- 7915,7919 ---- code compiled by @code{g77} is not expected to work well with code compiled by the native compiler. ! (This is true for @code{f2c}-compiled objects as well.) Libraries compiled with the native compiler probably will have to be recompiled with @code{g77} to be used with @code{g77}-compiled code. *************** of work!} *** 7873,7877 **** @cindex linking with C The following discussion assumes that you are running @code{g77} in @code{f2c} ! compatibility mode, i.e.@ not using @samp{-fno-f2c}. It provides some advice about quick and simple techniques for linking Fortran and C (or --- 7972,7976 ---- @cindex linking with C The following discussion assumes that you are running @code{g77} in @code{f2c} ! compatibility mode, i.e.@: not using @samp{-fno-f2c}. It provides some advice about quick and simple techniques for linking Fortran and C (or *************** It can be used in @code{f2c} mode with *** 7928,7937 **** Generally, C code written to link with @code{g77} code---calling and/or being ! called from Fortran---should @samp{#include } to define the C versions of the Fortran types. Don't assume Fortran @code{INTEGER} types correspond to C @samp{int}s, for instance; instead, declare them as ! @code{integer}, a type defined by @file{f2c.h}. ! @file{f2c.h} is installed where @code{gcc} will find it by default, assuming you use a copy of @code{gcc} compatible with @code{g77}, probably built at the same time as @code{g77}. --- 8027,8036 ---- Generally, C code written to link with @code{g77} code---calling and/or being ! called from Fortran---should @samp{#include } to define the C versions of the Fortran types. Don't assume Fortran @code{INTEGER} types correspond to C @samp{int}s, for instance; instead, declare them as ! @code{integer}, a type defined by @file{g2c.h}. ! @file{g2c.h} is installed where @code{gcc} will find it by default, assuming you use a copy of @code{gcc} compatible with @code{g77}, probably built at the same time as @code{g77}. *************** default, assuming you use a copy of @cod *** 7942,7946 **** @pindex f2c @cindex -fno-second-underscore ! A simple and foolproof way to write @code{g77}-callable C routines---e.g.@ to interface with an existing library---is to write a file (named, for example, @file{fred.f}) of dummy Fortran --- 8041,8045 ---- @pindex f2c @cindex -fno-second-underscore ! A simple and foolproof way to write @code{g77}-callable C routines---e.g.@: to interface with an existing library---is to write a file (named, for example, @file{fred.f}) of dummy Fortran *************** into which you can edit *** 7951,7956 **** useful code, confident the calling sequence is correct, at least. (There are some errors otherwise commonly made in generating C ! interfaces with f2c conventions, such as not using @code{doublereal} as ! the return type of a @code{REAL} @code{FUNCTION}.) @pindex ftnchek --- 8050,8056 ---- useful code, confident the calling sequence is correct, at least. (There are some errors otherwise commonly made in generating C ! interfaces with @code{f2c} conventions, ! such as not using @code{doublereal} ! as the return type of a @code{REAL} @code{FUNCTION}.) @pindex ftnchek *************** avoid clashes with C++ reserved words in *** 7993,8015 **** @cindex runtime initialization @cindex initialization, runtime ! Unlike with some runtime systems, it shouldn't be necessary (unless there are ! bugs) to use a Fortran main program to ensure the ! runtime---specifically the i/o system---is initialized. ! However, to use ! the @code{g77} intrinsics @code{GETARG()} and @code{IARGC()} the ! @code{main()} routine from the @file{libf2c} library must be used, either ! explicitly or implicitly by using a Fortran main program. ! This ! @code{main()} program calls @code{MAIN__()} (where the names are C-type ! @code{extern} names, i.e.@ not mangled). ! You need to provide this ! nullary procedure as the entry point for your C code if using ! @file{libf2c}'s @code{main}. ! In some cases it might be necessary to ! provide a dummy version of this to avoid linkers complaining about ! failure to resolve @code{MAIN__()} if linking against @file{libf2c} and ! not using @code{main()} from it. ! @include install.texi @node Debugging and Interfacing --- 8093,8240 ---- @cindex runtime initialization @cindex initialization, runtime ! Unlike with some runtime systems, ! it shouldn't be necessary ! (unless there are bugs) ! to use a Fortran main program unit to ensure the ! runtime---specifically the I/O system---is initialized. ! ! However, to use the @code{g77} intrinsics @code{GETARG} and @code{IARGC}, ! either the @code{main} routine from the @file{libg2c} library must be used, ! or the @code{f_setarg} routine ! (new as of version 0.5.23 of @code{g77}) ! must be called with the appropriate @code{argc} and @code{argv} arguments ! prior to the program calling @code{GETARG} or @code{IARGC}. ! ! To provide more flexibility for mixed-language programming ! involving @code{g77} while allowing for shared libraries, ! as of version 0.5.23, ! @code{g77}'s @code{main} routine in @code{libg2c} ! does the following, in order: ! ! @enumerate ! @item ! Calls @code{f_setarg} ! with the incoming @code{argc} and @code{argv} arguments, ! in the same order as for @code{main} itself. ! ! This sets up the command-line environment ! for @code{GETARG} and @code{IARGC}. ! ! @item ! Calls @code{f_setsig} (with no arguments). ! ! This sets up the signaling and exception environment. ! ! @item ! Calls @code{f_init} (with no arguments). ! ! This initializes the I/O environment, ! though that should not be necessary, ! as all I/O functions in @code{libf2c} ! are believed to call @code{f_init} automatically, ! if necessary. ! ! (A future version of @code{g77} might skip this explicit step, ! to speed up normal exit of a program.) ! ! @item ! Arranges for @code{f_exit} to be called (with no arguments) ! when the program exits. ! ! This ensures that the I/O environment is properly shut down ! before the program exits normally. ! Otherwise, output buffers might not be fully flushed, ! scratch files might not be deleted, and so on. ! ! The simple way @code{main} does this is ! to call @code{f_exit} itself after calling ! @code{MAIN__} (in the next step). ! ! However, this does not catch the cases where the program ! might call @code{exit} directly, ! instead of using the @code{EXIT} intrinsic ! (implemented as @code{exit_} in @code{libf2c}). ! ! So, @code{main} attempts to use ! the operating environment's @code{onexit} or @code{atexit} ! facility, if available, ! to cause @code{f_exit} to be called automatically ! upon any invocation of @code{exit}. ! ! @item ! Calls @code{MAIN__} (with no arguments). ! ! This starts executing the Fortran main program unit for ! the application. ! (Both @code{g77} and @code{f2c} currently compile a main ! program unit so that its global name is @code{MAIN__}.) ! ! @item ! If no @code{onexit} or @code{atexit} is provided by the system, ! calls @code{f_exit}. ! ! @item ! Calls @code{exit} with a zero argument, ! to signal a successful program termination. ! ! @item ! Returns a zero value to the caller, ! to signal a successful program termination, ! in case @code{exit} doesn't exit on the system. ! @end enumerate ! ! All of the above names are C @code{extern} names, ! i.e.@: not mangled. ! ! When using the @code{main} procedure provided by @code{g77} ! without a Fortran main program unit, ! you need to provide @code{MAIN__} ! as the entry point for your C code. ! (Make sure you link the object file that defines that ! entry point with the rest of your program.) ! ! To provide your own @code{main} procedure ! in place of @code{g77}'s, ! make sure you specify the object file defining that procedure ! @emph{before} @samp{-lg2c} on the @code{g77} command line. ! Since the @samp{-lg2c} option is implicitly provided, ! this is usually straightforward. ! (Use the @samp{--verbose} option to see how and where ! @code{g77} implicitly adds @samp{-lg2c} in a command line ! that will link the program. ! Feel free to specify @samp{-lg2c} explicitly, ! as appropriate.) ! ! However, when providing your own @code{main}, ! make sure you perform the appropriate tasks in the ! appropriate order. ! For example, if your @code{main} does not call @code{f_setarg}, ! make sure the rest of your application does not call ! @code{GETARG} or @code{IARGC}. ! ! And, if your @code{main} fails to ensure that @code{f_exit} ! is called upon program exit, ! some files might end up incompletely written, ! some scratch files might be left lying around, ! and some existing files being written might be left ! with old data not properly truncated at the end. ! ! Note that, generally, the @code{g77} operating environment ! does not depend on a procedure named @code{MAIN__} actually ! being called prior to any other @code{g77}-compiled code. ! That is, @code{MAIN__} does not, itself, ! set up any important operating-environment characteristics ! upon which other code might depend. ! This might change in future versions of @code{g77}, ! with appropriate notification in the release notes. ! ! For more information, consult the source code for the above routines. ! These are in @file{gcc/f/runtime/libF77/}, named @file{main.c}, ! @file{setarg.c}, @file{setsig.c}, @file{getarg_.c}, and @file{iargc_.c}. ! Also, the file @file{gcc/f/com.c} contains the code @code{g77} ! uses to open-code (inline) references to @code{IARGC}. ! ! @include g77install.texi @node Debugging and Interfacing *************** described in this section. *** 8081,8094 **** When @code{g77} compiles a main program unit, it gives it the public procedure name @samp{MAIN__}. ! The @code{libf2c} library has the actual @code{main()} procedure as is typical of C-based environments, and it is this procedure that performs some initial start-up activity and then calls @samp{MAIN__}. ! Generally, @code{g77} and @code{libf2c} are designed so that you need not include a main program unit written in Fortran in your program---it can be written in C or some other language. Especially for I/O handling, this is the case, although @code{g77} version 0.5.16 ! includes a bug fix for @code{libf2c} that solved a problem with using the @code{OPEN} statement as the first Fortran I/O activity in a program without a Fortran main program unit. --- 8306,8319 ---- When @code{g77} compiles a main program unit, it gives it the public procedure name @samp{MAIN__}. ! The @code{libg2c} library has the actual @code{main()} procedure as is typical of C-based environments, and it is this procedure that performs some initial start-up activity and then calls @samp{MAIN__}. ! Generally, @code{g77} and @code{libg2c} are designed so that you need not include a main program unit written in Fortran in your program---it can be written in C or some other language. Especially for I/O handling, this is the case, although @code{g77} version 0.5.16 ! includes a bug fix for @code{libg2c} that solved a problem with using the @code{OPEN} statement as the first Fortran I/O activity in a program without a Fortran main program unit. *************** However, if you don't intend to use @cod *** 8097,8101 **** your main program unit---that is, if you intend to compile a @code{main()} procedure using some other language---you should carefully ! examine the code for @code{main()} in @code{libf2c}, found in the source file @file{gcc/f/runtime/libF77/main.c}, to see what kinds of things might need to be done by your @code{main()} in order to provide the --- 8322,8326 ---- your main program unit---that is, if you intend to compile a @code{main()} procedure using some other language---you should carefully ! examine the code for @code{main()} in @code{libg2c}, found in the source file @file{gcc/f/runtime/libF77/main.c}, to see what kinds of things might need to be done by your @code{main()} in order to provide the *************** Fortran environment your Fortran code is *** 8106,8112 **** @cindex GETARG() intrinsic @cindex intrinsics, GETARG() ! For example, @code{libf2c}'s @code{main()} sets up the information used by the @code{IARGC} and @code{GETARG} intrinsics. ! Bypassing @code{libf2c}'s @code{main()} without providing a substitute for this activity would mean that invoking @code{IARGC} and @code{GETARG} would produce undefined --- 8331,8337 ---- @cindex GETARG() intrinsic @cindex intrinsics, GETARG() ! For example, @code{libg2c}'s @code{main()} sets up the information used by the @code{IARGC} and @code{GETARG} intrinsics. ! Bypassing @code{libg2c}'s @code{main()} without providing a substitute for this activity would mean that invoking @code{IARGC} and @code{GETARG} would produce undefined *************** results. *** 8120,8124 **** When debugging, one implication of the fact that @code{main()}, which is the place where the debugged program ``starts'' from the ! debugger's point of view, is in @code{libf2c} is that you won't be starting your Fortran program at a point you recognize as your Fortran code. --- 8345,8349 ---- When debugging, one implication of the fact that @code{main()}, which is the place where the debugged program ``starts'' from the ! debugger's point of view, is in @code{libg2c} is that you won't be starting your Fortran program at a point you recognize as your Fortran code. *************** calling sequence and is named @samp{__g7 *** 8173,8177 **** is the user-specified name. This argument is of the C type @code{ftnlen} ! (see @file{gcc/f/runtime/f2c.h.in} for information on that type) and is the number of characters the caller has allocated in the array pointed to by the first argument. --- 8398,8402 ---- is the user-specified name. This argument is of the C type @code{ftnlen} ! (see @file{gcc/f/runtime/g2c.h.in} for information on that type) and is the number of characters the caller has allocated in the array pointed to by the first argument. *************** as how casing is handled. *** 8285,8289 **** External names---names of entities that are public, or ``accessible'', to all modules in a program---normally have an underscore (@samp{_}) ! appended by @code{g77}, to generate code that is compatible with f2c. External names include names of Fortran things like common blocks, external procedures (subroutines and functions, but not including --- 8510,8515 ---- External names---names of entities that are public, or ``accessible'', to all modules in a program---normally have an underscore (@samp{_}) ! appended by @code{g77}, ! to generate code that is compatible with @code{f2c}. External names include names of Fortran things like common blocks, external procedures (subroutines and functions, but not including *************** that already has at least one underscore *** 8305,8309 **** implemented by @code{g77} by appending two underscores. (This second underscore can be disabled via the ! @samp{-fno-second-underscore} option.)@ External names are changed this way for @code{f2c} compatibility. Local names are changed this way to avoid collisions with external names --- 8531,8535 ---- implemented by @code{g77} by appending two underscores. (This second underscore can be disabled via the ! @samp{-fno-second-underscore} option.) External names are changed this way for @code{f2c} compatibility. Local names are changed this way to avoid collisions with external names *************** could be used to inhibit the appending o *** 8378,8383 **** @cindex statements, COMMON ! @code{g77} names and lays out @code{COMMON} areas the same way f2c does, ! for compatibility with f2c. Currently, @code{g77} does not emit ``true'' debugging information for --- 8604,8610 ---- @cindex statements, COMMON ! @code{g77} names and lays out @code{COMMON} areas ! the same way @code{f2c} does, ! for compatibility with @code{f2c}. Currently, @code{g77} does not emit ``true'' debugging information for *************** assigned-label uses of a variable. *** 8930,8934 **** @cindex I/O, errors ! The @code{libf2c} library currently has the following table to relate error code numbers, returned in @code{IOSTAT=} variables, to messages. This information should, in future versions of this document, be --- 9157,9161 ---- @cindex I/O, errors ! The @code{libg2c} library currently has the following table to relate error code numbers, returned in @code{IOSTAT=} variables, to messages. This information should, in future versions of this document, be *************** savings of resources, such as on systems *** 9203,9206 **** --- 9430,9436 ---- because @code{g77} simply asks for fewer zeros from the operating system than @code{f2c}. + (Avoiding spurious use of zero bytes, each byte typically have + eight zero bits, also reduces the liabilities in case + Microsoft's rumored patent on the digits 0 and 1 is upheld.) @node Block Data and Libraries *************** one of the few things not compatible wit *** 9234,9243 **** shipped. @code{f2c} currently does nothing with @samp{EXTERNAL FOO} except ! issue a warning that @samp{FOO} is not otherwise referenced, and for ! @samp{BLOCK DATA FOO}, f2c doesn't generate a dummy procedure with the ! name @samp{FOO}. The upshot is that you shouldn't mix @code{f2c} and @code{g77} in this particular case. ! If you use f2c to compile @samp{BLOCK DATA FOO}, then any @code{g77}-compiled program unit that says @samp{EXTERNAL FOO} will result in an unresolved reference when linked. --- 9464,9473 ---- shipped. @code{f2c} currently does nothing with @samp{EXTERNAL FOO} except ! issue a warning that @samp{FOO} is not otherwise referenced, ! and, for @samp{BLOCK DATA FOO}, ! @code{f2c} doesn't generate a dummy procedure with the name @samp{FOO}. The upshot is that you shouldn't mix @code{f2c} and @code{g77} in this particular case. ! If you use @code{f2c} to compile @samp{BLOCK DATA FOO}, then any @code{g77}-compiled program unit that says @samp{EXTERNAL FOO} will result in an unresolved reference when linked. *************** and @samp{-fno-argument-noalias-global} *** 9684,9694 **** introduced in version 0.5.20 and @code{g77}'s version 2.7.2.2.f.2 of @code{gcc}, ! control the assumptions regarding aliasing ! (overlapping) ! of writes and reads to main memory (core) made ! by the @code{gcc} back end. ! They are effective only when compiling with @samp{-O} (specifying ! any level other than @samp{-O0}) or with @samp{-falias-check}. The default for Fortran code is @samp{-fargument-noalias-global}. --- 9914,9933 ---- introduced in version 0.5.20 and @code{g77}'s version 2.7.2.2.f.2 of @code{gcc}, ! are withdrawn as of @code{g77} version 0.5.23 ! due to their not being supported by @code{gcc} version 2.8. ! These options, which control the assumptions regarding aliasing ! (overlapping) of writes and reads to main memory (core) made ! by the @code{gcc} back end, ! might well be added back (in some form) in a future version ! of @code{gcc}. ! ! The information below still is useful, but applies to ! only those versions of @code{g77} that support the ! alias analysis implied by support for these options. ! ! These options are effective only when compiling with @samp{-O} ! (specifying any level other than @samp{-O0}) ! or with @samp{-falias-check}. The default for Fortran code is @samp{-fargument-noalias-global}. *************** These defaults apply regardless of wheth *** 9698,9705 **** @code{gcc} to compile your code.) - Note that, on some systems, compiling with @samp{-fforce-addr} in - effect can produce more optimal code when the default aliasing - options are in effect (and when optimization is enabled). - If your program is not working when compiled with optimization, it is possible it is violating the Fortran standards (77 and 90) --- 9937,9940 ---- *************** since neither can catch all violations. *** 9814,9819 **** (Static analysis can catch all likely violations, and some that might never actually happen, while run-time analysis can catch ! only those violations that actually happen during a particular ! run. Neither approach can cope with programs mixing Fortran code with routines written in other languages, however.) --- 10049,10053 ---- (Static analysis can catch all likely violations, and some that might never actually happen, while run-time analysis can catch ! only those violations that actually happen during a particular run. Neither approach can cope with programs mixing Fortran code with routines written in other languages, however.) *************** relevant @code{ERR=} and @code{IOSTAT=} *** 9850,9861 **** Because of the adverse effects this approach had on the performance of many programs, @code{g77} no longer configures @code{libf2c} to always flush output. If your program depends on this behavior, either insert the appropriate @samp{CALL FLUSH} statements, or modify the sources ! to the @code{libf2c}, rebuild and reinstall @code{g77}, and relink your programs with the modified library. ! (Ideally, @code{libf2c} would offer the choice at run-time, so that a compile-time option to @code{g77} or @code{f2c} could result in generating the appropriate calls to flushing or --- 10084,10096 ---- Because of the adverse effects this approach had on the performance of many programs, @code{g77} no longer configures @code{libf2c} + (now named @code{libg2c} in its @code{g77} incarnation) to always flush output. If your program depends on this behavior, either insert the appropriate @samp{CALL FLUSH} statements, or modify the sources ! to the @code{libg2c}, rebuild and reinstall @code{g77}, and relink your programs with the modified library. ! (Ideally, @code{libg2c} would offer the choice at run-time, so that a compile-time option to @code{g77} or @code{f2c} could result in generating the appropriate calls to flushing or *************** non-flushing library routines.) *** 9863,9867 **** @xref{Always Flush Output}, for information on how to modify ! the @code{g77} source tree so that a version of @code{libf2c} can be built and installed with the @samp{ALWAYS_FLUSH} macro defined. --- 10098,10102 ---- @xref{Always Flush Output}, for information on how to modify ! the @code{g77} source tree so that a version of @code{libg2c} can be built and installed with the @samp{ALWAYS_FLUSH} macro defined. *************** can be built and installed with the @sam *** 9876,9887 **** If your program crashes at run time with a message including the text @samp{illegal unit number}, that probably is ! a message from the run-time library, @code{libf2c}, used, and ! distributed with, @code{g77}. The message means that your program has attempted to use a file unit number that is out of the range accepted by ! @code{libf2c}. Normally, this range is 0 through 99, and the high end ! of the range is controlled by a @code{libf2c} source-file macro named @samp{MXUNIT}. --- 10111,10121 ---- If your program crashes at run time with a message including the text @samp{illegal unit number}, that probably is ! a message from the run-time library, @code{libg2c}. The message means that your program has attempted to use a file unit number that is out of the range accepted by ! @code{libg2c}. Normally, this range is 0 through 99, and the high end ! of the range is controlled by a @code{libg2c} source-file macro named @samp{MXUNIT}. *************** in the range 0 through 99, you should do *** 9890,9898 **** Otherwise, see @ref{Larger File Unit Numbers}, for information on how ! to change @samp{MXUNIT} in @code{libf2c} so you can build and ! install a new version of @code{libf2c} that supports the larger unit numbers you need. ! @emph{Note:} While @code{libf2c} places a limit on the range of Fortran file-unit numbers, the underlying library and operating system might impose different kinds of limits. --- 10124,10132 ---- Otherwise, see @ref{Larger File Unit Numbers}, for information on how ! to change @samp{MXUNIT} in @code{libg2c} so you can build and ! install a new version of @code{libg2c} that supports the larger unit numbers you need. ! @emph{Note:} While @code{libg2c} places a limit on the range of Fortran file-unit numbers, the underlying library and operating system might impose different kinds of limits. *************** but using it will force @code{COMMON} to *** 10095,10098 **** --- 10329,10358 ---- @code{DOUBLE PRECISION} data. + When @code{DOUBLE PRECISION} data is forcibly aligned + in @code{COMMON} by @code{g77} due to specifying @samp{-malign-double}, + @code{g77} issues a warning about the need to + insert padding. + + In this case, each and every program unit that uses + the same @code{COMMON} area + must specify the same layout of variables and their types + for that area + and be compiled with @samp{-malign-double} as well. + @code{g77} will issue warnings in each case, + but as long as every program unit using that area + is compiled with the same warnings, + the resulting object files should work when linked together + unless the program makes additional assumptions about + @code{COMMON} area layouts that are outside the scope + of the FORTRAN 77 standard, + or uses @code{EQUIVALENCE} or different layouts + in ways that assume no padding is ever inserted by the compiler. + + @emph{Note:} @samp{-malign-double} applies only to + statically-allocated data. + Double-precision data on the stack can still + cause problems due to misalignment. + @xref{Aligned Data}. + @item Ensure that @file{crt0.o} or @file{crt1.o} *************** programs (which should be done using @co *** 10331,10340 **** If this happens to you, try appending @samp{-lc} to the command you use to link the program, e.g. @samp{g77 foo.f -lc}. ! @code{g77} already specifies @samp{-lf2c -lm} when it calls the linker, but it cannot also specify @samp{-lc} because not all systems have a file named @file{libc.a}. It is unclear at this point whether there are legitimately installed ! systems where @samp{-lf2c -lm} is insufficient to resolve code produced by @code{g77}. --- 10591,10600 ---- If this happens to you, try appending @samp{-lc} to the command you use to link the program, e.g. @samp{g77 foo.f -lc}. ! @code{g77} already specifies @samp{-lg2c -lm} when it calls the linker, but it cannot also specify @samp{-lc} because not all systems have a file named @file{libc.a}. It is unclear at this point whether there are legitimately installed ! systems where @samp{-lg2c -lm} is insufficient to resolve code produced by @code{g77}. *************** If your program doesn't link due to unre *** 10347,10351 **** like @samp{_main}, make sure you're using the @code{g77} command to do the link, since this command ensures that the necessary libraries are ! loaded by specifying @samp{-lf2c -lm} when it invokes the @code{gcc} command to do the actual link. (Use the @samp{-v} option to discover --- 10607,10611 ---- like @samp{_main}, make sure you're using the @code{g77} command to do the link, since this command ensures that the necessary libraries are ! loaded by specifying @samp{-lg2c -lm} when it invokes the @code{gcc} command to do the actual link. (Use the @samp{-v} option to discover *************** Inadequate investigation as of the relea *** 10379,10384 **** knowing which products are the culprit, but @file{gdb-4.14} definitely crashes when, for example, an attempt is made to print the contents ! of a @code{COMPLEX(KIND=2)} dummy array, on at least some GNU/Linux machines, plus ! some others. @node NeXTStep Problems --- 10639,10648 ---- knowing which products are the culprit, but @file{gdb-4.14} definitely crashes when, for example, an attempt is made to print the contents ! of a @code{COMPLEX(KIND=2)} dummy array, on at least some GNU/Linux ! machines, plus some others. ! Attempts to access assumed-size arrays are ! also known to crash recent versions of @code{gdb}. ! (@code{gdb}'s Fortran support was done for a different compiler ! and isn't properly compatible with @code{g77}.) @node NeXTStep Problems *************** executable that outputs @samp{0.2}. *** 10661,10665 **** This particular difference is due to the fact that, currently, ! conversion of floating-point values by the @code{libf2c} library, used by @code{g77}, handles only double-precision values. --- 10925,10929 ---- This particular difference is due to the fact that, currently, ! conversion of floating-point values by the @code{libg2c} library, used by @code{g77}, handles only double-precision values. *************** END *** 10703,10707 **** @end smallexample ! Future versions of @code{g77} and/or @code{libf2c} might convert single-precision values directly to decimal, instead of converting them to double precision first. --- 10967,10971 ---- @end smallexample ! Future versions of @code{g77} and/or @code{libg2c} might convert single-precision values directly to decimal, instead of converting them to double precision first. *************** specifiers. *** 11065,11069 **** @code{g77} doesn't support @samp{FORMAT(I)} and the like. Supporting this requires a significant redesign or replacement ! of @code{libf2c}. However, @code{g77} does support --- 11329,11333 ---- @code{g77} doesn't support @samp{FORMAT(I)} and the like. Supporting this requires a significant redesign or replacement ! of @code{libg2c}. However, @code{g77} does support *************** The @code{Q} edit descriptor in @code{FO *** 11115,11119 **** (This is meant to get the number of characters remaining in an input record.) Supporting this requires a significant redesign or replacement ! of @code{libf2c}. A workaround might be using internal I/O or the stream-based intrinsics. --- 11379,11383 ---- (This is meant to get the number of characters remaining in an input record.) Supporting this requires a significant redesign or replacement ! of @code{libg2c}. A workaround might be using internal I/O or the stream-based intrinsics. *************** This set of extensions is quite a bit *** 11171,11175 **** lower on the list of large, important things to add to @code{g77}, partly because it requires a great deal of work either upgrading or ! replacing @code{libf2c}. @node OPEN CLOSE and INQUIRE Keywords --- 11435,11439 ---- lower on the list of large, important things to add to @code{g77}, partly because it requires a great deal of work either upgrading or ! replacing @code{libg2c}. @node OPEN CLOSE and INQUIRE Keywords *************** replacing @code{libf2c}. *** 11186,11190 **** the @code{OPEN}, @code{CLOSE}, and @code{INQUIRE} statements. These extensions are easy to add to @code{g77} itself, but ! require much more work on @code{libf2c}. @node ENCODE and DECODE --- 11450,11454 ---- the @code{OPEN}, @code{CLOSE}, and @code{INQUIRE} statements. These extensions are easy to add to @code{g77} itself, but ! require much more work on @code{libg2c}. @node ENCODE and DECODE *************** control over whether or not floating-poi *** 11326,11330 **** ignored. (Ignoring them typically results in NaN values being ! propagated in systems that conform to IEEE 754.)@ The behaviour is inherited from the system-dependent startup code. --- 11590,11594 ---- ignored. (Ignoring them typically results in NaN values being ! propagated in systems that conform to IEEE 754.) The behaviour is inherited from the system-dependent startup code. *************** allocation of automatic arrays in heap s *** 11374,11378 **** @cindex parallel processing ! Neither the code produced by @code{g77} nor the @code{libf2c} library are thread-safe, nor does @code{g77} have support for parallel processing (other than the instruction-level parallelism available on some --- 11638,11642 ---- @cindex parallel processing ! Neither the code produced by @code{g77} nor the @code{libg2c} library are thread-safe, nor does @code{g77} have support for parallel processing (other than the instruction-level parallelism available on some *************** number---producing different computation *** 11901,11905 **** The reason this misfeature is dangerous is that a slight, apparently innocuous change to the source code can change ! the computational results. Consider: @smallexample --- 12165,12170 ---- The reason this misfeature is dangerous is that a slight, apparently innocuous change to the source code can change ! the computational results. ! Consider: @smallexample *************** Please consider offering useful answers *** 12137,12156 **** @itemize @bullet @item - How do system administrators and users manage multiple incompatible - Fortran compilers on their systems? - How can @code{g77} contribute to this, or at least avoiding - intefering with it? - - Currently, @code{g77} provides rudimentary ways to choose whether to - overwrite portions of other Fortran compilation systems - (such as the @code{f77} command and the @code{libf2c} library). - Is this sufficient? - What happens when users choose not to overwrite these---does - @code{g77} work properly in all such installations, picking - up its own versions, or does it pick up the existing ``alien'' - versions it didn't overwrite with its own, possibly leading - to subtle bugs? - - @item @code{LOC()} and other intrinsics are probably somewhat misclassified. Is the a need for more precise classification of intrinsics, and if so, --- 12402,12405 ---- *************** Reporting a bug might help you by bringi *** 12175,12179 **** it might not. (If it does not, look in the service directory; see ! @ref{Service}.)@ In any case, the principal function of a bug report is to help the entire community by making the next version of GNU Fortran work --- 12424,12428 ---- it might not. (If it does not, look in the service directory; see ! @ref{Service}.) In any case, the principal function of a bug report is to help the entire community by making the next version of GNU Fortran work *************** the feature-adding work. *** 13069,13073 **** @item Do the equivalent of the trick of putting @samp{extern inline} in front ! of every function definition in @code{libf2c} and #include'ing the resulting file in @code{f2c}+@code{gcc}---that is, inline all run-time-library functions that are at all worth inlining. --- 13318,13322 ---- @item Do the equivalent of the trick of putting @samp{extern inline} in front ! of every function definition in @code{libg2c} and #include'ing the resulting file in @code{f2c}+@code{gcc}---that is, inline all run-time-library functions that are at all worth inlining. *************** Among the important things the library w *** 13104,13108 **** Be a one-stop-shop-type library, hence shareable and usable by all, in that what are now ! library-build-time options in @code{libf2c} would be moved at least to the @code{g77} compile phase, if not to finer grains (such as choosing how list-directed I/O formatting is done by default at @code{OPEN} time, for --- 13353,13357 ---- Be a one-stop-shop-type library, hence shareable and usable by all, in that what are now ! library-build-time options in @code{libg2c} would be moved at least to the @code{g77} compile phase, if not to finer grains (such as choosing how list-directed I/O formatting is done by default at @code{OPEN} time, for *************** very useful. *** 13147,13151 **** @itemize @bullet @item ! A new library (replacing @code{libf2c}) should improve portability as well as produce more optimal code. Further, @code{g77} and the new library should --- 13396,13400 ---- @itemize @bullet @item ! A new library (replacing @code{libg2c}) should improve portability as well as produce more optimal code. Further, @code{g77} and the new library should *************** Support @samp{OPEN(@dots{},KEY=(@dots{}) *** 13224,13228 **** Support arbitrary file unit numbers, instead of limiting them to 0 through @samp{MXUNIT-1}. ! (This is a @code{libf2c} issue.) @item --- 13473,13477 ---- Support arbitrary file unit numbers, instead of limiting them to 0 through @samp{MXUNIT-1}. ! (This is a @code{libg2c} issue.) @item *************** whereas the rest of the *** 13248,13252 **** stuff has at least some parsing support. This requires either major ! changes to @code{libf2c} or its replacement. @item --- 13497,13501 ---- stuff has at least some parsing support. This requires either major ! changes to @code{libg2c} or its replacement. @item *************** as the above is just a sample, no such s *** 13481,13484 **** --- 13730,13734 ---- * LEX:: Various lexer messages * GLOBALS:: Disagreements about globals. + * LINKFAIL:: When linking @samp{f771} fails. @end menu *************** system, but have bugs that affect the re *** 13979,13982 **** --- 14229,14257 ---- without exhibiting any other outward manifestations of the bugs. + @node LINKFAIL + @section @code{LINKFAIL} + + @noindent + @smallexample + If the above command failed due to an unresolved reference + to strtoul, _strtoul, bsearch, _bsearch, or similar, see + [info -f g77 M LINKFAIL] (a node in the g77 documentation) + for information on what causes this, how to work around + the problem by editing $@{srcdir@}/proj.c, and what else to do. + @end smallexample + + @xref{Missing strtoul or bsearch}, for more information on + this problem. + + On AIX 4.1, @code{g77} might not build with the native (non-GNU) tools + due to a linker bug in coping with the @samp{-bbigtoc} option + which leads to a @samp{Relocation overflow} error. + + Compiling with @samp{-mminimal-toc} + might solve this problem, e.g.@: by adding + @smallexample + BOOT_CFLAGS='-mminimal-toc -O2 -g' + @end smallexample + to the @code{make bootstrap} command line. @end ifset diff -rcp2N g77-0.5.22/f/g77install.texi g77-0.5.23/f/g77install.texi *** g77-0.5.22/f/g77install.texi Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/g77install.texi Wed May 20 04:17:20 1998 *************** *** 0 **** --- 1,2140 ---- + @c Copyright (C) 1995-1997 Free Software Foundation, Inc. + @c This is part of the G77 manual. + @c For copying conditions, see the file g77.texi. + + @c The text of this file appears in the file INSTALL + @c in the G77 distribution, as well as in the G77 manual. + + @c 1998-05-20 + + @set version-g77 0.5.23 + @set version-gcc 2.8.1 + @set version-autoconf 2.12 + @set version-bison 1.25 + @set version-gperf 2.5 + @set version-gzip 1.2.4 + @set version-make 3.76.1 + @set version-makeinfo 1.68 + @set version-patch 2.5 + @set version-sed 2.05 + @set version-tar 1.12 + @set version-texinfo 3.11 + + @ifclear INSTALLONLY + @node Installation + @chapter Installing GNU Fortran + @end ifclear + @cindex installing GNU Fortran + + The following information describes how to install @code{g77}. + + The information in this file generally pertains to dealing + with @emph{source} distributions of @code{g77} and @code{gcc}. + It is possible that some of this information will be applicable + to some @emph{binary} distributions of these products---however, + since these distributions are not made by the maintainers of + @code{g77}, responsibility for binary distributions rests with + whoever built and first distributed them. + + Nevertheless, efforts to make @code{g77} easier to both build + and install from source and package up as a binary distribution + are ongoing. + + @menu + * Prerequisites:: Make sure your system is ready for @code{g77}. + * Problems Installing:: Known trouble areas. + * Settings:: Changing @code{g77} internals before building. + * Quick Start:: The easier procedure for non-experts. + * Complete Installation:: For experts, or those who want to be: the details. + * Distributing Binaries:: If you plan on distributing your @code{g77}. + @end menu + + @node Prerequisites + @section Prerequisites + @cindex prerequisites + + The procedures described to unpack, configure, build, and + install @code{g77} assume your system has certain programs + already installed. + + The following prerequisites should be met by your + system before you follow the @code{g77} installation instructions: + + @table @asis + @item @code{gzip} and @code{tar} + To unpack the @code{gcc} and @code{g77} distributions, + you'll need the @code{gunzip} utility in the @code{gzip} + distribution. + Most UNIX systems already have @code{gzip} installed. + If yours doesn't, you can get it from the FSF. + + Note that you'll need @code{tar} and other utilities + as well, but all UNIX systems have these. + There are GNU versions of all these available---in fact, + a complete GNU UNIX system can be put together on + most systems, if desired. + + The version of GNU @code{gzip} used to package this release + is @value{version-gzip}. + (The version of GNU @code{tar} used to package this release + is @value{version-tar}.) + + @item @file{gcc-@value{version-gcc}.tar.gz} + You need to have this, or some other applicable, version + of @code{gcc} on your system. + The version should be an exact copy of a distribution + from the FSF. + Its size is approximately 8.4MB. + + If you've already unpacked @file{gcc-@value{version-gcc}.tar.gz} into a + directory (named @file{gcc-@value{version-gcc}}) called the @dfn{source tree} + for @code{gcc}, you can delete the distribution + itself, but you'll need to remember to skip any instructions to unpack + this distribution. + + Without an applicable @code{gcc} source tree, you cannot + build @code{g77}. + You can obtain an FSF distribution of @code{gcc} from the FSF. + + @item @file{g77-@value{version-g77}.tar.gz} + You probably have already unpacked this package, + or you are reading an advance copy of these installation instructions, + which are contained in this distribution. + The size of this package is approximately 1.4MB. + + You can obtain an FSF distribution of @code{g77} from the FSF, + the same way you obtained @code{gcc}. + + @item Enough disk space + The amount of disk space needed to unpack, build, install, + and use @code{g77} depends on the type of system you're + using, how you build @code{g77}, and how much of it you + install (primarily, which languages you install). + + The sizes shown below assume all languages distributed + in @code{gcc-@value{version-gcc}}, plus @code{g77}, will be built + and installed. + These sizes are indicative of GNU/Linux systems on + Intel x86 running COFF and on Digital Alpha (AXP) systems + running ELF. + These should be fairly representative of 32-bit and 64-bit + systems, respectively. + + Note that all sizes are approximate and subject to change without + notice! + They are based on preliminary releases of g77 made shortly + before the public beta release. + + @itemize --- + @item + @code{gcc} and @code{g77} distributions occupy 10MB + packed, 40MB unpacked. + These consist of the source code and documentation, + plus some derived files (mostly documentation), for + @code{gcc} and @code{g77}. + Any deviations from these numbers for different + kinds of systems are likely to be very minor. + + @item + A ``bootstrap'' build requires an additional 91MB + for a total of 132MB on an ix86, and an additional + 136MB for a total of 177MB on an Alpha. + + @item + Removing @file{gcc/stage1} after the build recovers + 13MB for a total of 119MB on an ix86, and recovers + 21MB for a total of 155MB on an Alpha. + + After doing this, the integrity of the build can + still be verified via @samp{make compare}, and the + @code{gcc} compiler modified and used to build itself for + testing fairly quickly, using the copy of the compiler + kept in @code{gcc/stage2}. + + @item + Removing @file{gcc/stage2} after the build further + recovers 39MB for a total of 80MB, and recovers + 57MB for a total of 98MB on an Alpha. + + After doing this, the compiler can still be installed, + especially if GNU @code{make} is used to avoid + gratuitous rebuilds (or, the installation can be done + by hand). + + @item + Installing @code{gcc} and @code{g77} copies + 23MB onto the @samp{--prefix} disk for a total of 103MB + on an ix86, and copies 31MB onto the @samp{--prefix} + disk for a total of 130MB on an Alpha. + @end itemize + + After installation, if no further modifications and + builds of @code{gcc} or @code{g77} are planned, the + source and build directory may be removed, leaving + the total impact on a system's disk storage as + that of the amount copied during installation. + + Systems with the appropriate version of @code{gcc} + installed don't require the complete + bootstrap build. + Doing a ``straight build'' requires about as much + space as does a bootstrap build followed by removing + both the @file{gcc/stage1} and @file{gcc/stage2} + directories. + + Installing @code{gcc} and @code{g77} over existing + versions might require less @emph{new} disk space, + but note that, unlike many products, @code{gcc} + installs itself in a way that avoids overwriting other + installed versions of itself, so that other versions may + easily be invoked (via @samp{gcc -V @var{version}}). + + So, the amount of space saved as a result of having + an existing version of @code{gcc} and @code{g77} + already installed is not much---typically only the + command drivers (@code{gcc}, @code{g77}, @code{g++}, + and so on, which are small) and the documentation + is overwritten by the new installation. + The rest of the new installation is done without + replacing existing installed versions (assuming + they have different version numbers). + + @item @code{make} + Your system must have @code{make}, and you will probably save + yourself a lot of trouble if it is GNU @code{make} (sometimes + referred to as @code{gmake}). + In particular, you probably need GNU @code{make} + to build outside the source directory + (with @code{configure}'s @samp{--srcdir} option.) + + The version of GNU @code{make} used to develop this release + is @value{version-make}. + + @item @code{cc} + Your system must have a working C compiler. + If it doesn't, you might be able to obtain + a prebuilt binary of some version of @code{gcc} + from the network or on CD-ROM, + perhaps from the FSF@. + The best source of information about binaries + is probably a system-specific Usenet news group, + initially via its FAQ. + + @xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, + for more information on prerequisites for installing @code{gcc}. + + @item @code{sed} + All UNIX systems have @code{sed}, but some have a broken + version that cannot handle configuring, building, or + installing @code{gcc} or @code{g77}. + + The version of GNU @code{sed} used to develop this release + is @value{version-sed}. + (Note that GNU @code{sed} version 3.0 was withdrawn by the + FSF---if you happen to have this version installed, replace + it with version @value{version-sed} immediately. + See a GNU distribution site for further explanation.) + + @item @code{root} access or equivalent + To perform the complete installation procedures on a system, + you need to have @code{root} access to that system, or + equivalent access to the @samp{--prefix} directory tree + specified on the @code{configure} command line. + + Portions of the procedure (such as configuring and building + @code{g77}) can be performed by any user with enough disk + space and virtual memory. + + However, these instructions are oriented towards less-experienced + users who want to install @code{g77} on their own personal + systems. + + System administrators with more experience will want to + determine for themselves how they want to modify the + procedures described below to suit the needs of their + installation. + + @item @code{autoconf} + The version of GNU @code{autoconf} used to develop this release + is @value{version-autoconf}. + + @code{autoconf} is not needed in the typical case of + installing @code{gcc} and @code{g77}. + @xref{Missing tools?}, for information on when it + might be needed and how to work around not having it. + + @item @code{bison} + The version of GNU @code{bison} used to develop this release + is @value{version-bison}. + + @code{bison} is not needed in the typical case of + installing @code{gcc} and @code{g77}. + @xref{Missing tools?}, for information on when it + might be needed and how to work around not having it. + + @item @code{gperf} + The version of GNU @code{gperf} used to develop this release + is @value{version-gperf}. + + @code{gperf} is not needed in the typical case of + installing @code{gcc} and @code{g77}. + @xref{Missing tools?}, for information on when it + might be needed and how to work around not having it. + + @item @code{makeinfo} + The version of GNU @code{makeinfo} used to develop this release + is @value{version-makeinfo}. + + @code{makeinfo} is part of the GNU @code{texinfo} package; + @code{makeinfo} version @value{version-makeinfo} + is distributed as part of + GNU @code{texinfo} version @value{version-texinfo}. + + @code{makeinfo} is not needed in the typical case of + installing @code{gcc} and @code{g77}. + @xref{Missing tools?}, for information on when it + might be needed and how to work around not having it. + + An up-to-date version of GNU @code{makeinfo} is still convenient + when obtaining a new version of a GNU distribution such as + @code{gcc} or @code{g77}, + as it allows you to obtain the @file{.diff.gz} file + instead of the entire @file{.tar.gz} distribution + (assuming you have installed @code{patch}). + + @item @code{patch} + The version of GNU @code{patch} used to develop this release + is @value{version-patch}. + + Beginning with @code{g77} version 0.5.23, it is no longer + necessary to patch the @code{gcc} back end to build @code{g77}. + + An up-to-date version of GNU @code{patch} is still convenient + when obtaining a new version of a GNU distribution such as + @code{gcc} or @code{g77}, + as it allows you to obtain the @file{.diff.gz} file + instead of the entire @file{.tar.gz} distribution + (assuming you have installed the tools needed + to rebuild derived files, such as @code{makeinfo}). + @end table + + @node Problems Installing + @section Problems Installing + @cindex problems installing + @cindex installation problems + + This is a list of problems (and some apparent problems which don't + really mean anything is wrong) that show up when configuring, + building, installing, or porting GNU Fortran. + + @xref{Installation Problems,,,gcc,Using and Porting GNU CC}, + for more information on installation problems that can afflict + either @code{gcc} or @code{g77}. + + @menu + * General Problems:: Problems afflicting most or all systems. + * System-specific Problems:: Problems afflicting particular systems. + * Cross-compiler Problems:: Problems afflicting cross-compilation setups. + @end menu + + @node General Problems + @subsection General Problems + + These problems can occur on most or all systems. + + @menu + * GNU C Required:: Why even ANSI C is not enough. + * Patching GNU CC:: Why @code{gcc} needn't be patched. + * Building GNU CC Necessary:: Why you can't build @emph{just} Fortran. + * Missing strtoul or bsearch:: When linking @samp{f771} fails. + * Cleanup Kills Stage Directories:: For @code{g77} developers. + * LANGUAGES Macro Ignored:: Sometimes @samp{LANGUAGES} is ignored. + @end menu + + @node GNU C Required + @subsubsection GNU C Required + @cindex GNU C required + @cindex requirements, GNU C + + Compiling @code{g77} requires GNU C, not just ANSI C. + Fixing this wouldn't + be very hard (just tedious), but the code using GNU extensions to + the C language is expected to be rewritten for 0.6 anyway, + so there are no plans for an interim fix. + + This requirement does not mean you must already have @code{gcc} + installed to build @code{g77}. + As long as you have a working C compiler, you can use a + bootstrap build to automate the process of first building + @code{gcc} using the working C compiler you have, then building + @code{g77} and rebuilding @code{gcc} using that just-built @code{gcc}, + and so on. + + @node Patching GNU CC + @subsubsection Patching GNU CC + @cindex patch files + @cindex GBE + + @code{g77} no longer requires application of a patch file + to the @code{gcc} compiler tree. + In fact, no such patch file is distributed with @code{g77}. + This is as of version 0.5.23. + + @node Building GNU CC Necessary + @subsubsection Building GNU CC Necessary + @cindex gcc, building + @cindex building gcc + + It should be possible to build the runtime without building @code{cc1} + and other non-Fortran items, but, for now, an easy way to do that + is not yet established. + + @node Missing strtoul or bsearch + @subsubsection Missing strtoul or bsearch + @cindex bsearch + @cindex _bsearch + @cindex strtoul + @cindex _strtoul + @cindex undefined reference (_bsearch) + @cindex undefined reference (_strtoul) + @cindex f771, linking error for + @cindex linking error for f771 + @cindex ld error for f771 + @cindex ld can't find _bsearch + @cindex ld can't find _strtoul + @cindex SunOS4 + + On SunOS4 systems, linking the @code{f771} program used to + produce an error message concerning an undefined symbol named + @samp{_strtoul}, because the @samp{strtoul} library function + is not provided on that system. + + Other systems have, in the past, been reported to not provide + their own @samp{strtoul} or @samp{bsearch} function. + + Some versions @code{g77} tried to default to providing bare-bones + versions of @code{bsearch} and @code{strtoul} automatically, + but every attempt at this has failed for at least one kind of system. + + To limit the failures to those few systems actually missing the + required routines, the bare-bones versions are still provided, + in @file{gcc/f/proj.c}, + if the appropriate macros are defined. + These are @code{NEED_BSEARCH} for @samp{bsearch} and + @code{NEED_STRTOUL} for @samp{NEED_STRTOUL}. + + Therefore, if you are sure your system is missing + @code{bsearch} or @code{strtoul} in its library, + define the relevant macro(s) before building @code{g77}. + This can be done by editing @file{gcc/f/proj.c} and inserting + either or both of the following @samp{#define} statements + before the comment shown: + + @smallexample + /* Insert #define statements here. */ + + #define NEED_BSEARCH + #define NEED_STRTOUL + @end smallexample + + Then, continue configuring and building @code{g77} as usual. + + Or, you can define these on the @code{make} command line. + To build with the bundled @code{cc} on SunOS4, for example, try: + @smallexample + make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL' + @end smallexample + + If you then encounter problems compiling @file{gcc/f/proj.c}, + it might be due to a discrepancy between how @samp{bsearch} + or @samp{strtoul} are defined by that file and how they're + declared by your system's header files. + + In that case, you'll have to use some basic knowledge of C + to work around the problem, perhaps by editing @file{gcc/f/proj.c} + somewhat. + + @node Cleanup Kills Stage Directories + @subsubsection Cleanup Kills Stage Directories + @cindex stage directories + @cindex make clean + + It'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in} + would create the various @file{stage@var{n}} directories and their + subdirectories, so developers and expert installers wouldn't have to + reconfigure after cleaning up. + + That help has arrived as of version 0.5.23 of @code{g77}. + Configuration itself no longer creates any particular directories + that are unique to @code{g77}. + The build procedures in @file{Make-lang.in} take care of + that, on demand. + + @node LANGUAGES Macro Ignored + @subsubsection LANGUAGES Macro Ignored + @cindex @samp{LANGUAGES} macro ignored + @cindex ignoring @samp{LANGUAGES} macro + + Prior to version 0.5.23, @code{g77} would sometimes ignore + the absence of @samp{f77} and @samp{F77} in the + @samp{LANGUAGES} macro definition used for the + @code{make} command being processed. + + As of version 0.5.23, @code{g77} now obeys this macro + in all relevant situations. + + However, in versions of @code{gcc} through 2.8.1, + non-@code{g77} portions of @code{gcc}, + such as @code{g++}, + are known to go ahead and perform various + language-specific activities when their + respective language strings do not appear + in the @samp{LANGUAGES} macro in effect + during that invocation of @code{make}. + + It is expected that these remaining problems will + be fixed in a future version of @code{gcc}. + + @node System-specific Problems + @subsection System-specific Problems + + @cindex AIX + A linker bug on some versions of AIX 4.1 might prevent building. + @xref{LINKFAIL}. + + @node Cross-compiler Problems + @subsection Cross-compiler Problems + @cindex cross-compiler, problems + + @code{g77} has been in alpha testing since September of + 1992, and in public beta testing since February of 1995. + Alpha testing was done by a small number of people worldwide on a fairly + wide variety of machines, involving self-compilation in most or + all cases. + Beta testing has been done primarily via self-compilation, + but in more and more cases, cross-compilation (and ``criss-cross + compilation'', where a version of a compiler is built on one machine + to run on a second and generate code that runs on a third) has + been tried and has succeeded, to varying extents. + + Generally, @code{g77} can be ported to any configuration to which + @code{gcc}, @code{f2c}, and @code{libf2c} can be ported and made + to work together, aside from the known problems described in this + manual. + If you want to port @code{g77} to a particular configuration, + you should first make sure @code{gcc} and @code{libf2c} can be + ported to that configuration before focusing on @code{g77}, because + @code{g77} is so dependent on them. + + Even for cases where @code{gcc} and @code{libf2c} work, + you might run into problems with cross-compilation on certain machines, + for several reasons. + + @itemize @bullet + @item + There is one known bug + (a design bug to be fixed in 0.6) that prevents configuration of + @code{g77} as a cross-compiler in some cases, + though there are assumptions made during + configuration that probably make doing non-self-hosting builds + a hassle, requiring manual intervention. + + @item + @code{gcc} might still have some trouble being configured + for certain combinations of machines. + For example, it might not know how to handle floating-point + constants. + + @item + Improvements to the way @code{libg2c} is built could make + building @code{g77} as a cross-compiler easier---for example, + passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriate + ways. + + @item + There are still some challenges putting together the right + run-time libraries (needed by @code{libg2c}) for a target + system, depending on the systems involved in the configuration. + (This is a general problem with cross-compilation, and with + @code{gcc} in particular.) + @end itemize + + @node Settings + @section Changing Settings Before Building + + Here are some internal @code{g77} settings that can be changed + by editing source files in @file{gcc/f/} before building. + + This information, and perhaps even these settings, represent + stop-gap solutions to problems people doing various ports + of @code{g77} have encountered. + As such, none of the following information is expected to + be pertinent in future versions of @code{g77}. + + @menu + * Larger File Unit Numbers:: Raising @samp{MXUNIT}. + * Always Flush Output:: Synchronizing write errors. + * Maximum Stackable Size:: Large arrays forced off the stack. + * Floating-point Bit Patterns:: Possible programs building @code{g77} + as a cross-compiler. + * Large Initialization:: Large arrays with @code{DATA} + initialization. + * Alpha Problems Fixed:: Problems with 64-bit systems like + Alphas now fixed? + @end menu + + @node Larger File Unit Numbers + @subsection Larger File Unit Numbers + @cindex MXUNIT + @cindex unit numbers + @cindex maximum unit number + @cindex illegal unit number + @cindex increasing maximum unit number + + As distributed, whether as part of @code{f2c} or @code{g77}, + @code{libf2c} accepts file unit numbers only in the range + 0 through 99. + For example, a statement such as @samp{WRITE (UNIT=100)} causes + a run-time crash in @code{libf2c}, because the unit number, + 100, is out of range. + + If you know that Fortran programs at your installation require + the use of unit numbers higher than 99, you can change the + value of the @samp{MXUNIT} macro, which represents the maximum unit + number, to an appropriately higher value. + + To do this, edit the file @file{f/runtime/libI77/fio.h} in your + @code{g77} source tree, changing the following line: + + @example + #define MXUNIT 100 + @end example + + Change the line so that the value of @samp{MXUNIT} is defined to be + at least one @emph{greater} than the maximum unit number used by + the Fortran programs on your system. + + (For example, a program that does @samp{WRITE (UNIT=255)} would require + @samp{MXUNIT} set to at least 256 to avoid crashing.) + + Then build or rebuild @code{g77} as appropriate. + + @emph{Note:} Changing this macro has @emph{no} effect on other limits + your system might place on the number of files open at the same time. + That is, the macro might allow a program to do @samp{WRITE (UNIT=100)}, + but the library and operating system underlying @code{libf2c} might + disallow it if many other files have already been opened (via @code{OPEN} or + implicitly via @code{READ}, @code{WRITE}, and so on). + Information on how to increase these other limits should be found + in your system's documentation. + + @node Always Flush Output + @subsection Always Flush Output + @cindex ALWAYS_FLUSH + @cindex synchronous write errors + @cindex disk full + @cindex flushing output + @cindex fflush() + @cindex I/O, flushing + @cindex output, flushing + @cindex writes, flushing + @cindex NFS + @cindex network file system + + Some Fortran programs require output + (writes) to be flushed to the operating system (under UNIX, + via the @code{fflush()} library call) so that errors, + such as disk full, are immediately flagged via the relevant + @code{ERR=} and @code{IOSTAT=} mechanism, instead of such + errors being flagged later as subsequent writes occur, forcing + the previously written data to disk, or when the file is + closed. + + Essentially, the difference can be viewed as synchronous error + reporting (immediate flagging of errors during writes) versus + asynchronous, or, more precisely, buffered error reporting + (detection of errors might be delayed). + + @code{libg2c} supports flagging write errors immediately when + it is built with the @samp{ALWAYS_FLUSH} macro defined. + This results in a @code{libg2c} that runs slower, sometimes + quite a bit slower, under certain circumstances---for example, + accessing files via the networked file system NFS---but the + effect can be more reliable, robust file I/O. + + If you know that Fortran programs requiring this level of precision + of error reporting are to be compiled using the + version of @code{g77} you are building, you might wish to + modify the @code{g77} source tree so that the version of + @code{libg2c} is built with the @samp{ALWAYS_FLUSH} macro + defined, enabling this behavior. + + To do this, find this line in @file{f/runtime/f2c.h} in + your @code{g77} source tree: + + @example + /* #define ALWAYS_FLUSH */ + @end example + + Remove the leading @samp{/*@w{ }}, + so the line begins with @samp{#define}, + and the trailing @samp{@w{ }*/}. + + Then build or rebuild @code{g77} as appropriate. + + @node Maximum Stackable Size + @subsection Maximum Stackable Size + @vindex FFECOM_sizeMAXSTACKITEM + @cindex code, stack variables + @cindex maximum stackable size + @cindex stack allocation + @cindex segmentation violation + @code{g77}, on most machines, puts many variables and arrays on the stack + where possible, and can be configured (by changing + @samp{FFECOM_sizeMAXSTACKITEM} in @file{gcc/f/com.c}) to force + smaller-sized entities into static storage (saving + on stack space) or permit larger-sized entities to be put on the + stack (which can improve run-time performance, as it presents + more opportunities for the GBE to optimize the generated code). + + @emph{Note:} Putting more variables and arrays on the stack + might cause problems due to system-dependent limits on stack size. + Also, the value of @samp{FFECOM_sizeMAXSTACKITEM} has no + effect on automatic variables and arrays. + @xref{But-bugs}, for more information. + + @node Floating-point Bit Patterns + @subsection Floating-point Bit Patterns + + @cindex cross-compiler, building + @cindex floating-point bit patterns + @cindex bit patterns + The @code{g77} build will crash if an attempt is made to build + it as a cross-compiler + for a target when @code{g77} cannot reliably determine the bit pattern of + floating-point constants for the target. + Planned improvements for version 0.6 of @code{g77} + will give it the capabilities it needs to not have to crash the build + but rather generate correct code for the target. + (Currently, @code{g77} + would generate bad code under such circumstances if it didn't crash + during the build, e.g. when compiling a source file that does + something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.) + + @node Large Initialization + @subsection Initialization of Large Aggregate Areas + + @cindex speed, compiler + @cindex slow compiler + @cindex memory utilization + @cindex large initialization + @cindex aggregate initialization + A warning message is issued when @code{g77} sees code that provides + initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON} + or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER} + variable) + that is large enough to increase @code{g77}'s compile time by roughly + a factor of 10. + + This size currently is quite small, since @code{g77} + currently has a known bug requiring too much memory + and time to handle such cases. + In @file{gcc/f/data.c}, the macro + @samp{FFEDATA_sizeTOO_BIG_INIT_} is defined + to the minimum size for the warning to appear. + The size is specified in storage units, + which can be bytes, words, or whatever, on a case-by-case basis. + + After changing this macro definition, you must + (of course) rebuild and reinstall @code{g77} for + the change to take effect. + + Note that, as of version 0.5.18, improvements have + reduced the scope of the problem for @emph{sparse} + initialization of large arrays, especially those + with large, contiguous uninitialized areas. + However, the warning is issued at a point prior to + when @code{g77} knows whether the initialization is sparse, + and delaying the warning could mean it is produced + too late to be helpful. + + Therefore, the macro definition should not be adjusted to + reflect sparse cases. + Instead, adjust it to generate the warning when densely + initialized arrays begin to cause responses noticeably slower + than linear performance would suggest. + + @node Alpha Problems Fixed + @subsection Alpha Problems Fixed + + @cindex Alpha, support + @cindex 64-bit systems + @code{g77} used to warn when it was used to compile Fortran code + for a target configuration that is not basically a 32-bit + machine (such as an Alpha, which is a 64-bit machine, especially + if it has a 64-bit operating system running on it). + That was because @code{g77} was known to not work + properly on such configurations. + + As of version 0.5.20, @code{g77} is believed to work well + enough on such systems. + So, the warning is no longer needed or provided. + + However, support for 64-bit systems, especially in + areas such as cross-compilation and handling of + intrinsics, is still incomplete. + The symptoms + are believed to be compile-time diagnostics rather + than the generation of bad code. + It is hoped that version 0.6 will completely support 64-bit + systems. + + @node Quick Start + @section Quick Start + @cindex quick start + + This procedure configures, builds, and installs @code{g77} + ``out of the box'' and works on most UNIX systems. + Each command is identified by a unique number, + used in the explanatory text that follows. + For the most part, the output of each command is not shown, + though indications of the types of responses are given in a + few cases. + + To perform this procedure, the installer must be logged + in as user @code{root}. + Much of it can be done while not logged in as @code{root}, + and users experienced with UNIX administration should be + able to modify the procedure properly to do so. + + Following traditional UNIX conventions, it is assumed that + the source trees for @code{g77} and @code{gcc} will be + placed in @file{/usr/src}. + It also is assumed that the source distributions themselves + already reside in @file{/usr/FSF}, a naming convention + used by the author of @code{g77} on his own system: + + @example + /usr/FSF/gcc-@value{version-gcc}.tar.gz + /usr/FSF/g77-@value{version-g77}.tar.gz + @end example + + @c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or + @c the equivalent of it obtained by applying the + @c patch distributed as @file{gcc-2.7.2-2.7.2.1.diff.gz} + @c to version 2.7.2 of @code{gcc}, + @c if you remember to make the appropriate adjustments in the + @c instructions below.) + + @c @cindex SunOS4 + @c Users of the following systems should not blindly follow + @c these quick-start instructions, because of problems their + @c systems have coping with straightforward installation of + @c @code{g77}: + @c + @c @itemize @bullet + @c @item + @c SunOS4 + @c @end itemize + @c + @c Instead, see @ref{Complete Installation}, for detailed information + @c on how to configure, build, and install @code{g77} for your + @c particular system. + @c Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran}, + @c for information on bugs and other problems known to afflict the + @c installation process, and how to report newly discovered ones. + @c + @c If your system is @emph{not} on the above list, and @emph{is} + @c a UNIX system or one of its variants, you should be able to + @c follow the instructions below. + + If you vary @emph{any} of the steps below, you might run into + trouble, including possibly breaking existing programs for + other users of your system. + Before doing so, it is wise to review the explanations of some + of the steps. + These explanations follow this list of steps. + + @example + sh[ 1]# @kbd{cd /usr/src} + @set source-dir 1 + sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -} + [Might say "Broken pipe"...that is normal on some systems.] + @set unpack-gcc 2 + sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} + ["Broken pipe" again possible.] + @set unpack-g77 3 + sh[ 4]# @kbd{ln -s gcc-@value{version-gcc} gcc} + @set link-gcc 4 + sh[ 5]# @kbd{ln -s g77-@value{version-g77} g77} + @set link-g77 5 + sh[ 6]# @kbd{mv -i g77/* gcc} + [No questions should be asked by mv here; or, you made a mistake.] + @set merge-g77 6 + sh[ 7]# @kbd{cd gcc} + sh[ 8]# @kbd{./configure --prefix=/usr} + [Do not do the above if gcc is not installed in /usr/bin. + You might need a different @kbd{--prefix=@dots{}}, as + described below.] + @set configure-gcc 8 + sh[ 9]# @kbd{make bootstrap} + [This takes a long time, and is where most problems occur.] + @set build-gcc 9 + sh[10]# @kbd{make compare} + [This verifies that the compiler is `sane'. + If any files are printed, you have likely found a g77 bug.] + @set compare-gcc 10 + sh[11]# @kbd{rm -fr stage1} + @set rm-stage1 11 + sh[12]# @kbd{make -k install} + [The actual installation.] + @set install-g77 12 + sh[13]# @kbd{g77 -v} + [Verify that g77 is installed, obtain version info.] + @set show-version 13 + sh[14]# + @set end-procedure 14 + @end example + + @xref{Updating Documentation,,Updating Your Info Directory}, for + information on how to update your system's top-level @code{info} + directory to contain a reference to this manual, so that + users of @code{g77} can easily find documentation instead + of having to ask you for it. + + Elaborations of many of the above steps follows: + + @table @asis + @item Step @value{source-dir}: @kbd{cd /usr/src} + You can build @code{g77} pretty much anyplace. + By convention, this manual assumes @file{/usr/src}. + It might be helpful if other users on your system + knew where to look for the source code for the + installed version of @code{g77} and @code{gcc} in any case. + + @c @item Step @value{unpack-gcc}: @kbd{gunzip -d @dots{}} + @c Here, you might wish to use @file{gcc-2.7.2.1.tar.gz} + @c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve + @c similar results. + + @item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} + It is not always necessary to obtain the latest version of + @code{g77} as a complete @file{.tar.gz} file if you have + a complete, earlier distribution of @code{g77}. + If appropriate, you can unpack that earlier + version of @code{g77}, and then apply the appropriate patches + to achieve the same result---a source tree containing version + @value{version-g77} of @code{g77}. + + @item Step @value{link-gcc}: @kbd{ln -s gcc-@value{version-gcc} gcc} + @item Step @value{link-g77}: @kbd{ln -s g77-@value{version-g77} g77} + These commands mainly help reduce typing, + and help reduce visual clutter in examples + in this manual showing what to type to install @code{g77}. + + @c Of course, if appropriate, @kbd{ln -s gcc-2.7.2.1 gcc} or + @c similar. + + @xref{Unpacking}, for information on + using distributions of @code{g77} made by organizations + other than the FSF. + + @item Step @value{merge-g77}: @kbd{mv -i g77/* gcc} + After doing this, you can, if you like, type + @samp{rm g77} and @samp{rmdir g77-@value{version-g77}} to remove + the empty directory and the symbol link to it. + But, it might be helpful to leave them around as + quick reminders of which version(s) of @code{g77} are + installed on your system. + + @xref{Unpacking}, for information + on the contents of the @file{g77} directory (as merged + into the @file{gcc} directory). + + @item Step @value{configure-gcc}: @kbd{./configure --prefix=/usr} + This is where you specify that + the @file{g77} and @file{gcc} executables are to be + installed in @file{/usr/bin/}, + the @code{g77} and @code{gcc} documentation is + to be installed in @file{/usr/info/} and @file{/usr/man/}, + and so on. + + You should ensure that any existing installation of the @file{gcc} + executable is in @file{/usr/bin/}. + + However, if that existing version of @code{gcc} is not @value{version-gcc}, + or if you simply wish to avoid risking overwriting it with a + newly built copy of the same version, + you can specify @samp{--prefix=/usr/local} + (which is the default) + or some other path, + and invoke the newly installed version + directly from that path's @file{bin} directory. + + @xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?}, + for more information on determining where to install @code{g77}. + @xref{Configuring gcc}, for more information on the + configuration process triggered by invoking the @file{./configure} + script. + + @item Step @value{build-gcc}: @kbd{make bootstrap} + @xref{Installation,,Installing GNU CC, + gcc,Using and Porting GNU CC}, for information + on the kinds of diagnostics you should expect during + this procedure. + + @xref{Building gcc}, for complete @code{g77}-specific + information on this step. + + @item Step @value{compare-gcc}: @kbd{make compare} + @xref{Bug Lists,,Where to Port Bugs}, for information + on where to report that you observed files + having different contents during this + phase. + + @xref{Bug Reporting,,How to Report Bugs}, for + information on @emph{how} to report bugs like this. + + @item Step @value{rm-stage1}: @kbd{rm -fr stage1} + You don't need to do this, but it frees up disk space. + + @item Step @value{install-g77}: @kbd{make -k install} + If this doesn't seem to work, try: + + @example + make -k install install-libf77 + @end example + + Or, make sure you're using GNU @code{make}. + + @xref{Installation of Binaries}, for more information. + + @xref{Updating Documentation,,Updating Your Info Directory}, + for information on entering this manual into your + system's list of texinfo manuals. + + @item Step @value{show-version}: @kbd{g77 -v} + If this command prints approximately 25 lines of output, + including the GNU Fortran Front End version number (which + should be the same as the version number for the version + of @code{g77} you just built and installed) and the + version numbers for the three parts of the @code{libf2c} + library (@code{libF77}, @code{libI77}, @code{libU77}), and + those version numbers are all in agreement, then there is + a high likelihood that the installation has been successfully + completed. + + You might consider doing further testing. + For example, log in as a non-privileged user, then create + a small Fortran program, such as: + + @example + PROGRAM SMTEST + DO 10 I=1, 10 + PRINT *, 'Hello World #', I + 10 CONTINUE + END + @end example + + Compile, link, and run the above program, and, assuming you named + the source file @file{smtest.f}, the session should look like this: + + @example + sh# @kbd{g77 -o smtest smtest.f} + sh# @kbd{./smtest} + Hello World # 1 + Hello World # 2 + Hello World # 3 + Hello World # 4 + Hello World # 5 + Hello World # 6 + Hello World # 7 + Hello World # 8 + Hello World # 9 + Hello World # 10 + sh# + @end example + + If invoking @code{g77} doesn't seem to work, + the problem might be that you've installed it in + a location that is not in your shell's search path. + For example, if you specified @samp{--prefix=/gnu}, + and @file{/gnu/bin} is not in your @code{PATH} + environment variable, + you must explicitly specify the location of the compiler + via @kbd{/gnu/bin/g77 -o smtest smtest.f}. + + After proper installation, you don't + need to keep your gcc and g77 source and build directories + around anymore. + Removing them can free up a lot of disk space. + @end table + + @node Complete Installation + @section Complete Installation + + Here is the complete @code{g77}-specific information on how + to configure, build, and install @code{g77}. + + @menu + * Unpacking:: + * Merging Distributions:: + * Where to Install:: + * Configuring gcc:: + * Building gcc:: + * Pre-installation Checks:: + * Installation of Binaries:: + * Updating Documentation:: + * Missing tools?:: + @end menu + + @node Unpacking + @subsection Unpacking + @cindex unpacking distributions + @cindex distributions, unpacking + @cindex code, source + @cindex source code + @cindex source tree + @cindex packages + + The @code{gcc} source distribution is a stand-alone distribution. + It is designed to be unpacked (producing the @code{gcc} + source tree) and built as is, assuming certain + prerequisites are met (including the availability of compatible + UNIX programs such as @code{make}, @code{cc}, and so on). + + However, before building @code{gcc}, you will want to unpack + and merge the @code{g77} distribution in with it, so that you + build a Fortran-capable version of @code{gcc}, which includes + the @code{g77} command, the necessary run-time libraries, + and this manual. + + Unlike @code{gcc}, the @code{g77} source distribution + is @emph{not} a stand-alone distribution. + It is designed to be unpacked and, afterwards, immediately merged + into an applicable @code{gcc} source tree. + That is, the @code{g77} distribution @emph{augments} a + @code{gcc} distribution---without @code{gcc}, generally + only the documentation is immediately usable. + + A sequence of commands typically used to unpack @code{gcc} + and @code{g77} is: + + @example + sh# @kbd{cd /usr/src} + sh# @kbd{gunzip -c /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -} + sh# @kbd{gunzip -c /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} + sh# @kbd{ln -s gcc-@value{version-gcc} gcc} + sh# @kbd{ln -s g77-@value{version-g77} g77} + sh# @kbd{mv -i g77/* gcc} + @end example + + @emph{Notes:} The commands beginning with @samp{gunzip@dots{}} might + print @samp{Broken pipe@dots{}} as they complete. + That is nothing to worry about, unless you actually + @emph{hear} a pipe breaking. + The @code{ln} commands are helpful in reducing typing + and clutter in installation examples in this manual. + Hereafter, the top level of @code{gcc} source tree is referred to + as @file{gcc}, and the top level of just the @code{g77} + source tree (prior to issuing the @code{mv} command, above) + is referred to as @file{g77}. + + There are three top-level names in a @code{g77} distribution: + + @example + g77/COPYING.g77 + g77/README.g77 + g77/f + @end example + + All three entries should be moved (or copied) into a @code{gcc} + source tree (typically named after its version number and + as it appears in the FSF distributions---e.g. @file{gcc-@value{version-gcc}}). + + @file{g77/f} is the subdirectory containing all of the + code, documentation, and other information that is specific + to @code{g77}. + The other two files exist to provide information on @code{g77} + to someone encountering a @code{gcc} source tree with @code{g77} + already present, who has not yet read these installation + instructions and thus needs help understanding that the + source tree they are looking at does not come from a single + FSF distribution. + They also help people encountering an unmerged @code{g77} source + tree for the first time. + + @cindex modifying @code{g77} + @cindex code, modifying + @cindex Pentium optimizations + @cindex optimizations, Pentium + @emph{Note:} Please use @strong{only} @code{gcc} and @code{g77} + source trees as distributed by the FSF. + Use of modified versions is likely to result in problems that appear to be + in the @code{g77} code but, in fact, are not. + Do not use such modified versions + unless you understand all the differences between them and the versions + the FSF distributes---in which case you should be able to modify the + @code{g77} (or @code{gcc}) source trees appropriately so @code{g77} + and @code{gcc} can coexist as they do in the stock FSF distributions. + + @node Merging Distributions + @subsection Merging Distributions + @cindex merging distributions + @cindex @code{gcc} versions supported by @code{g77} + @cindex versions of @code{gcc} + @cindex support for @code{gcc} versions + + After merging the @code{g77} source tree into the @code{gcc} source tree, + you have put together a complete @code{g77} source tree. + + @cindex gcc version numbering + @cindex version numbering + @cindex g77 version number + @cindex GNU version numbering + As of version 0.5.23, @code{g77} no longer modifies + the version number of @code{gcc}, + nor does it patch @code{gcc} itself. + + @code{g77} still depends on being merged with an + appropriate version of @code{gcc}. + For version @value{version-g77} of @code{g77}, + the specific version of @code{gcc} supported is @value{version-gcc}. + + However, other versions of @code{gcc} might be suitable + ``hosts'' for this version of @code{g77}. + + GNU version numbers make it easy to figure out whether a + particular version of a distribution is newer or older than + some other version of that distribution. + The format is, + generally, @var{major}.@var{minor}.@var{patch}, with + each field being a decimal number. + (You can safely ignore + leading zeros; for example, 1.5.3 is the same as 1.5.03.) + The @var{major} field only increases with time. + The other two fields are reset to 0 when the field to + their left is incremented; otherwise, they, too, only + increase with time. + So, version 2.6.2 is newer than version 2.5.8, and + version 3.0 is newer than both. + (Trailing @samp{.0} fields often are omitted in + announcements and in names for distributions and + the directories they create.) + + If your version of @code{gcc} is older than the oldest version + supported by @code{g77} + (as casually determined by listing the contents of @file{gcc/f/INSTALL/}, + which contains these installation instructions in plain-text format), + you should obtain a newer, supported version of @code{gcc}. + (You could instead obtain an older version of @code{g77}, + or try and get your @code{g77} to work with the old + @code{gcc}, but neither approach is recommended, and + you shouldn't bother reporting any bugs you find if you + take either approach, because they're probably already + fixed in the newer versions you're not using.) + + If your version of @code{gcc} is newer than the newest version + supported by @code{g77}, it is possible that your @code{g77} + will work with it anyway. + If the version number for @code{gcc} differs only in the + @var{patch} field, you might as well try that version of @code{gcc}. + Since it has the same @var{major} and @var{minor} fields, + the resulting combination is likely to work. + + So, for example, if a particular version of @code{g77} has support for + @code{gcc} versions 2.8.0 and 2.8.1, + it is likely that @file{gcc-2.8.2} would work well with @code{g77}. + + However, @file{gcc-2.9.0} would almost certainly + not work with that version of @code{g77} + without appropriate modifications, + so a new version of @code{g77} would be needed (and you should + wait for it rather than bothering the maintainers---@pxref{Changes,, + User-Visible Changes}). + + @cindex distributions, why separate + @cindex separate distributions + @cindex why separate distributions + This complexity is the result of @code{gcc} and @code{g77} being + separate distributions. + By keeping them separate, each product is able to be independently + improved and distributed to its user base more frequently. + + However, the GBE interface defined by @code{gcc} typically + undergoes some incompatible changes at least every time the + @var{minor} field of the version number is incremented, + and such changes require corresponding changes to + the @code{g77} front end (FFE). + + @c @pindex config-lang.in + @c @emph{Note:} @code{g77}'s configuration file @file{gcc/f/config-lang.in} + @c sometimes ensures that the source code for the version of @code{gcc} + @c being configured has at least one indication of being an appropriate + @c version as required specifically by @code{g77}. + @c This configuration-time + @c checking should catch failures to use the proper version of @code{gcc} and, + @c if so caught, should abort the configuration with an explanation. + @c @emph{Please} do not try to disable this check, + @c otherwise @code{g77} might well appear to build + @c and install correctly, and even appear to compile correctly, + @c but could easily produce broken code. + + @node Where to Install + @subsection Where in the World Does Fortran (and GNU CC) Go? + @cindex language f77 not recognized + @cindex gcc will not compile Fortran programs + + Before configuring, you should make sure you know + where you want the @code{g77} and @code{gcc} + binaries to be installed after they're built, + because this information is given to the configuration + tool and used during the build itself. + + A @code{g77} installation normally includes installation of + a Fortran-aware version of @code{gcc}, so that the @code{gcc} + command recognizes Fortran source files and knows how to compile + them. + + For this to work, the version of @code{gcc} that you will be building + as part of @code{g77} @strong{must} be installed as the ``active'' + version of @code{gcc} on the system. + + Sometimes people make the mistake of installing @code{gcc} as + @file{/usr/local/bin/gcc}, + leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}. + (Or, the opposite happens.) + This can result in @code{gcc} being unable to compile Fortran + source files, + because when the older version of @code{gcc} is invoked, + it complains that it does not + recognize the language, or the file name suffix. + + So, determine whether @code{gcc} already is installed on your system, + and, if so, @emph{where} it is installed, and prepare to configure the + new version of @code{gcc} you'll be building so that it installs + over the existing version of @code{gcc}. + + You might want to back up your existing copy of @file{/usr/bin/gcc}, and + the entire @file{/usr/lib} directory, before + you perform the actual installation (as described in this manual). + + Existing @code{gcc} installations typically are + found in @file{/usr} or @file{/usr/local}. + (This means the commands are installed in @file{/usr/bin} or + @file{/usr/local/bin}, + the libraries in @file{/usr/lib} or @file{/usr/local/lib}, + and so on.) + + If you aren't certain where the currently + installed version of @code{gcc} and its + related programs reside, look at the output + of this command: + + @example + gcc -v -o /tmp/delete-me -xc /dev/null -xnone + @end example + + All sorts of interesting information on the locations of various + @code{gcc}-related programs and data files should be visible + in the output of the above command. + (The output also is likely to include a diagnostic from + the linker, since there's no @samp{main_()} function.) + However, you do have to sift through it yourself; @code{gcc} + currently provides no easy way to ask it where it is installed + and where it looks for the various programs and data files it + calls on to do its work. + + Just @emph{building} @code{g77} should not overwrite any installed + programs---but, usually, after you build @code{g77}, you will want + to install it, so backing up anything it might overwrite is + a good idea. + (This is true for any package, not just @code{g77}, + though in this case it is intentional that @code{g77} overwrites + @code{gcc} if it is already installed---it is unusual that + the installation process for one distribution intentionally + overwrites a program or file installed by another distribution, + although, in this case, @code{g77} is an augmentation of the + @code{gcc} distribution.) + + Another reason to back up the existing version first, + or make sure you can restore it easily, is that it might be + an older version on which other users have come to depend + for certain behaviors. + However, even the new version of @code{gcc} you install + will offer users the ability to specify an older version of + the actual compilation programs if desired, and these + older versions need not include any @code{g77} components. + @xref{Target Options,,Specifying Target Machine and Compiler Version, + gcc,Using and Porting GNU CC}, for information on the @samp{-V} + option of @code{gcc}. + + @node Configuring gcc + @subsection Configuring GNU CC + + @code{g77} is configured automatically when you configure + @code{gcc}. + There are two parts of @code{g77} that are configured in two + different ways---@code{g77}, which ``camps on'' to the + @code{gcc} configuration mechanism, and @code{libg2c}, which + uses a variation of the GNU @code{autoconf} configuration + system. + + Generally, you shouldn't have to be concerned with + either @code{g77} or @code{libg2c} configuration, unless + you're configuring @code{g77} as a cross-compiler. + In this case, the @code{libg2c} configuration, and possibly the + @code{g77} and @code{gcc} configurations as well, + might need special attention. + (This also might be the case if you're porting @code{gcc} to + a whole new system---even if it is just a new operating system + on an existing, supported CPU.) + + To configure the system, see + @ref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, + following the instructions for running @file{./configure}. + Pay special attention to the @samp{--prefix=} option, which + you almost certainly will need to specify. + + (Note that @code{gcc} installation information is provided + as a plain-text file in @file{gcc/INSTALL}.) + + The information printed by the invocation of @file{./configure} + should show that the @file{f} directory (the Fortran language) + has been configured. + If it does not, there is a problem. + + @emph{Note:} Configuring with the @samp{--srcdir} argument, + or by starting in an empty directory + and typing a command such as @kbd{../gcc/configure} to + build with separate build and source directories, + is known to work with GNU @code{make}, + but it is known to not work with other variants of @code{make}. + Irix5.2 and SunOS4.1 versions of @code{make} definitely + won't work outside the source directory at present. + + @code{g77}'s portion of the @file{configure} script + used to issue a warning message about this + when configuring for building binaries outside the source directory, + but no longer does this as of version 0.5.23. + + Instead, @code{g77} simply rejects most common attempts + to build it using a non-GNU @code{make} when the + build directory is not the same as the source directory, + issuing an explanatory diagnostic. + + @node Building gcc + @subsection Building GNU CC + @cindex building @code{gcc} + @cindex building @code{g77} + + @vindex LANGUAGES + Building @code{g77} requires building enough of @code{gcc} that + these instructions assume you're going to build all of + @code{gcc}, including @code{g++}, @code{protoize}, and so on. + You can save a little time and disk space by changes the + @samp{LANGUAGES} macro definition in @code{gcc/Makefile.in} + or @code{gcc/Makefile}, but if you do that, you're on your own. + One change is almost @emph{certainly} going to cause failures: + removing @samp{c} or @samp{f77} from the definition of the + @samp{LANGUAGES} macro. + + After configuring @code{gcc}, which configures @code{g77} and + @code{libg2c} automatically, you're ready to start the actual + build by invoking @code{make}. + + @pindex configure + @emph{Note:} You @strong{must} have run the @file{configure} + script in @code{gcc} before you run @code{make}, + even if you're using an already existing @code{gcc} development directory, + because @file{./configure} does the work to recognize that you've added + @code{g77} to the configuration. + + There are two general approaches to building GNU CC from + scratch: + + @table @dfn + @item bootstrap + This method uses minimal native system facilities to + build a barebones, unoptimized @code{gcc}, that is then + used to compile (``bootstrap'') the entire system. + + @item straight + This method assumes a more complete native system + exists, and uses that just once to build the entire + system. + @end table + + On all systems without a recent version of @code{gcc} + already installed, the @i{bootstrap} method must be + used. + In particular, @code{g77} uses extensions to the C + language offered, apparently, only by @code{gcc}. + + On most systems with a recent version of @code{gcc} + already installed, the @i{straight} method can be + used. + This is an advantage, because it takes less CPU time + and disk space for the build. + However, it does require that the system have fairly + recent versions of many GNU programs and other + programs, which are not enumerated here. + + @menu + * Bootstrap Build:: For all systems. + * Straight Build:: For systems with a recent version of @code{gcc}. + @end menu + + @node Bootstrap Build + @subsubsection Bootstrap Build + @cindex bootstrap build + @cindex build, bootstrap + + A complete bootstrap build is done by issuing a command + beginning with @samp{make bootstrap @dots{}}, as + described in @ref{Installation,,Installing GNU CC, + gcc,Using and Porting GNU CC}. + This is the most reliable form of build, but it does require + the most disk space and CPU time, since the complete system + is built twice (in Stages 2 and 3), after an initial build + (during Stage 1) of a minimal @code{gcc} compiler using + the native compiler and libraries. + + You might have to, or want to, control the way a bootstrap + build is done by entering the @code{make} commands to build + each stage one at a time, as described in the @code{gcc} + manual. + For example, to save time or disk space, you might want + to not bother doing the Stage 3 build, in which case you + are assuming that the @code{gcc} compiler you have built + is basically sound (because you are giving up the opportunity + to compare a large number of object files to ensure they're + identical). + + To save some disk space during installation, after Stage 2 + is built, you can type @samp{rm -fr stage1} to remove the + binaries built during Stage 1. + + Also, @xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, + for important information on building @code{gcc} that is + not described in this @code{g77} manual. + For example, explanations of diagnostic messages + and whether they're expected, or indicate trouble, + are found there. + + @node Straight Build + @subsubsection Straight Build + @cindex straight build + @cindex build, straight + + If you have a recent version of @code{gcc} + already installed on your system, and if you're + reasonably certain it produces code that is + object-compatible with the version of @code{gcc} + you want to build as part of building @code{g77}, + you can save time and disk space by doing a straight + build. + + To build just the compilers along with the + necessary run-time libraries, issue the following + command: + + @example + make -k CC=gcc + @end example + + If you run into problems using this method, you have + two options: + + @itemize @bullet + @item + Abandon this approach and do a bootstrap build. + + @item + Try to make this approach work by diagnosing the + problems you're running into and retrying. + @end itemize + + Especially if you do the latter, you might consider + submitting any solutions as bug/fix reports. + @xref{Trouble,,Known Causes of Trouble with GNU Fortran}. + + However, understand that many problems preventing a + straight build from working are not @code{g77} problems, + and, in such cases, are not likely to be addressed in + future versions of @code{g77}. + Consider treating them as @code{gcc} bugs instead. + + @node Pre-installation Checks + @subsection Pre-installation Checks + @cindex pre-installation checks + @cindex installing, checking before + + Before installing the system, which includes installing + @code{gcc}, you might want to do some minimum checking + to ensure that some basic things work. + + Here are some commands you can try, and output typically + printed by them when they work: + + @example + sh# @kbd{cd /usr/src/gcc} + sh# @kbd{./g77 -B./ -v} + g77 version @value{version-g77} + Driving: ./g77 -B./ -v -c -xf77-version /dev/null -xnone + Reading specs from ./specs + gcc version @value{version-gcc} + cpp -lang-c -v -isystem ./include -undef -D__GNUC__=2 @dots{} + GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF) + #include "..." search starts here: + #include <...> search starts here: + include + /usr/alpha-linux/include + /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include + /usr/include + End of search list. + ./f771 -fnull-version -quiet -dumpbase g77-version.f -version @dots{} + GNU F77 version @value{version-gcc} (alpha-linux) compiled @dots{} + GNU Fortran Front End version @value{version-g77} + as -nocpp -o /tmp/cca14485.o /tmp/cca14485.s + ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{} + /tmp/cca14485 + __G77_LIBF77_VERSION__: @value{version-g77} + @@(#)LIBF77 VERSION 19970919 + __G77_LIBI77_VERSION__: @value{version-g77} + @@(#) LIBI77 VERSION pjw,dmg-mods 19980405 + __G77_LIBU77_VERSION__: @value{version-g77} + @@(#) LIBU77 VERSION 19970919 + sh# @kbd{./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone} + Reading specs from ./specs + gcc version @value{version-gcc} + ./cpp -lang-c -v -isystem ./include -undef @dots{} + GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF) + #include "..." search starts here: + #include <...> search starts here: + include + /usr/alpha-linux/include + /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include + /usr/include + End of search list. + ./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version @dots{} + GNU C version @value{version-gcc} (alpha-linux) compiled @dots{} + as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s + ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{} + /usr/lib/crt1.o: In function `_start': + ../sysdeps/alpha/elf/start.S:77: undefined reference to `main' + ../sysdeps/alpha/elf/start.S:77: undefined reference to `main' + sh# + @end example + + (Note that long lines have been truncated, and @samp{@dots{}} + used to indicate such truncations.) + + The above two commands test whether @code{g77} and @code{gcc}, + respectively, are able to compile empty (null) source files, + whether invocation of the C preprocessor works, whether libraries + can be linked, and so on. + + If the output you get from either of the above two commands + is noticeably different, especially if it is shorter or longer + in ways that do not look consistent with the above sample + output, you probably should not install @code{gcc} and @code{g77} + until you have investigated further. + + For example, you could try compiling actual applications and + seeing how that works. + (You might want to do that anyway, even if the above tests + work.) + + To compile using the not-yet-installed versions of @code{gcc} + and @code{g77}, use the following commands to invoke them. + + To invoke @code{g77}, type: + + @example + /usr/src/gcc/g77 -B/usr/src/gcc/ @dots{} + @end example + + To invoke @code{gcc}, type: + + @example + /usr/src/gcc/xgcc -B/usr/src/gcc/ @dots{} + @end example + + @node Installation of Binaries + @subsection Installation of Binaries + @cindex installation of binaries + @cindex @code{g77}, installation of + @cindex @code{gcc}, installation of + + After configuring, building, and testing @code{g77} and @code{gcc}, + when you are ready to install them on your system, type: + + @example + make -k CC=gcc install + @end example + + As described in @ref{Installation,,Installing GNU CC, + gcc,Using and Porting GNU CC}, the values for + the @samp{CC} and @samp{LANGUAGES} macros should + be the same as those you supplied for the build + itself. + + So, the details of the above command might vary + if you used a bootstrap build (where you might be + able to omit both definitions, or might have to + supply the same definitions you used when building + the final stage) or if you deviated from the + instructions for a straight build. + + If the above command does not install @file{libg2c.a} + as expected, try this: + + @example + make -k @dots{} install install-libf77 + @end example + + We don't know why some non-GNU versions of @code{make} sometimes + require this alternate command, but they do. + (Remember to supply the appropriate definition for @samp{CC} + where you see @samp{@dots{}} in the above command.) + + Note that using the @samp{-k} option tells @code{make} to + continue after some installation problems, like not having + @code{makeinfo} installed on your system. + It might not be necessary for your system. + + @emph{Note:} @code{g77} no longer installs + files not directly part of @code{g77}, + such as @file{/usr/bin/f77}, @file{/usr/lib/libf2c.a}, + and @file{/usr/include/f2c.h}, or their + @file{/usr/local} equivalents. + + @xref{Distributing Binaries}, for information on + how to accommodate systems with no existing non-@code{g77} + @code{f77} compiler and systems with @code{f2c} installed. + + @node Updating Documentation + @subsection Updating Your Info Directory + @cindex updating info directory + @cindex info, updating directory + @cindex directory, updating info + @pindex /usr/info/dir + @pindex g77.info + @cindex texinfo + @cindex documentation + + As part of installing @code{g77}, you should make sure users + of @code{info} can easily access this manual on-line. + Do this by making sure a line such as the following exists + in @file{/usr/info/dir}, or in whatever file is the top-level + file in the @code{info} directory on your system (perhaps + @file{/usr/local/info/dir}: + + @example + * g77: (g77). The GNU Fortran programming language. + @end example + + If the menu in @file{dir} is organized into sections, @code{g77} + probably belongs in a section with a name such as one of + the following: + + @itemize @bullet + @item + Fortran Programming + + @item + Writing Programs + + @item + Programming Languages + + @item + Languages Other Than C + + @item + Scientific/Engineering Tools + + @item + GNU Compilers + @end itemize + + @node Missing tools? + @subsection Missing tools? + @cindex command missing + @cindex command not found + @cindex file not found + @cindex not found + + A build of @code{gcc} might fail due to one or more tools + being called upon by @code{make} + (during the build or install process), + when those tools are not installed on your system. + + This situation can result from any of the following actions + (performed by you or someone else): + + @itemize @bullet + @item + Changing the source code or documentation yourself + (as a developer or technical writer). + + @item + Applying a patch that changes the source code or documentation + (including, sometimes, the official patches distributed by + the FSF). + + @item + Deleting the files that are created by the (missing) tools. + + The @samp{make maintainer-clean} command is supposed + to delete these files, so invoking this command without + having all the appropriate tools installed is not recommended. + + @item + Creating the source directory using a method that + does not preserve the date-time-modified information + in the original distribution. + + For example, the UNIX @samp{cp -r} command copies a + directory tree without preserving the date-time-modified + information. + Use @samp{cp -pr} instead. + @end itemize + + The reason these activities cause @code{make} to try and + invoke tools that it probably wouldn't when building + from a perfectly ``clean'' source directory containing + @code{gcc} and @code{g77} is that some files in the + source directory (and the corresponding distribution) + aren't really source files, but @emph{derived} files + that are produced by running tools with the corresponding + source files as input. + These derived files @dfn{depend}, in @code{make} terminology, + on the corresponding source files. + + @code{make} determines that a file that depends on another + needs to be updated if the date-time-modified information for + the source file shows that it is newer than the corresponding + information for the derived file. + + If it makes that determination, @code{make} runs the appropriate + commands (specified in the ``Makefile'') to update the + derived file, and this process typically calls upon one or + more installed tools to do the work. + + The ``safest'' approach to dealing with this situation + is to recreate the @code{gcc} and @code{g77} source + directories from complete @code{gcc} and @code{g77} distributions + known to be provided by the FSF. + + Another fairly ``safe'' approach is to simply install + the tools you need to complete the build process. + This is especially appropriate if you've changed the + source code or applied a patch to do so. + + However, if you're certain that the problem is limited + entirely to incorrect date-time-modified information, + that there are no discrepancies between the contents of + source files and files derived from them in the source + directory, you can often update the date-time-modified + information for the derived files to work around the + problem of not having the appropriate tools installed. + + On UNIX systems, the simplest way to update the date-time-modified + information of a file is to use the use the @samp{touch} + command. + + How to use @samp{touch} to update the derived files + updated by each of the tools is described below. + @emph{Note:} New versions of @code{g77} might change the set of + files it generates by invoking each of these tools. + If you cannot figure + out for yourself how to handle such a situation, try an + older version of @code{g77} until you find someone who can + (or until you obtain and install the relevant tools). + + @menu + * autoconf: Missing autoconf?. + * bison: Missing bison?. + * gperf: Missing gperf?. + * makeinfo: Missing makeinfo?. + @end menu + + @node Missing autoconf? + @subsubsection Missing @code{autoconf}? + @cindex @code{autoconf} + @cindex missing @code{autoconf} + + If you cannot install @code{autoconf}, make sure you have started + with a @emph{fresh} distribution of @code{gcc} and @code{g77}, + do @emph{not} do @samp{make maintainer-clean}, and, to ensure that + @code{autoconf} is not invoked by @code{make} during the build, + type these commands: + + @example + sh# @kbd{cd gcc/f/runtime} + sh# @kbd{touch configure libU77/configure} + sh# @kbd{cd ../../..} + sh# + @end example + + @node Missing bison? + @subsubsection Missing @code{bison}? + @cindex @code{bison} + @cindex missing @code{bison} + + If you cannot install @code{bison}, make sure you have started + with a @emph{fresh} distribution of @code{gcc}, do @emph{not} + do @samp{make maintainer-clean}, and, to ensure that + @code{bison} is not invoked by @code{make} during the build, + type these commands: + + @example + sh# @kbd{cd gcc} + sh# @kbd{touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c} + sh# @kbd{touch cp/parse.c cp/parse.h objc-parse.c} + sh# @kbd{cd ..} + sh# + @end example + + @node Missing gperf? + @subsubsection Missing @code{gperf}? + @cindex @code{gperf} + @cindex missing @code{gperf} + + If you cannot install @code{gperf}, make sure you have started + with a @emph{fresh} distribution of @code{gcc}, do @emph{not} + do @samp{make maintainer-clean}, and, to ensure that + @code{gperf} is not invoked by @code{make} during the build, + type these commands: + + @example + sh# @kbd{cd gcc} + sh# @kbd{touch c-gperf.h} + sh# @kbd{cd ..} + sh# + @end example + + @node Missing makeinfo? + @subsubsection Missing @code{makeinfo}? + @cindex @code{makeinfo} + @cindex missing @code{makeinfo} + @cindex @code{libg2c.a} not found + @cindex missing @code{libg2c.a} + + If @code{makeinfo} is needed but unavailable + when installing (via @code{make install}), + some files, like @file{libg2c.a}, + might not be installed, + because once @code{make} determines that it cannot + invoke @code{makeinfo}, it cancels any further processing. + + If you cannot install @code{makeinfo}, an easy work-around is to + specify @samp{MAKEINFO=true} on the @code{make} command line, + or to specify the @samp{-k} option (@kbd{make -k install}). + + Another approach is to force the relevant files to be up-to-date + by typing these commands and then re-trying the installation step: + + @example + sh# @kbd{cd gcc} + sh# @kbd{touch f/g77.info f/BUGS f/INSTALL f/NEWS} + sh# @kbd{cd ..} + sh# + @end example + + @node Distributing Binaries + @section Distributing Binaries + @cindex binaries, distributing + @cindex code, distributing + + If you are building @code{g77} for distribution to others in binary form, + first make sure you are aware of your legal responsibilities (read + the file @file{gcc/COPYING} thoroughly). + + Then, consider your target audience and decide where @code{g77} should + be installed. + + For systems like GNU/Linux that have no native Fortran compiler (or + where @code{g77} could be considered the native compiler for Fortran and + @code{gcc} for C, etc.), you should definitely configure + @code{g77} for installation + in @file{/usr/bin} instead of @file{/usr/local/bin}. + Specify the + @samp{--prefix=/usr} option when running @file{./configure}. + + You might also want to set up the distribution + so the @file{f77} command is a link to @file{g77}, + although a script that accepts ``classic'' UNIX @code{f77} + options and translates the command-line to the + appropriate @code{g77} command line would be more appropriate. + If you do this, @emph{please} also provide a ``man page'' in + @file{man/man1/f77.1} describing the command. + (A link to @file{man/man1/g77.1} is appropriate + if @file{bin/f77} is a link to @file{bin/g77}.) + + For a system that might already have @code{f2c} installed, + consider whether inter-operation with @code{g77} will be + important to users of @code{f2c} on that system. + If you want to improve the likelihood + that users will be able to use both @code{f2c} and @code{g77} + to compile code for a single program + without encountering link-time or run-time incompatibilities, + make sure that, + whenever they intend to combine @code{f2c}-produced code + with @code{g77}-produced code in an executable, they: + + @itemize @bullet + @item + Use the @file{lib/gcc-lib/@dots{}/include/g2c.h} file + generated by the @code{g77} build + in place of the @file{f2c.h} file + that normally comes with @code{f2c} + (or versions of @code{g77} prior to 0.5.23) + when compiling @emph{all} of the @code{f2c}-produced C code + + @item + Link to the @code{lib/gcc-lib/@dots{}/libg2c.a} library + built by the @code{g77} build + instead of the @file{libf2c.a} library + that normally comes with @code{f2c} + (or versions of @code{g77} prior to 0.5.23) + @end itemize + + How you choose to effect the above depends on whether + the existing installation of @code{f2c} must be + maintained. + + In any case, it is important to try and ensure that + the installation keeps working properly even after + subsequent re-installation of @code{f2c}, + which probably involves overwriting + @file{/usr/local/lib/libf2c.a} and + @file{/usr/local/include/f2c.h}, + or similar. + + At least, copying @file{libg2c.a} and @file{g2c.h} into + the appropriate ``public'' directories + allows users to more easily select the version of + @code{libf2c} they wish to use for a particular + build. + The names are changed by @code{g77} to make this + coexistence easier to maintain; + even if @code{f2c} is installed later, + the @code{g77} files normally installed + by its installation process aren't disturbed. + Use of symbolic links from one set of files to + another might result in problems after a subsequent + reinstallation of either @code{f2c} or @code{g77}, + so be sure to alert users of your distribution + accordingly. + + (Make sure you clearly document, in the description of + your distribution, how installation of your distribution will + affect existing installations of @code{gcc}, @code{f2c}, + @code{f77}, @file{libf2c.a}, and so on. + Similarly, you should clearly document any requirements + you assume will be met by users of your distribution.) + + For other systems with native @code{f77} (and @code{cc}) compilers, + configure @code{g77} as you (or most of your audience) would + configure @code{gcc} for their installations. + Typically this is for installation in @file{/usr/local}, + and would not include a new version of @file{/usr/bin/f77} + or @file{/usr/local/bin/f77}, + so users could still use the native @code{f77}. + + In any case, for @code{g77} to work properly, you @strong{must} ensure + that the binaries you distribute include: + + @table @file + @item bin/g77 + This is the command most users use to compile Fortran. + + @item bin/gcc + This is the command some users use to compile Fortran, + typically when compiling programs written in other languages + at the same time. + The @file{bin/gcc} executable file must have been built + from a @code{gcc} source tree into which a @code{g77} source + tree was merged and configured, or it will not know how + to compile Fortran programs. + + @item info/g77.info* + This is the documentation for @code{g77}. + If it is not included, users will have trouble understanding + diagnostics messages and other such things, and will send + you a lot of email asking questions. + + Please edit this documentation (by editing @file{gcc/f/*.texi} + and doing @samp{make doc} from the @file{/usr/src/gcc} directory) + to reflect any changes you've made to @code{g77}, or at + least to encourage users of your binary distribution to + report bugs to you first. + + Also, whether you distribute binaries or install @code{g77} + on your own system, it might be helpful for everyone to + add a line listing this manual by name and topic to the + top-level @code{info} node in @file{/usr/info/dir}. + That way, users can find @code{g77} documentation more + easily. + @xref{Updating Documentation,,Updating Your Info Directory}. + + @item man/man1/g77.1 + This is the short man page for @code{g77}. + It is not always kept up-to-date, + but you might as well include it + for people who really like ``man'' pages. + + @cindex gcc-lib directory + @cindex directories, gcc-lib + @item lib/gcc-lib + This is the directory containing the ``private'' files + installed by and for @code{gcc}, @code{g77}, @code{g++}, + and other GNU compilers. + + @item lib/gcc-lib/@dots{}/f771 + This is the actual Fortran compiler. + + @item lib/gcc-lib/@dots{}/libg2c.a + This is the run-time library for @code{g77}-compiled programs. + @end table + + Whether you want to include the slightly updated (and possibly + improved) versions of @file{cc1}, @file{cc1plus}, and whatever other + binaries get rebuilt with the changes the GNU Fortran distribution + makes to the GNU back end, is up to you. + These changes are highly unlikely to break any compilers, + because they involve doing things like adding to the + list of acceptable compiler options + (so, for example, @file{cc1plus} accepts, and ignores, + options that only @file{f771} actually processes). + + Please assure users that unless + they have a specific need for their existing, + older versions of @file{gcc} command, + they are unlikely to experience any problems by overwriting + it with your version---though they could certainly protect + themselves by making backup copies first! + + Otherwise, users might try and install your binaries + in a ``safe'' place, find they cannot compile Fortran + programs with your distribution (because, perhaps, they're + invoking their old version of the @file{gcc} command, + which does not recognize Fortran programs), and assume + that your binaries (or, more generally, GNU Fortran + distributions in general) are broken, at least for their + system. + + Finally, @strong{please} ask for bug reports to go to you first, at least + until you're sure your distribution is widely used and has been + well tested. + This especially goes for those of you making any + changes to the @code{g77} sources to port @code{g77}, e.g. to OS/2. + @email{fortran@@gnu.org} has received a fair number of bug + reports that turned out to be problems with other peoples' ports + and distributions, about which nothing could be done for the + user. + Once you are quite certain a bug report does not involve + your efforts, you can forward it to us. diff -rcp2N g77-0.5.22/f/g77spec.c g77-0.5.23/f/g77spec.c *** g77-0.5.22/f/g77spec.c Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/g77spec.c Wed May 13 15:33:24 1998 *************** *** 0 **** --- 1,572 ---- + /* Specific flags and argument handling of the Fortran front-end. + Copyright (C) 1997 Free Software Foundation, Inc. + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* This file contains a filter for the main `gcc' driver, which is + replicated for the `g77' driver by adding this filter. The purpose + of this filter is to be basically identical to gcc (in that + it faithfully passes all of the original arguments to gcc) but, + unless explicitly overridden by the user in certain ways, ensure + that the needs of the language supported by this wrapper are met. + + For GNU Fortran (g77), we do the following to the argument list + before passing it to `gcc': + + 1. Make sure `-lg2c -lm' is at the end of the list. + + 2. Make sure each time `-lg2c' or `-lm' is seen, it forms + part of the series `-lg2c -lm'. + + #1 and #2 are not done if `-nostdlib' or any option that disables + the linking phase is present, or if `-xfoo' is in effect. Note that + a lack of source files or -l options disables linking. + + This program was originally made out of gcc/cp/g++spec.c, but the + way it builds the new argument list was rewritten so it is much + easier to maintain, improve the way it decides to add or not add + extra arguments, etc. And several improvements were made in the + handling of arguments, primarily to make it more consistent with + `gcc' itself. */ + + #include "config.h" + + #include + #include + + #include "gansidecl.h" + + #ifdef HAVE_STDLIB_H + #include + #endif + + #ifdef HAVE_STRING_H + #include + #endif + + #include + + #ifndef MATH_LIBRARY + #define MATH_LIBRARY "-lm" + #endif + + #ifndef FORTRAN_LIBRARY + #define FORTRAN_LIBRARY "-lg2c" + #endif + + /* Options this driver needs to recognize, not just know how to + skip over. */ + typedef enum + { + OPTION_b, /* Aka --prefix. */ + OPTION_B, /* Aka --target. */ + OPTION_c, /* Aka --compile. */ + OPTION_driver, /* Wrapper-specific option. */ + OPTION_E, /* Aka --preprocess. */ + OPTION_help, /* --help. */ + OPTION_i, /* -imacros, -include, -include-*. */ + OPTION_l, + OPTION_L, /* Aka --library-directory. */ + OPTION_M, /* Aka --dependencies. */ + OPTION_MM, /* Aka --user-dependencies. */ + OPTION_nostdlib, /* Aka --no-standard-libraries, or + -nodefaultlibs. */ + OPTION_o, /* Aka --output. */ + OPTION_S, /* Aka --assemble. */ + OPTION_syntax_only, /* -fsyntax-only. */ + OPTION_v, /* Aka --verbose. */ + OPTION_version, /* --version. */ + OPTION_V, /* Aka --use-version. */ + OPTION_x, /* Aka --language. */ + OPTION_ /* Unrecognized or unimportant. */ + } Option; + + /* The original argument list and related info is copied here. */ + static int g77_xargc; + static char **g77_xargv; + static void (*g77_fn)(); + + /* The new argument list will be built here. */ + static int g77_newargc; + static char **g77_newargv; + + extern char *xmalloc PROTO((size_t)); + + /* --- This comes from gcc.c (2.8.1) verbatim: */ + + /* This defines which switch letters take arguments. */ + + #define DEFAULT_SWITCH_TAKES_ARG(CHAR) \ + ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ + || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ + || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ + || (CHAR) == 'L' || (CHAR) == 'A') + + #ifndef SWITCH_TAKES_ARG + #define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR) + #endif + + /* This defines which multi-letter switches take arguments. */ + + #define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \ + (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \ + || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \ + || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ + || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ + || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ + || !strcmp (STR, "isystem") || !strcmp (STR, "specs")) + + #ifndef WORD_SWITCH_TAKES_ARG + #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) + #endif + + /* --- End of verbatim. */ + + /* Assumes text[0] == '-'. Returns number of argv items that belong to + (and follow) this one, an option id for options important to the + caller, and a pointer to the first char of the arg, if embedded (else + returns NULL, meaning no arg or it's the next argv). + + Note that this also assumes gcc.c's pass converting long options + to short ones, where available, has already been run. */ + + static void + lookup_option (xopt, xskip, xarg, text) + Option *xopt; + int *xskip; + char **xarg; + char *text; + { + Option opt = OPTION_; + int skip; + char *arg = NULL; + + if ((skip = SWITCH_TAKES_ARG (text[1]))) + skip -= (text[2] != '\0'); /* See gcc.c. */ + + if (text[1] == 'B') + opt = OPTION_B, skip = (text[2] == '\0'), arg = text + 2; + else if (text[1] == 'b') + opt = OPTION_b, skip = (text[2] == '\0'), arg = text + 2; + else if ((text[1] == 'c') && (text[2] == '\0')) + opt = OPTION_c, skip = 0; + else if ((text[1] == 'E') && (text[2] == '\0')) + opt = OPTION_E, skip = 0; + else if (text[1] == 'i') + opt = OPTION_i, skip = 0; + else if (text[1] == 'l') + opt = OPTION_l; + else if (text[1] == 'L') + opt = OPTION_L, arg = text + 2; + else if (text[1] == 'o') + opt = OPTION_o; + else if ((text[1] == 'S') && (text[2] == '\0')) + opt = OPTION_S, skip = 0; + else if (text[1] == 'V') + opt = OPTION_V, skip = (text[2] == '\0'); + else if ((text[1] == 'v') && (text[2] == '\0')) + opt = OPTION_v, skip = 0; + else if (text[1] == 'x') + opt = OPTION_x, arg = text + 2; + else + { + if ((skip = WORD_SWITCH_TAKES_ARG (text + 1)) != 0) /* See gcc.c. */ + ; + else if (! strncmp (text, "-fdriver", 8)) /* Really --driver!! */ + opt = OPTION_driver; /* Never mind arg, this is unsupported. */ + else if (! strcmp (text, "-fhelp")) /* Really --help!! */ + opt = OPTION_help; + else if (! strcmp (text, "-M")) + opt = OPTION_M; + else if (! strcmp (text, "-MM")) + opt = OPTION_MM; + else if (! strcmp (text, "-nostdlib") + || ! strcmp (text, "-nodefaultlibs")) + opt = OPTION_nostdlib; + else if (! strcmp (text, "-fsyntax-only")) + opt = OPTION_syntax_only; + else if (! strcmp (text, "-dumpversion")) + opt = OPTION_version; + else if (! strcmp (text, "-Xlinker") + || ! strcmp (text, "-specs")) + skip = 1; + else + skip = 0; + } + + if (xopt != NULL) + *xopt = opt; + if (xskip != NULL) + *xskip = skip; + if (xarg != NULL) + { + if ((arg != NULL) + && (arg[0] == '\0')) + *xarg = NULL; + else + *xarg = arg; + } + } + + /* Append another argument to the list being built. As long as it is + identical to the corresponding arg in the original list, just increment + the new arg count. Otherwise allocate a new list, etc. */ + + static void + append_arg (arg) + char *arg; + { + static int newargsize; + + #if 0 + fprintf (stderr, "`%s'\n", arg); + #endif + + if (g77_newargv == g77_xargv + && g77_newargc < g77_xargc + && (arg == g77_xargv[g77_newargc] + || ! strcmp (arg, g77_xargv[g77_newargc]))) + { + ++g77_newargc; + return; /* Nothing new here. */ + } + + if (g77_newargv == g77_xargv) + { /* Make new arglist. */ + int i; + + newargsize = (g77_xargc << 2) + 20; /* This should handle all. */ + g77_newargv = (char **) xmalloc (newargsize * sizeof (char *)); + + /* Copy what has been done so far. */ + for (i = 0; i < g77_newargc; ++i) + g77_newargv[i] = g77_xargv[i]; + } + + if (g77_newargc == newargsize) + (*g77_fn) ("overflowed output arg list for `%s'", arg); + + g77_newargv[g77_newargc++] = arg; + } + + void + lang_specific_driver (fn, in_argc, in_argv) + void (*fn)(); + int *in_argc; + char ***in_argv; + { + int argc = *in_argc; + char **argv = *in_argv; + + int i; + int verbose = 0; + Option opt; + int skip; + char *arg; + + /* This will be NULL if we encounter a situation where we should not + link in libf2c. */ + char *library = FORTRAN_LIBRARY; + + /* This will become 0 if anything other than -v and kin (like -V) + is seen, meaning the user is trying to accomplish something. + If it remains nonzero, and the user wants version info, add stuff to + the command line to make gcc invoke all the appropriate phases + to get all the version info. */ + int add_version_magic = 1; + + /* 0 => -xnone in effect. + 1 => -xfoo in effect. */ + int saw_speclang = 0; + + /* 0 => initial/reset state + 1 => last arg was -l + 2 => last two args were -l -lm. */ + int saw_library = 0; + + /* The number of input and output files in the incoming arg list. */ + int n_infiles = 0; + int n_outfiles = 0; + + #if 0 + fprintf (stderr, "Incoming:"); + for (i = 0; i < argc; i++) + fprintf (stderr, " %s", argv[i]); + fprintf (stderr, "\n"); + #endif + + g77_xargc = argc; + g77_xargv = argv; + g77_newargc = 0; + g77_newargv = argv; + g77_fn = fn; + + /* First pass through arglist. + + If -nostdlib or a "turn-off-linking" option is anywhere in the + command line, don't do any library-option processing (except + relating to -x). Also, if -v is specified, but no other options + that do anything special (allowing -V version, etc.), remember + to add special stuff to make gcc command actually invoke all + the different phases of the compilation process so all the version + numbers can be seen. + + Also, here is where all problems with missing arguments to options + are caught. If this loop is exited normally, it means all options + have the appropriate number of arguments as far as the rest of this + program is concerned. */ + + for (i = 1; i < argc; ++i) + { + if ((argv[i][0] == '+') && (argv[i][1] == 'e')) + { + add_version_magic = 0; + continue; + } + + if ((argv[i][0] != '-') || (argv[i][1] == '\0')) + { + ++n_infiles; + add_version_magic = 0; + continue; + } + + lookup_option (&opt, &skip, NULL, argv[i]); + + switch (opt) + { + case OPTION_nostdlib: + case OPTION_c: + case OPTION_S: + case OPTION_syntax_only: + case OPTION_E: + case OPTION_M: + case OPTION_MM: + /* These options disable linking entirely or linking of the + standard libraries. */ + library = 0; + add_version_magic = 0; + break; + + case OPTION_l: + ++n_infiles; + add_version_magic = 0; + break; + + case OPTION_o: + ++n_outfiles; + add_version_magic = 0; + break; + + case OPTION_v: + if (! verbose) + fprintf (stderr, "g77 version %s\n", ffe_version_string); + verbose = 1; + break; + + case OPTION_b: + case OPTION_B: + case OPTION_L: + case OPTION_i: + case OPTION_V: + /* These options are useful in conjunction with -v to get + appropriate version info. */ + break; + + case OPTION_version: + printf ("\ + GNU Fortran %s\n\ + Copyright (C) 1997 Free Software Foundation, Inc.\n\ + For more version information on components of the GNU Fortran\n\ + compilation system, especially useful when reporting bugs,\n\ + type the command `g77 --verbose'.\n\ + \n\ + GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\ + You may redistribute copies of GNU Fortran\n\ + under the terms of the GNU General Public License.\n\ + For more information about these matters, see the file named COPYING\n\ + or type the command `info -f g77 Copying'.\n\ + ", ffe_version_string); + exit (0); + break; + + case OPTION_help: + printf ("\ + Usage: g77 [OPTION]... FORTRAN-SOURCE...\n\ + \n\ + Compile and link Fortran source code to produce an executable program,\n\ + which by default is named `a.out', and can be invoked with the UNIX\n\ + command `./a.out'.\n\ + \n\ + Options:\n\ + --debug include debugging information in executable.\n\ + --help display this help and exit.\n\ + --optimize[=LEVEL] take extra time and memory to make generated\n\ + executable run faster. LEVEL is 0 for no\n\ + optimization, 1 for normal optimization, and\n\ + increases through 3 for more optimization.\n\ + --output=PROGRAM name the executable PROGRAM instead of a.out;\n\ + invoke with the command `./PROGRAM'.\n\ + --version display version information and exit.\n\ + \n\ + Many other options exist to tailor the compilation process, specify\n\ + the dialect of the Fortran source code, specify details of the\n\ + code-generation methodology, and so on.\n\ + \n\ + For more information on g77 and gcc, type the commands `info -f g77'\n\ + and `info -f gcc' to read the Info documentation.\n\ + \n\ + Report bugs to .\n"); + exit (0); + break; + + case OPTION_driver: + (*fn) ("--driver no longer supported", argv[i]); + break; + + default: + add_version_magic = 0; + break; + } + + /* This is the one place we check for missing arguments in the + program. */ + + if (i + skip < argc) + i += skip; + else + (*fn) ("argument to `%s' missing", argv[i]); + } + + if ((n_outfiles != 0) && (n_infiles == 0)) + (*fn) ("No input files; unwilling to write output files"); + + /* Second pass through arglist, transforming arguments as appropriate. */ + + append_arg (argv[0]); /* Start with command name, of course. */ + + for (i = 1; i < argc; ++i) + { + if (argv[i][0] == '\0') + { + append_arg (argv[i]); /* Interesting. Just append as is. */ + continue; + } + + if ((argv[i][0] == '-') && (argv[i][1] != 'l')) + { + /* Not a filename or library. */ + + if (saw_library == 1) /* -l. */ + append_arg (MATH_LIBRARY); + + saw_library = 0; + + lookup_option (&opt, &skip, &arg, argv[i]); + + if (argv[i][1] == '\0') + { + append_arg (argv[i]); /* "-" == Standard input. */ + continue; + } + + if (opt == OPTION_x) + { + /* Track input language. */ + char *lang; + + if (arg == NULL) + lang = argv[i+1]; + else + lang = arg; + + saw_speclang = (strcmp (lang, "none") != 0); + } + + append_arg (argv[i]); + + for (; skip != 0; --skip) + append_arg (argv[++i]); + + continue; + } + + /* A filename/library, not an option. */ + + if (saw_speclang) + saw_library = 0; /* -xfoo currently active. */ + else + { /* -lfoo or filename. */ + if (strcmp (argv[i], MATH_LIBRARY) == 0 + #ifdef ALT_LIBM + || strcmp (argv[i], ALT_LIBM) == 0 + #endif + ) + { + if (saw_library == 1) + saw_library = 2; /* -l -lm. */ + } + else if (strcmp (argv[i], FORTRAN_LIBRARY) == 0) + saw_library = 1; /* -l. */ + else + { /* Other library, or filename. */ + if (saw_library == 1) + append_arg (MATH_LIBRARY); + saw_library = 0; + } + } + append_arg (argv[i]); + } + + /* Append `-lg2c -lm' as necessary. */ + + if (! add_version_magic && library) + { /* Doing a link and no -nostdlib. */ + if (saw_speclang) + append_arg ("-xnone"); + + switch (saw_library) + { + case 0: + append_arg (library); + case 1: + append_arg (MATH_LIBRARY); + default: + break; + } + } + else if (add_version_magic && verbose) + { + append_arg ("-c"); + append_arg ("-xf77-version"); + append_arg ("/dev/null"); + append_arg ("-xnone"); + } + + if (verbose + && g77_newargv != g77_xargv) + { + fprintf (stderr, "Driving:"); + for (i = 0; i < g77_newargc; i++) + fprintf (stderr, " %s", g77_newargv[i]); + fprintf (stderr, "\n"); + } + + *in_argc = g77_newargc; + *in_argv = g77_newargv; + } diff -rcp2N g77-0.5.22/f/gbe/2.7.2.3.diff g77-0.5.23/f/gbe/2.7.2.3.diff *** g77-0.5.22/f/gbe/2.7.2.3.diff Sun Mar 15 11:21:46 1998 --- g77-0.5.23/f/gbe/2.7.2.3.diff Thu Jan 1 00:00:00 1970 *************** *** 1,17896 **** - IMPORTANT: After applying this patch, you must rebuild the - Info documentation derived from the Texinfo files in the - gcc distribution, as this patch does not include patches - to any derived files (due to differences in the way gcc - version 2.7.2.2 is obtained by users). Use the following - command sequence after applying this patch: - - cd gcc-2.7.2.3; make -f Makefile.in gcc.info - - If that fails due to `makeinfo' not being installed, obtain - texinfo-3.11.tar.gz from a GNU distribution site, unpack, - build, and install it, and try the above command sequence - again. - - NOTE: You probably will have trouble with the `ChangeLog' - file in this patch. That's because gcc version 2.7.2.2 itself - had an incomplete patch file (gcc-2.7.2.2-2.7.2.3.diff.gz - omitted the patch to gcc/ChangeLog), which in turn "infected" - both forms of the 2.7.2.3 distribution (the .tar.gz and .diff.gz - file, neither of which has the proper gcc/ChangeLog file). - - The following patch's gcc/ChangeLog patchlet assumes a - "fixed" gcc-2.7.2.3/ChangeLog, and then further "fixes" it - to sort the pertinent entries in the usual chronological order. - - If you start with the gcc-2.7.2.2.tar.gz distribution, apply - the gcc-2.7.2.2-2.7.2.3.diff.gz patch, "fix up" the gcc/ChangeLog - file so the new material ends up "above" the single large - 2.7.2.2 release entry (dated "Tue Jan 29 02:47:13 1997"), then - you *should* be able to apply this patch file cleanly. - - In any case, don't worry; the contents of gcc/ChangeLog aren't - really important to non-developers of gcc. - - - diff -rcp2N gcc-2.7.2.3/ChangeLog gcc-2.7.2.3.f.2/ChangeLog - *** gcc-2.7.2.3/ChangeLog Sun Mar 15 10:46:38 1998 - --- gcc-2.7.2.3.f.2/ChangeLog Tue Mar 3 18:05:03 1998 - *************** - *** 1,6 **** - --- 1,111 ---- - + Sun Mar 1 01:11:48 1998 Craig Burley - + - + * genattrtab.c (pc_rtx): Define global here, so linking works. - + - + Sun Mar 1 01:10:16 1998 Bernd Schmidt - + - + * basic-block.h (basic_block_computed_jump_target): Declare. - + * flags.h: (current_function_has_computed_jump): Declare. - + * flow.c: (basic_block_computed_jump_target): Define. - + (flow_analysis): Allocate it. Set current_function_has_computed_jump - + to 0. - + (find_basic_blocks): Set current_function_has_computed_jump and - + elements of basic_block_computed_jump_target to 1 as appropriate. - + * function.c: (current_function_has_computed_jump): Define. - + * global.c (global_conflicts): Don't allocate pseudos into stack regs - + at the start of a block that is reachable by a computed jump. - + * reg-stack.c (stack_reg_life_analysis): If must restart, do so - + immediately. - + (subst_stack_regs): Undo change from Aug 26 1997. - + (uses_reg_or_mem): Now unused, deleted. - + * stupid.c (stupid_life_analysis): Compute - + current_function_has_computed_jump. - + (stupid_find_reg): Don't allocate stack regs if the function has a - + computed goto. - + - + Thu Feb 26 16:13:44 1998 Craig Burley - + - + * emit-rtl.c (gen_lowpart_common): Install fix from - + to get right subword. - + - + Fri Feb 13 08:41:49 1998 Robert Lipe - + - + * rtlanal.c (computed_jump_p): Remove unused variable 'computed_jump'. - + - + Thu Dec 4 06:34:40 1997 Richard Kenner - + - + * stmt.c (pushcase_range): Clean up handling of "infinite" values. - + - + Mon Oct 6 18:27:12 1997 Richard Henderson - + - + * alpha.h (FLOAT_STORE_FLAG_VALUE): It's 2.0 not 0.5. - + - + Mon Sep 29 16:12:38 1997 Craig Burley - + - + * c-parse.gperf: Replace `restrict' with `__restrict__', - + to avoid collisions with C programs that use `restrict' - + as a variable name -- this makes `restrict' support much - + more like `complex' support. - + - + Sun Sep 28 17:13:34 1997 Richard Henderson - + - + * alias.c (base_alias_check): Two symbols can conflict if they - + are accessed via AND. - + (memrefs_conflict_p): Likewise. - + - + Tue Sep 23 00:59:54 1997 Jeffrey A Law (law@cygnus.com) - + - + * rtlanal.c (computed_jump_p): Fix typo in last change. - + - + Sun Sep 21 17:45:45 1997 Jeffrey A Law (law@cygnus.com) - + - + * flow.c (jmp_uses_reg_or_mem): Deleted unused function. - + (find_basic_blocks): Use computed_jump_p to determine if a - + particular JUMP_INSN is a computed jump. - + * reg-stack.c (find_blocks): Use computed_jump_p to determine - + if a particular JUMP_INSN is a computed jump. - + * rtlanal.c (jmp_uses_reg_or_mem): New function. - + (computed_jump_p): Likewise. - + * rtl.h (computed_jump_p): Declare. - + - + Mon Sep 15 17:47:12 1997 Craig Burley - + - + * expr.c (safe_from_p_1): Fix thinko, avoid trashing stack - + when compiling complicated (complex?) expressions. - + - + Wed Sep 3 12:26:33 1997 Jim Wilson - + - + * alias.c (true_dependence): Address with AND can alias scalars. - + (anti_dependence, output_dependence): Likewise. - + - + Wed Sep 3 10:36:51 1997 Jim Wilson - + - + * alias.c (true_dependence): Test x for BLKmode, in addition to mem. - + - + Sat Aug 30 16:42:50 1997 Craig Burley - + - + * reload.c (find_reloads): Fix 1997-07-28 fix so the - + loop to handle MATCH_DUPs is disabled when insn_code_number - + is <= 0, because in that case recog_dup_loc is not - + relevant. - + - + Tue Aug 26 01:52:17 1997 Craig Burley - + - + From Stan Cox - + * reg-stack.c (subst_stack_regs): Cope with computed goto - + (`GOTO I' in FORTRAN; `goto *lab;' in GNU C). - + - Thu Aug 22 23:47:38 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - * Version 2.7.2.3 released. - - + Fri Aug 22 21:31:54 1997 Jim Wilson - + - + * alias.c (true_dependence): Pass x_addr not x to varies. - + - + Sun Aug 17 03:31:44 1997 Craig Burley - + - + * Makefile.in: Comment out lines containing just formfeeds. - + - Wed Aug 13 08:28:18 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - *************** Wed Aug 13 08:28:18 1997 H.J. Lu (hjl@ - *** 26,33 **** - (FINALIZE_TRAMPOLINE, CLEAR_INSN_CACHE): New. - - ! Mon Mar 17 17:03:55 1997 J.T. Conklin - - ! * m68k.md (beq0_di, bne0_di, bge0_di, blt0_di): Use cmpw #0 - ! instead of tstl when testing address registers on the 68000. - - Fri Aug 8 08:15:55 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - --- 131,156 ---- - (FINALIZE_TRAMPOLINE, CLEAR_INSN_CACHE): New. - - ! Sun Aug 10 22:23:10 1997 Richard Kenner - - ! * explow.c (probe_stack_range): Add USE for test_addr if -O0. - ! - ! Sun Aug 10 18:14:24 1997 Craig Burley - ! - ! Integrate C front end part of patch for better alias - ! handling from John Carr : - ! * c-decl.c (grokdeclarator): Check for RID_RESTRICT - ! flag; diagnose certain misuses; set DECL_RESTRICT as - ! appropriate. - ! * c-lex.c (init_lex): Set up RID_RESTRICT pointer. - ! Unset `restrict' as reserved word. - ! * c-lex.h: Replace RID_NOALIAS with RID_RESTRICT. - ! * c-parse.gperf: Add `restrict' and `__restrict' - ! keywords. - ! * tree.h: Add DECL_RESTRICT flag. - ! - ! Sun Aug 10 14:50:30 1997 Jim Wilson - ! - ! * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN - ! has integer TYPE_{MAX,MIN}_VALUE before using them. - - Fri Aug 8 08:15:55 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - *************** Fri Aug 8 08:15:55 1997 H.J. Lu (hjl@ - *** 38,41 **** - --- 161,218 ---- - * install1.texi: New. - - + Mon Aug 4 17:49:14 1997 Richard Kenner - + - + * combine.c (try_combine): If have PARALLEL of independent SETs - + and have cc0, ensure insn using CC0 come first. - + - + Sat Aug 2 08:03:04 1997 Richard Kenner - + - + * varasm.c (compare_constant_1, case STRING_CST): Compare TYPE_MODE. - + (record_constant_1, case STRING_CST): Record TYPE_MODE. - + - + Sat Aug 2 08:03:04 1997 Richard Kenner - + - + * tree.c (contains_this_placeholder_p): Delete. - + (contains_placeholder_p): Now contains code from above function. - + (contains_placeholder_p, case 'r'): Don't look at offset info. - + * expr.c (expand_expr, case PLACEHOLDER_EXPR): Find innermost - + matching and don't check contains_placeholder_p. - + - + Mon Jul 28 15:35:38 1997 Craig Burley - + - + * combine.c (num_sign_bit_copies): Speed up the 961126-1.c - + case of repeated (neg (neg (neg ...))) so c-torture runs - + in less time. - + - + * reload.c (find_reloads_toplev, find_reloads_address): - + These now return whether replacement by a constant, so - + caller can know to do other replacements. Currently if - + caller doesn't want that info and such replacement would - + happen, we crash so as to investigate the problem and - + learn more about it. All callers updated. - + (find_reloads): If pseudo replaced by constant, always - + update duplicates of it. - + - + Sun Jul 27 12:13:01 1997 Richard Kenner - + - + * expr.c (expand_expr, case SAVE_EXPR): Handle top-level SAVE_EXPR by - + moving into current function; abort if in odd context. - + * fold-const.c (fold_truthop, fold): Avoid making SAVE_EXPR - + if at top level. - + - + * expr.c (get_inner_unaligned_p): Deleted. - + (expand_assignment): Remove special-case of constant array. - + (expand_expr, case ARRAY_REF): Likewise, and clean up remaining code. - + - + * explow.c (probe_stack_range): Do probing with loop if more - + than a small number. - + - + Fri Jul 25 08:38:37 1997 Richard Kenner - + - + * calls.c: (expand_call): If -fstack-check and temp needed - + for arg is too large, use alloca. - + * expr.c (expand_expr, case MODIFY_EXPR): Don't preexpand calls - + if LHS is an indirect via a constant pointer. - + - Mon Jul 21 22:47:13 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - *************** Mon Jul 21 22:47:13 1997 H.J. Lu (hjl@ - *** 43,46 **** - --- 220,288 ---- - for Linux. - - + Mon Jul 21 00:00:24 1997 Craig Burley - + - + * fold-const.c (size_binop): Make sure overflows - + are flagged properly, so as to avoid silently generating - + bad code for, e.g., a too-large array. - + - + Sun Jul 20 06:10:26 1997 Richard Kenner - + - + * tree.c (contains_placeholder_p): Call contains_this_placeholder_p. - + (contains_this_placeholder_p): Renamed from contains_placeholder_p. - + Added new arg, PL. - + Rework to make more consistent, check more codes, and avoid - + undefined fields. - + * expr.c (expand_expr, case PLACEHOLDER_EXPR): Pick outermost - + object in placeholder_list of right type without a PLACEHOLDER_EXPR> - + - + Sat Jul 19 17:54:28 1997 Richard Kenner - + - + * alpha.h (STACK_CHECK_BUILTIN): New macro. - + - + Thu Jul 17 07:02:10 1997 Richard Kenner - + - + * expr.h (STACK_CHECK_*): Provide default values. - + (probe_stack_range): New declaration. - + * flags.h (flag_stack_check): Likewise. - + * explow.c (allocate_dynamic_stack_space): Call probe_stack_range. - + (emit_stack_probe, probe_stack_range): New functions. - + * function.c (expand_function_end): If function is non-leaf and stack - + checking is requested, emit needed probes. - + * reload1.c (reload): If checking stack, verify frame small enough. - + * stmt.c (expand_decl): If stack checking, use alloca for large vars. - + * toplev.c (flag_stack_check): New variable. - + (f_options): Add "stack-check". - + - + Sun Jul 13 22:23:14 1997 Craig Burley - + - + * stmt.c (expand_expr_stmt): Must generate code for - + statements within an expression (gcc's `({ ... )}') - + even if -fsyntax-only. - + - + Sun Jul 13 15:14:48 1997 Richard Kenner - + - + * m68k.md (tstdi, cmpdi): Disable. - + - + Tue Jul 1 23:27:43 1997 Richard Kenner - + - + * reorg.c (redundant_insn): If INSN or possible match has REG_UNUSED - + note, don't have match. - + - + Mon Jun 30 17:23:07 1997 Michael Meissner - + - + * gcc.c (process_command): If -save-temps and -pipe were specified - + together, don't do -pipe. - + - + Thu Jun 26 05:40:46 1997 Craig Burley - + - + * stor-layout.c (get_best_mode): Handle negative bitpos - + correctly, so caller doesn't get into infinite recursion - + trying to cope with a spurious VOIDmode. - + - + Tue Jun 24 19:46:31 1997 Craig Burley - + - + * varasm.c (assemble_variable): If low part of size - + doesn't fit in an int, variable is too large. - + - Tue Jun 24 11:24:56 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - *************** Mon Jun 23 22:48:00 1997 Jim Wilson - - ! * function.c (expand_function_end): Allow TRAMPOLINE_TEMPLATE - ! to be omitted on systems for which it is not cost effective. - ! * varasm.c (assemble_trampoline_template): No such function - ! if no TRAMPOLINE_TEMPLATE. - ! * m68k.h: Greatly simplify the run-time trampoline code: - ! (TRAMPOLINE_TEMPLATE, TRANSFER_FROM_TRAMPOLINE): Delete define. - ! (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Changed. - ! (TRAMPOLINE_ALIGN): No point aligning to cache line. - ! (FINISH_INIT_TRAMPOLINE): New define. - ! * m68k/next.h: Instead of redefining INITIALIZE_TRAMPOLINE, - ! make use of the new FINISH_INIT_TRAMPOLINE. - ! * m68k/{m68k.h,next.h} (FINISH_INIT_TRAMPOLINE): - ! Rename to FINALIZE_TRAMPOLINE. - - ! Mon Apr 15 08:49:20 1996 Tom May (ftom@netcom.com) - - ! * cse.c (invalidate_skipped_set): Ignore CLOBBER after calling - ! note_mem_written, not before. - - Tue Jan 29 02:47:13 1997 Richard Stallman - --- 311,512 ---- - to biv_count for reduced givs. - - ! Sat Jun 21 12:09:00 1997 Craig Burley - - ! * toplev.c (rest_of_compilation): Also temporarily set - ! flag_unroll_all_loops to 0 during first of two calls - ! to loop_optimize, and clean up code a bit to make it - ! easier to read. - - ! * expr.c (safe_from_p_1, safe_from_p): Fix these to use - ! TREE_SET_CODE instead of TREE_CODE. - - ! Thu Jun 19 19:30:47 1997 Craig Burley - ! - ! * config/alpha/alpha.c: Don't include on - ! GNU Linux machines. - ! - ! * config/alpha/elf.c: New file for ELF systems. - ! - ! * config/alpha/xm-alpha.h: Don't declare alloca() - ! if it's already a macro (probably defined in stdlib.h). - ! - ! * config/alpha/xm-linux.h (HAVE_STRERROR): #define - ! this, according to what various people suggest. - ! - ! * config.guess, configure: Make some (hopefully safe) - ! changes, based mostly on gcc-2.8.0-in-development, - ! in the hopes that these make some systems configure - ! "out of the box" more easily, especially Alpha systems. - ! - ! Mon Jun 9 04:26:53 1997 Craig Burley - ! - ! * expr.c (safe_from_p): Don't examine a given SAVE_EXPR - ! node more than once, to avoid combinatorial explosion - ! in complex expressions. Fortran case that triggered - ! this had a complicated *and* complex expression with - ! 293 unique nodes, resulting in 28 minutes of compile - ! time mostly spent in a single top-level safe_from_p() - ! call due to all the redundant SAVE_EXPR traversals. - ! This change reduced the time to around 2 seconds. - ! (safe_from_p_1): New helper function that does almost - ! exactly what the old safe_from_p() did. - ! - ! Fri May 30 11:40:10 1997 Richard Kenner - ! - ! * rs6000.md (movdi): Emit a CLOBBER before the two movsi insns - ! in constant case. - ! - ! Thu May 29 15:42:59 1997 Stan Cox - ! - ! * i386.h (ASM_OUTPUT_REG_{PUSH,POP}): add %% before register name. - ! - ! Sun May 18 21:18:48 1997 Craig Burley - ! - ! * fold-const.c (fold): Clarify why TRUNC_DIV_EXPR - ! and FLOOR_DIV_EXPR aren't rewritten to EXACT_DIV_EXPR, - ! clean up related code. - ! - ! Sat May 17 15:15:23 1997 Richard Kenner - ! - ! * cse.c (cse_insn): Don't record a SRC that's a MEM and the same - ! as a REG_EQUIV note if DEST is set more than once. - ! - ! Sat May 3 13:53:00 1997 Craig Burley - ! - ! * config.sub: Change all `i[345]' to `i[3456]' to - ! support Pentium Pro (this change was already made - ! in configure for gcc-2.7.2.2). - ! - ! From Toon Moene : - ! * toplev.c (rest_of_compilation): Unroll loops - ! only the final time through loop optimization. - ! - ! Thu Apr 24 16:39:53 1997 Richard Kenner - ! - ! * stmt.c (pushcase_range): Check for null range first. - ! - ! Mon Apr 21 16:31:50 1997 Richard Kenner - ! - ! * cse.c (fold_rtx, case PLUS): When seeing if negative of constant - ! is around, make sure not dealing with largest negative. - ! - ! Sun Apr 20 10:46:24 1997 Richard Kenner - ! - ! * fold-const.c (operand_equal_p): Constants are not equal if there - ! has been an overflow. - ! - ! Sun Apr 20 10:45:35 1997 Richard Kenner - ! - ! * final.c (profile_function): Only call ASM_OUTPUT_REG_{PUSH,POP} - ! if defined. - ! - ! Wed Apr 16 22:26:16 1997 Craig Burley - ! - ! * alias.c, cse.c, loop.c, rtl.c, rtl.h, sched.c: - ! Make changes submitted by . - ! - ! Wed Apr 16 16:54:18 1997 Richard Kenner - ! - ! * function.c (find_temp_slot_from_address): Compare slots using - ! rtx_equal_p, not identity comparison. - ! * expr.c (store_expr): Check if TEMP and TARGET are the - ! same using rtx_equal_p. - ! - ! Tue Apr 15 18:03:58 1997 Richard Kenner - ! - ! * rs6000.c (rs6000_output_load_toc_table): New function. - ! (output_prolog): Delete code from here and call new function. - ! * rs6000.md (nonlocal_goto_receiver): New pattern. - ! - ! * expr.c (expand_assignment, store_field): Use copy_rtx when - ! need to copy rtx instead of change_address. - ! (expand_expr, case CONSTRUCTOR, COMPONENT_REF): Likewise. - ! - ! Sun Apr 13 19:32:53 1997 Craig Burley - ! - ! * fold-const.c (fold): If extra warnings enabled, - ! warn about integer division by zero. - ! - ! Sun Apr 13 08:15:31 1997 Bernd Schmidt - ! - ! * final.c (profile_function): Save the static chain register - ! around the call to the profiler function. - ! - ! Sat Apr 12 14:56:42 1997 Craig Burley - ! - ! * unroll.c (find_splittable_givs): Permit more cases - ! of mult_val/add_val to agree by using rtx_equal_p - ! to compare them instead of requiring them to be - ! integers with the same value. Also don't bother - ! checking if ADDRESS_COST not defined (they will be - ! equal in that case). - ! - ! Fri Apr 11 03:30:04 1997 Craig Burley - ! - ! * unroll.c (find_splittable_givs): Must create a new - ! register if the mult_val and add_val fields don't - ! agree. - ! - ! Fri Apr 4 23:00:55 1997 Craig Burley - ! - ! * fold-const.c (fold): Don't call multiple_of_p if - ! arg1 is constant zero, to avoid crashing; simplify - ! code accordingly. - ! - ! Mon Mar 24 22:33:40 1997 Dave Love - ! - ! * config/i386/i386.h (STACK_BOUNDARY): Define as BIGGEST_ALIGNMENT - ! so that -malign-double works for stack-allocated data. - ! - ! Wed Mar 19 12:24:11 1997 Jim Wilson - ! - ! * combine.c (move_deaths): Handle partial REG_DEAD note for - ! multi-reg hard register. - ! - ! Mon Mar 17 17:03:55 1997 J.T. Conklin - ! - ! * m68k.md (beq0_di, bne0_di, bge0_di, blt0_di): Use cmpw #0 - ! instead of tstl when testing address registers on the 68000. - ! - ! Sun Mar 16 19:53:13 1997 Richard Kenner - ! - ! * expr.c (expand_expr, case PLACEHOLDER_EXPR): Refine which - ! object is picked. - ! - ! Mon Mar 10 16:01:44 1997 Richard Kenner - ! - ! * emit-rtl.c (subreg_lowpart_p): Return 0 if SUBREG_REG is VOIDmode. - ! * combine.c (simplify_rtx, case SUBREG): Fix direction of test when - ! calling operand_subword; use inline code intead of subreg_lowpart_p. - ! - ! Wed Feb 26 13:09:33 1997 Michael Meissner - ! - ! * reload.c (debug_reload): Fix format string to print - ! reload_nocombine[r]. - ! - ! Sun Feb 23 15:26:53 1997 Craig Burley - ! - ! * fold-const.c (multiple_of_p): Clean up and improve. - ! (fold): Clean up invocation of multiple_of_p. - ! - ! Sun Feb 9 14:03:53 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - ! - ! * function.c (assign_stack_temp): Clear MEM flags from reuse. - ! - ! Sat Feb 8 04:53:27 1997 Craig Burley - ! - ! From Fri, 07 Feb 1997 22:02:21 -0500: - ! * alias.c (init_alias_analysis): Reduce amount of time - ! needed to simplify the reg_base_value array in the - ! typical case (especially involving function inlining). - ! - ! Fri Feb 7 07:56:12 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - ! - ! * function.c (instantiate_virtual_regs_1, case USE, CLOBBER): - ! Fix error in last change. - ! - ! Sat Feb 1 18:51:47 1997 Douglas B. Rupp (rupp@gnat.com) - ! - ! * gcc.c (process_command): Fix improper use of strncpy. - - Tue Jan 29 02:47:13 1997 Richard Stallman - *************** Tue Jan 29 02:47:13 1997 Richard Stallm - *** 109,112 **** - --- 529,616 ---- - [! LIBC_VERSION_1] (LIB_SPEC): New override definition. - - + Tue Jan 21 16:09:37 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * function.c (mark_all_temps_used): Set KEEP as well. - + - + Fri Jan 10 17:22:17 1997 Craig Burley - + - + Minor improvements/fixes to better alias handling: - + * Makefile.in (alias.o): Fix typo in rule (was RLT_H). - + * cse.c, sched.c: Fix up some indenting. - + * toplev.c: Add -fargument-alias flag, so Fortran users - + can turn C-style aliasing on once g77 defaults to - + -fargument-noalias-global. - + - + Integrate patch for better alias handling from - + John Carr : - + * Makefile.in (OBJS, alias.o): New module and rule. - + * alias.c: New source module. - + * calls.c (expand_call): Recognize alias status of calls - + to malloc(). - + * combine.c (distribute_notes): New REG_NOALIAS note. - + * rtl.h (REG_NOALIAS): Ditto. - + Many other changes for new alias.c module. - + * cse.c: Many changes, and much code moved into alias.c. - + * flags.h (flag_alias_check, flag_argument_noalias): - + New flags. - + * toplev.c: New flags and related options. - + * local-alloc.c (validate_equiv_mem_from_store): - + Caller of true_dependence changed. - + * loop.c (NUM_STORES): Increase to 50 from 20. - + (prescan_loop): "const" functions don't alter unknown addresses. - + (invariant_p): Caller of true_dependence changed. - + (record_giv): Zero new unrolled and shared flags. - + (emit_iv_add_mult): Record base value for register. - + * sched.c: Many changes, mostly moving code to alias.c. - + (sched_note_set): SCHED_SORT macro def form, but not function, - + inexplicably changed. - + * unroll.c: Record base values for registers, etc. - + - + Fri Jan 3 04:01:00 1997 Craig Burley - + - + * loop.c (check_final_value): Handle insns with no luid's - + appropriately, instead of crashing on INSN_LUID macro - + invocations. - + - + Mon Dec 23 00:49:19 1996 Craig Burley - + - + * config/alpha/alpha.md: Fix pattern that matches if_then_else - + involving DF target, DF comparison, SF source. - + - + Fri Dec 20 15:42:52 1996 Craig Burley - + - + * fold-const.c (multiple_of_p): New function. - + (fold): Use new function to turn *_DIV_EXPR into EXACT_DIV_EXPR. - + - + Tue Nov 26 14:50:54 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * expr.c (move_by_pieces): Abort only if length positive at end. - + - + Tue Oct 22 18:32:20 1996 Jim Wilson - + - + * unroll.c (unroll_loop): Always reject loops with unbalanced blocks. - + - + Tue Sep 24 19:37:00 1996 Jim Wilson - + - + * reload.c (push_secondary_reload): Do strip paradoxical SUBREG - + even if reload_class is CLASS_CANNOT_CHANGE_SIZE. Change reload_mode - + to mode in SECONDARY_MEMORY_NEEDED and get_secondary_mem calls. - + - + Mon Aug 12 07:48:54 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * expr.c (expand_builtin, case BUILT_IN_SETJMP): Add test - + and call for nonlocal_goto_receiver pattern. - + * stmt.c (expand_end_bindings): Likewise. - + - + Mon Aug 5 16:53:36 1996 Doug Evans - + - + * stor-layout.c (layout_record): Correct overflow test for 0 sized - + fields. - + - + Tue Jul 23 23:11:57 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * tree.h (struct tree_int_cst): Add field for TREE_CST_RTL. - + * varasm.c (decode_addr_const, output_constant_def): Allow INTEGER_CST. - + - Sat Jun 29 12:33:39 1996 Richard Kenner - - *************** Tue Jun 11 20:18:03 1996 Per Bothner - + - + * unroll.c (copy_loop_body): When update split DEST_ADDR giv, - + check to make sure it was split. - + (find_splittable_givs): Fix reversed test of verify_addresses result. - + - Fri May 10 18:35:00 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - - *************** Wed Apr 17 17:53:23 1996 Michael Meissn - *** 136,139 **** - --- 650,681 ---- - bits. - - + Tue Apr 16 16:59:49 1996 Richard Henderson - + - + * function.c (expand_function_end): Allow TRAMPOLINE_TEMPLATE - + to be omitted on systems for which it is not cost effective. - + * varasm.c (assemble_trampoline_template): No such function - + if no TRAMPOLINE_TEMPLATE. - + * m68k.h: Greatly simplify the run-time trampoline code: - + (TRAMPOLINE_TEMPLATE, TRANSFER_FROM_TRAMPOLINE): Delete define. - + (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Changed. - + (TRAMPOLINE_ALIGN): No point aligning to cache line. - + (FINISH_INIT_TRAMPOLINE): New define. - + * m68k/next.h: Instead of redefining INITIALIZE_TRAMPOLINE, - + make use of the new FINISH_INIT_TRAMPOLINE. - + * m68k/{m68k.h,next.h} (FINISH_INIT_TRAMPOLINE): - + Rename to FINALIZE_TRAMPOLINE. - + - + Mon Apr 15 08:49:20 1996 Tom May (ftom@netcom.com) - + - + * cse.c (invalidate_skipped_set): Ignore CLOBBER after calling - + note_mem_written, not before. - + - + Sat Apr 13 07:47:09 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * alpha.c (alpha_emit_set_const_1): Renamed from - + alpha_emit_set_const and static. - + Remove change of Nov 26; again use normal mechanism for SImode. - + (alpha_emit_set_const): New function. - + - Mon Apr 8 13:46:28 1996 Michael Meissner - - *************** Mon Feb 19 07:35:07 1996 Torbjorn Granl - *** 176,179 **** - --- 718,726 ---- - * rs6000.md (not:SI with assign and compare): Fix typo. - - + Tue Feb 13 17:43:46 1996 Jim Wilson - + - + * integrate.c (save_constants_in_decl_trees): New function. - + (save_for_inline_copying, save_for_inline_nocopy): Call it. - + - Wed Jan 24 18:00:12 1996 Brendan Kehoe - - *************** Tue Jan 16 06:01:28 1996 Thomas Graiche - *** 191,198 **** - --- 738,770 ---- - * i386/freebsd.h (ASM_WEAKEN_LABEL): Deleted; not supported. - - + Mon Jan 15 07:22:59 1996 Michel Delval (mfd@ccv.fr) - + - + * reload.c (find_equiv_reg): Apply single_set, not PATTERN, to WHERE. - + - Sun Jan 7 17:11:11 1996 David Edelsohn - - * collect2.c (scan_libraries): Correct Import File ID interpretation. - - + Sat Jan 6 03:27:49 1996 Hans-Peter Nilsson - + - + * expr.c (emit_move_insn_1): Don't emit lobber when moving - + by parts and source equals destination. - + - + Sat Jan 6 03:27:49 1996 Hans-Peter Nilsson - + - + * optabs.c (expand_fix): Don't copy TARGET to TO if same. - + - + Mon Jan 1 09:05:07 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * local-alloc.c (reg_equiv_replacement): New variable. - + (memref_referenced_p, case REG): Check for reg_equiv_replacement. - + (update_equiv_regs): reg_equiv_replacement now file-scope. - + - + Fri Dec 22 17:29:42 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) - + - + * reload.c (find_valid_class): New function. - + (push_reload): Use it in cases where a SUBREG and its contents - + both need to be reloaded. - + - Thu Dec 28 22:24:53 1995 Michael Meissner - - *************** Mon Dec 18 18:40:34 1995 Jim Wilson - + - + * rs6000/rs6000.c (input_operand): Allow any integer constant, not - + just integers that fit in 1 instruction. - - Sun Nov 26 14:47:42 1995 Richard Kenner - diff -rcp2N gcc-2.7.2.3/Makefile.in gcc-2.7.2.3.f.2/Makefile.in - *** gcc-2.7.2.3/Makefile.in Fri Aug 8 15:58:17 1997 - --- gcc-2.7.2.3.f.2/Makefile.in Tue Sep 9 07:01:12 1997 - *************** all: all.indirect - *** 397,401 **** - ####cross overrides - ####build overrides - ! - # Now figure out from those variables how to compile and link. - - --- 397,401 ---- - ####cross overrides - ####build overrides - ! # - # Now figure out from those variables how to compile and link. - - *************** INCLUDES = -I. -I$(srcdir) -I$(srcdir)/c - *** 454,458 **** - # defined in this file into the environment. - .NOEXPORT: - ! - # Support for additional languages (other than c and objc). - # ??? objc can be supported this way too (leave for later). - --- 454,458 ---- - # defined in this file into the environment. - .NOEXPORT: - ! # - # Support for additional languages (other than c and objc). - # ??? objc can be supported this way too (leave for later). - *************** FLAGS_TO_PASS = \ - *** 491,495 **** - "bindir=$(bindir)" \ - "libsubdir=$(libsubdir)" - ! - # Lists of files for various purposes. - - --- 491,495 ---- - "bindir=$(bindir)" \ - "libsubdir=$(libsubdir)" - ! # - # Lists of files for various purposes. - - *************** OBJS = toplev.o version.o tree.o print-t - *** 519,523 **** - integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \ - regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \ - ! insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \ - insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \ - insn-attrtab.o $(out_object_file) getpwd.o convert.o $(EXTRA_OBJS) - --- 519,523 ---- - integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \ - regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \ - ! insn-peep.o reorg.o alias.o sched.o final.o recog.o reg-stack.o \ - insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \ - insn-attrtab.o $(out_object_file) getpwd.o convert.o $(EXTRA_OBJS) - *************** LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udi - *** 570,574 **** - _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ - _fixtfdi _fixunstfdi _floatditf \ - ! __gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler _op_delete \ - _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh \ - _pure - --- 570,575 ---- - _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ - _fixtfdi _fixunstfdi _floatditf \ - ! __gcc_bcmp _varargs __dummy _eprintf \ - ! _op_new _op_vnew _new_handler _op_delete \ - _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh \ - _pure - *************** RTL_H = rtl.h rtl.def machmode.h machmod - *** 585,589 **** - TREE_H = tree.h real.h tree.def machmode.h machmode.def - BYTECODE_H = bytecode.h bc-emit.h bc-optab.h - ! - # Language makefile fragments. - - --- 586,590 ---- - TREE_H = tree.h real.h tree.def machmode.h machmode.def - BYTECODE_H = bytecode.h bc-emit.h bc-optab.h - ! # - # Language makefile fragments. - - *************** BYTECODE_H = bytecode.h bc-emit.h bc-opt - *** 607,611 **** - - # End of language makefile fragments. - ! - # Avoid a lot of time thinking about remaking Makefile.in and *.def. - .SUFFIXES: .in .def - --- 608,612 ---- - - # End of language makefile fragments. - ! # - # Avoid a lot of time thinking about remaking Makefile.in and *.def. - .SUFFIXES: .in .def - *************** xlimits.h: glimits.h limitx.h limity.h - *** 730,734 **** - fi - mv tmp-xlimits.h xlimits.h - ! - # Build libgcc.a. - # This is done in two parts because some functions, in libgcc1.c, - --- 731,735 ---- - fi - mv tmp-xlimits.h xlimits.h - ! # - # Build libgcc.a. - # This is done in two parts because some functions, in libgcc1.c, - *************** stamp-crtS: stamp-crt crtstuff.c $(GCC_P - *** 1042,1046 **** - mv crtstuff$(objext) crtendS$(objext) - touch stamp-crtS - ! - # Compiling object files from source files. - - --- 1043,1047 ---- - mv crtstuff$(objext) crtendS$(objext) - touch stamp-crtS - ! # - # Compiling object files from source files. - - *************** expr.o : expr.c $(CONFIG_H) $(RTL_H) $(T - *** 1179,1183 **** - insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h \ - typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \ - ! bc-emit.h modemap.def - calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \ - insn-flags.h - --- 1180,1184 ---- - insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h \ - typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \ - ! bc-emit.h modemap.def hard-reg-set.h - calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \ - insn-flags.h - *************** reorg.o : reorg.c $(CONFIG_H) $(RTL_H) c - *** 1238,1241 **** - --- 1239,1243 ---- - basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \ - flags.h output.h - + alias.o : $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h - sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \ - flags.h insn-config.h insn-attr.h - *************** alloca.o: alloca.c - *** 1275,1279 **** - -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'` - $(ALLOCA_FINISH) - ! - # Generate header and source files from the machine description, - # and compile them. - --- 1277,1281 ---- - -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'` - $(ALLOCA_FINISH) - ! # - # Generate header and source files from the machine description, - # and compile them. - *************** stamp-output : $(md_file) genoutput $(sr - *** 1400,1404 **** - $(srcdir)/move-if-change tmp-output.c insn-output.c - touch stamp-output - ! - # Compile the programs that generate insn-* from the machine description. - # They are compiled with $(HOST_CC), and associated libraries, - --- 1402,1406 ---- - $(srcdir)/move-if-change tmp-output.c insn-output.c - touch stamp-output - ! # - # Compile the programs that generate insn-* from the machine description. - # They are compiled with $(HOST_CC), and associated libraries, - *************** genoutput : genoutput.o $(HOST_RTL) $(HO - *** 1493,1497 **** - genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c - ! - # Compile the libraries to be used by gen*. - # If we are not cross-building, gen* use the same .o's that cc1 will use, - --- 1495,1499 ---- - genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c - ! # - # Compile the libraries to be used by gen*. - # If we are not cross-building, gen* use the same .o's that cc1 will use, - *************** $(HOST_PREFIX_1)malloc.o: malloc.c - *** 1532,1536 **** - $(HOST_PREFIX_1): - touch $(HOST_PREFIX_1) - ! - # Remake bytecode files. - BI_OBJ=bi-parser.o bi-lexer.o bi-reverse.o - --- 1534,1538 ---- - $(HOST_PREFIX_1): - touch $(HOST_PREFIX_1) - ! # - # Remake bytecode files. - BI_OBJ=bi-parser.o bi-lexer.o bi-reverse.o - *************** bytecode.maintainer-clean: bytecode.clea - *** 1601,1605 **** - -rm -f bi-parser.c bi-parser.h - - ! - # Remake cpp and protoize. - - --- 1603,1607 ---- - -rm -f bi-parser.c bi-parser.h - - ! # - # Remake cpp and protoize. - - *************** test-protoize-simple: ./protoize ./unpro - *** 1724,1728 **** - diff $(srcdir)/protoize.c tmp-proto.c | cat - -rm -f tmp-proto.[cs] tmp-proto$(objext) - ! - # Build the include directory. The stamp files are stmp-* rather than - # stamp-* so that mostlyclean does not force the include directory to - --- 1726,1730 ---- - diff $(srcdir)/protoize.c tmp-proto.c | cat - -rm -f tmp-proto.[cs] tmp-proto$(objext) - ! # - # Build the include directory. The stamp files are stmp-* rather than - # stamp-* so that mostlyclean does not force the include directory to - *************** stmp-fixproto: fixhdr.ready fixproto stm - *** 1862,1866 **** - fi - touch stmp-fixproto - ! - # Remake the info files. - - --- 1864,1868 ---- - fi - touch stmp-fixproto - ! # - # Remake the info files. - - *************** $(srcdir)/INSTALL: install1.texi install - *** 1889,1893 **** - cd $(srcdir); $(MAKEINFO) -D INSTALLONLY --no-header \ - --no-split install1.texi -o INSTALL - ! - # Deletion of files made during compilation. - # There are four levels of this: - --- 1891,1895 ---- - cd $(srcdir); $(MAKEINFO) -D INSTALLONLY --no-header \ - --no-split install1.texi -o INSTALL - ! # - # Deletion of files made during compilation. - # There are four levels of this: - *************** maintainer-clean: distclean bytecode.mai - *** 2010,2014 **** - -rm -f cpp.info* cpp.??s cpp.*aux - -rm -f gcc.info* gcc.??s gcc.*aux - ! - # Entry points `install' and `uninstall'. - # Also use `install-collect2' to install collect2 when the config files don't. - --- 2012,2016 ---- - -rm -f cpp.info* cpp.??s cpp.*aux - -rm -f gcc.info* gcc.??s gcc.*aux - ! # - # Entry points `install' and `uninstall'. - # Also use `install-collect2' to install collect2 when the config files don't. - *************** uninstall: lang.uninstall - *** 2256,2260 **** - -rm -rf $(mandir)/protoize$(manext) - -rm -rf $(mandir)/unprotoize$(manext) - ! - # These exist for maintenance purposes. - - --- 2258,2262 ---- - -rm -rf $(mandir)/protoize$(manext) - -rm -rf $(mandir)/unprotoize$(manext) - ! # - # These exist for maintenance purposes. - - diff -rcp2N gcc-2.7.2.3/alias.c gcc-2.7.2.3.f.2/alias.c - *** gcc-2.7.2.3/alias.c Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/alias.c Thu Feb 26 21:15:44 1998 - *************** - *** 0 **** - --- 1,1022 ---- - + /* Alias analysis for GNU C, by John Carr (jfc@mit.edu). - + Derived in part from sched.c */ - + #include "config.h" - + #include "rtl.h" - + #include "expr.h" - + #include "regs.h" - + #include "hard-reg-set.h" - + #include "flags.h" - + - + static rtx canon_rtx PROTO((rtx)); - + static int rtx_equal_for_memref_p PROTO((rtx, rtx)); - + static rtx find_symbolic_term PROTO((rtx)); - + static int memrefs_conflict_p PROTO((int, rtx, int, rtx, - + HOST_WIDE_INT)); - + - + /* Set up all info needed to perform alias analysis on memory references. */ - + - + #define SIZE_FOR_MODE(X) (GET_MODE_SIZE (GET_MODE (X))) - + - + /* reg_base_value[N] gives an address to which register N is related. - + If all sets after the first add or subtract to the current value - + or otherwise modify it so it does not point to a different top level - + object, reg_base_value[N] is equal to the address part of the source - + of the first set. The value will be a SYMBOL_REF, a LABEL_REF, or - + (address (reg)) to indicate that the address is derived from an - + argument or fixed register. */ - + rtx *reg_base_value; - + unsigned int reg_base_value_size; /* size of reg_base_value array */ - + #define REG_BASE_VALUE(X) \ - + (REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0) - + - + /* Vector indexed by N giving the initial (unchanging) value known - + for pseudo-register N. */ - + rtx *reg_known_value; - + - + /* Indicates number of valid entries in reg_known_value. */ - + static int reg_known_value_size; - + - + /* Vector recording for each reg_known_value whether it is due to a - + REG_EQUIV note. Future passes (viz., reload) may replace the - + pseudo with the equivalent expression and so we account for the - + dependences that would be introduced if that happens. */ - + /* ??? This is a problem only on the Convex. The REG_EQUIV notes created in - + assign_parms mention the arg pointer, and there are explicit insns in the - + RTL that modify the arg pointer. Thus we must ensure that such insns don't - + get scheduled across each other because that would invalidate the REG_EQUIV - + notes. One could argue that the REG_EQUIV notes are wrong, but solving - + the problem in the scheduler will likely give better code, so we do it - + here. */ - + char *reg_known_equiv_p; - + - + /* Inside SRC, the source of a SET, find a base address. */ - + - + /* When copying arguments into pseudo-registers, record the (ADDRESS) - + expression for the argument directly so that even if the argument - + register is changed later (e.g. for a function call) the original - + value is noted. */ - + static int copying_arguments; - + - + static rtx - + find_base_value (src) - + register rtx src; - + { - + switch (GET_CODE (src)) - + { - + case SYMBOL_REF: - + case LABEL_REF: - + return src; - + - + case REG: - + if (copying_arguments && REGNO (src) < FIRST_PSEUDO_REGISTER) - + return reg_base_value[REGNO (src)]; - + return src; - + - + case MEM: - + /* Check for an argument passed in memory. Only record in the - + copying-arguments block; it is too hard to track changes - + otherwise. */ - + if (copying_arguments - + && (XEXP (src, 0) == arg_pointer_rtx - + || (GET_CODE (XEXP (src, 0)) == PLUS - + && XEXP (XEXP (src, 0), 0) == arg_pointer_rtx))) - + return gen_rtx (ADDRESS, VOIDmode, src); - + return 0; - + - + case CONST: - + src = XEXP (src, 0); - + if (GET_CODE (src) != PLUS && GET_CODE (src) != MINUS) - + break; - + /* fall through */ - + case PLUS: - + case MINUS: - + /* Guess which operand to set the register equivalent to. */ - + /* If the first operand is a symbol or the second operand is - + an integer, the first operand is the base address. */ - + if (GET_CODE (XEXP (src, 0)) == SYMBOL_REF - + || GET_CODE (XEXP (src, 0)) == LABEL_REF - + || GET_CODE (XEXP (src, 1)) == CONST_INT) - + return XEXP (src, 0); - + /* If an operand is a register marked as a pointer, it is the base. */ - + if (GET_CODE (XEXP (src, 0)) == REG - + && REGNO_POINTER_FLAG (REGNO (XEXP (src, 0)))) - + src = XEXP (src, 0); - + else if (GET_CODE (XEXP (src, 1)) == REG - + && REGNO_POINTER_FLAG (REGNO (XEXP (src, 1)))) - + src = XEXP (src, 1); - + else - + return 0; - + if (copying_arguments && REGNO (src) < FIRST_PSEUDO_REGISTER) - + return reg_base_value[REGNO (src)]; - + return src; - + - + case AND: - + /* If the second operand is constant set the base - + address to the first operand. */ - + if (GET_CODE (XEXP (src, 1)) == CONST_INT - + && GET_CODE (XEXP (src, 0)) == REG) - + { - + src = XEXP (src, 0); - + if (copying_arguments && REGNO (src) < FIRST_PSEUDO_REGISTER) - + return reg_base_value[REGNO (src)]; - + return src; - + } - + return 0; - + - + case HIGH: - + return XEXP (src, 0); - + } - + - + return 0; - + } - + - + /* Called from init_alias_analysis indirectly through note_stores. */ - + - + /* while scanning insns to find base values, reg_seen[N] is nonzero if - + register N has been set in this function. */ - + static char *reg_seen; - + - + static - + void record_set (dest, set) - + rtx dest, set; - + { - + register int regno; - + rtx src; - + - + if (GET_CODE (dest) != REG) - + return; - + - + regno = REGNO (dest); - + - + if (set) - + { - + /* A CLOBBER wipes out any old value but does not prevent a previously - + unset register from acquiring a base address (i.e. reg_seen is not - + set). */ - + if (GET_CODE (set) == CLOBBER) - + { - + reg_base_value[regno] = 0; - + return; - + } - + src = SET_SRC (set); - + } - + else - + { - + static int unique_id; - + if (reg_seen[regno]) - + { - + reg_base_value[regno] = 0; - + return; - + } - + reg_seen[regno] = 1; - + reg_base_value[regno] = gen_rtx (ADDRESS, Pmode, - + GEN_INT (unique_id++)); - + return; - + } - + - + /* This is not the first set. If the new value is not related to the - + old value, forget the base value. Note that the following code is - + not detected: - + extern int x, y; int *p = &x; p += (&y-&x); - + ANSI C does not allow computing the difference of addresses - + of distinct top level objects. */ - + if (reg_base_value[regno]) - + switch (GET_CODE (src)) - + { - + case PLUS: - + case MINUS: - + if (XEXP (src, 0) != dest && XEXP (src, 1) != dest) - + reg_base_value[regno] = 0; - + break; - + case AND: - + if (XEXP (src, 0) != dest || GET_CODE (XEXP (src, 1)) != CONST_INT) - + reg_base_value[regno] = 0; - + break; - + case LO_SUM: - + if (XEXP (src, 0) != dest) - + reg_base_value[regno] = 0; - + break; - + default: - + reg_base_value[regno] = 0; - + break; - + } - + /* If this is the first set of a register, record the value. */ - + else if ((regno >= FIRST_PSEUDO_REGISTER || ! fixed_regs[regno]) - + && ! reg_seen[regno] && reg_base_value[regno] == 0) - + reg_base_value[regno] = find_base_value (src); - + - + reg_seen[regno] = 1; - + } - + - + /* Called from loop optimization when a new pseudo-register is created. */ - + void - + record_base_value (regno, val) - + int regno; - + rtx val; - + { - + if (!flag_alias_check || regno >= reg_base_value_size) - + return; - + if (GET_CODE (val) == REG) - + { - + if (REGNO (val) < reg_base_value_size) - + reg_base_value[regno] = reg_base_value[REGNO (val)]; - + return; - + } - + reg_base_value[regno] = find_base_value (val); - + } - + - + static rtx - + canon_rtx (x) - + rtx x; - + { - + /* Recursively look for equivalences. */ - + if (GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER - + && REGNO (x) < reg_known_value_size) - + return reg_known_value[REGNO (x)] == x - + ? x : canon_rtx (reg_known_value[REGNO (x)]); - + else if (GET_CODE (x) == PLUS) - + { - + rtx x0 = canon_rtx (XEXP (x, 0)); - + rtx x1 = canon_rtx (XEXP (x, 1)); - + - + if (x0 != XEXP (x, 0) || x1 != XEXP (x, 1)) - + { - + /* We can tolerate LO_SUMs being offset here; these - + rtl are used for nothing other than comparisons. */ - + if (GET_CODE (x0) == CONST_INT) - + return plus_constant_for_output (x1, INTVAL (x0)); - + else if (GET_CODE (x1) == CONST_INT) - + return plus_constant_for_output (x0, INTVAL (x1)); - + return gen_rtx (PLUS, GET_MODE (x), x0, x1); - + } - + } - + /* This gives us much better alias analysis when called from - + the loop optimizer. Note we want to leave the original - + MEM alone, but need to return the canonicalized MEM with - + all the flags with their original values. */ - + else if (GET_CODE (x) == MEM) - + { - + rtx addr = canon_rtx (XEXP (x, 0)); - + if (addr != XEXP (x, 0)) - + { - + rtx new = gen_rtx (MEM, GET_MODE (x), addr); - + MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x); - + RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x); - + MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x); - + x = new; - + } - + } - + return x; - + } - + - + /* Return 1 if X and Y are identical-looking rtx's. - + - + We use the data in reg_known_value above to see if two registers with - + different numbers are, in fact, equivalent. */ - + - + static int - + rtx_equal_for_memref_p (x, y) - + rtx x, y; - + { - + register int i; - + register int j; - + register enum rtx_code code; - + register char *fmt; - + - + if (x == 0 && y == 0) - + return 1; - + if (x == 0 || y == 0) - + return 0; - + x = canon_rtx (x); - + y = canon_rtx (y); - + - + if (x == y) - + return 1; - + - + code = GET_CODE (x); - + /* Rtx's of different codes cannot be equal. */ - + if (code != GET_CODE (y)) - + return 0; - + - + /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. - + (REG:SI x) and (REG:HI x) are NOT equivalent. */ - + - + if (GET_MODE (x) != GET_MODE (y)) - + return 0; - + - + /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ - + - + if (code == REG) - + return REGNO (x) == REGNO (y); - + if (code == LABEL_REF) - + return XEXP (x, 0) == XEXP (y, 0); - + if (code == SYMBOL_REF) - + return XSTR (x, 0) == XSTR (y, 0); - + - + /* For commutative operations, the RTX match if the operand match in any - + order. Also handle the simple binary and unary cases without a loop. */ - + if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c') - + return ((rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)) - + && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 1))) - + || (rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 1)) - + && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 0)))); - + else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2') - + return (rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)) - + && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 1))); - + else if (GET_RTX_CLASS (code) == '1') - + return rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)); - + - + /* Compare the elements. If any pair of corresponding elements - + fail to match, return 0 for the whole things. */ - + - + fmt = GET_RTX_FORMAT (code); - + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - + { - + switch (fmt[i]) - + { - + case 'w': - + if (XWINT (x, i) != XWINT (y, i)) - + return 0; - + break; - + - + case 'n': - + case 'i': - + if (XINT (x, i) != XINT (y, i)) - + return 0; - + break; - + - + case 'V': - + case 'E': - + /* Two vectors must have the same length. */ - + if (XVECLEN (x, i) != XVECLEN (y, i)) - + return 0; - + - + /* And the corresponding elements must match. */ - + for (j = 0; j < XVECLEN (x, i); j++) - + if (rtx_equal_for_memref_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) - + return 0; - + break; - + - + case 'e': - + if (rtx_equal_for_memref_p (XEXP (x, i), XEXP (y, i)) == 0) - + return 0; - + break; - + - + case 'S': - + case 's': - + if (strcmp (XSTR (x, i), XSTR (y, i))) - + return 0; - + break; - + - + case 'u': - + /* These are just backpointers, so they don't matter. */ - + break; - + - + case '0': - + break; - + - + /* It is believed that rtx's at this level will never - + contain anything but integers and other rtx's, - + except for within LABEL_REFs and SYMBOL_REFs. */ - + default: - + abort (); - + } - + } - + return 1; - + } - + - + /* Given an rtx X, find a SYMBOL_REF or LABEL_REF within - + X and return it, or return 0 if none found. */ - + - + static rtx - + find_symbolic_term (x) - + rtx x; - + { - + register int i; - + register enum rtx_code code; - + register char *fmt; - + - + code = GET_CODE (x); - + if (code == SYMBOL_REF || code == LABEL_REF) - + return x; - + if (GET_RTX_CLASS (code) == 'o') - + return 0; - + - + fmt = GET_RTX_FORMAT (code); - + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - + { - + rtx t; - + - + if (fmt[i] == 'e') - + { - + t = find_symbolic_term (XEXP (x, i)); - + if (t != 0) - + return t; - + } - + else if (fmt[i] == 'E') - + break; - + } - + return 0; - + } - + - + static rtx - + find_base_term (x) - + register rtx x; - + { - + switch (GET_CODE (x)) - + { - + case REG: - + return REG_BASE_VALUE (x); - + - + case HIGH: - + return find_base_term (XEXP (x, 0)); - + - + case CONST: - + x = XEXP (x, 0); - + if (GET_CODE (x) != PLUS && GET_CODE (x) != MINUS) - + return 0; - + /* fall through */ - + case LO_SUM: - + case PLUS: - + case MINUS: - + { - + rtx tmp = find_base_term (XEXP (x, 0)); - + if (tmp) - + return tmp; - + return find_base_term (XEXP (x, 1)); - + } - + - + case AND: - + if (GET_CODE (XEXP (x, 0)) == REG && GET_CODE (XEXP (x, 1)) == CONST_INT) - + return REG_BASE_VALUE (XEXP (x, 0)); - + return 0; - + - + case SYMBOL_REF: - + case LABEL_REF: - + return x; - + - + default: - + return 0; - + } - + } - + - + /* Return 0 if the addresses X and Y are known to point to different - + objects, 1 if they might be pointers to the same object. */ - + - + static int - + base_alias_check (x, y) - + rtx x, y; - + { - + rtx x_base = find_base_term (x); - + rtx y_base = find_base_term (y); - + - + /* If either base address is unknown or the base addresses are equal, - + nothing is known about aliasing. */ - + - + if (x_base == 0 || y_base == 0 || rtx_equal_p (x_base, y_base)) - + return 1; - + - + /* The base addresses of the read and write are different - + expressions. If they are both symbols and they are not accessed - + via AND, there is no conflict. */ - + /* XXX: We can bring knowledge of object alignment and offset into - + play here. For example, on alpha, "char a, b;" can alias one - + another, though "char a; long b;" cannot. Similarly, offsets - + into strutures may be brought into play. Given "char a, b[40];", - + a and b[1] may overlap, but a and b[20] do not. */ - + if (GET_CODE (x_base) != ADDRESS && GET_CODE (y_base) != ADDRESS) - + { - + return GET_CODE (x) == AND || GET_CODE (y) == AND; - + } - + - + /* If one address is a stack reference there can be no alias: - + stack references using different base registers do not alias, - + a stack reference can not alias a parameter, and a stack reference - + can not alias a global. */ - + if ((GET_CODE (x_base) == ADDRESS && GET_MODE (x_base) == Pmode) - + || (GET_CODE (y_base) == ADDRESS && GET_MODE (y_base) == Pmode)) - + return 0; - + - + if (! flag_argument_noalias) - + return 1; - + - + if (flag_argument_noalias > 1) - + return 0; - + - + /* Weak noalias assertion (arguments are distinct, but may match globals). */ - + return ! (GET_MODE (x_base) == VOIDmode && GET_MODE (y_base) == VOIDmode); - + } - + - + /* Return nonzero if X and Y (memory addresses) could reference the - + same location in memory. C is an offset accumulator. When - + C is nonzero, we are testing aliases between X and Y + C. - + XSIZE is the size in bytes of the X reference, - + similarly YSIZE is the size in bytes for Y. - + - + If XSIZE or YSIZE is zero, we do not know the amount of memory being - + referenced (the reference was BLKmode), so make the most pessimistic - + assumptions. - + - + If XSIZE or YSIZE is negative, we may access memory outside the object - + being referenced as a side effect. This can happen when using AND to - + align memory references, as is done on the Alpha. - + - + We recognize the following cases of non-conflicting memory: - + - + (1) addresses involving the frame pointer cannot conflict - + with addresses involving static variables. - + (2) static variables with different addresses cannot conflict. - + - + Nice to notice that varying addresses cannot conflict with fp if no - + local variables had their addresses taken, but that's too hard now. */ - + - + - + static int - + memrefs_conflict_p (xsize, x, ysize, y, c) - + register rtx x, y; - + int xsize, ysize; - + HOST_WIDE_INT c; - + { - + if (GET_CODE (x) == HIGH) - + x = XEXP (x, 0); - + else if (GET_CODE (x) == LO_SUM) - + x = XEXP (x, 1); - + else - + x = canon_rtx (x); - + if (GET_CODE (y) == HIGH) - + y = XEXP (y, 0); - + else if (GET_CODE (y) == LO_SUM) - + y = XEXP (y, 1); - + else - + y = canon_rtx (y); - + - + if (rtx_equal_for_memref_p (x, y)) - + { - + if (xsize <= 0 || ysize <= 0) - + return 1; - + if (c >= 0 && xsize > c) - + return 1; - + if (c < 0 && ysize+c > 0) - + return 1; - + return 0; - + } - + - + if (y == frame_pointer_rtx || y == hard_frame_pointer_rtx - + || y == stack_pointer_rtx) - + { - + rtx t = y; - + int tsize = ysize; - + y = x; ysize = xsize; - + x = t; xsize = tsize; - + } - + - + if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx - + || x == stack_pointer_rtx) - + { - + rtx y1; - + - + if (CONSTANT_P (y)) - + return 0; - + - + if (GET_CODE (y) == PLUS - + && canon_rtx (XEXP (y, 0)) == x - + && (y1 = canon_rtx (XEXP (y, 1))) - + && GET_CODE (y1) == CONST_INT) - + { - + c += INTVAL (y1); - + return (xsize <= 0 || ysize <= 0 - + || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - + } - + - + if (GET_CODE (y) == PLUS - + && (y1 = canon_rtx (XEXP (y, 0))) - + && CONSTANT_P (y1)) - + return 0; - + - + return 1; - + } - + - + if (GET_CODE (x) == PLUS) - + { - + /* The fact that X is canonicalized means that this - + PLUS rtx is canonicalized. */ - + rtx x0 = XEXP (x, 0); - + rtx x1 = XEXP (x, 1); - + - + if (GET_CODE (y) == PLUS) - + { - + /* The fact that Y is canonicalized means that this - + PLUS rtx is canonicalized. */ - + rtx y0 = XEXP (y, 0); - + rtx y1 = XEXP (y, 1); - + - + if (rtx_equal_for_memref_p (x1, y1)) - + return memrefs_conflict_p (xsize, x0, ysize, y0, c); - + if (rtx_equal_for_memref_p (x0, y0)) - + return memrefs_conflict_p (xsize, x1, ysize, y1, c); - + if (GET_CODE (x1) == CONST_INT) - + if (GET_CODE (y1) == CONST_INT) - + return memrefs_conflict_p (xsize, x0, ysize, y0, - + c - INTVAL (x1) + INTVAL (y1)); - + else - + return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1)); - + else if (GET_CODE (y1) == CONST_INT) - + return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); - + - + /* Handle case where we cannot understand iteration operators, - + but we notice that the base addresses are distinct objects. */ - + /* ??? Is this still necessary? */ - + x = find_symbolic_term (x); - + if (x == 0) - + return 1; - + y = find_symbolic_term (y); - + if (y == 0) - + return 1; - + return rtx_equal_for_memref_p (x, y); - + } - + else if (GET_CODE (x1) == CONST_INT) - + return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1)); - + } - + else if (GET_CODE (y) == PLUS) - + { - + /* The fact that Y is canonicalized means that this - + PLUS rtx is canonicalized. */ - + rtx y0 = XEXP (y, 0); - + rtx y1 = XEXP (y, 1); - + - + if (GET_CODE (y1) == CONST_INT) - + return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); - + else - + return 1; - + } - + - + if (GET_CODE (x) == GET_CODE (y)) - + switch (GET_CODE (x)) - + { - + case MULT: - + { - + /* Handle cases where we expect the second operands to be the - + same, and check only whether the first operand would conflict - + or not. */ - + rtx x0, y0; - + rtx x1 = canon_rtx (XEXP (x, 1)); - + rtx y1 = canon_rtx (XEXP (y, 1)); - + if (! rtx_equal_for_memref_p (x1, y1)) - + return 1; - + x0 = canon_rtx (XEXP (x, 0)); - + y0 = canon_rtx (XEXP (y, 0)); - + if (rtx_equal_for_memref_p (x0, y0)) - + return (xsize == 0 || ysize == 0 - + || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - + - + /* Can't properly adjust our sizes. */ - + if (GET_CODE (x1) != CONST_INT) - + return 1; - + xsize /= INTVAL (x1); - + ysize /= INTVAL (x1); - + c /= INTVAL (x1); - + return memrefs_conflict_p (xsize, x0, ysize, y0, c); - + } - + } - + - + /* Treat an access through an AND (e.g. a subword access on an Alpha) - + as an access with indeterminate size. */ - + if (GET_CODE (x) == AND && GET_CODE (XEXP (x, 1)) == CONST_INT) - + return memrefs_conflict_p (-1, XEXP (x, 0), ysize, y, c); - + if (GET_CODE (y) == AND && GET_CODE (XEXP (y, 1)) == CONST_INT) - + { - + /* XXX: If we are indexing far enough into the array/structure, we - + may yet be able to determine that we can not overlap. But we - + also need to that we are far enough from the end not to overlap - + a following reference, so we do nothing for now. */ - + return memrefs_conflict_p (xsize, x, -1, XEXP (y, 0), c); - + } - + - + if (CONSTANT_P (x)) - + { - + if (GET_CODE (x) == CONST_INT && GET_CODE (y) == CONST_INT) - + { - + c += (INTVAL (y) - INTVAL (x)); - + return (xsize <= 0 || ysize <= 0 - + || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - + } - + - + if (GET_CODE (x) == CONST) - + { - + if (GET_CODE (y) == CONST) - + return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), - + ysize, canon_rtx (XEXP (y, 0)), c); - + else - + return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), - + ysize, y, c); - + } - + if (GET_CODE (y) == CONST) - + return memrefs_conflict_p (xsize, x, ysize, - + canon_rtx (XEXP (y, 0)), c); - + - + if (CONSTANT_P (y)) - + return (xsize < 0 || ysize < 0 - + || (rtx_equal_for_memref_p (x, y) - + && (xsize == 0 || ysize == 0 - + || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)))); - + - + return 1; - + } - + return 1; - + } - + - + /* Functions to compute memory dependencies. - + - + Since we process the insns in execution order, we can build tables - + to keep track of what registers are fixed (and not aliased), what registers - + are varying in known ways, and what registers are varying in unknown - + ways. - + - + If both memory references are volatile, then there must always be a - + dependence between the two references, since their order can not be - + changed. A volatile and non-volatile reference can be interchanged - + though. - + - + A MEM_IN_STRUCT reference at a non-QImode non-AND varying address can never - + conflict with a non-MEM_IN_STRUCT reference at a fixed address. We must - + allow QImode aliasing because the ANSI C standard allows character - + pointers to alias anything. We are assuming that characters are - + always QImode here. We also must allow AND addresses, because they may - + generate accesses outside the object being referenced. This is used to - + generate aligned addresses from unaligned addresses, for instance, the - + alpha storeqi_unaligned pattern. */ - + - + /* Read dependence: X is read after read in MEM takes place. There can - + only be a dependence here if both reads are volatile. */ - + - + int - + read_dependence (mem, x) - + rtx mem; - + rtx x; - + { - + return MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem); - + } - + - + /* True dependence: X is read after store in MEM takes place. */ - + - + int - + true_dependence (mem, mem_mode, x, varies) - + rtx mem; - + enum machine_mode mem_mode; - + rtx x; - + int (*varies)(); - + { - + rtx x_addr, mem_addr; - + - + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - + return 1; - + - + x_addr = XEXP (x, 0); - + mem_addr = XEXP (mem, 0); - + - + if (flag_alias_check && ! base_alias_check (x_addr, mem_addr)) - + return 0; - + - + /* If X is an unchanging read, then it can't possibly conflict with any - + non-unchanging store. It may conflict with an unchanging write though, - + because there may be a single store to this address to initialize it. - + Just fall through to the code below to resolve the case where we have - + both an unchanging read and an unchanging write. This won't handle all - + cases optimally, but the possible performance loss should be - + negligible. */ - + if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem)) - + return 0; - + - + x_addr = canon_rtx (x_addr); - + mem_addr = canon_rtx (mem_addr); - + if (mem_mode == VOIDmode) - + mem_mode = GET_MODE (mem); - + - + if (! memrefs_conflict_p (mem_mode, mem_addr, SIZE_FOR_MODE (x), x_addr, 0)) - + return 0; - + - + /* If both references are struct references, or both are not, nothing - + is known about aliasing. - + - + If either reference is QImode or BLKmode, ANSI C permits aliasing. - + - + If both addresses are constant, or both are not, nothing is known - + about aliasing. */ - + if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem) - + || mem_mode == QImode || mem_mode == BLKmode - + || GET_MODE (x) == QImode || GET_MODE (x) == BLKmode - + || GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND - + || varies (x_addr) == varies (mem_addr)) - + return 1; - + - + /* One memory reference is to a constant address, one is not. - + One is to a structure, the other is not. - + - + If either memory reference is a variable structure the other is a - + fixed scalar and there is no aliasing. */ - + if ((MEM_IN_STRUCT_P (mem) && varies (mem_addr)) - + || (MEM_IN_STRUCT_P (x) && varies (x_addr))) - + return 0; - + - + return 1; - + } - + - + /* Anti dependence: X is written after read in MEM takes place. */ - + - + int - + anti_dependence (mem, x) - + rtx mem; - + rtx x; - + { - + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - + return 1; - + - + if (flag_alias_check && ! base_alias_check (XEXP (x, 0), XEXP (mem, 0))) - + return 0; - + - + /* If MEM is an unchanging read, then it can't possibly conflict with - + the store to X, because there is at most one store to MEM, and it must - + have occurred somewhere before MEM. */ - + x = canon_rtx (x); - + mem = canon_rtx (mem); - + if (RTX_UNCHANGING_P (mem)) - + return 0; - + - + return (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0), - + SIZE_FOR_MODE (x), XEXP (x, 0), 0) - + && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem) - + && GET_MODE (mem) != QImode - + && GET_CODE (XEXP (mem, 0)) != AND - + && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x)) - + && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x) - + && GET_MODE (x) != QImode - + && GET_CODE (XEXP (x, 0)) != AND - + && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem))); - + } - + - + /* Output dependence: X is written after store in MEM takes place. */ - + - + int - + output_dependence (mem, x) - + register rtx mem; - + register rtx x; - + { - + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - + return 1; - + - + if (flag_alias_check && !base_alias_check (XEXP (x, 0), XEXP (mem, 0))) - + return 0; - + - + x = canon_rtx (x); - + mem = canon_rtx (mem); - + return (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0), - + SIZE_FOR_MODE (x), XEXP (x, 0), 0) - + && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem) - + && GET_MODE (mem) != QImode - + && GET_CODE (XEXP (mem, 0)) != AND - + && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x)) - + && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x) - + && GET_MODE (x) != QImode - + && GET_CODE (XEXP (x, 0)) != AND - + && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem))); - + } - + - + void - + init_alias_analysis () - + { - + int maxreg = max_reg_num (); - + int changed; - + register int i; - + register rtx insn; - + rtx note; - + rtx set; - + - + reg_known_value_size = maxreg; - + - + reg_known_value - + = (rtx *) oballoc ((maxreg - FIRST_PSEUDO_REGISTER) * sizeof (rtx)) - + - FIRST_PSEUDO_REGISTER; - + reg_known_equiv_p = - + oballoc (maxreg - FIRST_PSEUDO_REGISTER) - FIRST_PSEUDO_REGISTER; - + bzero ((char *) (reg_known_value + FIRST_PSEUDO_REGISTER), - + (maxreg-FIRST_PSEUDO_REGISTER) * sizeof (rtx)); - + bzero (reg_known_equiv_p + FIRST_PSEUDO_REGISTER, - + (maxreg - FIRST_PSEUDO_REGISTER) * sizeof (char)); - + - + if (flag_alias_check) - + { - + /* Overallocate reg_base_value to allow some growth during loop - + optimization. Loop unrolling can create a large number of - + registers. */ - + reg_base_value_size = maxreg * 2; - + reg_base_value = (rtx *)oballoc (reg_base_value_size * sizeof (rtx)); - + reg_seen = (char *)alloca (reg_base_value_size); - + bzero (reg_base_value, reg_base_value_size * sizeof (rtx)); - + bzero (reg_seen, reg_base_value_size); - + - + /* Mark all hard registers which may contain an address. - + The stack, frame and argument pointers may contain an address. - + An argument register which can hold a Pmode value may contain - + an address even if it is not in BASE_REGS. - + - + The address expression is VOIDmode for an argument and - + Pmode for other registers. */ - + #ifndef OUTGOING_REGNO - + #define OUTGOING_REGNO(N) N - + #endif - + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - + /* Check whether this register can hold an incoming pointer - + argument. FUNCTION_ARG_REGNO_P tests outgoing register - + numbers, so translate if necessary due to register windows. */ - + if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (i)) && HARD_REGNO_MODE_OK (i, Pmode)) - + reg_base_value[i] = gen_rtx (ADDRESS, VOIDmode, - + gen_rtx (REG, Pmode, i)); - + - + reg_base_value[STACK_POINTER_REGNUM] - + = gen_rtx (ADDRESS, Pmode, stack_pointer_rtx); - + reg_base_value[ARG_POINTER_REGNUM] - + = gen_rtx (ADDRESS, Pmode, arg_pointer_rtx); - + reg_base_value[FRAME_POINTER_REGNUM] - + = gen_rtx (ADDRESS, Pmode, frame_pointer_rtx); - + reg_base_value[HARD_FRAME_POINTER_REGNUM] - + = gen_rtx (ADDRESS, Pmode, hard_frame_pointer_rtx); - + } - + - + copying_arguments = 1; - + /* Fill in the entries with known constant values. */ - + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - + { - + if (flag_alias_check && GET_RTX_CLASS (GET_CODE (insn)) == 'i') - + { - + /* If this insn has a noalias note, process it, Otherwise, - + scan for sets. A simple set will have no side effects - + which could change the base value of any other register. */ - + rtx noalias_note; - + if (GET_CODE (PATTERN (insn)) == SET - + && (noalias_note = find_reg_note (insn, REG_NOALIAS, NULL_RTX))) - + record_set (SET_DEST (PATTERN (insn)), 0); - + else - + note_stores (PATTERN (insn), record_set); - + } - + else if (GET_CODE (insn) == NOTE - + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) - + copying_arguments = 0; - + - + if ((set = single_set (insn)) != 0 - + && GET_CODE (SET_DEST (set)) == REG - + && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER - + && (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0 - + && reg_n_sets[REGNO (SET_DEST (set))] == 1) - + || (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0) - + && GET_CODE (XEXP (note, 0)) != EXPR_LIST) - + { - + int regno = REGNO (SET_DEST (set)); - + reg_known_value[regno] = XEXP (note, 0); - + reg_known_equiv_p[regno] = REG_NOTE_KIND (note) == REG_EQUIV; - + } - + } - + - + /* Fill in the remaining entries. */ - + for (i = FIRST_PSEUDO_REGISTER; i < maxreg; i++) - + if (reg_known_value[i] == 0) - + reg_known_value[i] = regno_reg_rtx[i]; - + - + if (! flag_alias_check) - + return; - + - + /* Simplify the reg_base_value array so that no register refers to - + another register, except to special registers indirectly through - + ADDRESS expressions. - + - + In theory this loop can take as long as O(registers^2), but unless - + there are very long dependency chains it will run in close to linear - + time. */ - + do - + { - + changed = 0; - + for (i = FIRST_PSEUDO_REGISTER; i < reg_base_value_size; i++) - + { - + rtx base = reg_base_value[i]; - + if (base && GET_CODE (base) == REG) - + { - + int base_regno = REGNO (base); - + if (base_regno == i) /* register set from itself */ - + reg_base_value[i] = 0; - + else - + reg_base_value[i] = reg_base_value[base_regno]; - + changed = 1; - + } - + } - + } - + while (changed); - + - + reg_seen = 0; - + } - + - + void - + end_alias_analysis () - + { - + reg_known_value = 0; - + reg_base_value = 0; - + reg_base_value_size = 0; - + } - diff -rcp2N gcc-2.7.2.3/basic-block.h gcc-2.7.2.3.f.2/basic-block.h - *** gcc-2.7.2.3/basic-block.h Thu Jun 15 11:03:29 1995 - --- gcc-2.7.2.3.f.2/basic-block.h Sun Mar 1 03:28:56 1998 - *************** extern rtx *basic_block_head; - *** 53,56 **** - --- 53,61 ---- - extern rtx *basic_block_end; - - + /* Index by basic block number, determine whether the block can be reached - + through a computed jump. */ - + - + extern char *basic_block_computed_jump_target; - + - /* Index by basic block number, get address of regset - describing the registers live at the start of that block. */ - diff -rcp2N gcc-2.7.2.3/c-decl.c gcc-2.7.2.3.f.2/c-decl.c - *** gcc-2.7.2.3/c-decl.c Fri Oct 27 09:44:43 1995 - --- gcc-2.7.2.3.f.2/c-decl.c Tue Sep 9 07:01:13 1997 - *************** init_decl_processing () - *** 3207,3210 **** - --- 3207,3223 ---- - builtin_function ("__builtin_cosl", ldouble_ftype_ldouble, - BUILT_IN_COS, "cosl"); - + builtin_function ("__builtin_setjmp", - + build_function_type (integer_type_node, - + tree_cons (NULL_TREE, - + ptr_type_node, endlink)), - + BUILT_IN_SETJMP, NULL_PTR); - + builtin_function ("__builtin_longjmp", - + build_function_type - + (void_type_node, - + tree_cons (NULL, ptr_type_node, - + tree_cons (NULL_TREE, - + integer_type_node, - + endlink))), - + BUILT_IN_LONGJMP, NULL_PTR); - - /* In an ANSI C program, it is okay to supply built-in meanings - *************** grokdeclarator (declarator, declspecs, d - *** 4049,4052 **** - --- 4062,4066 ---- - int volatilep; - int inlinep; - + int restrictp; - int explicit_int = 0; - int explicit_char = 0; - *************** grokdeclarator (declarator, declspecs, d - *** 4342,4349 **** - --- 4356,4366 ---- - volatilep = !! (specbits & 1 << (int) RID_VOLATILE) + TYPE_VOLATILE (type); - inlinep = !! (specbits & (1 << (int) RID_INLINE)); - + restrictp = !! (specbits & (1 << (int) RID_RESTRICT)); - if (constp > 1) - pedwarn ("duplicate `const'"); - if (volatilep > 1) - pedwarn ("duplicate `volatile'"); - + if (restrictp) - + error ("`restrict' used in non-parameter or non-pointer type declaration"); - if (! flag_gen_aux_info && (TYPE_READONLY (type) || TYPE_VOLATILE (type))) - type = TYPE_MAIN_VARIANT (type); - *************** grokdeclarator (declarator, declspecs, d - *** 4693,4696 **** - --- 4710,4715 ---- - else if (TREE_VALUE (typemodlist) == ridpointers[(int) RID_VOLATILE]) - volatilep++; - + else if (TREE_VALUE (typemodlist) == ridpointers[(int) RID_RESTRICT]) - + restrictp++; - else if (!erred) - { - *************** grokdeclarator (declarator, declspecs, d - *** 4703,4706 **** - --- 4722,4727 ---- - if (volatilep > 1) - pedwarn ("duplicate `volatile'"); - + if (restrictp > 1) - + pedwarn ("duplicate `restrict'"); - } - - *************** grokdeclarator (declarator, declspecs, d - *** 4844,4847 **** - --- 4865,4875 ---- - } - - + if (restrictp) - + { - + if (TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE) - + error ("`restrict' applied to non-pointer"); - + DECL_RESTRICT (decl) = 1; - + } - + - DECL_ARG_TYPE_AS_WRITTEN (decl) = type_as_written; - } - *************** start_struct (code, name) - *** 5365,5368 **** - --- 5393,5397 ---- - pushtag (name, ref); - C_TYPE_BEING_DEFINED (ref) = 1; - + TYPE_PACKED (ref) = flag_pack_struct; - return ref; - } - *************** start_enum (name) - *** 5806,5809 **** - --- 5835,5841 ---- - enum_overflow = 0; - - + if (flag_short_enums) - + TYPE_PACKED (enumtype) = 1; - + - return enumtype; - } - *************** finish_enum (enumtype, values, attribute - *** 5862,5867 **** - precision = MAX (lowprec, highprec); - - ! if (flag_short_enums || TYPE_PACKED (enumtype) - ! || precision > TYPE_PRECISION (integer_type_node)) - /* Use the width of the narrowest normal C type which is wide enough. */ - TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size (precision, 1)); - --- 5894,5898 ---- - precision = MAX (lowprec, highprec); - - ! if (TYPE_PACKED (enumtype) || precision > TYPE_PRECISION (integer_type_node)) - /* Use the width of the narrowest normal C type which is wide enough. */ - TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size (precision, 1)); - diff -rcp2N gcc-2.7.2.3/c-lex.c gcc-2.7.2.3.f.2/c-lex.c - *** gcc-2.7.2.3/c-lex.c Thu Jun 15 11:11:39 1995 - --- gcc-2.7.2.3.f.2/c-lex.c Mon Sep 29 19:55:33 1997 - *************** init_lex () - *** 173,176 **** - --- 173,177 ---- - ridpointers[(int) RID_CONST] = get_identifier ("const"); - ridpointers[(int) RID_VOLATILE] = get_identifier ("volatile"); - + ridpointers[(int) RID_RESTRICT] = get_identifier ("restrict"); - ridpointers[(int) RID_AUTO] = get_identifier ("auto"); - ridpointers[(int) RID_STATIC] = get_identifier ("static"); - *************** init_lex () - *** 206,209 **** - --- 207,211 ---- - UNSET_RESERVED_WORD ("iterator"); - UNSET_RESERVED_WORD ("complex"); - + UNSET_RESERVED_WORD ("restrict"); - } - if (flag_no_asm) - *************** init_lex () - *** 214,217 **** - --- 216,220 ---- - UNSET_RESERVED_WORD ("iterator"); - UNSET_RESERVED_WORD ("complex"); - + UNSET_RESERVED_WORD ("restrict"); - } - } - *************** yylex () - *** 1433,1437 **** - /* Create a node with determined type and value. */ - if (imag) - ! yylval.ttype = build_complex (convert (type, integer_zero_node), - build_real (type, value)); - else - --- 1436,1441 ---- - /* Create a node with determined type and value. */ - if (imag) - ! yylval.ttype = build_complex (NULL_TREE, - ! convert (type, integer_zero_node), - build_real (type, value)); - else - *************** yylex () - *** 1624,1629 **** - <= TYPE_PRECISION (integer_type_node)) - yylval.ttype - ! = build_complex (integer_zero_node, - ! convert (integer_type_node, yylval.ttype)); - else - error ("complex integer constant is too wide for `complex int'"); - --- 1628,1634 ---- - <= TYPE_PRECISION (integer_type_node)) - yylval.ttype - ! = build_complex (NULL_TREE, integer_zero_node, - ! convert (integer_type_node, - ! yylval.ttype)); - else - error ("complex integer constant is too wide for `complex int'"); - diff -rcp2N gcc-2.7.2.3/c-lex.h gcc-2.7.2.3.f.2/c-lex.h - *** gcc-2.7.2.3/c-lex.h Thu Jun 15 11:12:22 1995 - --- gcc-2.7.2.3.f.2/c-lex.h Tue Sep 9 07:01:13 1997 - *************** enum rid - *** 43,47 **** - RID_VOLATILE, - RID_INLINE, - ! RID_NOALIAS, - RID_ITERATOR, - RID_COMPLEX, - --- 43,47 ---- - RID_VOLATILE, - RID_INLINE, - ! RID_RESTRICT, - RID_ITERATOR, - RID_COMPLEX, - diff -rcp2N gcc-2.7.2.3/c-parse.gperf gcc-2.7.2.3.f.2/c-parse.gperf - *** gcc-2.7.2.3/c-parse.gperf Fri Apr 9 23:00:44 1993 - --- gcc-2.7.2.3.f.2/c-parse.gperf Mon Sep 29 19:49:21 1997 - *************** __label__, LABEL, NORID - *** 36,39 **** - --- 36,41 ---- - __real, REALPART, NORID - __real__, REALPART, NORID - + __restrict, TYPE_QUAL, RID_RESTRICT - + __restrict__, TYPE_QUAL, RID_RESTRICT - __signed, TYPESPEC, RID_SIGNED - __signed__, TYPESPEC, RID_SIGNED - diff -rcp2N gcc-2.7.2.3/c-typeck.c gcc-2.7.2.3.f.2/c-typeck.c - *** gcc-2.7.2.3/c-typeck.c Sat Jun 29 16:27:15 1996 - --- gcc-2.7.2.3.f.2/c-typeck.c Tue Sep 9 07:01:14 1997 - *************** pointer_int_sum (resultcode, ptrop, into - *** 2681,2686 **** - so the multiply won't overflow spuriously. */ - - ! if (TYPE_PRECISION (TREE_TYPE (intop)) != POINTER_SIZE) - ! intop = convert (type_for_size (POINTER_SIZE, 0), intop); - - /* Replace the integer argument with a suitable product by the object size. - --- 2681,2688 ---- - so the multiply won't overflow spuriously. */ - - ! if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype) - ! || TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype)) - ! intop = convert (type_for_size (TYPE_PRECISION (sizetype), - ! TREE_UNSIGNED (sizetype)), intop); - - /* Replace the integer argument with a suitable product by the object size. - diff -rcp2N gcc-2.7.2.3/calls.c gcc-2.7.2.3.f.2/calls.c - *** gcc-2.7.2.3/calls.c Fri Oct 27 01:53:43 1995 - --- gcc-2.7.2.3.f.2/calls.c Tue Sep 9 07:01:14 1997 - *************** expand_call (exp, target, ignore) - *** 564,567 **** - --- 564,569 ---- - /* Nonzero if it is plausible that this is a call to alloca. */ - int may_be_alloca; - + /* Nonzero if this is a call to malloc or a related function. */ - + int is_malloc; - /* Nonzero if this is a call to setjmp or a related function. */ - int returns_twice; - *************** expand_call (exp, target, ignore) - *** 741,745 **** - if (stack_arg_under_construction || i >= 0) - { - ! rtx insn = NEXT_INSN (before_call), seq; - - /* Look for a call in the inline function code. - --- 743,749 ---- - if (stack_arg_under_construction || i >= 0) - { - ! rtx first_insn - ! = before_call ? NEXT_INSN (before_call) : get_insns (); - ! rtx insn, seq; - - /* Look for a call in the inline function code. - *************** expand_call (exp, target, ignore) - *** 749,753 **** - - if (OUTGOING_ARGS_SIZE (DECL_SAVED_INSNS (fndecl)) == 0) - ! for (; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN) - break; - --- 753,757 ---- - - if (OUTGOING_ARGS_SIZE (DECL_SAVED_INSNS (fndecl)) == 0) - ! for (insn = first_insn; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN) - break; - *************** expand_call (exp, target, ignore) - *** 781,785 **** - seq = get_insns (); - end_sequence (); - ! emit_insns_before (seq, NEXT_INSN (before_call)); - emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX); - } - --- 785,789 ---- - seq = get_insns (); - end_sequence (); - ! emit_insns_before (seq, first_insn); - emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX); - } - *************** expand_call (exp, target, ignore) - *** 852,855 **** - --- 856,860 ---- - returns_twice = 0; - is_longjmp = 0; - + is_malloc = 0; - - if (name != 0 && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 15) - *************** expand_call (exp, target, ignore) - *** 891,894 **** - --- 896,903 ---- - && ! strcmp (tname, "longjmp")) - is_longjmp = 1; - + /* Only recognize malloc when alias analysis is enabled. */ - + else if (tname[0] == 'm' && flag_alias_check - + && ! strcmp(tname, "malloc")) - + is_malloc = 1; - } - - *************** expand_call (exp, target, ignore) - *** 1060,1064 **** - - if (TYPE_SIZE (type) == 0 - ! || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) - { - /* This is a variable-sized object. Make space on the stack - --- 1069,1077 ---- - - if (TYPE_SIZE (type) == 0 - ! || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST - ! || (flag_stack_check && ! STACK_CHECK_BUILTIN - ! && (TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0 - ! || (TREE_INT_CST_LOW (TYPE_SIZE (type)) - ! > STACK_CHECK_MAX_VAR_SIZE * BITS_PER_UNIT)))) - { - /* This is a variable-sized object. Make space on the stack - *************** expand_call (exp, target, ignore) - *** 1087,1090 **** - --- 1100,1104 ---- - - store_expr (args[i].tree_value, copy, 0); - + is_const = 0; - - args[i].tree_value = build1 (ADDR_EXPR, - *************** expand_call (exp, target, ignore) - *** 1363,1367 **** - /* Now we are about to start emitting insns that can be deleted - if a libcall is deleted. */ - ! if (is_const) - start_sequence (); - - --- 1377,1381 ---- - /* Now we are about to start emitting insns that can be deleted - if a libcall is deleted. */ - ! if (is_const || is_malloc) - start_sequence (); - - *************** expand_call (exp, target, ignore) - *** 1951,1954 **** - --- 1965,1982 ---- - end_sequence (); - emit_insns (insns); - + } - + else if (is_malloc) - + { - + rtx temp = gen_reg_rtx (GET_MODE (valreg)); - + rtx last, insns; - + - + emit_move_insn (temp, valreg); - + last = get_last_insn (); - + REG_NOTES (last) = - + gen_rtx (EXPR_LIST, REG_NOALIAS, temp, REG_NOTES (last)); - + insns = get_insns (); - + end_sequence (); - + emit_insns (insns); - + valreg = temp; - } - - diff -rcp2N gcc-2.7.2.3/cccp.c gcc-2.7.2.3.f.2/cccp.c - *** gcc-2.7.2.3/cccp.c Thu Oct 26 22:07:26 1995 - --- gcc-2.7.2.3.f.2/cccp.c Tue Sep 9 07:01:15 1997 - *************** initialize_builtins (inp, outp) - *** 9626,9629 **** - --- 9626,9630 ---- - so that it is present only when truly compiling with GNU C. */ - /* install ((U_CHAR *) "__GNUC__", -1, T_CONST, "2", -1); */ - + install ((U_CHAR *) "__HAVE_BUILTIN_SETJMP__", -1, T_CONST, "1", -1); - - if (debug_output) - diff -rcp2N gcc-2.7.2.3/combine.c gcc-2.7.2.3.f.2/combine.c - *** gcc-2.7.2.3/combine.c Sun Nov 26 19:32:07 1995 - --- gcc-2.7.2.3.f.2/combine.c Tue Sep 9 07:01:17 1997 - *************** try_combine (i3, i2, i1) - *** 2011,2016 **** - XVECEXP (newpat, 0, 1))) - { - ! newi2pat = XVECEXP (newpat, 0, 1); - ! newpat = XVECEXP (newpat, 0, 0); - - i2_code_number - --- 2011,2029 ---- - XVECEXP (newpat, 0, 1))) - { - ! /* Normally, it doesn't matter which of the two is done first, - ! but it does if one references cc0. In that case, it has to - ! be first. */ - ! #ifdef HAVE_cc0 - ! if (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0))) - ! { - ! newi2pat = XVECEXP (newpat, 0, 0); - ! newpat = XVECEXP (newpat, 0, 1); - ! } - ! else - ! #endif - ! { - ! newi2pat = XVECEXP (newpat, 0, 1); - ! newpat = XVECEXP (newpat, 0, 0); - ! } - - i2_code_number - *************** simplify_rtx (x, op0_mode, last, in_dest - *** 3278,3282 **** - if (CONSTANT_P (SUBREG_REG (x)) && op0_mode != VOIDmode - && GET_MODE_SIZE (mode) == UNITS_PER_WORD - ! && GET_MODE_SIZE (op0_mode) < UNITS_PER_WORD - && GET_MODE_CLASS (mode) == MODE_INT) - { - --- 3291,3295 ---- - if (CONSTANT_P (SUBREG_REG (x)) && op0_mode != VOIDmode - && GET_MODE_SIZE (mode) == UNITS_PER_WORD - ! && GET_MODE_SIZE (op0_mode) > UNITS_PER_WORD - && GET_MODE_CLASS (mode) == MODE_INT) - { - *************** simplify_rtx (x, op0_mode, last, in_dest - *** 3290,3295 **** - take the low bits. On a little-endian machine, that's - always valid. On a big-endian machine, it's valid - ! only if the constant's mode fits in one word. */ - ! if (CONSTANT_P (SUBREG_REG (x)) && subreg_lowpart_p (x) - && GET_MODE_SIZE (mode) < GET_MODE_SIZE (op0_mode) - && (! WORDS_BIG_ENDIAN - --- 3303,3316 ---- - take the low bits. On a little-endian machine, that's - always valid. On a big-endian machine, it's valid - ! only if the constant's mode fits in one word. Note that we - ! cannot use subreg_lowpart_p since we SUBREG_REG may be VOIDmode. */ - ! if (CONSTANT_P (SUBREG_REG (x)) - ! && ((GET_MODE_SIZE (op0_mode) <= UNITS_PER_WORD - ! || ! WORDS_BIG_ENDIAN) - ! ? SUBREG_WORD (x) == 0 - ! : (SUBREG_WORD (x) - ! == ((GET_MODE_SIZE (op0_mode) - ! - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) - ! / UNITS_PER_WORD))) - && GET_MODE_SIZE (mode) < GET_MODE_SIZE (op0_mode) - && (! WORDS_BIG_ENDIAN - *************** num_sign_bit_copies (x, mode) - *** 7326,7329 **** - --- 7347,7356 ---- - - case NEG: - + while (GET_MODE (XEXP (x, 0)) == GET_MODE (x) - + && GET_CODE (XEXP (x, 0)) == NEG - + && GET_MODE (XEXP (XEXP (x, 0), 0)) == GET_MODE (x) - + && GET_CODE (XEXP (XEXP (x, 0), 0)) == NEG) - + x = XEXP (XEXP (x, 0), 0); /* Speed up 961126-1.c */ - + - /* In general, this subtracts one sign bit copy. But if the value - is known to be positive, the number of sign bit copies is the - *************** move_deaths (x, from_cuid, to_insn, pnot - *** 10421,10425 **** - if (note != 0 && regno < FIRST_PSEUDO_REGISTER - && (GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) - ! != GET_MODE_SIZE (GET_MODE (x)))) - { - int deadregno = REGNO (XEXP (note, 0)); - --- 10448,10452 ---- - if (note != 0 && regno < FIRST_PSEUDO_REGISTER - && (GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) - ! > GET_MODE_SIZE (GET_MODE (x)))) - { - int deadregno = REGNO (XEXP (note, 0)); - *************** move_deaths (x, from_cuid, to_insn, pnot - *** 10437,10452 **** - REG_NOTES (where_dead)); - } - ! /* If we didn't find any note, and we have a multi-reg hard - register, then to be safe we must check for REG_DEAD notes - for each register other than the first. They could have - their own REG_DEAD notes lying around. */ - ! else if (note == 0 && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1) - { - int ourend = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); - ! int i; - rtx oldnotes = 0; - - ! for (i = regno + 1; i < ourend; i++) - move_deaths (gen_rtx (REG, reg_raw_mode[i], i), - from_cuid, to_insn, &oldnotes); - --- 10464,10489 ---- - REG_NOTES (where_dead)); - } - ! /* If we didn't find any note, or if we found a REG_DEAD note that - ! covers only part of the given reg, and we have a multi-reg hard - register, then to be safe we must check for REG_DEAD notes - for each register other than the first. They could have - their own REG_DEAD notes lying around. */ - ! else if ((note == 0 - ! || (note != 0 - ! && (GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) - ! < GET_MODE_SIZE (GET_MODE (x))))) - ! && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1) - { - int ourend = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); - ! int i, offset; - rtx oldnotes = 0; - - ! if (note) - ! offset = HARD_REGNO_NREGS (regno, GET_MODE (XEXP (note, 0))); - ! else - ! offset = 1; - ! - ! for (i = regno + offset; i < ourend; i++) - move_deaths (gen_rtx (REG, reg_raw_mode[i], i), - from_cuid, to_insn, &oldnotes); - *************** distribute_notes (notes, from_insn, i3, - *** 10648,10651 **** - --- 10685,10689 ---- - case REG_EQUIV: - case REG_NONNEG: - + case REG_NOALIAS: - /* These notes say something about results of an insn. We can - only support them if they used to be on I3 in which case they - diff -rcp2N gcc-2.7.2.3/config/alpha/alpha.c gcc-2.7.2.3.f.2/config/alpha/alpha.c - *** gcc-2.7.2.3/config/alpha/alpha.c Sat Jun 29 16:26:53 1996 - --- gcc-2.7.2.3.f.2/config/alpha/alpha.c Tue Sep 9 07:01:17 1997 - *************** extern int rtx_equal_function_value_matt - *** 64,67 **** - --- 64,69 ---- - /* Declarations of static functions. */ - static void alpha_set_memflags_1 PROTO((rtx, int, int, int)); - + static rtx alpha_emit_set_const_1 PROTO((rtx, enum machine_mode, - + HOST_WIDE_INT, int)); - static void add_long_const PROTO((FILE *, HOST_WIDE_INT, int, int, int)); - - *************** alpha_emit_set_const (target, mode, c, n - *** 670,673 **** - --- 672,695 ---- - int n; - { - + rtx pat; - + int i; - + - + /* Try 1 insn, then 2, then up to N. */ - + for (i = 1; i <= n; i++) - + if ((pat = alpha_emit_set_const_1 (target, mode, c, i)) != 0) - + return pat; - + - + return 0; - + } - + - + /* Internal routine for the above to check for N or below insns. */ - + - + static rtx - + alpha_emit_set_const_1 (target, mode, c, n) - + rtx target; - + enum machine_mode mode; - + HOST_WIDE_INT c; - + int n; - + { - HOST_WIDE_INT new = c; - int i, bits; - *************** alpha_emit_set_const (target, mode, c, n - *** 714,723 **** - if (c == low || (low == 0 && extra == 0)) - return copy_to_suggested_reg (GEN_INT (c), target, mode); - ! else if (n >= 2 + (extra != 0) - ! /* We can't do this when SImode if HIGH required adjustment. - ! This is because the code relies on an implicit overflow - ! which is invisible to the RTL. We can thus get incorrect - ! code if the two ldah instructions are combined. */ - ! && ! (mode == SImode && extra != 0)) - { - temp = copy_to_suggested_reg (GEN_INT (low), subtarget, mode); - --- 736,740 ---- - if (c == low || (low == 0 && extra == 0)) - return copy_to_suggested_reg (GEN_INT (c), target, mode); - ! else if (n >= 2 + (extra != 0)) - { - temp = copy_to_suggested_reg (GEN_INT (low), subtarget, mode); - *************** direct_return () - *** 1239,1243 **** - cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */ - - ! #if !defined(CROSS_COMPILE) && !defined(_WIN32) - #include - #endif - --- 1256,1260 ---- - cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */ - - ! #if !defined(CROSS_COMPILE) && !defined(_WIN32) && !defined(__linux__) - #include - #endif - *************** output_prolog (file, size) - *** 1370,1373 **** - --- 1387,1395 ---- - - alpha_function_needs_gp = 0; - + #ifdef __linux__ - + if(profile_flag) { - + alpha_function_needs_gp = 1; - + } - + #endif - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - if ((GET_CODE (insn) == CALL_INSN) - diff -rcp2N gcc-2.7.2.3/config/alpha/alpha.h gcc-2.7.2.3.f.2/config/alpha/alpha.h - *** gcc-2.7.2.3/config/alpha/alpha.h Sat Jun 29 16:27:31 1996 - --- gcc-2.7.2.3.f.2/config/alpha/alpha.h Thu Feb 26 21:16:59 1998 - *************** extern int target_flags; - *** 112,116 **** - --- 112,118 ---- - {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT} } - - + #ifndef TARGET_DEFAULT - #define TARGET_DEFAULT 3 - + #endif - - #ifndef TARGET_CPU_DEFAULT - *************** extern int target_flags; - *** 253,256 **** - --- 255,261 ---- - #define BIGGEST_ALIGNMENT 64 - - + /* For atomic access to objects, must have at least 32-bit alignment. */ - + #define MINIMUM_ATOMIC_ALIGNMENT 32 - + - /* Make strings word-aligned so strcpy from constants will be faster. */ - #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ - *************** enum reg_class { NO_REGS, GENERAL_REGS, - *** 665,668 **** - --- 670,676 ---- - /* #define PUSH_ROUNDING(BYTES) */ - - + /* Define this to be nonzero if stack checking is built into the ABI. */ - + #define STACK_CHECK_BUILTIN 1 - + - /* Define this if the maximum size of all the outgoing args is to be - accumulated and pushed during the prologue. The amount can be - *************** __enable_execute_stack (addr) \ - *** 1374,1378 **** - /* Define the value returned by a floating-point comparison instruction. */ - - ! #define FLOAT_STORE_FLAG_VALUE 0.5 - - /* Canonicalize a comparison from one we don't have to one we do have. */ - --- 1382,1386 ---- - /* Define the value returned by a floating-point comparison instruction. */ - - ! #define FLOAT_STORE_FLAG_VALUE 2.0 - - /* Canonicalize a comparison from one we don't have to one we do have. */ - diff -rcp2N gcc-2.7.2.3/config/alpha/alpha.md gcc-2.7.2.3.f.2/config/alpha/alpha.md - *** gcc-2.7.2.3/config/alpha/alpha.md Fri Oct 27 10:49:59 1995 - --- gcc-2.7.2.3.f.2/config/alpha/alpha.md Tue Sep 9 07:01:17 1997 - *************** - *** 1746,1752 **** - (if_then_else:DF - (match_operator 3 "signed_comparison_operator" - ! [(match_operand:DF 1 "reg_or_fp0_operand" "fG,fG") - (match_operand:DF 2 "fp0_operand" "G,G")]) - ! (float_extend:DF (match_operand:SF 4 "reg_or_fp0_operand" "fG,0")) - (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))] - "TARGET_FP" - --- 1746,1752 ---- - (if_then_else:DF - (match_operator 3 "signed_comparison_operator" - ! [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG") - (match_operand:DF 2 "fp0_operand" "G,G")]) - ! (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")) - (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))] - "TARGET_FP" - diff -rcp2N gcc-2.7.2.3/config/alpha/elf.h gcc-2.7.2.3.f.2/config/alpha/elf.h - *** gcc-2.7.2.3/config/alpha/elf.h Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/alpha/elf.h Tue Sep 9 07:01:18 1997 - *************** - *** 0 **** - --- 1,522 ---- - + /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF. - + Copyright (C) 1996 Free Software Foundation, Inc. - + Contributed by Richard Henderson (rth@tamu.edu). - + - + 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, 59 Temple Place - Suite 330, - + Boston, MA 02111-1307, USA. */ - + - + /* This is used on Alpha platforms that use the ELF format. - + Currently only Linux uses this. */ - + - + #include "alpha/linux.h" - + - + #undef TARGET_VERSION - + #define TARGET_VERSION fprintf (stderr, " (Alpha Linux/ELF)"); - + - + #undef OBJECT_FORMAT_COFF - + #undef EXTENDED_COFF - + #define OBJECT_FORMAT_ELF - + - + #define SDB_DEBUGGING_INFO - + - + #undef ASM_FINAL_SPEC - + - + #undef CPP_PREDEFINES - + #define CPP_PREDEFINES "\ - + -D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dlinux -Dunix \ - + -Asystem(linux) -Acpu(alpha) -Amachine(alpha) -D__ELF__" - + - + #undef LINK_SPEC - + #define LINK_SPEC "-m elf64alpha -G 8 %{O*:-O3} %{!O*:-O1} \ - + %{shared:-shared} \ - + %{!shared: \ - + %{!static: \ - + %{rdynamic:-export-dynamic} \ - + %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ - + %{static:-static}}" - + - + /* Output at beginning of assembler file. */ - + - + #undef ASM_FILE_START - + #define ASM_FILE_START(FILE) \ - + { \ - + alpha_write_verstamp (FILE); \ - + output_file_directive (FILE, main_input_filename); \ - + fprintf (FILE, "\t.version\t\"01.01\"\n"); \ - + fprintf (FILE, "\t.set noat\n"); \ - + } - + - + #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \ - + alpha_output_lineno (STREAM, LINE) - + extern void alpha_output_lineno (); - + - + extern void output_file_directive (); - + - + /* Attach a special .ident directive to the end of the file to identify - + the version of GCC which compiled this code. The format of the - + .ident string is patterned after the ones produced by native svr4 - + C compilers. */ - + - + #define IDENT_ASM_OP ".ident" - + - + #ifdef IDENTIFY_WITH_IDENT - + #define ASM_IDENTIFY_GCC(FILE) /* nothing */ - + #define ASM_IDENTIFY_LANGUAGE(FILE) \ - + fprintf(FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \ - + lang_identify(), version_string) - + #else - + #define ASM_FILE_END(FILE) \ - + do { \ - + fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n", \ - + IDENT_ASM_OP, version_string); \ - + } while (0) - + #endif - + - + /* Allow #sccs in preprocessor. */ - + - + #define SCCS_DIRECTIVE - + - + /* Output #ident as a .ident. */ - + - + #define ASM_OUTPUT_IDENT(FILE, NAME) \ - + fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME); - + - + /* This is how to allocate empty space in some section. The .zero - + pseudo-op is used for this on most svr4 assemblers. */ - + - + #define SKIP_ASM_OP ".zero" - + - + #undef ASM_OUTPUT_SKIP - + #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - + fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE)) - + - + /* Output the label which precedes a jumptable. Note that for all svr4 - + systems where we actually generate jumptables (which is to say every - + svr4 target except i386, where we use casesi instead) we put the jump- - + tables into the .rodata section and since other stuff could have been - + put into the .rodata section prior to any given jumptable, we have to - + make sure that the location counter for the .rodata section gets pro- - + perly re-aligned prior to the actual beginning of the jump table. */ - + - + #define ALIGN_ASM_OP ".align" - + - + #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL - + #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \ - + ASM_OUTPUT_ALIGN ((FILE), 2); - + #endif - + - + #undef ASM_OUTPUT_CASE_LABEL - + #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \ - + do { \ - + ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \ - + ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \ - + } while (0) - + - + /* The standard SVR4 assembler seems to require that certain builtin - + library routines (e.g. .udiv) be explicitly declared as .globl - + in each assembly file where they are referenced. */ - + - + #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ - + ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0)) - + - + /* This says how to output assembler code to declare an - + uninitialized external linkage data object. Under SVR4, - + the linker seems to want the alignment of data objects - + to depend on their types. We do exactly that here. */ - + - + #define COMMON_ASM_OP ".comm" - + - + #undef ASM_OUTPUT_ALIGNED_COMMON - + #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ - + do { \ - + fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \ - + assemble_name ((FILE), (NAME)); \ - + fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ - + } while (0) - + - + /* This says how to output assembler code to declare an - + uninitialized internal linkage data object. Under SVR4, - + the linker seems to want the alignment of data objects - + to depend on their types. We do exactly that here. */ - + - + #define LOCAL_ASM_OP ".local" - + - + #undef ASM_OUTPUT_ALIGNED_LOCAL - + #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ - + do { \ - + fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \ - + assemble_name ((FILE), (NAME)); \ - + fprintf ((FILE), "\n"); \ - + ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ - + } while (0) - + - + /* This is the pseudo-op used to generate a 64-bit word of data with a - + specific value in some section. */ - + - + #define INT_ASM_OP ".quad" - + - + /* This is the pseudo-op used to generate a contiguous sequence of byte - + values from a double-quoted string WITHOUT HAVING A TERMINATING NUL - + AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */ - + - + #undef ASCII_DATA_ASM_OP - + #define ASCII_DATA_ASM_OP ".ascii" - + - + /* Support const sections and the ctors and dtors sections for g++. - + Note that there appears to be two different ways to support const - + sections at the moment. You can either #define the symbol - + READONLY_DATA_SECTION (giving it some code which switches to the - + readonly data section) or else you can #define the symbols - + EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and - + SELECT_RTX_SECTION. We do both here just to be on the safe side. */ - + - + #define USE_CONST_SECTION 1 - + - + #define CONST_SECTION_ASM_OP ".section\t.rodata" - + - + /* Define the pseudo-ops used to switch to the .ctors and .dtors sections. - + - + Note that we want to give these sections the SHF_WRITE attribute - + because these sections will actually contain data (i.e. tables of - + addresses of functions in the current root executable or shared library - + file) and, in the case of a shared library, the relocatable addresses - + will have to be properly resolved/relocated (and then written into) by - + the dynamic linker when it actually attaches the given shared library - + to the executing process. (Note that on SVR4, you may wish to use the - + `-z text' option to the ELF linker, when building a shared library, as - + an additional check that you are doing everything right. But if you do - + use the `-z text' option when building a shared library, you will get - + errors unless the .ctors and .dtors sections are marked as writable - + via the SHF_WRITE attribute.) */ - + - + #define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\"" - + #define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\"" - + - + /* On svr4, we *do* have support for the .init and .fini sections, and we - + can put stuff in there to be executed before and after `main'. We let - + crtstuff.c and other files know this by defining the following symbols. - + The definitions say how to change sections to the .init and .fini - + sections. This is the same for all known svr4 assemblers. */ - + - + #define INIT_SECTION_ASM_OP ".section\t.init" - + #define FINI_SECTION_ASM_OP ".section\t.fini" - + - + /* Support non-common, uninitialized data in the .bss section. */ - + - + #define BSS_SECTION_ASM_OP ".section\t.bss" - + - + /* A default list of other sections which we might be "in" at any given - + time. For targets that use additional sections (e.g. .tdesc) you - + should override this definition in the target-specific file which - + includes this file. */ - + - + #undef EXTRA_SECTIONS - + #define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_bss - + - + /* A default list of extra section function definitions. For targets - + that use additional sections (e.g. .tdesc) you should override this - + definition in the target-specific file which includes this file. */ - + - + #undef EXTRA_SECTION_FUNCTIONS - + #define EXTRA_SECTION_FUNCTIONS \ - + CONST_SECTION_FUNCTION \ - + CTORS_SECTION_FUNCTION \ - + DTORS_SECTION_FUNCTION \ - + BSS_SECTION_FUNCTION - + - + #undef READONLY_DATA_SECTION - + #define READONLY_DATA_SECTION() const_section () - + - + extern void text_section (); - + - + #define CONST_SECTION_FUNCTION \ - + void \ - + const_section () \ - + { \ - + if (!USE_CONST_SECTION) \ - + text_section(); \ - + else if (in_section != in_const) \ - + { \ - + fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \ - + in_section = in_const; \ - + } \ - + } - + - + #define CTORS_SECTION_FUNCTION \ - + void \ - + ctors_section () \ - + { \ - + if (in_section != in_ctors) \ - + { \ - + fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ - + in_section = in_ctors; \ - + } \ - + } - + - + #define DTORS_SECTION_FUNCTION \ - + void \ - + dtors_section () \ - + { \ - + if (in_section != in_dtors) \ - + { \ - + fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ - + in_section = in_dtors; \ - + } \ - + } - + - + #define BSS_SECTION_FUNCTION \ - + void \ - + bss_section () \ - + { \ - + if (in_section != in_bss) \ - + { \ - + fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP); \ - + in_section = in_bss; \ - + } \ - + } - + - + - + /* Switch into a generic section. - + This is currently only used to support section attributes. - + - + We make the section read-only and executable for a function decl, - + read-only for a const data decl, and writable for a non-const data decl. */ - + #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ - + fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \ - + (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ - + (DECL) && TREE_READONLY (DECL) ? "a" : "aw") - + - + - + /* A C statement (sans semicolon) to output an element in the table of - + global constructors. */ - + #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ - + do { \ - + ctors_section (); \ - + fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ - + assemble_name (FILE, NAME); \ - + fprintf (FILE, "\n"); \ - + } while (0) - + - + /* A C statement (sans semicolon) to output an element in the table of - + global destructors. */ - + #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ - + do { \ - + dtors_section (); \ - + fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ - + assemble_name (FILE, NAME); \ - + fprintf (FILE, "\n"); \ - + } while (0) - + - + /* A C statement or statements to switch to the appropriate - + section for output of DECL. DECL is either a `VAR_DECL' node - + or a constant of some sort. RELOC indicates whether forming - + the initial value of DECL requires link-time relocations. */ - + - + #define SELECT_SECTION(DECL,RELOC) \ - + { \ - + if (TREE_CODE (DECL) == STRING_CST) \ - + { \ - + if (! flag_writable_strings) \ - + const_section (); \ - + else \ - + data_section (); \ - + } \ - + else if (TREE_CODE (DECL) == VAR_DECL) \ - + { \ - + if ((flag_pic && RELOC) \ - + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ - + || !DECL_INITIAL (DECL) \ - + || (DECL_INITIAL (DECL) != error_mark_node \ - + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ - + { \ - + if (DECL_COMMON (DECL) \ - + && !DECL_INITIAL (DECL)) \ - + /* || DECL_INITIAL (DECL) == error_mark_node)) */ \ - + bss_section(); \ - + else \ - + data_section (); \ - + } \ - + else \ - + const_section (); \ - + } \ - + else \ - + const_section (); \ - + } - + - + /* A C statement or statements to switch to the appropriate - + section for output of RTX in mode MODE. RTX is some kind - + of constant in RTL. The argument MODE is redundant except - + in the case of a `const_int' rtx. Currently, these always - + go into the const section. */ - + - + #undef SELECT_RTX_SECTION - + #define SELECT_RTX_SECTION(MODE,RTX) const_section() - + - + /* Define the strings used for the special svr4 .type and .size directives. - + These strings generally do not vary from one system running svr4 to - + another, but if a given system (e.g. m88k running svr) needs to use - + different pseudo-op names for these, they may be overridden in the - + file which includes this one. */ - + - + #define TYPE_ASM_OP ".type" - + #define SIZE_ASM_OP ".size" - + - + /* This is how we tell the assembler that a symbol is weak. */ - + - + #define ASM_WEAKEN_LABEL(FILE,NAME) \ - + do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ - + fputc ('\n', FILE); } while (0) - + - + /* This is how we tell the assembler that two symbols have the same value. */ - + - + #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \ - + do { assemble_name(FILE, NAME1); \ - + fputs(" = ", FILE); \ - + assemble_name(FILE, NAME2); \ - + fputc('\n', FILE); } while (0) - + - + /* The following macro defines the format used to output the second - + operand of the .type assembler directive. Different svr4 assemblers - + expect various different forms for this operand. The one given here - + is just a default. You may need to override it in your machine- - + specific tm.h file (depending upon the particulars of your assembler). */ - + - + #define TYPE_OPERAND_FMT "@%s" - + - + /* Write the extra assembler code needed to declare a function's result. - + Most svr4 assemblers don't require any special declaration of the - + result value, but there are exceptions. */ - + - + #ifndef ASM_DECLARE_RESULT - + #define ASM_DECLARE_RESULT(FILE, RESULT) - + #endif - + - + /* These macros generate the special .type and .size directives which - + are used to set the corresponding fields of the linker symbol table - + entries in an ELF object file under SVR4. These macros also output - + the starting labels for the relevant functions/objects. */ - + - + /* Write the extra assembler code needed to declare an object properly. */ - + - + #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ - + do { \ - + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ - + assemble_name (FILE, NAME); \ - + putc (',', FILE); \ - + fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ - + putc ('\n', FILE); \ - + size_directive_output = 0; \ - + if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ - + { \ - + size_directive_output = 1; \ - + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - + assemble_name (FILE, NAME); \ - + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ - + } \ - + ASM_OUTPUT_LABEL(FILE, NAME); \ - + } while (0) - + - + /* Output the size directive for a decl in rest_of_decl_compilation - + in the case where we did not do so before the initializer. - + Once we find the error_mark_node, we know that the value of - + size_directive_output was set - + by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ - + - + #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ - + do { \ - + char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ - + if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ - + && ! AT_END && TOP_LEVEL \ - + && DECL_INITIAL (DECL) == error_mark_node \ - + && !size_directive_output) \ - + { \ - + size_directive_output = 1; \ - + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - + assemble_name (FILE, name); \ - + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ - + } \ - + } while (0) - + - + /* A table of bytes codes used by the ASM_OUTPUT_ASCII and - + ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table - + corresponds to a particular byte value [0..255]. For any - + given byte value, if the value in the corresponding table - + position is zero, the given character can be output directly. - + If the table value is 1, the byte must be output as a \ooo - + octal escape. If the tables value is anything else, then the - + byte value should be output as a \ followed by the value - + in the table. Note that we can use standard UN*X escape - + sequences for many control characters, but we don't use - + \a to represent BEL because some svr4 assemblers (e.g. on - + the i386) don't know about that. Also, we don't use \v - + since some versions of gas, such as 2.2 did not accept it. */ - + - + #define ESCAPES \ - + "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ - + \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ - + \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\ - + \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\ - + \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ - + \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ - + \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ - + \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1" - + - + /* Some svr4 assemblers have a limit on the number of characters which - + can appear in the operand of a .string directive. If your assembler - + has such a limitation, you should define STRING_LIMIT to reflect that - + limit. Note that at least some svr4 assemblers have a limit on the - + actual number of bytes in the double-quoted string, and that they - + count each character in an escape sequence as one byte. Thus, an - + escape sequence like \377 would count as four bytes. - + - + If your target assembler doesn't support the .string directive, you - + should define this to zero. - + */ - + - + #define STRING_LIMIT ((unsigned) 256) - + - + #define STRING_ASM_OP ".string" - + - + /* - + * We always use gas here, so we don't worry about ECOFF assembler problems. - + */ - + #undef TARGET_GAS - + #define TARGET_GAS (1) - + - + #undef PREFERRED_DEBUGGING_TYPE - + #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - + - + /* Provide a STARTFILE_SPEC appropriate for Linux. Here we add - + the Linux magical crtbegin.o file (see crtstuff.c) which - + provides part of the support for getting C++ file-scope static - + object constructed before entering `main'. */ - + - + #undef STARTFILE_SPEC - + #define STARTFILE_SPEC \ - + "%{!shared: \ - + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ - + crti.o%s crtbegin.o%s" - + - + /* Provide a ENDFILE_SPEC appropriate for Linux. Here we tack on - + the Linux magical crtend.o file (see crtstuff.c) which - + provides part of the support for getting C++ file-scope static - + object constructed before entering `main', followed by a normal - + Linux "finalizer" file, `crtn.o'. */ - + - + #undef ENDFILE_SPEC - + #define ENDFILE_SPEC \ - + "crtend.o%s crtn.o%s" - diff -rcp2N gcc-2.7.2.3/config/alpha/linux.h gcc-2.7.2.3.f.2/config/alpha/linux.h - *** gcc-2.7.2.3/config/alpha/linux.h Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/alpha/linux.h Tue Sep 9 07:01:18 1997 - *************** - *** 0 **** - --- 1,72 ---- - + /* Definitions of target machine for GNU compiler, for Alpha Linux, - + using ECOFF. - + Copyright (C) 1995 Free Software Foundation, Inc. - + Contributed by Bob Manson. - + Derived from work contributed by Cygnus Support, - + (c) 1993 Free Software Foundation. - + - + 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. */ - + - + #define TARGET_DEFAULT (3 | MASK_GAS) - + - + #include "alpha/alpha.h" - + - + #undef TARGET_VERSION - + #define TARGET_VERSION fprintf (stderr, " (Linux/Alpha)"); - + - + #undef CPP_PREDEFINES - + #define CPP_PREDEFINES "\ - + -D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dlinux -Dunix \ - + -Asystem(linux) -Acpu(alpha) -Amachine(alpha)" - + - + /* We don't actually need any of these; the MD_ vars are ignored - + anyway for cross-compilers, and the other specs won't get picked up - + 'coz the user is supposed to do ld -r (hmm, perhaps that should be - + the default). In any case, setting them thus will catch some - + common user errors. */ - + - + #undef MD_EXEC_PREFIX - + #undef MD_STARTFILE_PREFIX - + - + #undef LIB_SPEC - + #define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}" - + - + #undef LINK_SPEC - + #define LINK_SPEC \ - + "-G 8 %{O*:-O3} %{!O*:-O1}" - + - + #undef ASM_SPEC - + #define ASM_SPEC "-nocpp" - + - + /* Can't do stabs */ - + #undef SDB_DEBUGGING_INFO - + - + /* Prefer dbx. */ - + #undef PREFERRED_DEBUGGING_TYPE - + #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - + - + #undef FUNCTION_PROFILER - + - + #define FUNCTION_PROFILER(FILE, LABELNO) \ - + do { \ - + fputs ("\tlda $27,_mcount\n", (FILE)); \ - + fputs ("\tjsr $26,($27),_mcount\n", (FILE)); \ - + fputs ("\tldgp $29,0($26)\n", (FILE)); \ - + } while (0); - + - + /* Generate calls to memcpy, etc., not bcopy, etc. */ - + #define TARGET_MEM_FUNCTIONS - diff -rcp2N gcc-2.7.2.3/config/alpha/t-linux gcc-2.7.2.3.f.2/config/alpha/t-linux - *** gcc-2.7.2.3/config/alpha/t-linux Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/alpha/t-linux Tue Sep 9 07:01:18 1997 - *************** - *** 0 **** - --- 1,3 ---- - + # Our header files are supposed to be correct, nein? - + FIXINCLUDES = - + STMP_FIXPROTO = - diff -rcp2N gcc-2.7.2.3/config/alpha/x-linux gcc-2.7.2.3.f.2/config/alpha/x-linux - *** gcc-2.7.2.3/config/alpha/x-linux Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/alpha/x-linux Tue Sep 9 07:01:18 1997 - *************** - *** 0 **** - --- 1 ---- - + CLIB=-lbfd -liberty - diff -rcp2N gcc-2.7.2.3/config/alpha/xm-alpha.h gcc-2.7.2.3.f.2/config/alpha/xm-alpha.h - *** gcc-2.7.2.3/config/alpha/xm-alpha.h Thu Aug 31 21:52:27 1995 - --- gcc-2.7.2.3.f.2/config/alpha/xm-alpha.h Tue Sep 9 07:01:18 1997 - *************** Boston, MA 02111-1307, USA. */ - *** 46,51 **** - --- 46,53 ---- - #include - #else - + #ifndef alloca - extern void *alloca (); - #endif - + #endif - - /* The host compiler has problems with enum bitfields since it makes - *************** extern void *malloc (), *realloc (), *ca - *** 68,72 **** - --- 70,76 ---- - /* OSF/1 has vprintf. */ - - + #ifndef linux /* 1996/02/22 mauro@craftwork.com -- unreliable with Linux */ - #define HAVE_VPRINTF - + #endif - - /* OSF/1 has putenv. */ - diff -rcp2N gcc-2.7.2.3/config/alpha/xm-linux.h gcc-2.7.2.3.f.2/config/alpha/xm-linux.h - *** gcc-2.7.2.3/config/alpha/xm-linux.h Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/alpha/xm-linux.h Tue Sep 9 07:01:18 1997 - *************** - *** 0 **** - --- 1,10 ---- - + #ifndef _XM_LINUX_H - + #define _XM_LINUX_H - + - + #include "xm-alpha.h" - + - + #define HAVE_STRERROR - + - + #define DONT_DECLARE_SYS_SIGLIST - + #define USE_BFD - + #endif - diff -rcp2N gcc-2.7.2.3/config/i386/i386.c gcc-2.7.2.3.f.2/config/i386/i386.c - *** gcc-2.7.2.3/config/i386/i386.c Sun Oct 22 11:13:21 1995 - --- gcc-2.7.2.3.f.2/config/i386/i386.c Tue Sep 9 07:01:18 1997 - *************** standard_80387_constant_p (x) - *** 1290,1294 **** - set_float_handler (handler); - REAL_VALUE_FROM_CONST_DOUBLE (d, x); - ! is0 = REAL_VALUES_EQUAL (d, dconst0); - is1 = REAL_VALUES_EQUAL (d, dconst1); - set_float_handler (NULL_PTR); - --- 1290,1294 ---- - set_float_handler (handler); - REAL_VALUE_FROM_CONST_DOUBLE (d, x); - ! is0 = REAL_VALUES_EQUAL (d, dconst0) && !REAL_VALUE_MINUS_ZERO (d); - is1 = REAL_VALUES_EQUAL (d, dconst1); - set_float_handler (NULL_PTR); - diff -rcp2N gcc-2.7.2.3/config/i386/i386.h gcc-2.7.2.3.f.2/config/i386/i386.h - *** gcc-2.7.2.3/config/i386/i386.h Fri Sep 22 22:42:57 1995 - --- gcc-2.7.2.3.f.2/config/i386/i386.h Tue Mar 3 18:04:35 1998 - *************** extern int target_flags; - *** 245,249 **** - - /* Boundary (in *bits*) on which stack pointer should be aligned. */ - ! #define STACK_BOUNDARY 32 - - /* Allocation boundary (in *bits*) for the code of a function. - --- 245,249 ---- - - /* Boundary (in *bits*) on which stack pointer should be aligned. */ - ! #define STACK_BOUNDARY BIGGEST_ALIGNMENT - - /* Allocation boundary (in *bits*) for the code of a function. - *************** do { long l; \ - *** 1699,1703 **** - - #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ - ! fprintf (FILE, "\tpushl e%s\n", reg_names[REGNO]) - - /* This is how to output an insn to pop a register from the stack. - --- 1699,1703 ---- - - #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ - ! fprintf (FILE, "\tpushl %%e%s\n", reg_names[REGNO]) - - /* This is how to output an insn to pop a register from the stack. - *************** do { long l; \ - *** 1705,1709 **** - - #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ - ! fprintf (FILE, "\tpopl e%s\n", reg_names[REGNO]) - - /* This is how to output an element of a case-vector that is absolute. - --- 1705,1709 ---- - - #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ - ! fprintf (FILE, "\tpopl %%e%s\n", reg_names[REGNO]) - - /* This is how to output an element of a case-vector that is absolute. - diff -rcp2N gcc-2.7.2.3/config/m68k/m68k.md gcc-2.7.2.3.f.2/config/m68k/m68k.md - *** gcc-2.7.2.3/config/m68k/m68k.md Wed Aug 13 17:23:23 1997 - --- gcc-2.7.2.3.f.2/config/m68k/m68k.md Tue Sep 9 07:01:20 1997 - *************** - *** 288,292 **** - (match_operand:DI 0 "nonimmediate_operand" "d")) - (clobber (match_dup 1))])] - ! "" - "operands[1] = gen_reg_rtx (DImode);") - - --- 288,292 ---- - (match_operand:DI 0 "nonimmediate_operand" "d")) - (clobber (match_dup 1))])] - ! "0" - "operands[1] = gen_reg_rtx (DImode);") - - *************** - *** 411,415 **** - (match_operand:DI 1 "general_operand" ""))) - (clobber (match_dup 2))])] - ! "" - "operands[2] = gen_reg_rtx (DImode);") - - --- 411,415 ---- - (match_operand:DI 1 "general_operand" ""))) - (clobber (match_dup 2))])] - ! "0" - "operands[2] = gen_reg_rtx (DImode);") - - diff -rcp2N gcc-2.7.2.3/config/mips/mips.c gcc-2.7.2.3.f.2/config/mips/mips.c - *** gcc-2.7.2.3/config/mips/mips.c Sat Jun 29 16:26:44 1996 - --- gcc-2.7.2.3.f.2/config/mips/mips.c Tue Sep 9 07:01:20 1997 - *************** expand_block_move (operands) - *** 2360,2365 **** - - else if (constp && bytes <= 2*MAX_MOVE_BYTES) - ! emit_insn (gen_movstrsi_internal (gen_rtx (MEM, BLKmode, dest_reg), - ! gen_rtx (MEM, BLKmode, src_reg), - bytes_rtx, align_rtx)); - - --- 2360,2367 ---- - - else if (constp && bytes <= 2*MAX_MOVE_BYTES) - ! emit_insn (gen_movstrsi_internal (change_address (operands[0], - ! BLKmode, dest_reg), - ! change_address (orig_src, BLKmode, - ! src_reg), - bytes_rtx, align_rtx)); - - diff -rcp2N gcc-2.7.2.3/config/mips/mips.h gcc-2.7.2.3.f.2/config/mips/mips.h - *** gcc-2.7.2.3/config/mips/mips.h Thu Nov 9 16:23:09 1995 - --- gcc-2.7.2.3.f.2/config/mips/mips.h Tue Sep 9 07:01:21 1997 - *************** typedef struct mips_args { - *** 2160,2170 **** - } \ - \ - ! /* Flush the instruction cache. */ \ - ! /* ??? Are the modes right? Maybe they should depend on -mint64/-mlong64? */\ - /* ??? Should check the return value for errors. */ \ - ! emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "cacheflush"), \ - 0, VOIDmode, 3, addr, Pmode, \ - GEN_INT (TRAMPOLINE_SIZE), SImode, \ - ! GEN_INT (1), SImode); \ - } - - --- 2160,2170 ---- - } \ - \ - ! /* Flush both caches. We need to flush the data cache in case \ - ! the system has a write-back cache. */ \ - /* ??? Should check the return value for errors. */ \ - ! emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "_flush_cache"), \ - 0, VOIDmode, 3, addr, Pmode, \ - GEN_INT (TRAMPOLINE_SIZE), SImode, \ - ! GEN_INT (3), TYPE_MODE (integer_type_node)); \ - } - - *************** typedef struct mips_args { - *** 2388,2392 **** - ((GET_CODE (X) != CONST_DOUBLE \ - || mips_const_double_ok (X, GET_MODE (X))) \ - ! && ! (GET_CODE (X) == CONST && ABI_64BIT)) - - /* A C compound statement that attempts to replace X with a valid - --- 2388,2393 ---- - ((GET_CODE (X) != CONST_DOUBLE \ - || mips_const_double_ok (X, GET_MODE (X))) \ - ! && ! (GET_CODE (X) == CONST \ - ! && (ABI_64BIT || GET_CODE (XEXP (X, 0)) == MINUS))) - - /* A C compound statement that attempts to replace X with a valid - diff -rcp2N gcc-2.7.2.3/config/mips/sni-gas.h gcc-2.7.2.3.f.2/config/mips/sni-gas.h - *** gcc-2.7.2.3/config/mips/sni-gas.h Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/mips/sni-gas.h Tue Sep 9 07:01:21 1997 - *************** - *** 0 **** - --- 1,43 ---- - + #include "mips/sni-svr4.h" - + - + /* Enable debugging. */ - + #define DBX_DEBUGGING_INFO - + #define SDB_DEBUGGING_INFO - + #define MIPS_DEBUGGING_INFO - + - + #define DWARF_DEBUGGING_INFO - + #undef PREFERRED_DEBUGGING_TYPE - + #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG - + - + /* We need to use .esize and .etype instead of .size and .type to - + avoid conflicting with ELF directives. These are only recognized - + by gas, anyhow, not the native assembler. */ - + #undef PUT_SDB_SIZE - + #define PUT_SDB_SIZE(a) \ - + do { \ - + extern FILE *asm_out_text_file; \ - + fprintf (asm_out_text_file, "\t.esize\t%d;", (a)); \ - + } while (0) - + - + #undef PUT_SDB_TYPE - + #define PUT_SDB_TYPE(a) \ - + do { \ - + extern FILE *asm_out_text_file; \ - + fprintf (asm_out_text_file, "\t.etype\t0x%x;", (a)); \ - + } while (0) - + - + - + /* This is how to equate one symbol to another symbol. The syntax used is - + `SYM1=SYM2'. Note that this is different from the way equates are done - + with most svr4 assemblers, where the syntax is `.set SYM1,SYM2'. */ - + - + #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ - + do { fprintf ((FILE), "\t"); \ - + assemble_name (FILE, LABEL1); \ - + fprintf (FILE, " = "); \ - + assemble_name (FILE, LABEL2); \ - + fprintf (FILE, "\n"); \ - + } while (0) - + - + - + - diff -rcp2N gcc-2.7.2.3/config/mips/sni-svr4.h gcc-2.7.2.3.f.2/config/mips/sni-svr4.h - *** gcc-2.7.2.3/config/mips/sni-svr4.h Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/mips/sni-svr4.h Tue Sep 9 07:01:21 1997 - *************** - *** 0 **** - --- 1,103 ---- - + /* Definitions of target machine for GNU compiler. SNI SINIX version. - + Copyright (C) 1996 Free Software Foundation, Inc. - + Contributed by Marco Walther (Marco.Walther@mch.sni.de). - + - + 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. */ - + - + #define MIPS_SVR4 - + - + #define CPP_PREDEFINES "\ - + -Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_SVR4 \ - + -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_SVR4 \ - + -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(mips)" - + - + #define CPP_SPEC "\ - + %{.cc: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ - + %{.cxx: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ - + %{.C: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ - + %{.m: -D__LANGUAGE_OBJECTIVE_C -D_LANGUAGE_OBJECTIVE_C} \ - + %{.S: -D__LANGUAGE_ASSEMBLY -D_LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ - + %{.s: -D__LANGUAGE_ASSEMBLY -D_LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ - + %{!.S:%{!.s: -D__LANGUAGE_C -D_LANGUAGE_C %{!ansi:-DLANGUAGE_C}}} \ - + -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int" - + - + #define LINK_SPEC "\ - + %{G*} \ - + %{!mgas: \ - + %{dy} %{dn}}" - + - + #define LIB_SPEC "\ - + %{p:-lprof1} \ - + %{!p:%{pg:-lprof1} \ - + %{!pg:-L/usr/ccs/lib/ -lc /usr/ccs/lib/crtn.o%s}}" - + - + #define STARTFILE_SPEC "\ - + %{pg:gcrt0.o%s} \ - + %{!pg:%{p:mcrt0.o%s} \ - + %{!p:/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o%s}}" - + - + /* Mips System V.4 doesn't have a getpagesize() function needed by the - + trampoline code, so use the POSIX sysconf function to get it. - + This is only done when compiling the trampoline code. */ - + - + #ifdef L_trampoline - + #include - + - + #define getpagesize() sysconf(_SC_PAGE_SIZE) - + #endif /* L_trampoline */ - + - + /* Use atexit for static constructors/destructors, instead of defining - + our own exit function. */ - + #define HAVE_ATEXIT - + - + /* Generate calls to memcpy, etc., not bcopy, etc. */ - + #define TARGET_MEM_FUNCTIONS - + - + #define OBJECT_FORMAT_ELF - + - + #define TARGET_DEFAULT MASK_ABICALLS - + #define ABICALLS_ASM_OP ".option pic2" - + - + #define MACHINE_TYPE "SNI running SINIX 5.42" - + - + #define MIPS_DEFAULT_GVALUE 0 - + - + #define NM_FLAGS "-p" - + - + /* wir haben ein Problem, wenn in einem Assembler-File keine .text-section - + erzeugt wird. Dann landen diese Pseudo-Labels in irgendeiner anderen - + section, z.B. .reginfo. Das macht den ld sehr ungluecklich. */ - + - + #define ASM_IDENTIFY_GCC(mw_stream) \ - + fprintf(mw_stream, "\t.ident \"gcc2_compiled.\"\n"); - + - + #define ASM_IDENTIFY_LANGUAGE(STREAM) - + - + #define ASM_LONG ".word\t" - + #define ASM_GLOBAL ".rdata\n\t\t.globl\t" - + - + #include "mips/mips.h" - + - + /* We do not want to run mips-tfile! */ - + #undef ASM_FINAL_SPEC - + - + #undef OBJECT_FORMAT_COFF - + - + /* We don't support debugging info for now. */ - + #undef DBX_DEBUGGING_INFO - + #undef SDB_DEBUGGING_INFO - + #undef MIPS_DEBUGGING_INFO - diff -rcp2N gcc-2.7.2.3/config/mips/x-sni-svr4 gcc-2.7.2.3.f.2/config/mips/x-sni-svr4 - *** gcc-2.7.2.3/config/mips/x-sni-svr4 Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/mips/x-sni-svr4 Tue Sep 9 07:01:21 1997 - *************** - *** 0 **** - --- 1,18 ---- - + # Define CC and OLDCC as the same, so that the tests: - + # if [ x"$(OLDCC)" = x"$(CC)" ] ... - + # - + # will succeed (if OLDCC != CC, it is assumed that GCC is - + # being used in secondary stage builds). - + # -Olimit is so the user can use -O2. Down with fixed - + # size tables! - + - + CC = $(OLDCC) - + OPT = - + OLDCC = cc -Olimit 3000 $(OPT) - + - + X_CFLAGS = -DNO_SYS_SIGLIST - + - + # Show we need to use the C version of ALLOCA - + # The SVR3 configurations have it, but the SVR4 configurations don't. - + # For now, just try using it for all SVR* configurations. - + ALLOCA = alloca.o - diff -rcp2N gcc-2.7.2.3/config/msdos/configur.bat gcc-2.7.2.3.f.2/config/msdos/configur.bat - *** gcc-2.7.2.3/config/msdos/configur.bat Mon Aug 28 09:55:47 1995 - --- gcc-2.7.2.3.f.2/config/msdos/configur.bat Tue Sep 9 07:01:21 1997 - *************** sed -f config/msdos/top.sed Makefile.in - *** 18,21 **** - --- 18,27 ---- - set LANG= - - + if not exist ada\make-lang.in goto no_ada - + sed -f config/msdos/top.sed ada\make-lang.in >> Makefile - + sed -f config/msdos/top.sed ada\makefile.in > ada\Makefile - + set LANG=%LANG% ada.& - + :no_ada - + - if not exist cp\make-lang.in goto no_cp - sed -f config/msdos/top.sed cp\make-lang.in >> Makefile - diff -rcp2N gcc-2.7.2.3/config/pa/pa.c gcc-2.7.2.3.f.2/config/pa/pa.c - *** gcc-2.7.2.3/config/pa/pa.c Sun Oct 22 11:45:20 1995 - --- gcc-2.7.2.3.f.2/config/pa/pa.c Tue Sep 9 07:01:22 1997 - *************** output_move_double (operands) - *** 1344,1369 **** - do them in the other order. - - ! RMS says "This happens only for registers; - ! such overlap can't happen in memory unless the user explicitly - ! sets it up, and that is an undefined circumstance." - ! - ! but it happens on the HP-PA when loading parameter registers, - ! so I am going to define that circumstance, and make it work - ! as expected. */ - - ! if (optype0 == REGOP && (optype1 == MEMOP || optype1 == OFFSOP) - ! && reg_overlap_mentioned_p (operands[0], XEXP (operands[1], 0))) - { - - /* XXX THIS PROBABLY DOESN'T WORK. */ - /* Do the late half first. */ - if (addreg1) - output_asm_insn ("ldo 4(%0),%0", &addreg1); - output_asm_insn (singlemove_string (latehalf), latehalf); - if (addreg1) - output_asm_insn ("ldo -4(%0),%0", &addreg1); - - /* Then clobber. */ - return singlemove_string (operands); - } - - if (optype0 == REGOP && optype1 == REGOP - && REGNO (operands[0]) == REGNO (operands[1]) + 1) - --- 1344,1377 ---- - do them in the other order. - - ! This can happen in two cases: - - ! mem -> register where the first half of the destination register - ! is the same register used in the memory's address. Reload - ! can create such insns. - ! - ! mem in this case will be either register indirect or register - ! indirect plus a valid offset. - ! - ! register -> register move where REGNO(dst) == REGNO(src + 1) - ! someone (Tim/Tege?) claimed this can happen for parameter loads. - ! - ! Handle mem -> register case first. */ - ! if (optype0 == REGOP - ! && (optype1 == MEMOP || optype1 == OFFSOP) - ! && refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1, - ! operands[1], 0)) - { - /* Do the late half first. */ - if (addreg1) - output_asm_insn ("ldo 4(%0),%0", &addreg1); - output_asm_insn (singlemove_string (latehalf), latehalf); - + - + /* Then clobber. */ - if (addreg1) - output_asm_insn ("ldo -4(%0),%0", &addreg1); - return singlemove_string (operands); - } - - + /* Now handle register -> register case. */ - if (optype0 == REGOP && optype1 == REGOP - && REGNO (operands[0]) == REGNO (operands[1]) + 1) - diff -rcp2N gcc-2.7.2.3/config/pa/pa.md gcc-2.7.2.3.f.2/config/pa/pa.md - *** gcc-2.7.2.3/config/pa/pa.md Mon Aug 14 13:00:49 1995 - --- gcc-2.7.2.3.f.2/config/pa/pa.md Tue Sep 9 07:01:22 1997 - *************** - *** 1828,1832 **** - (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - ! "=f,*r,Q,?o,?Q,f,*&r,*&r") - (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" - "fG,*rG,f,*r,*r,Q,o,Q"))] - --- 1828,1832 ---- - (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - ! "=f,*r,Q,?o,?Q,f,*r,*r") - (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" - "fG,*rG,f,*r,*r,Q,o,Q"))] - *************** - *** 1846,1850 **** - (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - ! "=r,?o,?Q,&r,&r") - (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" - "rG,r,r,o,Q"))] - --- 1846,1850 ---- - (define_insn "" - [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" - ! "=r,?o,?Q,r,r") - (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand" - "rG,r,r,o,Q"))] - *************** - *** 2019,2023 **** - (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - ! "=r,o,Q,&r,&r,&r,f,f,*T") - (match_operand:DI 1 "general_operand" - "rM,r,r,o,Q,i,fM,*T,f"))] - --- 2019,2023 ---- - (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - ! "=r,o,Q,r,r,r,f,f,*T") - (match_operand:DI 1 "general_operand" - "rM,r,r,o,Q,i,fM,*T,f"))] - *************** - *** 2037,2041 **** - (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - ! "=r,o,Q,&r,&r,&r") - (match_operand:DI 1 "general_operand" - "rM,r,r,o,Q,i"))] - --- 2037,2041 ---- - (define_insn "" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" - ! "=r,o,Q,r,r,r") - (match_operand:DI 1 "general_operand" - "rM,r,r,o,Q,i"))] - diff -rcp2N gcc-2.7.2.3/config/rs6000/rs6000.c gcc-2.7.2.3.f.2/config/rs6000/rs6000.c - *** gcc-2.7.2.3/config/rs6000/rs6000.c Sat Jun 29 16:26:26 1996 - --- gcc-2.7.2.3.f.2/config/rs6000/rs6000.c Tue Sep 9 07:01:23 1997 - *************** input_operand (op, mode) - *** 724,730 **** - return 1; - - ! /* For HImode and QImode, any constant is valid. */ - ! if ((mode == HImode || mode == QImode) - ! && GET_CODE (op) == CONST_INT) - return 1; - - --- 724,729 ---- - return 1; - - ! /* For integer modes, any constant is ok. */ - ! if (GET_CODE (op) == CONST_INT) - return 1; - - *************** svr4_traceback (file, name, decl) - *** 2611,2614 **** - --- 2610,2682 ---- - #endif /* USING_SVR4_H */ - - + /* Write out an instruction to load the TOC_TABLE address into register 30. - + This is only needed when TARGET_TOC, TARGET_MINIMAL_TOC, and there is - + a constant pool. */ - + - + void - + rs6000_output_load_toc_table (file) - + FILE *file; - + { - + char buf[256]; - + - + #ifdef USING_SVR4_H - + if (TARGET_RELOCATABLE) - + { - + ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); - + fprintf (file, "\tbl "); - + assemble_name (file, buf); - + fprintf (file, "\n"); - + - + ASM_OUTPUT_INTERNAL_LABEL (file, "LCF", rs6000_pic_labelno); - + fprintf (file, "\tmflr %s\n", reg_names[30]); - + - + if (TARGET_POWERPC64) - + fprintf (file, "\tld"); - + else if (TARGET_NEW_MNEMONICS) - + fprintf (file, "\tlwz"); - + else - + fprintf (file, "\tl"); - + - + fprintf (file, " %s,(", reg_names[0]); - + ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno); - + assemble_name (file, buf); - + fprintf (file, "-"); - + ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); - + assemble_name (file, buf); - + fprintf (file, ")(%s)\n", reg_names[30]); - + asm_fprintf (file, "\t{cax|add} %s,%s,%s\n", - + reg_names[30], reg_names[0], reg_names[30]); - + rs6000_pic_labelno++; - + } - + else if (!TARGET_64BIT) - + { - + ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); - + asm_fprintf (file, "\t{cau|addis} %s,%s,", reg_names[30], reg_names[0]); - + assemble_name (file, buf); - + asm_fprintf (file, "@ha\n"); - + if (TARGET_NEW_MNEMONICS) - + { - + asm_fprintf (file, "\taddi %s,%s,", reg_names[30], reg_names[30]); - + assemble_name (file, buf); - + asm_fprintf (file, "@l\n"); - + } - + else - + { - + asm_fprintf (file, "\tcal %s,", reg_names[30]); - + assemble_name (file, buf); - + asm_fprintf (file, "@l(%s)\n", reg_names[30]); - + } - + } - + else - + abort (); - + - + #else /* !USING_SVR4_H */ - + ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0); - + asm_fprintf (file, "\t{l|lwz} %s,", reg_names[30]); - + assemble_name (file, buf); - + asm_fprintf (file, "(%s)\n", reg_names[2]); - + #endif /* USING_SVR4_H */ - + } - + - /* Write function prologue. */ - void - *************** output_prolog (file, size) - *** 2770,2834 **** - TOC_TABLE address into register 30. */ - if (TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) - ! { - ! char buf[256]; - ! - ! #ifdef USING_SVR4_H - ! if (TARGET_RELOCATABLE) - ! { - ! ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); - ! fprintf (file, "\tbl "); - ! assemble_name (file, buf); - ! fprintf (file, "\n"); - ! - ! ASM_OUTPUT_INTERNAL_LABEL (file, "LCF", rs6000_pic_labelno); - ! fprintf (file, "\tmflr %s\n", reg_names[30]); - ! - ! if (TARGET_POWERPC64) - ! fprintf (file, "\tld"); - ! else if (TARGET_NEW_MNEMONICS) - ! fprintf (file, "\tlwz"); - ! else - ! fprintf (file, "\tl"); - ! - ! fprintf (file, " %s,(", reg_names[0]); - ! ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno); - ! assemble_name (file, buf); - ! fprintf (file, "-"); - ! ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); - ! assemble_name (file, buf); - ! fprintf (file, ")(%s)\n", reg_names[30]); - ! asm_fprintf (file, "\t{cax|add} %s,%s,%s\n", - ! reg_names[30], reg_names[0], reg_names[30]); - ! rs6000_pic_labelno++; - ! } - ! else if (!TARGET_64BIT) - ! { - ! ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); - ! asm_fprintf (file, "\t{cau|addis} %s,%s,", reg_names[30], reg_names[0]); - ! assemble_name (file, buf); - ! asm_fprintf (file, "@ha\n"); - ! if (TARGET_NEW_MNEMONICS) - ! { - ! asm_fprintf (file, "\taddi %s,%s,", reg_names[30], reg_names[30]); - ! assemble_name (file, buf); - ! asm_fprintf (file, "@l\n"); - ! } - ! else - ! { - ! asm_fprintf (file, "\tcal %s,", reg_names[30]); - ! assemble_name (file, buf); - ! asm_fprintf (file, "@l(%s)\n", reg_names[30]); - ! } - ! } - ! else - ! abort (); - ! - ! #else /* !USING_SVR4_H */ - ! ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0); - ! asm_fprintf (file, "\t{l|lwz} %s,", reg_names[30]); - ! assemble_name (file, buf); - ! asm_fprintf (file, "(%s)\n", reg_names[2]); - ! #endif /* USING_SVR4_H */ - ! } - } - - --- 2838,2842 ---- - TOC_TABLE address into register 30. */ - if (TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) - ! rs6000_output_load_toc_table (file); - } - - diff -rcp2N gcc-2.7.2.3/config/rs6000/rs6000.md gcc-2.7.2.3.f.2/config/rs6000/rs6000.md - *** gcc-2.7.2.3/config/rs6000/rs6000.md Sat Jun 29 16:27:24 1996 - --- gcc-2.7.2.3.f.2/config/rs6000/rs6000.md Tue Sep 9 07:01:23 1997 - *************** - *** 4420,4423 **** - --- 4420,4424 ---- - } - - + emit_insn (gen_rtx (CLOBBER, VOIDmode, operands[0])); - emit_move_insn (gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN), - GEN_INT (low)); - *************** - *** 5409,5412 **** - --- 5410,5425 ---- - DONE; - }") - + - + ;; If we have -mmiminal-toc, we need to reload r30 after a nonlocal goto. - + - + (define_insn "nonlocal_goto_receiver" - + [(unspec_volatile [(const_int 0)] 1)] - + "TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0" - + "* - + { - + rs6000_output_load_toc_table (asm_out_file); - + return \"\"; - + }" - + [(set_attr "type" "load")]) - - ;; A function pointer is a pointer to a data area whose first word contains - diff -rcp2N gcc-2.7.2.3/config/sparc/sol2.h gcc-2.7.2.3.f.2/config/sparc/sol2.h - *** gcc-2.7.2.3/config/sparc/sol2.h Sat Aug 19 21:36:45 1995 - --- gcc-2.7.2.3.f.2/config/sparc/sol2.h Tue Sep 9 07:01:23 1997 - *************** do { \ - *** 166,168 **** - /* Define for support of TFmode long double and REAL_ARITHMETIC. - Sparc ABI says that long double is 4 words. */ - ! #define LONG_DOUBLE_TYPE_SIZE 128 - --- 166,168 ---- - /* Define for support of TFmode long double and REAL_ARITHMETIC. - Sparc ABI says that long double is 4 words. */ - ! #define LONG_DOUBLE_TYPE_SIZE 64 - diff -rcp2N gcc-2.7.2.3/config/sparc/sparc.c gcc-2.7.2.3.f.2/config/sparc/sparc.c - *** gcc-2.7.2.3/config/sparc/sparc.c Tue Sep 12 22:32:24 1995 - --- gcc-2.7.2.3.f.2/config/sparc/sparc.c Tue Sep 9 07:01:24 1997 - *************** Boston, MA 02111-1307, USA. */ - *** 40,46 **** - /* 1 if the caller has placed an "unimp" insn immediately after the call. - This is used in v8 code when calling a function that returns a structure. - ! v9 doesn't have this. */ - - ! #define SKIP_CALLERS_UNIMP_P (!TARGET_V9 && current_function_returns_struct) - - /* Global variables for machine-dependent things. */ - --- 40,51 ---- - /* 1 if the caller has placed an "unimp" insn immediately after the call. - This is used in v8 code when calling a function that returns a structure. - ! v9 doesn't have this. Be careful to have this test be the same as that - ! used on the call. */ - - ! #define SKIP_CALLERS_UNIMP_P \ - ! (!TARGET_V9 && current_function_returns_struct \ - ! && ! integer_zerop (DECL_SIZE (DECL_RESULT (current_function_decl))) \ - ! && (TREE_CODE (DECL_SIZE (DECL_RESULT (current_function_decl))) \ - ! == INTEGER_CST)) - - /* Global variables for machine-dependent things. */ - diff -rcp2N gcc-2.7.2.3/config/sparc/sparc.h gcc-2.7.2.3.f.2/config/sparc/sparc.h - *** gcc-2.7.2.3/config/sparc/sparc.h Sat Jun 29 16:25:54 1996 - --- gcc-2.7.2.3.f.2/config/sparc/sparc.h Tue Sep 9 07:01:25 1997 - *************** extern int leaf_function; - *** 1526,1533 **** - - /* Output assembler code to FILE to increment profiler label # LABELNO - ! for profiling a function entry. */ - - #define FUNCTION_PROFILER(FILE, LABELNO) \ - do { \ - fputs ("\tsethi %hi(", (FILE)); \ - ASM_OUTPUT_INTERNAL_LABELREF (FILE, "LP", LABELNO); \ - --- 1526,1540 ---- - - /* Output assembler code to FILE to increment profiler label # LABELNO - ! for profiling a function entry. - ! - ! 32 bit sparc uses %g2 as the STATIC_CHAIN_REGNUM which gets clobbered - ! during profiling so we need to save/restore it around the call to mcount. - ! We're guaranteed that a save has just been done, and we use the space - ! allocated for intreg/fpreg value passing. */ - - #define FUNCTION_PROFILER(FILE, LABELNO) \ - do { \ - + if (! TARGET_V9) \ - + fputs ("\tst %g2,[%fp-4]\n", FILE); \ - fputs ("\tsethi %hi(", (FILE)); \ - ASM_OUTPUT_INTERNAL_LABELREF (FILE, "LP", LABELNO); \ - *************** extern int leaf_function; - *** 1539,1542 **** - --- 1546,1551 ---- - ASM_OUTPUT_INTERNAL_LABELREF (FILE, "LP", LABELNO); \ - fputs ("),%o0,%o0\n", (FILE)); \ - + if (! TARGET_V9) \ - + fputs ("\tld [%fp-4],%g2\n", FILE); \ - } while (0) - - diff -rcp2N gcc-2.7.2.3/config/sparc/sparc.md gcc-2.7.2.3.f.2/config/sparc/sparc.md - *** gcc-2.7.2.3/config/sparc/sparc.md Tue Sep 12 22:57:35 1995 - --- gcc-2.7.2.3.f.2/config/sparc/sparc.md Tue Sep 9 07:01:26 1997 - *************** - *** 4799,4803 **** - abort (); - - ! if (GET_CODE (XEXP (operands[0], 0)) == LABEL_REF) - { - /* This is really a PIC sequence. We want to represent - --- 4799,4803 ---- - abort (); - - ! if (GET_CODE (XEXP (operands[0], 0)) == LABEL_REF) - { - /* This is really a PIC sequence. We want to represent - *************** - *** 4809,4824 **** - - if (! TARGET_V9 && INTVAL (operands[3]) != 0) - ! emit_jump_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (3, - ! gen_rtx (SET, VOIDmode, pc_rtx, - ! XEXP (operands[0], 0)), - ! operands[3], - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - else - ! emit_jump_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, - ! gen_rtx (SET, VOIDmode, pc_rtx, - ! XEXP (operands[0], 0)), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - goto finish_call; - } - --- 4809,4828 ---- - - if (! TARGET_V9 && INTVAL (operands[3]) != 0) - ! emit_jump_insn - ! (gen_rtx (PARALLEL, VOIDmode, - ! gen_rtvec (3, - ! gen_rtx (SET, VOIDmode, pc_rtx, - ! XEXP (operands[0], 0)), - ! GEN_INT (INTVAL (operands[3]) & 0xfff), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - else - ! emit_jump_insn - ! (gen_rtx (PARALLEL, VOIDmode, - ! gen_rtvec (2, - ! gen_rtx (SET, VOIDmode, pc_rtx, - ! XEXP (operands[0], 0)), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - goto finish_call; - } - *************** - *** 4839,4852 **** - - if (! TARGET_V9 && INTVAL (operands[3]) != 0) - ! emit_call_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (3, - ! gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx), - ! operands[3], - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - else - ! emit_call_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, - ! gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - - finish_call: - --- 4843,4858 ---- - - if (! TARGET_V9 && INTVAL (operands[3]) != 0) - ! emit_call_insn - ! (gen_rtx (PARALLEL, VOIDmode, - ! gen_rtvec (3, gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx), - ! GEN_INT (INTVAL (operands[3]) & 0xfff), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - else - ! emit_call_insn - ! (gen_rtx (PARALLEL, VOIDmode, - ! gen_rtvec (2, gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx), - ! gen_rtx (CLOBBER, VOIDmode, - ! gen_rtx (REG, Pmode, 15))))); - - finish_call: - *************** - *** 4911,4915 **** - (clobber (reg:SI 15))] - ;;- Do not use operand 1 for most machines. - ! "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" - "call %a0,%1\;nop\;unimp %2" - [(set_attr "type" "call_no_delay_slot")]) - --- 4917,4921 ---- - (clobber (reg:SI 15))] - ;;- Do not use operand 1 for most machines. - ! "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0" - "call %a0,%1\;nop\;unimp %2" - [(set_attr "type" "call_no_delay_slot")]) - *************** - *** 4923,4927 **** - (clobber (reg:SI 15))] - ;;- Do not use operand 1 for most machines. - ! "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" - "call %a0,%1\;nop\;unimp %2" - [(set_attr "type" "call_no_delay_slot")]) - --- 4929,4933 ---- - (clobber (reg:SI 15))] - ;;- Do not use operand 1 for most machines. - ! "! TARGET_V9 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0" - "call %a0,%1\;nop\;unimp %2" - [(set_attr "type" "call_no_delay_slot")]) - *************** - *** 5178,5184 **** - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); - emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx)); - - emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, Pmode, 8))); - /* Return, restoring reg window and jumping to goto handler. */ - emit_insn (gen_goto_handler_and_restore ()); - DONE; - }") - --- 5184,5190 ---- - emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); - emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx)); - /* Return, restoring reg window and jumping to goto handler. */ - emit_insn (gen_goto_handler_and_restore ()); - + emit_barrier (); - DONE; - }") - *************** - *** 5192,5200 **** - - (define_insn "goto_handler_and_restore" - ! [(unspec_volatile [(const_int 0)] 2)] - "" - "jmp %%o0+0\;restore" - [(set_attr "type" "misc") - (set_attr "length" "2")]) - - ;; Special pattern for the FLUSH instruction. - --- 5198,5237 ---- - - (define_insn "goto_handler_and_restore" - ! [(unspec_volatile [(const_int 0)] 2) - ! (use (reg:SI 8))] - "" - "jmp %%o0+0\;restore" - [(set_attr "type" "misc") - (set_attr "length" "2")]) - + - + ;; Pattern for use after a setjmp to store FP and the return register - + ;; into the stack area. - + - + (define_expand "setjmp" - + [(const_int 0)] - + "" - + " - + { - + if (TARGET_V9) - + emit_insn (gen_setjmp_64 ()); - + else - + emit_insn (gen_setjmp_32 ()); - + - + DONE; - + }") - + - + (define_expand "setjmp_32" - + [(set (mem:SI (plus:SI (reg:SI 14) (const_int 56))) (match_dup 0)) - + (set (mem:SI (plus:SI (reg:SI 14) (const_int 60))) (reg:SI 31))] - + "" - + " - + { operands[0] = frame_pointer_rtx; }") - + - + (define_expand "setjmp_64" - + [(set (mem:DI (plus:DI (reg:DI 14) (const_int 112))) (match_dup 0)) - + (set (mem:DI (plus:DI (reg:DI 14) (const_int 120))) (reg:DI 31))] - + "" - + " - + { operands[0] = frame_pointer_rtx; }") - - ;; Special pattern for the FLUSH instruction. - diff -rcp2N gcc-2.7.2.3/config/x-linux gcc-2.7.2.3.f.2/config/x-linux - *** gcc-2.7.2.3/config/x-linux Tue Mar 28 12:43:37 1995 - --- gcc-2.7.2.3.f.2/config/x-linux Tue Sep 9 07:01:26 1997 - *************** BOOT_CFLAGS = -O $(CFLAGS) -Iinclude - *** 13,14 **** - --- 13,17 ---- - # Don't run fixproto - STMP_FIXPROTO = - + - + # Don't install "assert.h" in gcc. We use the one in glibc. - + INSTALL_ASSERT_H = - diff -rcp2N gcc-2.7.2.3/config/x-linux-aout gcc-2.7.2.3.f.2/config/x-linux-aout - *** gcc-2.7.2.3/config/x-linux-aout Thu Jan 1 00:00:00 1970 - --- gcc-2.7.2.3.f.2/config/x-linux-aout Tue Sep 9 07:01:26 1997 - *************** - *** 0 **** - --- 1,14 ---- - + # It is defined in config/xm-linux.h. - + # X_CFLAGS = -DPOSIX - + - + # The following is needed when compiling stages 2 and 3 because gcc's - + # limits.h must be picked up before /usr/include/limits.h. This is because - + # each does an #include_next of the other if the other hasn't been included. - + # /usr/include/limits.h loses if it gets found first because /usr/include is - + # at the end of the search order. When a new version of gcc is released, - + # gcc's limits.h hasn't been installed yet and hence isn't found. - + - + BOOT_CFLAGS = -O $(CFLAGS) -Iinclude - + - + # Don't run fixproto - + STMP_FIXPROTO = - diff -rcp2N gcc-2.7.2.3/config.guess gcc-2.7.2.3.f.2/config.guess - *** gcc-2.7.2.3/config.guess Tue Jun 24 18:42:50 1997 - --- gcc-2.7.2.3.f.2/config.guess Tue Sep 9 07:01:26 1997 - *************** trap 'rm -f dummy.c dummy.o dummy; exit - *** 52,63 **** - - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - - alpha:OSF1:V*:*) - - # After 1.2, OSF1 uses "V1.3" for uname -r. - - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'` - - exit 0 ;; - alpha:OSF1:*:*) - # 1.2 uses "1.2" for uname -r. - ! echo alpha-dec-osf${UNAME_RELEASE} - ! exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - --- 52,62 ---- - - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - + # A Vn.n version is a released version. - + # A Tn.n version is a released field test version. - + # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - ! echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` - ! exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - *************** case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ - *** 154,161 **** - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ! ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - ! i[34]86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - --- 153,160 ---- - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ! ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - ! i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *************** EOF - *** 220,224 **** - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - ! 9000/7?? | 9000/8?[79] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; - esac - --- 219,223 ---- - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - ! 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; - esac - *************** EOF - *** 304,308 **** - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - ! i[34]86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - --- 303,307 ---- - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - ! i?86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *************** EOF - *** 314,318 **** - exit 0 ;; - *:GNU:*:*) - ! echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) - --- 313,317 ---- - exit 0 ;; - *:GNU:*:*) - ! echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) - *************** EOF - *** 320,330 **** - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` - ! # if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then - # echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 - ! if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 - ! elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then - echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux ; exit 0 - else - --- 319,333 ---- - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` - ! # if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i?86"; then - # echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 - ! if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i?86linux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 - ! elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i?86coff"; then - echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - + as_version_string=`as --version 2>&1` - + if echo $as_version_string | grep >/dev/null 2>&1 " version 2.6 "; then - + echo alpha-unknown-linuxoldas ; exit 0 - + fi - echo alpha-unknown-linux ; exit 0 - else - *************** EOF - *** 362,369 **** - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions - # are messed up and put the nodename in both sysname and nodename. - ! i[34]86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - ! i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - --- 365,372 ---- - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions - # are messed up and put the nodename in both sysname and nodename. - ! i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - ! i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - *************** EOF - *** 372,376 **** - fi - exit 0 ;; - ! i[34]86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null) && UNAME_MACHINE=i486 - + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - + && UNAME_MACHINE=i586 - echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL - else - *************** EOF - *** 401,405 **** - echo m68010-convergent-sysv - exit 0 ;; - ! M680[234]0:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0) - --- 406,410 ---- - echo m68010-convergent-sysv - exit 0 ;; - ! M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0) - *************** EOF - *** 409,413 **** - uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - ! m680[234]0:LynxOS:2.[23]*:*) - echo m68k-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - --- 414,418 ---- - uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - ! m68*:LynxOS:2.*:*) - echo m68k-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - *************** EOF - *** 415,425 **** - echo m68k-atari-sysv4 - exit 0 ;; - ! i[34]86:LynxOS:2.[23]*:*) - echo i386-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - ! TSUNAMI:LynxOS:2.[23]*:*) - echo sparc-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - ! rs6000:LynxOS:2.[23]*:*) - echo rs6000-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - --- 420,430 ---- - echo m68k-atari-sysv4 - exit 0 ;; - ! i?86:LynxOS:2.*:*) - echo i386-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - ! TSUNAMI:LynxOS:2.*:*) - echo sparc-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - ! rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-lynx-lynxos${UNAME_RELEASE} - exit 0 ;; - *************** main () - *** 478,482 **** - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - ! printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); - exit (0); - #endif - --- 483,487 ---- - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - ! printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - exit (0); - #endif - diff -rcp2N gcc-2.7.2.3/configure gcc-2.7.2.3.f.2/configure - *** gcc-2.7.2.3/configure Wed Aug 13 17:23:24 1997 - --- gcc-2.7.2.3.f.2/configure Tue Sep 9 07:01:26 1997 - *************** exec_prefix='$(prefix)' - *** 82,85 **** - --- 82,86 ---- - # The default g++ include directory is $(libdir)/g++-include. - gxx_include_dir='$(libdir)/g++-include' - + #gxx_include_dir='$(exec_prefix)/include/g++' - - # Default --program-transform-name to nothing. - *************** for machine in $canon_build $canon_host - *** 548,551 **** - --- 549,578 ---- - use_collect2=yes - ;; - + alpha-*-linux*oldas*) - + tm_file=alpha/linux.h - + tmake_file=alpha/t-linux - + xmake_file=alpha/x-linux - + fixincludes=Makefile.in - + xm_file=alpha/xm-linux.h - + gas=yes gnu_ld=yes - + ;; - + alpha-*-linux*ecoff*) - + tm_file=alpha/linux.h - + tmake_file=alpha/t-linux - + xmake_file=alpha/x-linux - + fixincludes=Makefile.in - + xm_file=alpha/xm-linux.h - + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - + gas=yes gnu_ld=yes - + ;; - + alpha-*-linux*) - + tm_file=alpha/elf.h - + tmake_file=alpha/t-linux - + xmake_file=alpha/x-linux - + fixincludes=Makefile.in - + xm_file=alpha/xm-linux.h - + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - + gas=yes gnu_ld=yes - + ;; - alpha-dec-osf[23456789]*) - tm_file=alpha/osf2.h - *************** for machine in $canon_build $canon_host - *** 982,986 **** - cpu_type=i386 # with a.out format using pre BFD linkers - xm_file=i386/xm-linux.h - ! xmake_file=x-linux - tm_file=i386/linux-oldld.h - fixincludes=Makefile.in # The headers are ok already. - --- 1009,1013 ---- - cpu_type=i386 # with a.out format using pre BFD linkers - xm_file=i386/xm-linux.h - ! xmake_file=x-linux-aout - tm_file=i386/linux-oldld.h - fixincludes=Makefile.in # The headers are ok already. - *************** for machine in $canon_build $canon_host - *** 991,995 **** - cpu_type=i386 # with a.out format - xm_file=i386/xm-linux.h - ! xmake_file=x-linux - tm_file=i386/linux-aout.h - fixincludes=Makefile.in # The headers are ok already. - --- 1018,1022 ---- - cpu_type=i386 # with a.out format - xm_file=i386/xm-linux.h - ! xmake_file=x-linux-aout - tm_file=i386/linux-aout.h - fixincludes=Makefile.in # The headers are ok already. - *************** for machine in $canon_build $canon_host - *** 1663,1666 **** - --- 1690,1714 ---- - use_collect2=yes - ;; - + mips-sni-sysv4) - + if [ x$gas = xyes ] - + then - + if [ x$stabs = xyes ] - + then - + tm_file=mips/iris5gdb.h - + else - + tm_file=mips/sni-gas.h - + fi - + else - + tm_file=mips/sni-svr4.h - + fi - + xm_file=mips/xm-sysv.h - + xmake_file=mips/x-sni-svr4 - + tmake_file=mips/t-mips-gas - + if [ x$gnu_ld != xyes ] - + then - + use_collect2=yes - + fi - + broken_install=yes - + ;; - mips-sgi-irix5*) # SGI System V.4., IRIX 5 - if [ x$gas = xyes ] - *************** MAYBE_TARGET_DEFAULT = -DTARGET_CPU_DEFA - *** 2995,2999 **** - rm Makefile.sed - echo 's| ||' > Makefile.sed - ! echo "s|^target=.*$|target=${target}|" >> Makefile.sed - echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed - echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed - --- 3043,3047 ---- - rm Makefile.sed - echo 's| ||' > Makefile.sed - ! echo "s|^target=.*$|target=${canon_target}|" >> Makefile.sed - echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed - echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed - diff -rcp2N gcc-2.7.2.3/cp/ChangeLog gcc-2.7.2.3.f.2/cp/ChangeLog - *** gcc-2.7.2.3/cp/ChangeLog Tue Aug 19 21:26:09 1997 - --- gcc-2.7.2.3.f.2/cp/ChangeLog Mon Oct 27 08:01:25 1997 - *************** - *** 1,2 **** - --- 1,12 ---- - + Mon Oct 27 03:00:07 1997 Craig Burley - + - + * tree.def (TEMPLATE_CONST_PARM): Word size now 3, not - + 2, due to Jul 23 1996 change to gcc/tree.h by Richard - + Kenner to add an `rtl' field to `struct tree_int_cst'. - + Silently depending on the length or layout of an - + internal gcc back-end structure is, of course, a - + kludge, but presumably the g++ people have long since - + abandoned such kludges. - + - Thu Aug 22 23:47:38 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - diff -rcp2N gcc-2.7.2.3/cp/tree.def gcc-2.7.2.3.f.2/cp/tree.def - *** gcc-2.7.2.3/cp/tree.def Thu Oct 12 02:31:34 1995 - --- gcc-2.7.2.3.f.2/cp/tree.def Mon Oct 27 07:42:11 1997 - *************** DEFTREECODE (TEMPLATE_TYPE_PARM, "templa - *** 93,97 **** - /* Index into a template parameter list. This parameter must not be a - type. */ - ! DEFTREECODE (TEMPLATE_CONST_PARM, "template_const_parm", "c", 2) - - /* For uninstantiated parameterized types. - --- 93,97 ---- - /* Index into a template parameter list. This parameter must not be a - type. */ - ! DEFTREECODE (TEMPLATE_CONST_PARM, "template_const_parm", "c", 3) - - /* For uninstantiated parameterized types. - diff -rcp2N gcc-2.7.2.3/cse.c gcc-2.7.2.3.f.2/cse.c - *** gcc-2.7.2.3/cse.c Fri Aug 8 15:30:25 1997 - --- gcc-2.7.2.3.f.2/cse.c Tue Sep 9 07:01:27 1997 - *************** static struct table_elt *last_jump_equiv - *** 520,544 **** - static int constant_pool_entries_cost; - - - /* Bits describing what kind of values in memory must be invalidated - - for a particular instruction. If all three bits are zero, - - no memory refs need to be invalidated. Each bit is more powerful - - than the preceding ones, and if a bit is set then the preceding - - bits are also set. - - - - Here is how the bits are set: - - Pushing onto the stack invalidates only the stack pointer, - - writing at a fixed address invalidates only variable addresses, - - writing in a structure element at variable address - - invalidates all but scalar variables, - - and writing in anything else at variable address invalidates everything. */ - - - - struct write_data - - { - - int sp : 1; /* Invalidate stack pointer. */ - - int var : 1; /* Invalidate variable addresses. */ - - int nonscalar : 1; /* Invalidate all but scalar variables. */ - - int all : 1; /* Invalidate all memory refs. */ - - }; - - - /* Define maximum length of a branch path. */ - - --- 520,523 ---- - *************** static void merge_equiv_classes PROTO((s - *** 626,632 **** - struct table_elt *)); - static void invalidate PROTO((rtx, enum machine_mode)); - static void remove_invalid_refs PROTO((int)); - static void rehash_using_reg PROTO((rtx)); - ! static void invalidate_memory PROTO((struct write_data *)); - static void invalidate_for_call PROTO((void)); - static rtx use_related_value PROTO((rtx, struct table_elt *)); - --- 605,612 ---- - struct table_elt *)); - static void invalidate PROTO((rtx, enum machine_mode)); - + static int cse_rtx_varies_p PROTO((rtx)); - static void remove_invalid_refs PROTO((int)); - static void rehash_using_reg PROTO((rtx)); - ! static void invalidate_memory PROTO((void)); - static void invalidate_for_call PROTO((void)); - static rtx use_related_value PROTO((rtx, struct table_elt *)); - *************** static void set_nonvarying_address_compo - *** 638,644 **** - HOST_WIDE_INT *)); - static int refers_to_p PROTO((rtx, rtx)); - - static int refers_to_mem_p PROTO((rtx, rtx, HOST_WIDE_INT, - - HOST_WIDE_INT)); - - static int cse_rtx_addr_varies_p PROTO((rtx)); - static rtx canon_reg PROTO((rtx, rtx)); - static void find_best_addr PROTO((rtx, rtx *)); - --- 618,621 ---- - *************** static void record_jump_cond PROTO((enum - *** 656,661 **** - rtx, rtx, int)); - static void cse_insn PROTO((rtx, int)); - ! static void note_mem_written PROTO((rtx, struct write_data *)); - ! static void invalidate_from_clobbers PROTO((struct write_data *, rtx)); - static rtx cse_process_notes PROTO((rtx, rtx)); - static void cse_around_loop PROTO((rtx)); - --- 633,638 ---- - rtx, rtx, int)); - static void cse_insn PROTO((rtx, int)); - ! static int note_mem_written PROTO((rtx)); - ! static void invalidate_from_clobbers PROTO((rtx)); - static rtx cse_process_notes PROTO((rtx, rtx)); - static void cse_around_loop PROTO((rtx)); - *************** invalidate (x, full_mode) - *** 1512,1517 **** - register int i; - register struct table_elt *p; - - rtx base; - - HOST_WIDE_INT start, end; - - /* If X is a register, dependencies on its contents - --- 1489,1492 ---- - *************** invalidate (x, full_mode) - *** 1605,1611 **** - full_mode = GET_MODE (x); - - - set_nonvarying_address_components (XEXP (x, 0), GET_MODE_SIZE (full_mode), - - &base, &start, &end); - - - for (i = 0; i < NBUCKETS; i++) - { - --- 1580,1583 ---- - *************** invalidate (x, full_mode) - *** 1614,1618 **** - { - next = p->next_same_hash; - ! if (refers_to_mem_p (p->exp, base, start, end)) - remove_from_table (p, i); - } - --- 1586,1594 ---- - { - next = p->next_same_hash; - ! /* Invalidate ASM_OPERANDS which reference memory (this is easier - ! than checking all the aliases). */ - ! if (p->in_memory - ! && (GET_CODE (p->exp) != MEM - ! || true_dependence (x, full_mode, p->exp, cse_rtx_varies_p))) - remove_from_table (p, i); - } - *************** rehash_using_reg (x) - *** 1695,1722 **** - } - - - /* Remove from the hash table all expressions that reference memory, - - or some of them as specified by *WRITES. */ - - - - static void - - invalidate_memory (writes) - - struct write_data *writes; - - { - - register int i; - - register struct table_elt *p, *next; - - int all = writes->all; - - int nonscalar = writes->nonscalar; - - - - for (i = 0; i < NBUCKETS; i++) - - for (p = table[i]; p; p = next) - - { - - next = p->next_same_hash; - - if (p->in_memory - - && (all - - || (nonscalar && p->in_struct) - - || cse_rtx_addr_varies_p (p->exp))) - - remove_from_table (p, i); - - } - - } - - - /* Remove from the hash table any expression that is a call-clobbered - register. Also update their TICK values. */ - --- 1671,1674 ---- - *************** invalidate_for_call () - *** 1756,1759 **** - --- 1708,1717 ---- - next = p->next_same_hash; - - + if (p->in_memory) - + { - + remove_from_table (p, hash); - + continue; - + } - + - if (GET_CODE (p->exp) != REG - || REGNO (p->exp) >= FIRST_PSEUDO_REGISTER) - *************** canon_hash (x, mode) - *** 1946,1950 **** - return 0; - } - ! if (! RTX_UNCHANGING_P (x)) - { - hash_arg_in_memory = 1; - --- 1904,1908 ---- - return 0; - } - ! if (! RTX_UNCHANGING_P (x) || FIXED_BASE_PLUS_P (XEXP (x, 0))) - { - hash_arg_in_memory = 1; - *************** set_nonvarying_address_components (addr, - *** 2395,2477 **** - } - - ! /* Return 1 iff any subexpression of X refers to memory - ! at an address of BASE plus some offset - ! such that any of the bytes' offsets fall between START (inclusive) - ! and END (exclusive). - ! - ! The value is undefined if X is a varying address (as determined by - ! cse_rtx_addr_varies_p). This function is not used in such cases. - ! - ! When used in the cse pass, `qty_const' is nonzero, and it is used - ! to treat an address that is a register with a known constant value - ! as if it were that constant value. - ! In the loop pass, `qty_const' is zero, so this is not done. */ - ! - ! static int - ! refers_to_mem_p (x, base, start, end) - ! rtx x, base; - ! HOST_WIDE_INT start, end; - ! { - ! register HOST_WIDE_INT i; - ! register enum rtx_code code; - ! register char *fmt; - ! - ! repeat: - ! if (x == 0) - ! return 0; - ! - ! code = GET_CODE (x); - ! if (code == MEM) - ! { - ! register rtx addr = XEXP (x, 0); /* Get the address. */ - ! rtx mybase; - ! HOST_WIDE_INT mystart, myend; - ! - ! set_nonvarying_address_components (addr, GET_MODE_SIZE (GET_MODE (x)), - ! &mybase, &mystart, &myend); - ! - ! - ! /* refers_to_mem_p is never called with varying addresses. - ! If the base addresses are not equal, there is no chance - ! of the memory addresses conflicting. */ - ! if (! rtx_equal_p (mybase, base)) - ! return 0; - ! - ! return myend > start && mystart < end; - ! } - ! - ! /* X does not match, so try its subexpressions. */ - ! - ! fmt = GET_RTX_FORMAT (code); - ! for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - ! if (fmt[i] == 'e') - ! { - ! if (i == 0) - ! { - ! x = XEXP (x, 0); - ! goto repeat; - ! } - ! else - ! if (refers_to_mem_p (XEXP (x, i), base, start, end)) - ! return 1; - ! } - ! else if (fmt[i] == 'E') - ! { - ! int j; - ! for (j = 0; j < XVECLEN (x, i); j++) - ! if (refers_to_mem_p (XVECEXP (x, i, j), base, start, end)) - ! return 1; - ! } - ! - ! return 0; - ! } - ! - ! /* Nonzero if X refers to memory at a varying address; - except that a register which has at the moment a known constant value - isn't considered variable. */ - - static int - ! cse_rtx_addr_varies_p (x) - ! rtx x; - { - /* We need not check for X and the equivalence class being of the same - --- 2353,2363 ---- - } - - ! /* Nonzero if X, a memory address, refers to a varying address; - except that a register which has at the moment a known constant value - isn't considered variable. */ - - static int - ! cse_rtx_varies_p (x) - ! register rtx x; - { - /* We need not check for X and the equivalence class being of the same - *************** cse_rtx_addr_varies_p (x) - *** 2479,2497 **** - doesn't vary in any mode. */ - - ! if (GET_CODE (x) == MEM - ! && GET_CODE (XEXP (x, 0)) == REG - ! && REGNO_QTY_VALID_P (REGNO (XEXP (x, 0))) - ! && GET_MODE (XEXP (x, 0)) == qty_mode[reg_qty[REGNO (XEXP (x, 0))]] - ! && qty_const[reg_qty[REGNO (XEXP (x, 0))]] != 0) - return 0; - - ! if (GET_CODE (x) == MEM - ! && GET_CODE (XEXP (x, 0)) == PLUS - ! && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT - ! && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG - ! && REGNO_QTY_VALID_P (REGNO (XEXP (XEXP (x, 0), 0))) - ! && (GET_MODE (XEXP (XEXP (x, 0), 0)) - ! == qty_mode[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]]) - ! && qty_const[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]]) - return 0; - - --- 2365,2381 ---- - doesn't vary in any mode. */ - - ! if (GET_CODE (x) == REG - ! && REGNO_QTY_VALID_P (REGNO (x)) - ! && GET_MODE (x) == qty_mode[reg_qty[REGNO (x)]] - ! && qty_const[reg_qty[REGNO (x)]] != 0) - return 0; - - ! if (GET_CODE (x) == PLUS - ! && GET_CODE (XEXP (x, 1)) == CONST_INT - ! && GET_CODE (XEXP (x, 0)) == REG - ! && REGNO_QTY_VALID_P (REGNO (XEXP (x, 0))) - ! && (GET_MODE (XEXP (x, 0)) - ! == qty_mode[reg_qty[REGNO (XEXP (x, 0))]]) - ! && qty_const[reg_qty[REGNO (XEXP (x, 0))]]) - return 0; - - *************** cse_rtx_addr_varies_p (x) - *** 2501,2519 **** - load fp minus a constant into a register, then a MEM which is the - sum of the two `constant' registers. */ - ! if (GET_CODE (x) == MEM - ! && GET_CODE (XEXP (x, 0)) == PLUS - ! && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG - ! && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG - ! && REGNO_QTY_VALID_P (REGNO (XEXP (XEXP (x, 0), 0))) - ! && (GET_MODE (XEXP (XEXP (x, 0), 0)) - ! == qty_mode[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]]) - ! && qty_const[reg_qty[REGNO (XEXP (XEXP (x, 0), 0))]] - ! && REGNO_QTY_VALID_P (REGNO (XEXP (XEXP (x, 0), 1))) - ! && (GET_MODE (XEXP (XEXP (x, 0), 1)) - ! == qty_mode[reg_qty[REGNO (XEXP (XEXP (x, 0), 1))]]) - ! && qty_const[reg_qty[REGNO (XEXP (XEXP (x, 0), 1))]]) - return 0; - - ! return rtx_addr_varies_p (x); - } - - --- 2385,2402 ---- - load fp minus a constant into a register, then a MEM which is the - sum of the two `constant' registers. */ - ! if (GET_CODE (x) == PLUS - ! && GET_CODE (XEXP (x, 0)) == REG - ! && GET_CODE (XEXP (x, 1)) == REG - ! && REGNO_QTY_VALID_P (REGNO (XEXP (x, 0))) - ! && (GET_MODE (XEXP (x, 0)) - ! == qty_mode[reg_qty[REGNO (XEXP (x, 0))]]) - ! && qty_const[reg_qty[REGNO (XEXP (x, 0))]] - ! && REGNO_QTY_VALID_P (REGNO (XEXP (x, 1))) - ! && (GET_MODE (XEXP (x, 1)) - ! == qty_mode[reg_qty[REGNO (XEXP (x, 1))]]) - ! && qty_const[reg_qty[REGNO (XEXP (x, 1))]]) - return 0; - - ! return rtx_varies_p (x); - } - - *************** fold_rtx (x, insn) - *** 5542,5550 **** - CONST_INT, see if we can find a register equivalent to the - positive constant. Make a MINUS if so. Don't do this for - ! a negative constant since we might then alternate between - chosing positive and negative constants. Having the positive - ! constant previously-used is the more common case. */ - ! if (const_arg1 && GET_CODE (const_arg1) == CONST_INT - ! && INTVAL (const_arg1) < 0 && GET_CODE (folded_arg1) == REG) - { - rtx new_const = GEN_INT (- INTVAL (const_arg1)); - --- 5425,5439 ---- - CONST_INT, see if we can find a register equivalent to the - positive constant. Make a MINUS if so. Don't do this for - ! a non-negative constant since we might then alternate between - chosing positive and negative constants. Having the positive - ! constant previously-used is the more common case. Be sure - ! the resulting constant is non-negative; if const_arg1 were - ! the smallest negative number this would overflow: depending - ! on the mode, this would either just be the same value (and - ! hence not save anything) or be incorrect. */ - ! if (const_arg1 != 0 && GET_CODE (const_arg1) == CONST_INT - ! && INTVAL (const_arg1) < 0 - ! && - INTVAL (const_arg1) >= 0 - ! && GET_CODE (folded_arg1) == REG) - { - rtx new_const = GEN_INT (- INTVAL (const_arg1)); - *************** cse_insn (insn, in_libcall_block) - *** 6105,6110 **** - rtx this_insn_cc0 = 0; - enum machine_mode this_insn_cc0_mode; - - struct write_data writes_memory; - - static struct write_data init = {0, 0, 0, 0}; - - rtx src_eqv = 0; - --- 5994,5997 ---- - *************** cse_insn (insn, in_libcall_block) - *** 6118,6122 **** - - this_insn = insn; - - writes_memory = init; - - /* Find all the SETs and CLOBBERs in this instruction. - --- 6005,6008 ---- - *************** cse_insn (insn, in_libcall_block) - *** 6220,6232 **** - else if (GET_CODE (y) == CLOBBER) - { - ! /* If we clobber memory, take note of that, - ! and canon the address. - This does nothing when a register is clobbered - because we have already invalidated the reg. */ - if (GET_CODE (XEXP (y, 0)) == MEM) - ! { - ! canon_reg (XEXP (y, 0), NULL_RTX); - ! note_mem_written (XEXP (y, 0), &writes_memory); - ! } - } - else if (GET_CODE (y) == USE - --- 6106,6114 ---- - else if (GET_CODE (y) == CLOBBER) - { - ! /* If we clobber memory, canon the address. - This does nothing when a register is clobbered - because we have already invalidated the reg. */ - if (GET_CODE (XEXP (y, 0)) == MEM) - ! canon_reg (XEXP (y, 0), NULL_RTX); - } - else if (GET_CODE (y) == USE - *************** cse_insn (insn, in_libcall_block) - *** 6247,6254 **** - { - if (GET_CODE (XEXP (x, 0)) == MEM) - ! { - ! canon_reg (XEXP (x, 0), NULL_RTX); - ! note_mem_written (XEXP (x, 0), &writes_memory); - ! } - } - - --- 6129,6133 ---- - { - if (GET_CODE (XEXP (x, 0)) == MEM) - ! canon_reg (XEXP (x, 0), NULL_RTX); - } - - *************** cse_insn (insn, in_libcall_block) - *** 6430,6433 **** - --- 6309,6327 ---- - sets[i].src_in_struct = hash_arg_in_struct; - - + /* If SRC is a MEM, there is a REG_EQUIV note for SRC, and DEST is - + a pseudo that is set more than once, do not record SRC. Using - + SRC as a replacement for anything else will be incorrect in that - + situation. Note that this usually occurs only for stack slots, - + in which case all the RTL would be refering to SRC, so we don't - + lose any optimization opportunities by not having SRC in the - + hash table. */ - + - + if (GET_CODE (src) == MEM - + && find_reg_note (insn, REG_EQUIV, src) != 0 - + && GET_CODE (dest) == REG - + && REGNO (dest) >= FIRST_PSEUDO_REGISTER - + && reg_n_sets[REGNO (dest)] != 1) - + sets[i].src_volatile = 1; - + - #if 0 - /* It is no longer clear why we used to do this, but it doesn't - *************** cse_insn (insn, in_libcall_block) - *** 6674,6678 **** - } - #endif /* LOAD_EXTEND_OP */ - ! - if (src == src_folded) - src_folded = 0; - --- 6568,6572 ---- - } - #endif /* LOAD_EXTEND_OP */ - ! - if (src == src_folded) - src_folded = 0; - *************** cse_insn (insn, in_libcall_block) - *** 6860,6864 **** - || (GET_CODE (src_folded) != MEM - && ! src_folded_force_flag)) - ! && GET_MODE_CLASS (mode) != MODE_CC) - { - src_folded_force_flag = 1; - --- 6754,6759 ---- - || (GET_CODE (src_folded) != MEM - && ! src_folded_force_flag)) - ! && GET_MODE_CLASS (mode) != MODE_CC - ! && mode != VOIDmode) - { - src_folded_force_flag = 1; - *************** cse_insn (insn, in_libcall_block) - *** 6983,6993 **** - if (GET_CODE (dest) == MEM) - { - dest = fold_rtx (dest, insn); - - - - /* Decide whether we invalidate everything in memory, - - or just things at non-fixed places. - - Writing a large aggregate must invalidate everything - - because we don't know how long it is. */ - - note_mem_written (dest, &writes_memory); - } - - --- 6878,6890 ---- - if (GET_CODE (dest) == MEM) - { - + #ifdef PUSH_ROUNDING - + /* Stack pushes invalidate the stack pointer. */ - + rtx addr = XEXP (dest, 0); - + if ((GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC - + || GET_CODE (addr) == POST_DEC || GET_CODE (addr) == POST_INC) - + && XEXP (addr, 0) == stack_pointer_rtx) - + invalidate (stack_pointer_rtx, Pmode); - + #endif - dest = fold_rtx (dest, insn); - } - - *************** cse_insn (insn, in_libcall_block) - *** 7234,7238 **** - sets[i].src_elt = src_eqv_elt; - - ! invalidate_from_clobbers (&writes_memory, x); - - /* Some registers are invalidated by subroutine calls. Memory is - --- 7131,7135 ---- - sets[i].src_elt = src_eqv_elt; - - ! invalidate_from_clobbers (x); - - /* Some registers are invalidated by subroutine calls. Memory is - *************** cse_insn (insn, in_libcall_block) - *** 7241,7248 **** - if (GET_CODE (insn) == CALL_INSN) - { - - static struct write_data everything = {0, 1, 1, 1}; - - - if (! CONST_CALL_P (insn)) - ! invalidate_memory (&everything); - invalidate_for_call (); - } - --- 7138,7143 ---- - if (GET_CODE (insn) == CALL_INSN) - { - if (! CONST_CALL_P (insn)) - ! invalidate_memory (); - invalidate_for_call (); - } - *************** cse_insn (insn, in_libcall_block) - *** 7265,7270 **** - we have just done an invalidate_memory that covers even those. */ - if (GET_CODE (dest) == REG || GET_CODE (dest) == SUBREG - ! || (GET_CODE (dest) == MEM && ! writes_memory.all - ! && ! cse_rtx_addr_varies_p (dest))) - invalidate (dest, VOIDmode); - else if (GET_CODE (dest) == STRICT_LOW_PART - --- 7160,7164 ---- - we have just done an invalidate_memory that covers even those. */ - if (GET_CODE (dest) == REG || GET_CODE (dest) == SUBREG - ! || GET_CODE (dest) == MEM) - invalidate (dest, VOIDmode); - else if (GET_CODE (dest) == STRICT_LOW_PART - *************** cse_insn (insn, in_libcall_block) - *** 7359,7363 **** - sets[i].dest_hash, GET_MODE (dest)); - elt->in_memory = (GET_CODE (sets[i].inner_dest) == MEM - ! && ! RTX_UNCHANGING_P (sets[i].inner_dest)); - - if (elt->in_memory) - --- 7253,7259 ---- - sets[i].dest_hash, GET_MODE (dest)); - elt->in_memory = (GET_CODE (sets[i].inner_dest) == MEM - ! && (! RTX_UNCHANGING_P (sets[i].inner_dest) - ! || FIXED_BASE_PLUS_P (XEXP (sets[i].inner_dest, - ! 0)))); - - if (elt->in_memory) - *************** cse_insn (insn, in_libcall_block) - *** 7532,7580 **** - } - - - /* Store 1 in *WRITES_PTR for those categories of memory ref - - that must be invalidated when the expression WRITTEN is stored in. - - If WRITTEN is null, say everything must be invalidated. */ - - - static void - ! note_mem_written (written, writes_ptr) - ! rtx written; - ! struct write_data *writes_ptr; - ! { - ! static struct write_data everything = {0, 1, 1, 1}; - ! - ! if (written == 0) - ! *writes_ptr = everything; - ! else if (GET_CODE (written) == MEM) - ! { - ! /* Pushing or popping the stack invalidates just the stack pointer. */ - ! rtx addr = XEXP (written, 0); - ! if ((GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC - ! || GET_CODE (addr) == POST_DEC || GET_CODE (addr) == POST_INC) - ! && GET_CODE (XEXP (addr, 0)) == REG - ! && REGNO (XEXP (addr, 0)) == STACK_POINTER_REGNUM) - ! { - ! writes_ptr->sp = 1; - ! return; - ! } - ! else if (GET_MODE (written) == BLKmode) - ! *writes_ptr = everything; - ! /* (mem (scratch)) means clobber everything. */ - ! else if (GET_CODE (addr) == SCRATCH) - ! *writes_ptr = everything; - ! else if (cse_rtx_addr_varies_p (written)) - ! { - ! /* A varying address that is a sum indicates an array element, - ! and that's just as good as a structure element - ! in implying that we need not invalidate scalar variables. - ! However, we must allow QImode aliasing of scalars, because the - ! ANSI C standard allows character pointers to alias anything. */ - ! if (! ((MEM_IN_STRUCT_P (written) - ! || GET_CODE (XEXP (written, 0)) == PLUS) - ! && GET_MODE (written) != QImode)) - ! writes_ptr->all = 1; - ! writes_ptr->nonscalar = 1; - ! } - ! writes_ptr->var = 1; - } - } - - --- 7428,7471 ---- - } - - static void - ! invalidate_memory () - ! { - ! register int i; - ! register struct table_elt *p, *next; - ! - ! for (i = 0; i < NBUCKETS; i++) - ! for (p = table[i]; p; p = next) - ! { - ! next = p->next_same_hash; - ! if (p->in_memory) - ! remove_from_table (p, i); - ! } - ! } - ! - ! static int - ! note_mem_written (mem) - ! register rtx mem; - ! { - ! if (mem == 0 || GET_CODE(mem) != MEM ) - ! return 0; - ! else - ! { - ! register rtx addr = XEXP (mem, 0); - ! /* Pushing or popping the stack invalidates just the stack pointer. */ - ! if ((GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC - ! || GET_CODE (addr) == POST_DEC || GET_CODE (addr) == POST_INC) - ! && GET_CODE (XEXP (addr, 0)) == REG - ! && REGNO (XEXP (addr, 0)) == STACK_POINTER_REGNUM) - ! { - ! if (reg_tick[STACK_POINTER_REGNUM] >= 0) - ! reg_tick[STACK_POINTER_REGNUM]++; - ! - ! /* This should be *very* rare. */ - ! if (TEST_HARD_REG_BIT (hard_regs_in_table, STACK_POINTER_REGNUM)) - ! invalidate (stack_pointer_rtx, VOIDmode); - ! return 1; - } - + return 0; - + } - } - - *************** note_mem_written (written, writes_ptr) - *** 7584,7612 **** - alias with something that is SET or CLOBBERed. - - - W points to the writes_memory for this insn, a struct write_data - - saying which kinds of memory references must be invalidated. - X is the pattern of the insn. */ - - static void - ! invalidate_from_clobbers (w, x) - ! struct write_data *w; - rtx x; - { - - /* If W->var is not set, W specifies no action. - - If W->all is set, this step gets all memory refs - - so they can be ignored in the rest of this function. */ - - if (w->var) - - invalidate_memory (w); - - - - if (w->sp) - - { - - if (reg_tick[STACK_POINTER_REGNUM] >= 0) - - reg_tick[STACK_POINTER_REGNUM]++; - - - - /* This should be *very* rare. */ - - if (TEST_HARD_REG_BIT (hard_regs_in_table, STACK_POINTER_REGNUM)) - - invalidate (stack_pointer_rtx, VOIDmode); - - } - - - if (GET_CODE (x) == CLOBBER) - { - --- 7475,7484 ---- - alias with something that is SET or CLOBBERed. - - X is the pattern of the insn. */ - - static void - ! invalidate_from_clobbers (x) - rtx x; - { - if (GET_CODE (x) == CLOBBER) - { - *************** invalidate_from_clobbers (w, x) - *** 7615,7619 **** - { - if (GET_CODE (ref) == REG || GET_CODE (ref) == SUBREG - ! || (GET_CODE (ref) == MEM && ! w->all)) - invalidate (ref, VOIDmode); - else if (GET_CODE (ref) == STRICT_LOW_PART - --- 7487,7491 ---- - { - if (GET_CODE (ref) == REG || GET_CODE (ref) == SUBREG - ! || GET_CODE (ref) == MEM) - invalidate (ref, VOIDmode); - else if (GET_CODE (ref) == STRICT_LOW_PART - *************** invalidate_from_clobbers (w, x) - *** 7631,7643 **** - { - rtx ref = XEXP (y, 0); - ! if (ref) - ! { - ! if (GET_CODE (ref) == REG || GET_CODE (ref) == SUBREG - ! || (GET_CODE (ref) == MEM && !w->all)) - ! invalidate (ref, VOIDmode); - ! else if (GET_CODE (ref) == STRICT_LOW_PART - ! || GET_CODE (ref) == ZERO_EXTRACT) - ! invalidate (XEXP (ref, 0), GET_MODE (ref)); - ! } - } - } - --- 7503,7512 ---- - { - rtx ref = XEXP (y, 0); - ! if (GET_CODE (ref) == REG || GET_CODE (ref) == SUBREG - ! || GET_CODE (ref) == MEM) - ! invalidate (ref, VOIDmode); - ! else if (GET_CODE (ref) == STRICT_LOW_PART - ! || GET_CODE (ref) == ZERO_EXTRACT) - ! invalidate (XEXP (ref, 0), GET_MODE (ref)); - } - } - *************** cse_around_loop (loop_start) - *** 7800,7807 **** - } - - - /* Variable used for communications between the next two routines. */ - - - - static struct write_data skipped_writes_memory; - - - /* Process one SET of an insn that was skipped. We ignore CLOBBERs - since they are done elsewhere. This function is called via note_stores. */ - --- 7669,7672 ---- - *************** invalidate_skipped_set (dest, set) - *** 7812,7823 **** - rtx dest; - { - ! if (GET_CODE (dest) == MEM) - ! note_mem_written (dest, &skipped_writes_memory); - ! - ! /* There are times when an address can appear varying and be a PLUS - ! during this scan when it would be a fixed address were we to know - ! the proper equivalences. So promote "nonscalar" to be "all". */ - ! if (skipped_writes_memory.nonscalar) - ! skipped_writes_memory.all = 1; - - if (GET_CODE (set) == CLOBBER - --- 7677,7695 ---- - rtx dest; - { - ! enum rtx_code code = GET_CODE (dest); - ! - ! if (code == MEM - ! && ! note_mem_written (dest) /* If this is not a stack push ... */ - ! /* There are times when an address can appear varying and be a PLUS - ! during this scan when it would be a fixed address were we to know - ! the proper equivalences. So invalidate all memory if there is - ! a BLKmode or nonscalar memory reference or a reference to a - ! variable address. */ - ! && (MEM_IN_STRUCT_P (dest) || GET_MODE (dest) == BLKmode - ! || cse_rtx_varies_p (XEXP (dest, 0)))) - ! { - ! invalidate_memory (); - ! return; - ! } - - if (GET_CODE (set) == CLOBBER - *************** invalidate_skipped_set (dest, set) - *** 7828,7837 **** - return; - - ! if (GET_CODE (dest) == REG || GET_CODE (dest) == SUBREG - ! || (! skipped_writes_memory.all && ! cse_rtx_addr_varies_p (dest))) - ! invalidate (dest, VOIDmode); - ! else if (GET_CODE (dest) == STRICT_LOW_PART - ! || GET_CODE (dest) == ZERO_EXTRACT) - invalidate (XEXP (dest, 0), GET_MODE (dest)); - } - - --- 7700,7707 ---- - return; - - ! if (code == STRICT_LOW_PART || code == ZERO_EXTRACT) - invalidate (XEXP (dest, 0), GET_MODE (dest)); - + else if (code == REG || code == SUBREG || code == MEM) - + invalidate (dest, VOIDmode); - } - - *************** invalidate_skipped_block (start) - *** 7845,7850 **** - { - rtx insn; - - static struct write_data init = {0, 0, 0, 0}; - - static struct write_data everything = {0, 1, 1, 1}; - - for (insn = start; insn && GET_CODE (insn) != CODE_LABEL; - --- 7715,7718 ---- - *************** invalidate_skipped_block (start) - *** 7854,7867 **** - continue; - - - skipped_writes_memory = init; - - - if (GET_CODE (insn) == CALL_INSN) - { - invalidate_for_call (); - - skipped_writes_memory = everything; - } - - note_stores (PATTERN (insn), invalidate_skipped_set); - - invalidate_from_clobbers (&skipped_writes_memory, PATTERN (insn)); - } - } - --- 7722,7733 ---- - continue; - - if (GET_CODE (insn) == CALL_INSN) - { - + if (! CONST_CALL_P (insn)) - + invalidate_memory (); - invalidate_for_call (); - } - - note_stores (PATTERN (insn), invalidate_skipped_set); - } - } - *************** cse_set_around_loop (x, insn, loop_start - *** 7913,7920 **** - { - struct table_elt *src_elt; - - static struct write_data init = {0, 0, 0, 0}; - - struct write_data writes_memory; - - - - writes_memory = init; - - /* If this is a SET, see if we can replace SET_SRC, but ignore SETs that - --- 7779,7782 ---- - *************** cse_set_around_loop (x, insn, loop_start - *** 7976,7991 **** - - /* Now invalidate anything modified by X. */ - ! note_mem_written (SET_DEST (x), &writes_memory); - ! - ! if (writes_memory.var) - ! invalidate_memory (&writes_memory); - ! - ! /* See comment on similar code in cse_insn for explanation of these tests. */ - if (GET_CODE (SET_DEST (x)) == REG || GET_CODE (SET_DEST (x)) == SUBREG - ! || (GET_CODE (SET_DEST (x)) == MEM && ! writes_memory.all - ! && ! cse_rtx_addr_varies_p (SET_DEST (x)))) - invalidate (SET_DEST (x), VOIDmode); - else if (GET_CODE (SET_DEST (x)) == STRICT_LOW_PART - ! || GET_CODE (SET_DEST (x)) == ZERO_EXTRACT) - invalidate (XEXP (SET_DEST (x), 0), GET_MODE (SET_DEST (x))); - } - --- 7838,7849 ---- - - /* Now invalidate anything modified by X. */ - ! note_mem_written (SET_DEST (x)); - ! - ! /* See comment on similar code in cse_insn for explanation of these tests. */ - if (GET_CODE (SET_DEST (x)) == REG || GET_CODE (SET_DEST (x)) == SUBREG - ! || GET_CODE (SET_DEST (x)) == MEM) - invalidate (SET_DEST (x), VOIDmode); - else if (GET_CODE (SET_DEST (x)) == STRICT_LOW_PART - ! || GET_CODE (SET_DEST (x)) == ZERO_EXTRACT) - invalidate (XEXP (SET_DEST (x), 0), GET_MODE (SET_DEST (x))); - } - *************** cse_main (f, nregs, after_loop, file) - *** 8234,8237 **** - --- 8092,8096 ---- - - init_recog (); - + init_alias_analysis (); - - max_reg = nregs; - *************** cse_basic_block (from, to, next_branch, - *** 8405,8408 **** - --- 8264,8268 ---- - int to_usage = 0; - int in_libcall_block = 0; - + int num_insns = 0; - - /* Each of these arrays is undefined before max_reg, so only allocate - *************** cse_basic_block (from, to, next_branch, - *** 8437,8440 **** - --- 8297,8320 ---- - { - register enum rtx_code code; - + int i; - + struct table_elt *p, *next; - + - + /* If we have processed 1,000 insns, flush the hash table to avoid - + extreme quadratic behavior. */ - + if (num_insns++ > 1000) - + { - + for (i = 0; i < NBUCKETS; i++) - + for (p = table[i]; p; p = next) - + { - + next = p->next_same_hash; - + - + if (GET_CODE (p->exp) == REG) - + invalidate (p->exp, p->mode); - + else - + remove_from_table (p, i); - + } - + - + num_insns = 0; - + } - - /* See if this is a branch that is part of the path. If so, and it is - diff -rcp2N gcc-2.7.2.3/dwarfout.c gcc-2.7.2.3.f.2/dwarfout.c - *** gcc-2.7.2.3/dwarfout.c Fri Oct 27 01:40:07 1995 - --- gcc-2.7.2.3.f.2/dwarfout.c Tue Sep 9 07:01:28 1997 - *************** output_bound_representation (bound, dim_ - *** 1629,1705 **** - { - - ! case ERROR_MARK: - ! return; - - /* All fixed-bounds are represented by INTEGER_CST nodes. */ - - ! case INTEGER_CST: - ! ASM_OUTPUT_DWARF_DATA4 (asm_out_file, - ! (unsigned) TREE_INT_CST_LOW (bound)); - ! break; - ! - ! /* Dynamic bounds may be represented by NOP_EXPR nodes containing - ! SAVE_EXPR nodes. */ - ! - ! case NOP_EXPR: - ! bound = TREE_OPERAND (bound, 0); - ! /* ... fall thru... */ - ! - ! case SAVE_EXPR: - ! { - ! char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - ! char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - ! - ! sprintf (begin_label, BOUND_BEGIN_LABEL_FMT, - ! current_dienum, dim_num, u_or_l); - - ! sprintf (end_label, BOUND_END_LABEL_FMT, - ! current_dienum, dim_num, u_or_l); - - ! ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ! ASM_OUTPUT_LABEL (asm_out_file, begin_label); - - ! /* If we are working on a bound for a dynamic dimension in C, - ! the dynamic dimension in question had better have a static - ! (zero) lower bound and a dynamic *upper* bound. */ - - ! if (u_or_l != 'u') - ! abort (); - - ! /* If optimization is turned on, the SAVE_EXPRs that describe - ! how to access the upper bound values are essentially bogus. - ! They only describe (at best) how to get at these values at - ! the points in the generated code right after they have just - ! been computed. Worse yet, in the typical case, the upper - ! bound values will not even *be* computed in the optimized - ! code, so these SAVE_EXPRs are entirely bogus. - ! - ! In order to compensate for this fact, we check here to see - ! if optimization is enabled, and if so, we effectively create - ! an empty location description for the (unknown and unknowable) - ! upper bound. - ! - ! This should not cause too much trouble for existing (stupid?) - ! debuggers because they have to deal with empty upper bounds - ! location descriptions anyway in order to be able to deal with - ! incomplete array types. - ! - ! Of course an intelligent debugger (GDB?) should be able to - ! comprehend that a missing upper bound specification in a - ! array type used for a storage class `auto' local array variable - ! indicates that the upper bound is both unknown (at compile- - ! time) and unknowable (at run-time) due to optimization. - ! */ - ! - ! if (! optimize) - ! output_loc_descriptor - ! (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX)); - - ! ASM_OUTPUT_LABEL (asm_out_file, end_label); - ! } - ! break; - - - default: - - abort (); - } - } - --- 1629,1699 ---- - { - - ! case ERROR_MARK: - ! return; - - /* All fixed-bounds are represented by INTEGER_CST nodes. */ - - ! case INTEGER_CST: - ! ASM_OUTPUT_DWARF_DATA4 (asm_out_file, - ! (unsigned) TREE_INT_CST_LOW (bound)); - ! break; - - ! default: - - ! /* Dynamic bounds may be represented by NOP_EXPR nodes containing - ! SAVE_EXPR nodes, in which case we can do something, or as - ! an expression, which we cannot represent. */ - ! { - ! char begin_label[MAX_ARTIFICIAL_LABEL_BYTES]; - ! char end_label[MAX_ARTIFICIAL_LABEL_BYTES]; - - ! sprintf (begin_label, BOUND_BEGIN_LABEL_FMT, - ! current_dienum, dim_num, u_or_l); - - ! sprintf (end_label, BOUND_END_LABEL_FMT, - ! current_dienum, dim_num, u_or_l); - - ! ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label); - ! ASM_OUTPUT_LABEL (asm_out_file, begin_label); - ! - ! /* If optimization is turned on, the SAVE_EXPRs that describe - ! how to access the upper bound values are essentially bogus. - ! They only describe (at best) how to get at these values at - ! the points in the generated code right after they have just - ! been computed. Worse yet, in the typical case, the upper - ! bound values will not even *be* computed in the optimized - ! code, so these SAVE_EXPRs are entirely bogus. - ! - ! In order to compensate for this fact, we check here to see - ! if optimization is enabled, and if so, we effectively create - ! an empty location description for the (unknown and unknowable) - ! upper bound. - ! - ! This should not cause too much trouble for existing (stupid?) - ! debuggers because they have to deal with empty upper bounds - ! location descriptions anyway in order to be able to deal with - ! incomplete array types. - ! - ! Of course an intelligent debugger (GDB?) should be able to - ! comprehend that a missing upper bound specification in a - ! array type used for a storage class `auto' local array variable - ! indicates that the upper bound is both unknown (at compile- - ! time) and unknowable (at run-time) due to optimization. */ - ! - ! if (! optimize) - ! { - ! while (TREE_CODE (bound) == NOP_EXPR - ! || TREE_CODE (bound) == CONVERT_EXPR) - ! bound = TREE_OPERAND (bound, 0); - ! - ! if (TREE_CODE (bound) == SAVE_EXPR) - ! output_loc_descriptor - ! (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX)); - ! } - - ! ASM_OUTPUT_LABEL (asm_out_file, end_label); - ! } - ! break; - - } - } - *************** type_attribute (type, decl_const, decl_v - *** 2857,2861 **** - register int root_type_modified; - - ! if (TREE_CODE (type) == ERROR_MARK) - return; - - --- 2851,2855 ---- - register int root_type_modified; - - ! if (code == ERROR_MARK) - return; - - *************** type_attribute (type, decl_const, decl_v - *** 2864,2869 **** - type `void', so this only applies to function return types. */ - - ! if (TREE_CODE (type) == VOID_TYPE) - return; - - root_type_modified = (code == POINTER_TYPE || code == REFERENCE_TYPE - --- 2858,2869 ---- - type `void', so this only applies to function return types. */ - - ! if (code == VOID_TYPE) - return; - + - + /* If this is a subtype, find the underlying type. Eventually, - + this should write out the appropriate subtype info. */ - + while ((code == INTEGER_TYPE || code == REAL_TYPE) - + && TREE_TYPE (type) != 0) - + type = TREE_TYPE (type), code = TREE_CODE (type); - - root_type_modified = (code == POINTER_TYPE || code == REFERENCE_TYPE - diff -rcp2N gcc-2.7.2.3/emit-rtl.c gcc-2.7.2.3.f.2/emit-rtl.c - *** gcc-2.7.2.3/emit-rtl.c Thu Sep 14 20:09:30 1995 - --- gcc-2.7.2.3.f.2/emit-rtl.c Thu Feb 26 21:12:55 1998 - *************** max_label_num () - *** 545,548 **** - --- 545,565 ---- - } - - + /* Identify REG (which may be a CONCAT) as a user register. */ - + - + void - + mark_user_reg (reg) - + rtx reg; - + { - + if (GET_CODE (reg) == CONCAT) - + { - + REG_USERVAR_P (XEXP (reg, 0)) = 1; - + REG_USERVAR_P (XEXP (reg, 1)) = 1; - + } - + else if (GET_CODE (reg) == REG) - + REG_USERVAR_P (reg) = 1; - + else - + abort (); - + } - + - /* Return first label number used in this function (if any were used). */ - - *************** gen_lowpart_common (mode, x) - *** 610,614 **** - return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0 - ? SUBREG_REG (x) - ! : gen_rtx (SUBREG, mode, SUBREG_REG (x), SUBREG_WORD (x))); - else if (GET_CODE (x) == REG) - { - --- 627,631 ---- - return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0 - ? SUBREG_REG (x) - ! : gen_rtx (SUBREG, mode, SUBREG_REG (x), SUBREG_WORD (x) + word)); - else if (GET_CODE (x) == REG) - { - *************** subreg_lowpart_p (x) - *** 975,978 **** - --- 992,997 ---- - if (GET_CODE (x) != SUBREG) - return 1; - + else if (GET_MODE (SUBREG_REG (x)) == VOIDmode) - + return 0; - - if (WORDS_BIG_ENDIAN - *************** change_address (memref, mode, addr) - *** 1315,1318 **** - --- 1334,1340 ---- - addr = memory_address (mode, addr); - - + if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref)) - + return memref; - + - new = gen_rtx (MEM, mode, addr); - MEM_VOLATILE_P (new) = MEM_VOLATILE_P (memref); - diff -rcp2N gcc-2.7.2.3/explow.c gcc-2.7.2.3.f.2/explow.c - *** gcc-2.7.2.3/explow.c Thu Jun 15 11:30:10 1995 - --- gcc-2.7.2.3.f.2/explow.c Tue Sep 9 07:01:28 1997 - *************** Boston, MA 02111-1307, USA. */ - *** 32,36 **** - - static rtx break_out_memory_refs PROTO((rtx)); - ! - /* Return an rtx for the sum of X and the integer C. - - --- 32,36 ---- - - static rtx break_out_memory_refs PROTO((rtx)); - ! static void emit_stack_probe PROTO((rtx)); - /* Return an rtx for the sum of X and the integer C. - - *************** convert_memory_address (to_mode, x) - *** 305,310 **** - --- 305,313 ---- - rtx x; - { - + enum machine_mode from_mode = to_mode == ptr_mode ? Pmode : ptr_mode; - rtx temp; - - + /* Here we handle some special cases. If none of them apply, fall through - + to the default case. */ - switch (GET_CODE (x)) - { - *************** convert_memory_address (to_mode, x) - *** 321,339 **** - return temp; - - - case PLUS: - - case MULT: - - return gen_rtx (GET_CODE (x), to_mode, - - convert_memory_address (to_mode, XEXP (x, 0)), - - convert_memory_address (to_mode, XEXP (x, 1))); - - - case CONST: - return gen_rtx (CONST, to_mode, - convert_memory_address (to_mode, XEXP (x, 0))); - - ! default: - ! return convert_modes (to_mode, - ! to_mode == ptr_mode ? Pmode : ptr_mode, - ! x, POINTERS_EXTEND_UNSIGNED); - } - } - #endif - --- 324,348 ---- - return temp; - - case CONST: - return gen_rtx (CONST, to_mode, - convert_memory_address (to_mode, XEXP (x, 0))); - - ! case PLUS: - ! case MULT: - ! /* For addition the second operand is a small constant, we can safely - ! permute the converstion and addition operation. We can always safely - ! permute them if we are making the address narrower. In addition, - ! always permute the operations if this is a constant. */ - ! if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode) - ! || (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT - ! && (INTVAL (XEXP (x, 1)) + 20000 < 40000 - ! || CONSTANT_P (XEXP (x, 0))))) - ! return gen_rtx (GET_CODE (x), to_mode, - ! convert_memory_address (to_mode, XEXP (x, 0)), - ! convert_memory_address (to_mode, XEXP (x, 1))); - } - + - + return convert_modes (to_mode, from_mode, - + x, POINTERS_EXTEND_UNSIGNED); - } - #endif - *************** allocate_dynamic_stack_space (size, targ - *** 1066,1069 **** - --- 1075,1083 ---- - do_pending_stack_adjust (); - - + /* If needed, check that we have the required amount of stack. Take into - + account what has already been checked. */ - + if (flag_stack_check && ! STACK_CHECK_BUILTIN) - + probe_stack_range (STACK_CHECK_MAX_FRAME_SIZE + STACK_CHECK_PROTECT, size); - + - /* Don't use a TARGET that isn't a pseudo. */ - if (target == 0 || GET_CODE (target) != REG - *************** allocate_dynamic_stack_space (size, targ - *** 1133,1136 **** - --- 1147,1281 ---- - - return target; - + } - + - + /* Emit one stack probe at ADDRESS, an address within the stack. */ - + - + static void - + emit_stack_probe (address) - + rtx address; - + { - + rtx memref = gen_rtx (MEM, word_mode, address); - + - + MEM_VOLATILE_P (memref) = 1; - + - + if (STACK_CHECK_PROBE_LOAD) - + emit_move_insn (gen_reg_rtx (word_mode), memref); - + else - + emit_move_insn (memref, const0_rtx); - + } - + - + /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. - + FIRST is a constant and size is a Pmode RTX. These are offsets from the - + current stack pointer. STACK_GROWS_DOWNWARD says whether to add or - + subtract from the stack. If SIZE is constant, this is done - + with a fixed number of probes. Otherwise, we must make a loop. */ - + - + #ifdef STACK_GROWS_DOWNWARD - + #define STACK_GROW_OP MINUS - + #else - + #define STACK_GROW_OP PLUS - + #endif - + - + void - + probe_stack_range (first, size) - + HOST_WIDE_INT first; - + rtx size; - + { - + /* First see if we have an insn to check the stack. Use it if so. */ - + #ifdef HAVE_check_stack - + if (HAVE_check_stack) - + { - + rtx last_addr = force_operand (gen_rtx (STACK_GROW_OP, Pmode, - + stack_pointer_rtx, - + plus_constant (size, first)), - + NULL_RTX); - + - + if (insn_operand_predicate[(int) CODE_FOR_check_stack][0] - + && ! ((*insn_operand_predicate[(int) CODE_FOR_check_stack][0]) - + (last_address, Pmode))) - + last_address = copy_to_mode_reg (Pmode, last_address); - + - + emit_insn (gen_check_stack (last_address)); - + return; - + } - + #endif - + - + /* If we have to generate explicit probes, see if we have a constant - + small number of them to generate. If so, that's the easy case. */ - + if (GET_CODE (size) == CONST_INT && INTVAL (size) < 10) - + { - + HOST_WIDE_INT offset; - + - + /* Start probing at FIRST + N * STACK_CHECK_PROBE_INTERVAL - + for values of N from 1 until it exceeds LAST. If only one - + probe is needed, this will not generate any code. Then probe - + at LAST. */ - + for (offset = first + STACK_CHECK_PROBE_INTERVAL; - + offset < INTVAL (size); - + offset = offset + STACK_CHECK_PROBE_INTERVAL) - + emit_stack_probe (gen_rtx (STACK_GROW_OP, Pmode, - + stack_pointer_rtx, GEN_INT (offset))); - + - + emit_stack_probe (gen_rtx (STACK_GROW_OP, Pmode, stack_pointer_rtx, - + plus_constant (size, first))); - + } - + - + /* In the variable case, do the same as above, but in a loop. We emit loop - + notes so that loop optimization can be done. */ - + else - + { - + rtx test_addr - + = force_operand (gen_rtx (STACK_GROW_OP, Pmode, stack_pointer_rtx, - + GEN_INT (first - + + STACK_CHECK_PROBE_INTERVAL)), - + NULL_RTX); - + rtx last_addr - + = force_operand (gen_rtx (STACK_GROW_OP, Pmode, stack_pointer_rtx, - + plus_constant (size, first)), - + NULL_RTX); - + rtx incr = GEN_INT (STACK_CHECK_PROBE_INTERVAL); - + rtx loop_lab = gen_label_rtx (); - + rtx test_lab = gen_label_rtx (); - + rtx end_lab = gen_label_rtx (); - + rtx temp; - + - + if (GET_CODE (test_addr) != REG - + || REGNO (test_addr) < FIRST_PSEUDO_REGISTER) - + test_addr = force_reg (Pmode, test_addr); - + - + emit_note (NULL_PTR, NOTE_INSN_LOOP_BEG); - + emit_jump (test_lab); - + - + emit_label (loop_lab); - + emit_stack_probe (test_addr); - + - + emit_note (NULL_PTR, NOTE_INSN_LOOP_CONT); - + - + #ifdef STACK_GROWS_DOWNWARD - + #define CMP_OPCODE GTU - + temp = expand_binop (Pmode, sub_optab, test_addr, incr, test_addr, - + 1, OPTAB_WIDEN); - + #else - + #define CMP_OPCODE LTU - + temp = expand_binop (Pmode, add_optab, test_addr, incr, test_addr, - + 1, OPTAB_WIDEN); - + #endif - + - + if (temp != test_addr) - + abort (); - + - + emit_label (test_lab); - + emit_cmp_insn (test_addr, last_addr, CMP_OPCODE, NULL_RTX, Pmode, 1, 0); - + emit_jump_insn ((*bcc_gen_fctn[(int) CMP_OPCODE]) (loop_lab)); - + emit_jump (end_lab); - + emit_note (NULL_PTR, NOTE_INSN_LOOP_END); - + emit_label (end_lab); - + - + /* If will be doing stupid optimization, show test_addr is still live. */ - + if (obey_regdecls) - + emit_insn (gen_rtx (USE, VOIDmode, test_addr)); - + - + emit_stack_probe (last_addr); - + } - } - - diff -rcp2N gcc-2.7.2.3/expmed.c gcc-2.7.2.3.f.2/expmed.c - *** gcc-2.7.2.3/expmed.c Thu Jul 13 23:25:37 1995 - --- gcc-2.7.2.3.f.2/expmed.c Tue Sep 9 07:01:29 1997 - *************** store_bit_field (str_rtx, bitsize, bitnu - *** 399,402 **** - --- 399,403 ---- - #ifdef HAVE_insv - if (HAVE_insv - + && GET_MODE (value) != BLKmode - && !(bitsize == 1 && GET_CODE (value) == CONST_INT) - /* Ensure insv's size is wide enough for this field. */ - *************** store_split_bit_field (op0, bitsize, bit - *** 777,781 **** - done in extract_bit_field, so that the two calls to - extract_fixed_bit_field will have comparable arguments. */ - ! if (GET_CODE (value) != MEM) - total_bits = BITS_PER_WORD; - else - --- 778,782 ---- - done in extract_bit_field, so that the two calls to - extract_fixed_bit_field will have comparable arguments. */ - ! if (GET_CODE (value) != MEM || GET_MODE (value) == BLKmode) - total_bits = BITS_PER_WORD; - else - *************** store_split_bit_field (op0, bitsize, bit - *** 790,797 **** - /* The args are chosen so that the last part includes the - lsb. Give extract_bit_field the value it needs (with - ! endianness compensation) to fetch the piece we want. */ - ! part = extract_fixed_bit_field (word_mode, value, 0, thissize, - ! total_bits - bitsize + bitsdone, - ! NULL_RTX, 1, align); - } - else - --- 791,807 ---- - /* The args are chosen so that the last part includes the - lsb. Give extract_bit_field the value it needs (with - ! endianness compensation) to fetch the piece we want. - ! - ! ??? We have no idea what the alignment of VALUE is, so - ! we have to use a guess. */ - ! part - ! = extract_fixed_bit_field - ! (word_mode, value, 0, thissize, - ! total_bits - bitsize + bitsdone, NULL_RTX, 1, - ! GET_MODE (value) == VOIDmode - ! ? UNITS_PER_WORD - ! : (GET_MODE (value) == BLKmode - ! ? 1 - ! : GET_MODE_ALIGNMENT (GET_MODE (value)) / BITS_PER_UNIT)); - } - else - *************** store_split_bit_field (op0, bitsize, bit - *** 803,808 **** - & (((HOST_WIDE_INT) 1 << thissize) - 1)); - else - ! part = extract_fixed_bit_field (word_mode, value, 0, thissize, - ! bitsdone, NULL_RTX, 1, align); - } - - --- 813,824 ---- - & (((HOST_WIDE_INT) 1 << thissize) - 1)); - else - ! part - ! = extract_fixed_bit_field - ! (word_mode, value, 0, thissize, bitsdone, NULL_RTX, 1, - ! GET_MODE (value) == VOIDmode - ! ? UNITS_PER_WORD - ! : (GET_MODE (value) == BLKmode - ! ? 1 - ! : GET_MODE_ALIGNMENT (GET_MODE (value)) / BITS_PER_UNIT)); - } - - *************** extract_bit_field (str_rtx, bitsize, bit - *** 876,882 **** - rtx spec_target_subreg = 0; - - - if (GET_CODE (str_rtx) == MEM && ! MEM_IN_STRUCT_P (str_rtx)) - - abort (); - - - /* Discount the part of the structure before the desired byte. - We need to know how many bytes are safe to reference after it. */ - --- 892,895 ---- - *************** expand_divmod (rem_flag, code, mode, op0 - *** 3189,3193 **** - Notice that we compute also the final remainder value here, - and return the result right away. */ - ! if (target == 0) - target = gen_reg_rtx (compute_mode); - - --- 3202,3206 ---- - Notice that we compute also the final remainder value here, - and return the result right away. */ - ! if (target == 0 || GET_MODE (target) != compute_mode) - target = gen_reg_rtx (compute_mode); - - *************** expand_divmod (rem_flag, code, mode, op0 - *** 3316,3320 **** - remainder. Notice that we compute also the final remainder - value here, and return the result right away. */ - ! if (target == 0) - target = gen_reg_rtx (compute_mode); - - --- 3329,3333 ---- - remainder. Notice that we compute also the final remainder - value here, and return the result right away. */ - ! if (target == 0 || GET_MODE (target) != compute_mode) - target = gen_reg_rtx (compute_mode); - - *************** expand_divmod (rem_flag, code, mode, op0 - *** 3418,3422 **** - remainder. Notice that we compute also the final remainder - value here, and return the result right away. */ - ! if (target == 0) - target = gen_reg_rtx (compute_mode); - if (rem_flag) - --- 3431,3435 ---- - remainder. Notice that we compute also the final remainder - value here, and return the result right away. */ - ! if (target == 0 || GET_MODE (target) != compute_mode) - target = gen_reg_rtx (compute_mode); - if (rem_flag) - *************** expand_divmod (rem_flag, code, mode, op0 - *** 3602,3605 **** - --- 3615,3621 ---- - if (quotient == 0) - { - + if (target && GET_MODE (target) != compute_mode) - + target = 0; - + - if (rem_flag) - { - *************** expand_divmod (rem_flag, code, mode, op0 - *** 3653,3656 **** - --- 3669,3675 ---- - if (rem_flag) - { - + if (target && GET_MODE (target) != compute_mode) - + target = 0; - + - if (quotient == 0) - /* No divide instruction either. Use library for remainder. */ - diff -rcp2N gcc-2.7.2.3/expr.c gcc-2.7.2.3.f.2/expr.c - *** gcc-2.7.2.3/expr.c Sat Jun 29 16:26:15 1996 - --- gcc-2.7.2.3.f.2/expr.c Mon Sep 15 21:47:09 1997 - *************** Boston, MA 02111-1307, USA. */ - *** 27,30 **** - --- 27,31 ---- - #include "flags.h" - #include "regs.h" - + #include "hard-reg-set.h" - #include "function.h" - #include "insn-flags.h" - *************** extern int stack_depth; - *** 139,143 **** - extern int max_stack_depth; - extern struct obstack permanent_obstack; - ! - - static rtx enqueue_insn PROTO((rtx, rtx)); - --- 140,144 ---- - extern int max_stack_depth; - extern struct obstack permanent_obstack; - ! extern rtx arg_pointer_save_area; - - static rtx enqueue_insn PROTO((rtx, rtx)); - *************** static void store_constructor PROTO((tre - *** 151,155 **** - static rtx store_field PROTO((rtx, int, int, enum machine_mode, tree, - enum machine_mode, int, int, int)); - - static int get_inner_unaligned_p PROTO((tree)); - static tree save_noncopied_parts PROTO((tree, tree)); - static tree init_noncopied_parts PROTO((tree, tree)); - --- 152,155 ---- - *************** move_by_pieces (to, from, len, align) - *** 1494,1498 **** - - /* The code above should have handled everything. */ - ! if (data.len != 0) - abort (); - } - --- 1494,1498 ---- - - /* The code above should have handled everything. */ - ! if (data.len > 0) - abort (); - } - *************** emit_move_insn_1 (x, y) - *** 1989,1993 **** - - /* Show the output dies here. */ - ! emit_insn (gen_rtx (CLOBBER, VOIDmode, x)); - - for (i = 0; - --- 1989,1994 ---- - - /* Show the output dies here. */ - ! if (x != y) - ! emit_insn (gen_rtx (CLOBBER, VOIDmode, x)); - - for (i = 0; - *************** expand_assignment (to, from, want_value, - *** 2481,2490 **** - problem. */ - - ! if (TREE_CODE (to) == COMPONENT_REF - ! || TREE_CODE (to) == BIT_FIELD_REF - ! || (TREE_CODE (to) == ARRAY_REF - ! && ((TREE_CODE (TREE_OPERAND (to, 1)) == INTEGER_CST - ! && TREE_CODE (TYPE_SIZE (TREE_TYPE (to))) == INTEGER_CST) - ! || (SLOW_UNALIGNED_ACCESS && get_inner_unaligned_p (to))))) - { - enum machine_mode mode1; - --- 2482,2487 ---- - problem. */ - - ! if (TREE_CODE (to) == COMPONENT_REF || TREE_CODE (to) == BIT_FIELD_REF - ! || TREE_CODE (to) == ARRAY_REF) - { - enum machine_mode mode1; - *************** expand_assignment (to, from, want_value, - *** 2498,2503 **** - - push_temp_slots (); - ! tem = get_inner_reference (to, &bitsize, &bitpos, &offset, - ! &mode1, &unsignedp, &volatilep); - - /* If we are going to use store_bit_field and extract_bit_field, - --- 2495,2500 ---- - - push_temp_slots (); - ! tem = get_inner_reference (to, &bitsize, &bitpos, &offset, &mode1, - ! &unsignedp, &volatilep, &alignment); - - /* If we are going to use store_bit_field and extract_bit_field, - *************** expand_assignment (to, from, want_value, - *** 2507,2511 **** - tem = stabilize_reference (tem); - - - alignment = TYPE_ALIGN (TREE_TYPE (tem)) / BITS_PER_UNIT; - to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0); - if (offset != 0) - --- 2504,2507 ---- - *************** expand_assignment (to, from, want_value, - *** 2518,2529 **** - gen_rtx (PLUS, ptr_mode, XEXP (to_rtx, 0), - force_reg (ptr_mode, offset_rtx))); - - /* If we have a variable offset, the known alignment - - is only that of the innermost structure containing the field. - - (Actually, we could sometimes do better by using the - - align of an element of the innermost array, but no need.) */ - - if (TREE_CODE (to) == COMPONENT_REF - - || TREE_CODE (to) == BIT_FIELD_REF) - - alignment - - = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (to, 0))) / BITS_PER_UNIT; - } - if (volatilep) - --- 2514,2517 ---- - *************** expand_assignment (to, from, want_value, - *** 2535,2539 **** - We must make a new MEM before setting the volatile bit. */ - if (offset == 0) - ! to_rtx = change_address (to_rtx, VOIDmode, XEXP (to_rtx, 0)); - MEM_VOLATILE_P (to_rtx) = 1; - } - --- 2523,2527 ---- - We must make a new MEM before setting the volatile bit. */ - if (offset == 0) - ! to_rtx = copy_rtx (to_rtx); - MEM_VOLATILE_P (to_rtx) = 1; - } - *************** store_expr (exp, target, want_value) - *** 2775,2780 **** - which will often result in some optimizations. Do the conversion - in two steps: first change the signedness, if needed, then - ! the extend. */ - ! if (! want_value) - { - if (TREE_UNSIGNED (TREE_TYPE (exp)) - --- 2763,2771 ---- - which will often result in some optimizations. Do the conversion - in two steps: first change the signedness, if needed, then - ! the extend. But don't do this if the type of EXP is a subtype - ! of something else since then the conversion might involve - ! more than just converting modes. */ - ! if (! want_value && INTEGRAL_TYPE_P (TREE_TYPE (exp)) - ! && TREE_TYPE (TREE_TYPE (exp)) == 0) - { - if (TREE_UNSIGNED (TREE_TYPE (exp)) - *************** store_expr (exp, target, want_value) - *** 2843,2847 **** - Convert the value to TARGET's type first if nec. */ - - ! if (temp != target && TREE_CODE (exp) != ERROR_MARK) - { - target = protect_from_queue (target, 1); - --- 2834,2838 ---- - Convert the value to TARGET's type first if nec. */ - - ! if (! rtx_equal_p (temp, target) && TREE_CODE (exp) != ERROR_MARK) - { - target = protect_from_queue (target, 1); - *************** store_constructor (exp, target) - *** 3071,3074 **** - --- 3062,3073 ---- - } - - + if (TREE_READONLY (field)) - + { - + if (GET_CODE (to_rtx) == MEM) - + to_rtx = copy_rtx (to_rtx); - + - + RTX_UNCHANGING_P (to_rtx) = 1; - + } - + - store_field (to_rtx, bitsize, bitpos, mode, TREE_VALUE (elt), - /* The alignment of TARGET is - *************** store_field (target, bitsize, bitpos, mo - *** 3414,3417 **** - --- 3413,3428 ---- - rtx temp = expand_expr (exp, NULL_RTX, VOIDmode, 0); - - + /* If BITSIZE is narrower than the size of the type of EXP - + we will be narrowing TEMP. Normally, what's wanted are the - + low-order bits. However, if EXP's type is a record and this is - + big-endian machine, we want the upper BITSIZE bits. */ - + if (BYTES_BIG_ENDIAN && GET_MODE_CLASS (GET_MODE (temp)) == MODE_INT - + && bitsize < GET_MODE_BITSIZE (GET_MODE (temp)) - + && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE) - + temp = expand_shift (RSHIFT_EXPR, GET_MODE (temp), temp, - + size_int (GET_MODE_BITSIZE (GET_MODE (temp)) - + - bitsize), - + temp, 1); - + - /* Unless MODE is VOIDmode or BLKmode, convert TEMP to - MODE. */ - *************** store_field (target, bitsize, bitpos, mo - *** 3420,3423 **** - --- 3431,3455 ---- - temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1); - - + /* If the modes of TARGET and TEMP are both BLKmode, both - + must be in memory and BITPOS must be aligned on a byte - + boundary. If so, we simply do a block copy. */ - + if (GET_MODE (target) == BLKmode && GET_MODE (temp) == BLKmode) - + { - + if (GET_CODE (target) != MEM || GET_CODE (temp) != MEM - + || bitpos % BITS_PER_UNIT != 0) - + abort (); - + - + target = change_address (target, VOIDmode, - + plus_constant (XEXP (target, 0), - + bitpos / BITS_PER_UNIT)); - + - + emit_block_move (target, temp, - + GEN_INT ((bitsize + BITS_PER_UNIT - 1) - + / BITS_PER_UNIT), - + 1); - + - + return value_mode == VOIDmode ? const0_rtx : target; - + } - + - /* Store the value in the bitfield. */ - store_bit_field (target, bitsize, bitpos, mode, temp, align, total_size); - *************** store_field (target, bitsize, bitpos, mo - *** 3466,3471 **** - /* Now build a reference to just the desired component. */ - - ! to_rtx = change_address (target, mode, - ! plus_constant (addr, (bitpos / BITS_PER_UNIT))); - MEM_IN_STRUCT_P (to_rtx) = 1; - - --- 3498,3505 ---- - /* Now build a reference to just the desired component. */ - - ! to_rtx - ! = copy_rtx (change_address (target, mode, - ! plus_constant (addr, - ! (bitpos / BITS_PER_UNIT)))); - MEM_IN_STRUCT_P (to_rtx) = 1; - - *************** store_field (target, bitsize, bitpos, mo - *** 3474,3508 **** - } - - - /* Return true if any object containing the innermost array is an unaligned - - packed structure field. */ - - - - static int - - get_inner_unaligned_p (exp) - - tree exp; - - { - - int needed_alignment = TYPE_ALIGN (TREE_TYPE (exp)); - - - - while (1) - - { - - if (TREE_CODE (exp) == COMPONENT_REF || TREE_CODE (exp) == BIT_FIELD_REF) - - { - - if (TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0))) - - < needed_alignment) - - return 1; - - } - - else if (TREE_CODE (exp) != ARRAY_REF - - && TREE_CODE (exp) != NON_LVALUE_EXPR - - && ! ((TREE_CODE (exp) == NOP_EXPR - - || TREE_CODE (exp) == CONVERT_EXPR) - - && (TYPE_MODE (TREE_TYPE (exp)) - - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)))))) - - break; - - - - exp = TREE_OPERAND (exp, 0); - - } - - - - return 0; - - } - - - /* Given an expression EXP that may be a COMPONENT_REF, a BIT_FIELD_REF, - or an ARRAY_REF, look for nested COMPONENT_REFs, BIT_FIELD_REFs, or - --- 3508,3511 ---- - *************** get_inner_unaligned_p (exp) - *** 3515,3518 **** - --- 3518,3524 ---- - This offset is in addition to the bit position. - If the position is not variable, we store 0 in *POFFSET. - + We set *PALIGNMENT to the alignment in bytes of the address that will be - + computed. This is the alignment of the thing we return if *POFFSET - + is zero, but can be more less strictly aligned if *POFFSET is nonzero. - - If any of the extraction expressions is volatile, - *************** get_inner_unaligned_p (exp) - *** 3525,3533 **** - If the field describes a variable-sized object, *PMODE is set to - VOIDmode and *PBITSIZE is set to -1. An access cannot be made in - ! this case, but the address of the object can be found. */ - - tree - get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, - ! punsignedp, pvolatilep) - tree exp; - int *pbitsize; - --- 3531,3539 ---- - If the field describes a variable-sized object, *PMODE is set to - VOIDmode and *PBITSIZE is set to -1. An access cannot be made in - ! this case, but the address of the object can be found. */ - - tree - get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, - ! punsignedp, pvolatilep, palignment) - tree exp; - int *pbitsize; - *************** get_inner_reference (exp, pbitsize, pbit - *** 3537,3540 **** - --- 3543,3547 ---- - int *punsignedp; - int *pvolatilep; - + int *palignment; - { - tree orig_exp = exp; - *************** get_inner_reference (exp, pbitsize, pbit - *** 3542,3545 **** - --- 3549,3553 ---- - enum machine_mode mode = VOIDmode; - tree offset = integer_zero_node; - + int alignment = BIGGEST_ALIGNMENT; - - if (TREE_CODE (exp) == COMPONENT_REF) - *************** get_inner_reference (exp, pbitsize, pbit - *** 3599,3607 **** - - *pbitpos += TREE_INT_CST_LOW (constant); - ! - ! if (var) - ! offset = size_binop (PLUS_EXPR, offset, - ! size_binop (EXACT_DIV_EXPR, var, - ! size_int (BITS_PER_UNIT))); - } - - --- 3607,3613 ---- - - *pbitpos += TREE_INT_CST_LOW (constant); - ! offset = size_binop (PLUS_EXPR, offset, - ! size_binop (EXACT_DIV_EXPR, var, - ! size_int (BITS_PER_UNIT))); - } - - *************** get_inner_reference (exp, pbitsize, pbit - *** 3629,3633 **** - - index = fold (build (MULT_EXPR, index_type, index, - ! TYPE_SIZE (TREE_TYPE (exp)))); - - if (TREE_CODE (index) == INTEGER_CST - --- 3635,3640 ---- - - index = fold (build (MULT_EXPR, index_type, index, - ! convert (index_type, - ! TYPE_SIZE (TREE_TYPE (exp))))); - - if (TREE_CODE (index) == INTEGER_CST - *************** get_inner_reference (exp, pbitsize, pbit - *** 3652,3666 **** - if (TREE_THIS_VOLATILE (exp)) - *pvolatilep = 1; - exp = TREE_OPERAND (exp, 0); - } - - ! /* If this was a bit-field, see if there is a mode that allows direct - ! access in case EXP is in memory. */ - ! if (mode == VOIDmode && *pbitsize != 0 && *pbitpos % *pbitsize == 0) - ! { - ! mode = mode_for_size (*pbitsize, MODE_INT, 0); - ! if (mode == BLKmode) - ! mode = VOIDmode; - ! } - - if (integer_zerop (offset)) - --- 3659,3675 ---- - if (TREE_THIS_VOLATILE (exp)) - *pvolatilep = 1; - + - + /* If the offset is non-constant already, then we can't assume any - + alignment more than the alignment here. */ - + if (! integer_zerop (offset)) - + alignment = MIN (alignment, TYPE_ALIGN (TREE_TYPE (exp))); - + - exp = TREE_OPERAND (exp, 0); - } - - ! if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd') - ! alignment = MIN (alignment, DECL_ALIGN (exp)); - ! else if (TREE_TYPE (exp) != 0) - ! alignment = MIN (alignment, TYPE_ALIGN (TREE_TYPE (exp))); - - if (integer_zerop (offset)) - *************** get_inner_reference (exp, pbitsize, pbit - *** 3672,3675 **** - --- 3681,3685 ---- - *pmode = mode; - *poffset = offset; - + *palignment = alignment / BITS_PER_UNIT; - return exp; - } - *************** init_noncopied_parts (lhs, list) - *** 3812,3820 **** - } - - ! /* Subroutine of expand_expr: return nonzero iff there is no way that - EXP can reference X, which is being modified. */ - - static int - ! safe_from_p (x, exp) - rtx x; - tree exp; - --- 3822,3834 ---- - } - - ! static int safe_from_p_count; - ! static int safe_from_p_size; - ! static tree *safe_from_p_rewritten; - ! - ! /* Subroutine of safe_from_p: return nonzero iff there is no way that - EXP can reference X, which is being modified. */ - - static int - ! safe_from_p_1 (x, exp) - rtx x; - tree exp; - *************** safe_from_p (x, exp) - *** 3822,3825 **** - --- 3836,3840 ---- - rtx exp_rtl = 0; - int i, nops; - + int is_save_expr = 0; - - if (x == 0 - *************** safe_from_p (x, exp) - *** 3860,3878 **** - - case 'x': - ! if (TREE_CODE (exp) == TREE_LIST) - ! return ((TREE_VALUE (exp) == 0 - ! || safe_from_p (x, TREE_VALUE (exp))) - ! && (TREE_CHAIN (exp) == 0 - ! || safe_from_p (x, TREE_CHAIN (exp)))); - ! else - ! return 0; - - case '1': - ! return safe_from_p (x, TREE_OPERAND (exp, 0)); - - case '2': - case '<': - ! return (safe_from_p (x, TREE_OPERAND (exp, 0)) - ! && safe_from_p (x, TREE_OPERAND (exp, 1))); - - case 'e': - --- 3875,3900 ---- - - case 'x': - ! switch (TREE_CODE (exp)) - ! { - ! case TREE_LIST: - ! return ((TREE_VALUE (exp) == 0 - ! || safe_from_p_1 (x, TREE_VALUE (exp))) - ! && (TREE_CHAIN (exp) == 0 - ! || safe_from_p_1 (x, TREE_CHAIN (exp)))); - ! - ! case ERROR_MARK: - ! return 1; - ! - ! default: - ! return 0; - ! } - - case '1': - ! return safe_from_p_1 (x, TREE_OPERAND (exp, 0)); - - case '2': - case '<': - ! return (safe_from_p_1 (x, TREE_OPERAND (exp, 0)) - ! && safe_from_p_1 (x, TREE_OPERAND (exp, 1))); - - case 'e': - *************** safe_from_p (x, exp) - *** 3887,3891 **** - case ADDR_EXPR: - return (staticp (TREE_OPERAND (exp, 0)) - ! || safe_from_p (x, TREE_OPERAND (exp, 0))); - - case INDIRECT_REF: - --- 3909,3913 ---- - case ADDR_EXPR: - return (staticp (TREE_OPERAND (exp, 0)) - ! || safe_from_p_1 (x, TREE_OPERAND (exp, 0))); - - case INDIRECT_REF: - *************** safe_from_p (x, exp) - *** 3922,3928 **** - - case CLEANUP_POINT_EXPR: - ! return safe_from_p (x, TREE_OPERAND (exp, 0)); - - case SAVE_EXPR: - exp_rtl = SAVE_EXPR_RTL (exp); - break; - --- 3944,3951 ---- - - case CLEANUP_POINT_EXPR: - ! return safe_from_p_1 (x, TREE_OPERAND (exp, 0)); - - case SAVE_EXPR: - + is_save_expr = 1; - exp_rtl = SAVE_EXPR_RTL (exp); - break; - *************** safe_from_p (x, exp) - *** 3931,3935 **** - /* The only operand we look at is operand 1. The rest aren't - part of the expression. */ - ! return safe_from_p (x, TREE_OPERAND (exp, 1)); - - case METHOD_CALL_EXPR: - --- 3954,3958 ---- - /* The only operand we look at is operand 1. The rest aren't - part of the expression. */ - ! return safe_from_p_1 (x, TREE_OPERAND (exp, 1)); - - case METHOD_CALL_EXPR: - *************** safe_from_p (x, exp) - *** 3945,3949 **** - for (i = 0; i < nops; i++) - if (TREE_OPERAND (exp, i) != 0 - ! && ! safe_from_p (x, TREE_OPERAND (exp, i))) - return 0; - } - --- 3968,3972 ---- - for (i = 0; i < nops; i++) - if (TREE_OPERAND (exp, i) != 0 - ! && ! safe_from_p_1 (x, TREE_OPERAND (exp, i))) - return 0; - } - *************** safe_from_p (x, exp) - *** 3969,3975 **** - --- 3992,4054 ---- - - /* If we reach here, it is safe. */ - + if (is_save_expr) - + { - + /* This SAVE_EXPR might appear many times in the top-level - + safe_from_p() expression, and if it has a complex - + subexpression, examining it multiple times could result - + in a combinatorial explosion. E.g. on an Alpha Cabriolet - + running at least 200MHz, a Fortran test case compiled with - + optimization took about 28 minutes to compile -- even though - + it was only a few lines long, and the complicated line causing - + so much time to be spent in the earlier version of safe_from_p() - + had only 293 or so unique nodes. - + - + So, turn this SAVE_EXPR into an ERROR_MARK for now, but remember - + where it is so we can turn it back in the top-level safe_from_p() - + when we're done. */ - + - + if (safe_from_p_count >= safe_from_p_size) - + return 0; /* For now, don't bother re-sizing the array. */ - + safe_from_p_rewritten[safe_from_p_count++] = exp; - + TREE_SET_CODE (exp, ERROR_MARK); - + } - + - return 1; - } - - + /* Subroutine of expand_expr: return nonzero iff there is no way that - + EXP can reference X, which is being modified. */ - + - + static int - + safe_from_p (x, exp) - + rtx x; - + tree exp; - + { - + int rtn; - + int i; - + tree trees[128]; - + - + safe_from_p_count = 0; - + safe_from_p_size = sizeof (trees) / sizeof (trees[0]); - + safe_from_p_rewritten = &trees[0]; - + - + rtn = safe_from_p_1 (x, exp); - + - + #if 0 - + if (safe_from_p_count != 0) - + fprintf (stderr, "%s:%d: safe_from_p_count = %d\n", - + input_filename, lineno, safe_from_p_count); - + #endif - + - + for (i = 0; i < safe_from_p_count; ++i) - + { - + if (TREE_CODE (trees [i]) != ERROR_MARK) - + abort (); - + TREE_SET_CODE (trees[i], SAVE_EXPR); - + } - + - + return rtn; - + } - + - /* Subroutine of expand_expr: return nonzero iff EXP is an - expression whose type is statically determinable. */ - *************** expand_expr (exp, target, tmode, modifie - *** 4300,4303 **** - --- 4379,4387 ---- - context = decl_function_context (exp); - - + /* If this SAVE_EXPR was at global context, assume we are an - + initialization function and move it into our context. */ - + if (context == 0) - + SAVE_EXPR_CONTEXT (exp) = current_function_decl; - + - /* We treat inline_function_decl as an alias for the current function - because that is the inline function whose vars, types, etc. - *************** expand_expr (exp, target, tmode, modifie - *** 4310,4313 **** - --- 4394,4401 ---- - if (context) - { - + /* The following call just exists to abort if the context is - + not of a containing function. */ - + find_function_data (context); - + - temp = SAVE_EXPR_RTL (exp); - if (temp && GET_CODE (temp) == REG) - *************** expand_expr (exp, target, tmode, modifie - *** 4381,4400 **** - if (placeholder_list) - { - ! tree object; - tree old_list = placeholder_list; - - ! for (object = TREE_PURPOSE (placeholder_list); - ! (TYPE_MAIN_VARIANT (TREE_TYPE (object)) - ! != TYPE_MAIN_VARIANT (type)) - ! && (TREE_CODE_CLASS (TREE_CODE (object)) == 'r' - ! || TREE_CODE_CLASS (TREE_CODE (object)) == '1' - ! || TREE_CODE_CLASS (TREE_CODE (object)) == '2' - ! || TREE_CODE_CLASS (TREE_CODE (object)) == 'e'); - ! object = TREE_OPERAND (object, 0)) - ! ; - ! - ! if (object != 0 - ! && (TYPE_MAIN_VARIANT (TREE_TYPE (object)) - ! == TYPE_MAIN_VARIANT (type))) - { - /* Expand this object skipping the list entries before - --- 4469,4501 ---- - if (placeholder_list) - { - ! tree need_type = TYPE_MAIN_VARIANT (type); - ! tree object = 0; - tree old_list = placeholder_list; - + tree elt; - + - + /* See if the object is the type that we want. */ - + if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_PURPOSE (placeholder_list))) - + == need_type)) - + object = TREE_PURPOSE (placeholder_list); - + - + /* Find the innermost reference that is of the type we want. */ - + for (elt = TREE_PURPOSE (placeholder_list); - + elt != 0 - + && (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' - + || TREE_CODE_CLASS (TREE_CODE (elt)) == '1' - + || TREE_CODE_CLASS (TREE_CODE (elt)) == '2' - + || TREE_CODE_CLASS (TREE_CODE (elt)) == 'e'); - + elt = ((TREE_CODE (elt) == COMPOUND_EXPR - + || TREE_CODE (elt) == COND_EXPR) - + ? TREE_OPERAND (elt, 1) : TREE_OPERAND (elt, 0))) - + if (TREE_CODE_CLASS (TREE_CODE (elt)) == 'r' - + && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (elt, 0))) - + == need_type)) - + { - + object = TREE_OPERAND (elt, 0); - + break; - + } - - ! if (object != 0) - { - /* Expand this object skipping the list entries before - *************** expand_expr (exp, target, tmode, modifie - *** 4534,4537 **** - --- 4635,4647 ---- - } - } - + - + if (TREE_READONLY (exp)) - + { - + if (GET_CODE (target) == MEM) - + target = copy_rtx (target); - + - + RTX_UNCHANGING_P (target) = 1; - + } - + - store_constructor (exp, target); - return target; - *************** expand_expr (exp, target, tmode, modifie - *** 4543,4567 **** - tree exp2; - - ! /* A SAVE_EXPR as the address in an INDIRECT_EXPR is generated - ! for *PTR += ANYTHING where PTR is put inside the SAVE_EXPR. - ! This code has the same general effect as simply doing - ! expand_expr on the save expr, except that the expression PTR - ! is computed for use as a memory address. This means different - ! code, suitable for indexing, may be generated. */ - ! if (TREE_CODE (exp1) == SAVE_EXPR - ! && SAVE_EXPR_RTL (exp1) == 0 - ! && TYPE_MODE (TREE_TYPE (exp1)) == ptr_mode) - ! { - ! temp = expand_expr (TREE_OPERAND (exp1, 0), NULL_RTX, - ! VOIDmode, EXPAND_SUM); - ! op0 = memory_address (mode, temp); - ! op0 = copy_all_regs (op0); - ! SAVE_EXPR_RTL (exp1) = op0; - ! } - ! else - ! { - ! op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM); - ! op0 = memory_address (mode, op0); - ! } - - temp = gen_rtx (MEM, mode, op0); - --- 4653,4658 ---- - tree exp2; - - ! op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM); - ! op0 = memory_address (mode, op0); - - temp = gen_rtx (MEM, mode, op0); - *************** expand_expr (exp, target, tmode, modifie - *** 4597,4605 **** - tree index = TREE_OPERAND (exp, 1); - tree index_type = TREE_TYPE (index); - ! int i; - ! - ! if (TREE_CODE (low_bound) != INTEGER_CST - ! && contains_placeholder_p (low_bound)) - ! low_bound = build (WITH_RECORD_EXPR, sizetype, low_bound, exp); - - /* Optimize the special-case of a zero lower bound. - --- 4688,4692 ---- - tree index = TREE_OPERAND (exp, 1); - tree index_type = TREE_TYPE (index); - ! HOST_WIDE_INT i; - - /* Optimize the special-case of a zero lower bound. - *************** expand_expr (exp, target, tmode, modifie - *** 4618,4684 **** - convert (sizetype, low_bound))); - - - if ((TREE_CODE (index) != INTEGER_CST - - || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) - - && (! SLOW_UNALIGNED_ACCESS || ! get_inner_unaligned_p (exp))) - - { - - /* Nonconstant array index or nonconstant element size, and - - not an array in an unaligned (packed) structure field. - - Generate the tree for *(&array+index) and expand that, - - except do it in a language-independent way - - and don't complain about non-lvalue arrays. - - `mark_addressable' should already have been called - - for any array for which this case will be reached. */ - - - - /* Don't forget the const or volatile flag from the array - - element. */ - - tree variant_type = build_type_variant (type, - - TREE_READONLY (exp), - - TREE_THIS_VOLATILE (exp)); - - tree array_adr = build1 (ADDR_EXPR, - - build_pointer_type (variant_type), array); - - tree elt; - - tree size = size_in_bytes (type); - - - - /* Convert the integer argument to a type the same size as sizetype - - so the multiply won't overflow spuriously. */ - - if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype)) - - index = convert (type_for_size (TYPE_PRECISION (sizetype), 0), - - index); - - - - if (TREE_CODE (size) != INTEGER_CST - - && contains_placeholder_p (size)) - - size = build (WITH_RECORD_EXPR, sizetype, size, exp); - - - - /* Don't think the address has side effects - - just because the array does. - - (In some cases the address might have side effects, - - and we fail to record that fact here. However, it should not - - matter, since expand_expr should not care.) */ - - TREE_SIDE_EFFECTS (array_adr) = 0; - - - - elt - - = build1 - - (INDIRECT_REF, type, - - fold (build (PLUS_EXPR, - - TYPE_POINTER_TO (variant_type), - - array_adr, - - fold - - (build1 - - (NOP_EXPR, - - TYPE_POINTER_TO (variant_type), - - fold (build (MULT_EXPR, TREE_TYPE (index), - - index, - - convert (TREE_TYPE (index), - - size))))))));; - - - - /* Volatility, etc., of new expression is same as old - - expression. */ - - TREE_SIDE_EFFECTS (elt) = TREE_SIDE_EFFECTS (exp); - - TREE_THIS_VOLATILE (elt) = TREE_THIS_VOLATILE (exp); - - TREE_READONLY (elt) = TREE_READONLY (exp); - - - - return expand_expr (elt, target, tmode, modifier); - - } - - - /* Fold an expression like: "foo"[2]. - This is not done in fold so it won't happen inside &. - --- 4705,4708 ---- - *************** expand_expr (exp, target, tmode, modifie - *** 4720,4725 **** - && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK) - { - ! if (TREE_CODE (index) == INTEGER_CST - ! && TREE_INT_CST_HIGH (index) == 0) - { - tree init = DECL_INITIAL (array); - --- 4744,4748 ---- - && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK) - { - ! if (TREE_CODE (index) == INTEGER_CST) - { - tree init = DECL_INITIAL (array); - *************** expand_expr (exp, target, tmode, modifie - *** 4738,4748 **** - } - else if (TREE_CODE (init) == STRING_CST - ! && i < TREE_STRING_LENGTH (init)) - ! return GEN_INT (TREE_STRING_POINTER (init)[i]); - } - } - } - - ! /* Treat array-ref with constant index as a component-ref. */ - - case COMPONENT_REF: - --- 4761,4775 ---- - } - else if (TREE_CODE (init) == STRING_CST - ! && TREE_INT_CST_HIGH (index) == 0 - ! && (TREE_INT_CST_LOW (index) - ! < TREE_STRING_LENGTH (init))) - ! return (GEN_INT - ! (TREE_STRING_POINTER - ! (init)[TREE_INT_CST_LOW (index)])); - } - } - } - - ! /* ... fall through ... */ - - case COMPONENT_REF: - *************** expand_expr (exp, target, tmode, modifie - *** 4770,4776 **** - tree offset; - int volatilep = 0; - - tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset, - - &mode1, &unsignedp, &volatilep); - int alignment; - - /* If we got back the original object, something is wrong. Perhaps - --- 4797,4804 ---- - tree offset; - int volatilep = 0; - int alignment; - + tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset, - + &mode1, &unsignedp, &volatilep, - + &alignment); - - /* If we got back the original object, something is wrong. Perhaps - *************** expand_expr (exp, target, tmode, modifie - *** 4793,4797 **** - != INTEGER_CST) - ? target : NULL_RTX), - ! VOIDmode, EXPAND_SUM); - - /* If this is a constant, put it into a register if it is a - --- 4821,4826 ---- - != INTEGER_CST) - ? target : NULL_RTX), - ! VOIDmode, - ! modifier == EXPAND_INITIALIZER ? modifier : 0); - - /* If this is a constant, put it into a register if it is a - *************** expand_expr (exp, target, tmode, modifie - *** 4806,4810 **** - } - - - alignment = TYPE_ALIGN (TREE_TYPE (tem)) / BITS_PER_UNIT; - if (offset != 0) - { - --- 4835,4838 ---- - *************** expand_expr (exp, target, tmode, modifie - *** 4816,4827 **** - gen_rtx (PLUS, ptr_mode, XEXP (op0, 0), - force_reg (ptr_mode, offset_rtx))); - - /* If we have a variable offset, the known alignment - - is only that of the innermost structure containing the field. - - (Actually, we could sometimes do better by using the - - size of an element of the innermost array, but no need.) */ - - if (TREE_CODE (exp) == COMPONENT_REF - - || TREE_CODE (exp) == BIT_FIELD_REF) - - alignment = (TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0))) - - / BITS_PER_UNIT); - } - - --- 4844,4847 ---- - *************** expand_expr (exp, target, tmode, modifie - *** 4844,4848 **** - && modifier != EXPAND_SUM - && modifier != EXPAND_INITIALIZER - ! && ((mode1 != BLKmode && ! direct_load[(int) mode1]) - /* If the field isn't aligned enough to fetch as a memref, - fetch it as a bit field. */ - --- 4864,4870 ---- - && modifier != EXPAND_SUM - && modifier != EXPAND_INITIALIZER - ! && ((mode1 != BLKmode && ! direct_load[(int) mode1] - ! && GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - ! && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - /* If the field isn't aligned enough to fetch as a memref, - fetch it as a bit field. */ - *************** expand_expr (exp, target, tmode, modifie - *** 4857,4861 **** - - if (ext_mode == BLKmode) - ! abort (); - - op0 = extract_bit_field (validize_mem (op0), bitsize, bitpos, - --- 4879,4907 ---- - - if (ext_mode == BLKmode) - ! { - ! /* In this case, BITPOS must start at a byte boundary and - ! TARGET, if specified, must be a MEM. */ - ! if (GET_CODE (op0) != MEM - ! || (target != 0 && GET_CODE (target) != MEM) - ! || bitpos % BITS_PER_UNIT != 0) - ! abort (); - ! - ! op0 = change_address (op0, VOIDmode, - ! plus_constant (XEXP (op0, 0), - ! bitpos / BITS_PER_UNIT)); - ! if (target == 0) - ! { - ! target - ! = assign_stack_temp (mode, int_size_in_bytes (type), 0); - ! MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (type); - ! } - ! - ! emit_block_move (target, op0, - ! GEN_INT ((bitsize + BITS_PER_UNIT - 1) - ! / BITS_PER_UNIT), - ! 1); - ! - ! return target; - ! } - - op0 = extract_bit_field (validize_mem (op0), bitsize, bitpos, - *************** expand_expr (exp, target, tmode, modifie - *** 4863,4866 **** - --- 4909,4924 ---- - alignment, - int_size_in_bytes (TREE_TYPE (tem))); - + - + /* If the result is a record type and BITSIZE is narrower than - + the mode of OP0, an integral mode, and this is a big endian - + machine, we must put the field into the high-order bits. */ - + if (TREE_CODE (type) == RECORD_TYPE && BYTES_BIG_ENDIAN - + && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT - + && bitsize < GET_MODE_BITSIZE (GET_MODE (op0))) - + op0 = expand_shift (LSHIFT_EXPR, GET_MODE (op0), op0, - + size_int (GET_MODE_BITSIZE (GET_MODE (op0)) - + - bitsize), - + op0, 1); - + - if (mode == BLKmode) - { - *************** expand_expr (exp, target, tmode, modifie - *** 4877,4880 **** - --- 4935,4943 ---- - } - - + /* If the result is BLKmode, use that to access the object - + now as well. */ - + if (mode == BLKmode) - + mode1 = BLKmode; - + - /* Get a reference to just this component. */ - if (modifier == EXPAND_CONST_ADDRESS - *************** expand_expr (exp, target, tmode, modifie - *** 4883,4895 **** - (bitpos / BITS_PER_UNIT))); - else - ! op0 = change_address (op0, mode1, - ! plus_constant (XEXP (op0, 0), - ! (bitpos / BITS_PER_UNIT))); - MEM_IN_STRUCT_P (op0) = 1; - MEM_VOLATILE_P (op0) |= volatilep; - ! if (mode == mode1 || mode1 == BLKmode || mode1 == tmode) - return op0; - ! if (target == 0) - target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode); - convert_move (target, op0, unsignedp); - return target; - --- 4946,4964 ---- - (bitpos / BITS_PER_UNIT))); - else - ! op0 - ! = copy_rtx - ! (change_address (op0, mode1, - ! plus_constant (XEXP (op0, 0), - ! (bitpos / BITS_PER_UNIT)))); - ! - MEM_IN_STRUCT_P (op0) = 1; - MEM_VOLATILE_P (op0) |= volatilep; - ! if (mode == mode1 || mode1 == BLKmode || mode1 == tmode - ! || modifier == EXPAND_CONST_ADDRESS - ! || modifier == EXPAND_INITIALIZER) - return op0; - ! else if (target == 0) - target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode); - + - convert_move (target, op0, unsignedp); - return target; - *************** expand_expr (exp, target, tmode, modifie - *** 6199,6203 **** - if (TREE_CODE (lhs) != VAR_DECL - && TREE_CODE (lhs) != RESULT_DECL - ! && TREE_CODE (lhs) != PARM_DECL) - preexpand_calls (exp); - - --- 6268,6274 ---- - if (TREE_CODE (lhs) != VAR_DECL - && TREE_CODE (lhs) != RESULT_DECL - ! && TREE_CODE (lhs) != PARM_DECL - ! && ! (TREE_CODE (lhs) == INDIRECT_REF - ! && TYPE_READONLY (TREE_TYPE (TREE_OPERAND (lhs, 0))))) - preexpand_calls (exp); - - *************** expand_builtin (exp, target, subtarget, - *** 7986,7989 **** - --- 8057,8295 ---- - #endif - - + /* __builtin_setjmp is passed a pointer to an array of five words - + (not all will be used on all machines). It operates similarly to - + the C library function of the same name, but is more efficient. - + Much of the code below (and for longjmp) is copied from the handling - + of non-local gotos. - + - + NOTE: This is intended for use by GNAT and will only work in - + the method used by it. This code will likely NOT survive to - + the GCC 2.8.0 release. */ - + case BUILT_IN_SETJMP: - + if (arglist == 0 - + || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) - + break; - + - + { - + rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget, - + VOIDmode, 0); - + rtx lab1 = gen_label_rtx (), lab2 = gen_label_rtx (); - + enum machine_mode sa_mode = Pmode; - + rtx stack_save; - + int old_inhibit_defer_pop = inhibit_defer_pop; - + int return_pops = RETURN_POPS_ARGS (get_identifier ("__dummy"), - + get_identifier ("__dummy"), 0); - + rtx next_arg_reg; - + CUMULATIVE_ARGS args_so_far; - + int current_call_is_indirect = 1; - + int i; - + - + #ifdef POINTERS_EXTEND_UNSIGNED - + buf_addr = convert_memory_address (Pmode, buf_addr); - + #endif - + - + buf_addr = force_reg (Pmode, buf_addr); - + - + if (target == 0 || GET_CODE (target) != REG - + || REGNO (target) < FIRST_PSEUDO_REGISTER) - + target = gen_reg_rtx (value_mode); - + - + emit_queue (); - + - + CONST_CALL_P (emit_note (NULL_PTR, NOTE_INSN_SETJMP)) = 1; - + current_function_calls_setjmp = 1; - + - + /* We store the frame pointer and the address of lab1 in the buffer - + and use the rest of it for the stack save area, which is - + machine-dependent. */ - + emit_move_insn (gen_rtx (MEM, Pmode, buf_addr), - + virtual_stack_vars_rtx); - + emit_move_insn - + (validize_mem (gen_rtx (MEM, Pmode, - + plus_constant (buf_addr, - + GET_MODE_SIZE (Pmode)))), - + gen_rtx (LABEL_REF, Pmode, lab1)); - + - + #ifdef HAVE_save_stack_nonlocal - + if (HAVE_save_stack_nonlocal) - + sa_mode = insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0]; - + #endif - + - + current_function_has_nonlocal_goto = 1; - + - + stack_save = gen_rtx (MEM, sa_mode, - + plus_constant (buf_addr, - + 2 * GET_MODE_SIZE (Pmode))); - + emit_stack_save (SAVE_NONLOCAL, &stack_save, NULL_RTX); - + - + #ifdef HAVE_setjmp - + if (HAVE_setjmp) - + emit_insn (gen_setjmp ()); - + #endif - + - + /* Set TARGET to zero and branch around the other case. */ - + emit_move_insn (target, const0_rtx); - + emit_jump_insn (gen_jump (lab2)); - + emit_barrier (); - + emit_label (lab1); - + - + /* Note that setjmp clobbers FP when we get here, so we have to - + make sure it's marked as used by this function. */ - + emit_insn (gen_rtx (USE, VOIDmode, hard_frame_pointer_rtx)); - + - + /* Mark the static chain as clobbered here so life information - + doesn't get messed up for it. */ - + emit_insn (gen_rtx (CLOBBER, VOIDmode, static_chain_rtx)); - + - + /* Now put in the code to restore the frame pointer, and argument - + pointer, if needed. The code below is from expand_end_bindings - + in stmt.c; see detailed documentation there. */ - + #ifdef HAVE_nonlocal_goto - + if (! HAVE_nonlocal_goto) - + #endif - + emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); - + - + #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM - + if (fixed_regs[ARG_POINTER_REGNUM]) - + { - + #ifdef ELIMINABLE_REGS - + static struct elims {int from, to;} elim_regs[] = ELIMINABLE_REGS; - + - + for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++) - + if (elim_regs[i].from == ARG_POINTER_REGNUM - + && elim_regs[i].to == HARD_FRAME_POINTER_REGNUM) - + break; - + - + if (i == sizeof elim_regs / sizeof elim_regs [0]) - + #endif - + { - + /* Now restore our arg pointer from the address at which it - + was saved in our stack frame. - + If there hasn't be space allocated for it yet, make - + some now. */ - + if (arg_pointer_save_area == 0) - + arg_pointer_save_area - + = assign_stack_local (Pmode, GET_MODE_SIZE (Pmode), 0); - + emit_move_insn (virtual_incoming_args_rtx, - + copy_to_reg (arg_pointer_save_area)); - + } - + } - + #endif - + - + #ifdef HAVE_nonlocal_goto_receiver - + if (HAVE_nonlocal_goto_receiver) - + emit_insn (gen_nonlocal_goto_receiver ()); - + #endif - + /* The static chain pointer contains the address of dummy function. - + We need to call it here to handle some PIC cases of restoring - + a global pointer. Then return 1. */ - + op0 = copy_to_mode_reg (Pmode, static_chain_rtx); - + - + /* We can't actually call emit_library_call here, so do everything - + it does, which isn't much for a libfunc with no args. */ - + op0 = memory_address (FUNCTION_MODE, op0); - + - + INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, - + gen_rtx (SYMBOL_REF, Pmode, "__dummy")); - + next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1); - + - + #ifndef ACCUMULATE_OUTGOING_ARGS - + #ifdef HAVE_call_pop - + if (HAVE_call_pop) - + emit_call_insn (gen_call_pop (gen_rtx (MEM, FUNCTION_MODE, op0), - + const0_rtx, next_arg_reg, - + GEN_INT (return_pops))); - + else - + #endif - + #endif - + - + #ifdef HAVE_call - + if (HAVE_call) - + emit_call_insn (gen_call (gen_rtx (MEM, FUNCTION_MODE, op0), - + const0_rtx, next_arg_reg, const0_rtx)); - + else - + #endif - + abort (); - + - + emit_move_insn (target, const1_rtx); - + emit_label (lab2); - + return target; - + } - + - + /* __builtin_longjmp is passed a pointer to an array of five words - + and a value, which is a dummy. It's similar to the C library longjmp - + function but works with __builtin_setjmp above. */ - + case BUILT_IN_LONGJMP: - + if (arglist == 0 || TREE_CHAIN (arglist) == 0 - + || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE) - + break; - + - + { - + tree dummy_id = get_identifier ("__dummy"); - + tree dummy_type = build_function_type (void_type_node, NULL_TREE); - + tree dummy_decl = build_decl (FUNCTION_DECL, dummy_id, dummy_type); - + #ifdef POINTERS_EXTEND_UNSIGNED - + rtx buf_addr - + = force_reg (Pmode, - + convert_memory_address - + (Pmode, - + expand_expr (TREE_VALUE (arglist), - + NULL_RTX, VOIDmode, 0))); - + #else - + rtx buf_addr - + = force_reg (Pmode, expand_expr (TREE_VALUE (arglist), - + NULL_RTX, - + VOIDmode, 0)); - + #endif - + rtx fp = gen_rtx (MEM, Pmode, buf_addr); - + rtx lab = gen_rtx (MEM, Pmode, - + plus_constant (buf_addr, GET_MODE_SIZE (Pmode))); - + enum machine_mode sa_mode - + #ifdef HAVE_save_stack_nonlocal - + = (HAVE_save_stack_nonlocal - + ? insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0] - + : Pmode); - + #else - + = Pmode; - + #endif - + rtx stack = gen_rtx (MEM, sa_mode, - + plus_constant (buf_addr, - + 2 * GET_MODE_SIZE (Pmode))); - + - + DECL_EXTERNAL (dummy_decl) = 1; - + TREE_PUBLIC (dummy_decl) = 1; - + make_decl_rtl (dummy_decl, NULL_PTR, 1); - + - + /* Expand the second expression just for side-effects. */ - + expand_expr (TREE_VALUE (TREE_CHAIN (arglist)), - + const0_rtx, VOIDmode, 0); - + - + assemble_external (dummy_decl); - + - + /* Pick up FP, label, and SP from the block and jump. This code is - + from expand_goto in stmt.c; see there for detailed comments. */ - + #if HAVE_nonlocal_goto - + if (HAVE_nonlocal_goto) - + emit_insn (gen_nonlocal_goto (fp, lab, stack, - + XEXP (DECL_RTL (dummy_decl), 0))); - + else - + #endif - + { - + lab = copy_to_reg (lab); - + emit_move_insn (hard_frame_pointer_rtx, fp); - + emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); - + - + /* Put in the static chain register the address of the dummy - + function. */ - + emit_move_insn (static_chain_rtx, XEXP (DECL_RTL (dummy_decl), 0)); - + emit_insn (gen_rtx (USE, VOIDmode, hard_frame_pointer_rtx)); - + emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx)); - + emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx)); - + emit_indirect_jump (lab); - + } - + - + return const0_rtx; - + } - + - default: /* just do library call, if unknown builtin */ - error ("built-in function `%s' not currently supported", - *************** preexpand_calls (exp) - *** 8688,8701 **** - case CALL_EXPR: - /* Do nothing if already expanded. */ - ! if (CALL_EXPR_RTL (exp) != 0) - return; - - ! /* Do nothing to built-in functions. */ - ! if (TREE_CODE (TREE_OPERAND (exp, 0)) != ADDR_EXPR - ! || TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) != FUNCTION_DECL - ! || ! DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) - ! /* Do nothing if the call returns a variable-sized object. */ - ! || TREE_CODE (TYPE_SIZE (TREE_TYPE(exp))) != INTEGER_CST) - ! CALL_EXPR_RTL (exp) = expand_call (exp, NULL_RTX, 0); - return; - - --- 8994,9008 ---- - case CALL_EXPR: - /* Do nothing if already expanded. */ - ! if (CALL_EXPR_RTL (exp) != 0 - ! /* Do nothing if the call returns a variable-sized object. */ - ! || TREE_CODE (TYPE_SIZE (TREE_TYPE(exp))) != INTEGER_CST - ! /* Do nothing to built-in functions. */ - ! || (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR - ! && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) - ! == FUNCTION_DECL) - ! && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)))) - return; - - ! CALL_EXPR_RTL (exp) = expand_call (exp, NULL_RTX, 0); - return; - - *************** do_jump (exp, if_false_label, if_true_la - *** 9087,9090 **** - --- 9394,9398 ---- - push_temp_slots (); - expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0); - + preserve_temp_slots (NULL_RTX); - free_temp_slots (); - pop_temp_slots (); - *************** do_jump (exp, if_false_label, if_true_la - *** 9103,9111 **** - tree offset; - int volatilep = 0; - - /* Get description of this reference. We don't actually care - about the underlying object here. */ - get_inner_reference (exp, &bitsize, &bitpos, &offset, - ! &mode, &unsignedp, &volatilep); - - type = type_for_size (bitsize, unsignedp); - --- 9411,9421 ---- - tree offset; - int volatilep = 0; - + int alignment; - - /* Get description of this reference. We don't actually care - about the underlying object here. */ - get_inner_reference (exp, &bitsize, &bitpos, &offset, - ! &mode, &unsignedp, &volatilep, - ! &alignment); - - type = type_for_size (bitsize, unsignedp); - diff -rcp2N gcc-2.7.2.3/expr.h gcc-2.7.2.3.f.2/expr.h - *** gcc-2.7.2.3/expr.h Fri Oct 27 10:16:56 1995 - --- gcc-2.7.2.3.f.2/expr.h Tue Sep 9 07:01:31 1997 - *************** enum direction {none, upward, downward}; - *** 229,232 **** - --- 229,272 ---- - #define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode) - #endif - + - + /* Provide default values for the macros controlling stack checking. */ - + - + #ifndef STACK_CHECK_BUILTIN - + #define STACK_CHECK_BUILTIN 0 - + #endif - + - + /* The default interval is one page. */ - + #ifndef STACK_CHECK_PROBE_INTERVAL - + #define STACK_CHECK_PROBE_INTERVAL 4096 - + #endif - + - + /* The default is to do a store into the stack. */ - + #ifndef STACK_CHECK_PROBE_LOAD - + #define STACK_CHECK_PROBE_LOAD 0 - + #endif - + - + /* This value is arbitrary, but should be sufficient for most machines. */ - + #ifndef STACK_CHECK_PROTECT - + #define STACK_CHECK_PROTECT (75 * UNITS_PER_WORD) - + #endif - + - + /* Make the maximum frame size be the largest we can and still only need - + one probe per function. */ - + #ifndef STACK_CHECK_MAX_FRAME_SIZE - + #define STACK_CHECK_MAX_FRAME_SIZE \ - + (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD) - + #endif - + - + /* This is arbitrary, but should be large enough everywhere. */ - + #ifndef STACK_CHECK_FIXED_FRAME_SIZE - + #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) - + #endif - + - + /* Provide a reasonable default for the maximum size of an object to - + allocate in the fixed frame. We may need to be able to make this - + controllable by the user at some point. */ - + #ifndef STACK_CHECK_MAX_VAR_SIZE - + #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) - + #endif - - /* Optabs are tables saying how to generate insn bodies - *************** extern void emit_stack_restore PROTO((en - *** 828,831 **** - --- 868,878 ---- - says how many bytes. */ - extern rtx allocate_dynamic_stack_space PROTO((rtx, rtx, int)); - + - + /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. - + FIRST is a constant and size is a Pmode RTX. These are offsets from the - + current stack pointer. STACK_GROWS_DOWNWARD says whether to add or - + subtract from the stack. If SIZE is constant, this is done - + with a fixed number of probes. Otherwise, we must make a loop. */ - + extern void probe_stack_range PROTO((HOST_WIDE_INT, rtx)); - - /* Emit code to copy function value to a new temp reg and return that reg. */ - diff -rcp2N gcc-2.7.2.3/final.c gcc-2.7.2.3.f.2/final.c - *** gcc-2.7.2.3/final.c Sun Nov 26 18:50:00 1995 - --- gcc-2.7.2.3.f.2/final.c Tue Sep 9 07:01:32 1997 - *************** profile_function (file) - *** 983,991 **** - text_section (); - - ! #ifdef STRUCT_VALUE_INCOMING_REGNUM - if (sval) - ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_INCOMING_REGNUM); - #else - ! #ifdef STRUCT_VALUE_REGNUM - if (sval) - ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_REGNUM); - --- 983,991 ---- - text_section (); - - ! #if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (sval) - ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_INCOMING_REGNUM); - #else - ! #if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (sval) - ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_REGNUM); - *************** profile_function (file) - *** 993,1027 **** - #endif - - ! #if 0 - ! #ifdef STATIC_CHAIN_INCOMING_REGNUM - if (cxt) - ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_INCOMING_REGNUM); - #else - ! #ifdef STATIC_CHAIN_REGNUM - if (cxt) - ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_REGNUM); - #endif - #endif - - #endif /* 0 */ - - FUNCTION_PROFILER (file, profile_label_no); - - ! #if 0 - ! #ifdef STATIC_CHAIN_INCOMING_REGNUM - if (cxt) - ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_INCOMING_REGNUM); - #else - ! #ifdef STATIC_CHAIN_REGNUM - if (cxt) - ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_REGNUM); - #endif - #endif - - #endif /* 0 */ - - ! #ifdef STRUCT_VALUE_INCOMING_REGNUM - if (sval) - ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_INCOMING_REGNUM); - #else - ! #ifdef STRUCT_VALUE_REGNUM - if (sval) - ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_REGNUM); - --- 993,1023 ---- - #endif - - ! #if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (cxt) - ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_INCOMING_REGNUM); - #else - ! #if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (cxt) - ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_REGNUM); - #endif - #endif - - FUNCTION_PROFILER (file, profile_label_no); - - ! #if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (cxt) - ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_INCOMING_REGNUM); - #else - ! #if defined(STATIC_CHAIN_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (cxt) - ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_REGNUM); - #endif - #endif - - ! #if defined(STRUCT_VALUE_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (sval) - ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_INCOMING_REGNUM); - #else - ! #if defined(STRUCT_VALUE_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) - if (sval) - ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_REGNUM); - diff -rcp2N gcc-2.7.2.3/flags.h gcc-2.7.2.3.f.2/flags.h - *** gcc-2.7.2.3/flags.h Thu Jun 15 11:34:11 1995 - --- gcc-2.7.2.3.f.2/flags.h Sun Mar 1 03:29:49 1998 - *************** extern int flag_unroll_loops; - *** 204,207 **** - --- 204,221 ---- - extern int flag_unroll_all_loops; - - + /* Nonzero forces all invariant computations in loops to be moved - + outside the loop. */ - + - + extern int flag_move_all_movables; - + - + /* Nonzero forces all general induction variables in loops to be - + strength reduced. */ - + - + extern int flag_reduce_all_givs; - + - + /* Nonzero gets another run of loop_optimize performed. */ - + - + extern int flag_rerun_loop_opt; - + - /* Nonzero for -fcse-follow-jumps: - have cse follow jumps to do a more extensive job. */ - *************** extern int flag_gnu_linker; - *** 339,342 **** - --- 353,373 ---- - /* Tag all structures with __attribute__(packed) */ - extern int flag_pack_struct; - + - + /* Emit code to check for stack overflow; also may cause large objects - + to be allocated dynamically. */ - + extern int flag_stack_check; - + - + /* 1 if alias checking is enabled: symbols do not alias each other - + and parameters do not alias the current stack frame. */ - + extern int flag_alias_check; - + - + /* This flag is only tested if alias checking is enabled. - + 0 if pointer arguments may alias each other. True in C. - + 1 if pointer arguments may not alias each other but may alias - + global variables. - + 2 if pointer arguments may not alias each other and may not - + alias global variables. True in Fortran. - + The value is ignored if flag_alias_check is 0. */ - + extern int flag_argument_noalias; - - /* Other basic status info about current function. */ - *************** extern int current_function_has_nonlocal - *** 362,363 **** - --- 393,401 ---- - - extern int current_function_has_nonlocal_goto; - + - + /* If reg-stack will be run and this function has a computed goto, we can't - + put pseudos into stack registers, since reg-stack will be unable to cope. - + This variable is nonzero if we have found a computed goto. This is - + computed in flow.c or in stupid.c. */ - + - + extern int current_function_has_computed_jump; - diff -rcp2N gcc-2.7.2.3/flow.c gcc-2.7.2.3.f.2/flow.c - *** gcc-2.7.2.3/flow.c Mon Aug 28 10:23:34 1995 - --- gcc-2.7.2.3.f.2/flow.c Sun Mar 1 03:59:40 1998 - *************** rtx *basic_block_head; - *** 236,239 **** - --- 236,244 ---- - rtx *basic_block_end; - - + /* Element N indicates whether basic block N can be reached through a - + computed jump. */ - + - + char *basic_block_computed_jump_target; - + - /* Element N is a regset describing the registers live - at the start of basic block N. - *************** static HARD_REG_SET elim_reg_set; - *** 288,292 **** - /* Forward declarations */ - static void find_basic_blocks PROTO((rtx, rtx)); - - static int uses_reg_or_mem PROTO((rtx)); - static void mark_label_ref PROTO((rtx, rtx, int)); - static void life_analysis PROTO((rtx, int)); - --- 293,296 ---- - *************** flow_analysis (f, nregs, file) - *** 376,379 **** - --- 380,384 ---- - basic_block_head = (rtx *) oballoc (n_basic_blocks * sizeof (rtx)); - basic_block_end = (rtx *) oballoc (n_basic_blocks * sizeof (rtx)); - + basic_block_computed_jump_target = (char *) oballoc (n_basic_blocks); - basic_block_drops_in = (char *) alloca (n_basic_blocks); - basic_block_loop_depth = (short *) alloca (n_basic_blocks * sizeof (short)); - *************** find_basic_blocks (f, nonlocal_label_lis - *** 422,425 **** - --- 427,432 ---- - bzero (block_live, n_basic_blocks); - bzero (block_marked, n_basic_blocks); - + bzero (basic_block_computed_jump_target, n_basic_blocks); - + current_function_has_computed_jump = 0; - - /* Initialize with just block 0 reachable and no blocks marked. */ - *************** find_basic_blocks (f, nonlocal_label_lis - *** 534,574 **** - - for (insn = f; insn; insn = NEXT_INSN (insn)) - ! if (GET_CODE (insn) == JUMP_INSN) - { - ! rtx pat = PATTERN (insn); - ! int computed_jump = 0; - ! - ! if (GET_CODE (pat) == PARALLEL) - { - ! int len = XVECLEN (pat, 0); - ! int has_use_labelref = 0; - ! - ! for (i = len - 1; i >= 0; i--) - ! if (GET_CODE (XVECEXP (pat, 0, i)) == USE - ! && (GET_CODE (XEXP (XVECEXP (pat, 0, i), 0)) - ! == LABEL_REF)) - ! has_use_labelref = 1; - ! - ! if (! has_use_labelref) - ! for (i = len - 1; i >= 0; i--) - ! if (GET_CODE (XVECEXP (pat, 0, i)) == SET - ! && SET_DEST (XVECEXP (pat, 0, i)) == pc_rtx - ! && uses_reg_or_mem (SET_SRC (XVECEXP (pat, 0, i)))) - ! computed_jump = 1; - } - - else if (GET_CODE (pat) == SET - - && SET_DEST (pat) == pc_rtx - - && uses_reg_or_mem (SET_SRC (pat))) - - computed_jump = 1; - - - - if (computed_jump) - - { - - for (x = label_value_list; x; x = XEXP (x, 1)) - - mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)), - - insn, 0); - - ! for (x = forced_labels; x; x = XEXP (x, 1)) - ! mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)), - ! insn, 0); - } - } - --- 541,561 ---- - - for (insn = f; insn; insn = NEXT_INSN (insn)) - ! if (computed_jump_p (insn)) - { - ! for (x = label_value_list; x; x = XEXP (x, 1)) - { - ! int b = BLOCK_NUM (XEXP (x, 0)); - ! basic_block_computed_jump_target[b] = 1; - ! mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, - ! XEXP (x, 0)), - ! insn, 0); - } - - ! for (x = forced_labels; x; x = XEXP (x, 1)) - ! { - ! int b = BLOCK_NUM (XEXP (x, 0)); - ! basic_block_computed_jump_target[b] = 1; - ! mark_label_ref (gen_rtx (LABEL_REF, VOIDmode, XEXP (x, 0)), - ! insn, 0); - } - } - *************** find_basic_blocks (f, nonlocal_label_lis - *** 760,795 **** - /* Subroutines of find_basic_blocks. */ - - - /* Return 1 if X contain a REG or MEM that is not in the constant pool. */ - - - - static int - - uses_reg_or_mem (x) - - rtx x; - - { - - enum rtx_code code = GET_CODE (x); - - int i, j; - - char *fmt; - - - - if (code == REG - - || (code == MEM - - && ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF - - && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0))))) - - return 1; - - - - fmt = GET_RTX_FORMAT (code); - - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - - { - - if (fmt[i] == 'e' - - && uses_reg_or_mem (XEXP (x, i))) - - return 1; - - - - if (fmt[i] == 'E') - - for (j = 0; j < XVECLEN (x, i); j++) - - if (uses_reg_or_mem (XVECEXP (x, i, j))) - - return 1; - - } - - - - return 0; - - } - - - /* Check expression X for label references; - if one is found, add INSN to the label's chain of references. - --- 747,750 ---- - *************** propagate_block (old, first, last, final - *** 1605,1614 **** - - /* Each call clobbers all call-clobbered regs that are not - ! global. Note that the function-value reg is a - call-clobbered reg, and mark_set_regs has already had - a chance to handle it. */ - - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - ! if (call_used_regs[i] && ! global_regs[i]) - dead[i / REGSET_ELT_BITS] - |= ((REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS)); - --- 1560,1570 ---- - - /* Each call clobbers all call-clobbered regs that are not - ! global or fixed. Note that the function-value reg is a - call-clobbered reg, and mark_set_regs has already had - a chance to handle it. */ - - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - ! if (call_used_regs[i] && ! global_regs[i] - ! && ! fixed_regs[i]) - dead[i / REGSET_ELT_BITS] - |= ((REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS)); - diff -rcp2N gcc-2.7.2.3/fold-const.c gcc-2.7.2.3.f.2/fold-const.c - *** gcc-2.7.2.3/fold-const.c Fri Sep 15 22:26:12 1995 - --- gcc-2.7.2.3.f.2/fold-const.c Tue Sep 9 07:01:33 1997 - *************** static tree unextend PROTO((tree, int, i - *** 80,83 **** - --- 80,84 ---- - static tree fold_truthop PROTO((enum tree_code, tree, tree, tree)); - static tree strip_compound_expr PROTO((tree, tree)); - + static int multiple_of_p PROTO((tree, tree, tree)); - - #ifndef BRANCH_COST - *************** const_binop (code, arg1, arg2, notrunc) - *** 1077,1080 **** - --- 1078,1083 ---- - if (int2h == 0 && int2l > 0 - && TREE_TYPE (arg1) == sizetype - + && ! TREE_CONSTANT_OVERFLOW (arg1) - + && ! TREE_CONSTANT_OVERFLOW (arg2) - && int1h == 0 && int1l >= 0) - { - *************** const_binop (code, arg1, arg2, notrunc) - *** 1230,1233 **** - --- 1233,1237 ---- - if (TREE_CODE (arg1) == COMPLEX_CST) - { - + register tree type = TREE_TYPE (arg1); - register tree r1 = TREE_REALPART (arg1); - register tree i1 = TREE_IMAGPART (arg1); - *************** const_binop (code, arg1, arg2, notrunc) - *** 1239,1253 **** - { - case PLUS_EXPR: - ! t = build_complex (const_binop (PLUS_EXPR, r1, r2, notrunc), - const_binop (PLUS_EXPR, i1, i2, notrunc)); - break; - - case MINUS_EXPR: - ! t = build_complex (const_binop (MINUS_EXPR, r1, r2, notrunc), - const_binop (MINUS_EXPR, i1, i2, notrunc)); - break; - - case MULT_EXPR: - ! t = build_complex (const_binop (MINUS_EXPR, - const_binop (MULT_EXPR, - r1, r2, notrunc), - --- 1243,1260 ---- - { - case PLUS_EXPR: - ! t = build_complex (type, - ! const_binop (PLUS_EXPR, r1, r2, notrunc), - const_binop (PLUS_EXPR, i1, i2, notrunc)); - break; - - case MINUS_EXPR: - ! t = build_complex (type, - ! const_binop (MINUS_EXPR, r1, r2, notrunc), - const_binop (MINUS_EXPR, i1, i2, notrunc)); - break; - - case MULT_EXPR: - ! t = build_complex (type, - ! const_binop (MINUS_EXPR, - const_binop (MULT_EXPR, - r1, r2, notrunc), - *************** const_binop (code, arg1, arg2, notrunc) - *** 1271,1293 **** - notrunc); - - ! t = build_complex - ! (const_binop (INTEGRAL_TYPE_P (TREE_TYPE (r1)) - ! ? TRUNC_DIV_EXPR : RDIV_EXPR, - ! const_binop (PLUS_EXPR, - ! const_binop (MULT_EXPR, r1, r2, - ! notrunc), - ! const_binop (MULT_EXPR, i1, i2, - ! notrunc), - ! notrunc), - ! magsquared, notrunc), - ! const_binop (INTEGRAL_TYPE_P (TREE_TYPE (r1)) - ! ? TRUNC_DIV_EXPR : RDIV_EXPR, - ! const_binop (MINUS_EXPR, - ! const_binop (MULT_EXPR, i1, r2, - ! notrunc), - ! const_binop (MULT_EXPR, r1, i2, - ! notrunc), - ! notrunc), - ! magsquared, notrunc)); - } - break; - --- 1278,1302 ---- - notrunc); - - ! t = build_complex (type, - ! const_binop - ! (INTEGRAL_TYPE_P (TREE_TYPE (r1)) - ! ? TRUNC_DIV_EXPR : RDIV_EXPR, - ! const_binop (PLUS_EXPR, - ! const_binop (MULT_EXPR, r1, r2, - ! notrunc), - ! const_binop (MULT_EXPR, i1, i2, - ! notrunc), - ! notrunc), - ! magsquared, notrunc), - ! const_binop - ! (INTEGRAL_TYPE_P (TREE_TYPE (r1)) - ! ? TRUNC_DIV_EXPR : RDIV_EXPR, - ! const_binop (MINUS_EXPR, - ! const_binop (MULT_EXPR, i1, r2, - ! notrunc), - ! const_binop (MULT_EXPR, r1, i2, - ! notrunc), - ! notrunc), - ! magsquared, notrunc)); - } - break; - *************** const_binop (code, arg1, arg2, notrunc) - *** 1296,1300 **** - abort (); - } - - TREE_TYPE (t) = TREE_TYPE (arg1); - return t; - } - --- 1305,1308 ---- - *************** size_binop (code, arg0, arg1) - *** 1346,1363 **** - { - /* And some specific cases even faster than that. */ - ! if (code == PLUS_EXPR - ! && TREE_INT_CST_LOW (arg0) == 0 - ! && TREE_INT_CST_HIGH (arg0) == 0) - return arg1; - ! if (code == MINUS_EXPR - ! && TREE_INT_CST_LOW (arg1) == 0 - ! && TREE_INT_CST_HIGH (arg1) == 0) - return arg0; - ! if (code == MULT_EXPR - ! && TREE_INT_CST_LOW (arg0) == 1 - ! && TREE_INT_CST_HIGH (arg0) == 0) - return arg1; - /* Handle general case of two integer constants. */ - ! return const_binop (code, arg0, arg1, 0); - } - - --- 1354,1367 ---- - { - /* And some specific cases even faster than that. */ - ! if (code == PLUS_EXPR && integer_zerop (arg0)) - return arg1; - ! else if ((code == MINUS_EXPR || code == PLUS_EXPR) - ! && integer_zerop (arg1)) - return arg0; - ! else if (code == MULT_EXPR && integer_onep (arg0)) - return arg1; - + - /* Handle general case of two integer constants. */ - ! return const_binop (code, arg0, arg1, 1); - } - - *************** fold_convert (t, arg1) - *** 1482,1486 **** - { - if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1))) - ! return arg1; - else if (setjmp (float_error)) - { - --- 1486,1494 ---- - { - if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1))) - ! { - ! t = arg1; - ! TREE_TYPE (arg1) = type; - ! return t; - ! } - else if (setjmp (float_error)) - { - *************** operand_equal_p (arg0, arg1, only_const) - *** 1644,1687 **** - STRIP_NOPS (arg1); - - ! /* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal. - ! We don't care about side effects in that case because the SAVE_EXPR - ! takes care of that for us. */ - ! if (TREE_CODE (arg0) == SAVE_EXPR && arg0 == arg1) - ! return ! only_const; - ! - ! if (TREE_SIDE_EFFECTS (arg0) || TREE_SIDE_EFFECTS (arg1)) - return 0; - - ! if (TREE_CODE (arg0) == TREE_CODE (arg1) - ! && TREE_CODE (arg0) == ADDR_EXPR - ! && TREE_OPERAND (arg0, 0) == TREE_OPERAND (arg1, 0)) - ! return 1; - ! - ! if (TREE_CODE (arg0) == TREE_CODE (arg1) - ! && TREE_CODE (arg0) == INTEGER_CST - ! && TREE_INT_CST_LOW (arg0) == TREE_INT_CST_LOW (arg1) - ! && TREE_INT_CST_HIGH (arg0) == TREE_INT_CST_HIGH (arg1)) - return 1; - - ! /* Detect when real constants are equal. */ - ! if (TREE_CODE (arg0) == TREE_CODE (arg1) - ! && TREE_CODE (arg0) == REAL_CST) - ! return !bcmp ((char *) &TREE_REAL_CST (arg0), - ! (char *) &TREE_REAL_CST (arg1), - ! sizeof (REAL_VALUE_TYPE)); - - if (only_const) - return 0; - - - if (arg0 == arg1) - - return 1; - - - - if (TREE_CODE (arg0) != TREE_CODE (arg1)) - - return 0; - - /* This is needed for conversions and for COMPONENT_REF. - - Might as well play it safe and always test this. */ - - if (TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1))) - - return 0; - - - switch (TREE_CODE_CLASS (TREE_CODE (arg0))) - { - --- 1652,1710 ---- - STRIP_NOPS (arg1); - - ! if (TREE_CODE (arg0) != TREE_CODE (arg1) - ! /* This is needed for conversions and for COMPONENT_REF. - ! Might as well play it safe and always test this. */ - ! || TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1))) - return 0; - - ! /* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal. - ! We don't care about side effects in that case because the SAVE_EXPR - ! takes care of that for us. In all other cases, two expressions are - ! equal if they have no side effects. If we have two identical - ! expressions with side effects that should be treated the same due - ! to the only side effects being identical SAVE_EXPR's, that will - ! be detected in the recursive calls below. */ - ! if (arg0 == arg1 && ! only_const - ! && (TREE_CODE (arg0) == SAVE_EXPR - ! || (! TREE_SIDE_EFFECTS (arg0) && ! TREE_SIDE_EFFECTS (arg1)))) - return 1; - - ! /* Next handle constant cases, those for which we can return 1 even - ! if ONLY_CONST is set. */ - ! if (TREE_CONSTANT (arg0) && TREE_CONSTANT (arg1)) - ! switch (TREE_CODE (arg0)) - ! { - ! case INTEGER_CST: - ! return (! TREE_CONSTANT_OVERFLOW (arg0) - ! && ! TREE_CONSTANT_OVERFLOW (arg1) - ! && TREE_INT_CST_LOW (arg0) == TREE_INT_CST_LOW (arg1) - ! && TREE_INT_CST_HIGH (arg0) == TREE_INT_CST_HIGH (arg1)); - ! - ! case REAL_CST: - ! return (! TREE_CONSTANT_OVERFLOW (arg0) - ! && ! TREE_CONSTANT_OVERFLOW (arg1) - ! && REAL_VALUES_EQUAL (TREE_REAL_CST (arg0), - ! TREE_REAL_CST (arg1))); - ! - ! case COMPLEX_CST: - ! return (operand_equal_p (TREE_REALPART (arg0), TREE_REALPART (arg1), - ! only_const) - ! && operand_equal_p (TREE_IMAGPART (arg0), TREE_IMAGPART (arg1), - ! only_const)); - ! - ! case STRING_CST: - ! return (TREE_STRING_LENGTH (arg0) == TREE_STRING_LENGTH (arg1) - ! && ! strncmp (TREE_STRING_POINTER (arg0), - ! TREE_STRING_POINTER (arg1), - ! TREE_STRING_LENGTH (arg0))); - ! - ! case ADDR_EXPR: - ! return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0), - ! 0); - ! } - - if (only_const) - return 0; - - switch (TREE_CODE_CLASS (TREE_CODE (arg0))) - { - *************** operand_equal_p (arg0, arg1, only_const) - *** 1698,1705 **** - case '<': - case '2': - ! return (operand_equal_p (TREE_OPERAND (arg0, 0), - ! TREE_OPERAND (arg1, 0), 0) - && operand_equal_p (TREE_OPERAND (arg0, 1), - ! TREE_OPERAND (arg1, 1), 0)); - - case 'r': - --- 1721,1740 ---- - case '<': - case '2': - ! if (operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0), 0) - ! && operand_equal_p (TREE_OPERAND (arg0, 1), TREE_OPERAND (arg1, 1), - ! 0)) - ! return 1; - ! - ! /* For commutative ops, allow the other order. */ - ! return ((TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MULT_EXPR - ! || TREE_CODE (arg0) == MIN_EXPR || TREE_CODE (arg0) == MAX_EXPR - ! || TREE_CODE (arg0) == BIT_IOR_EXPR - ! || TREE_CODE (arg0) == BIT_XOR_EXPR - ! || TREE_CODE (arg0) == BIT_AND_EXPR - ! || TREE_CODE (arg0) == NE_EXPR || TREE_CODE (arg0) == EQ_EXPR) - ! && operand_equal_p (TREE_OPERAND (arg0, 0), - ! TREE_OPERAND (arg1, 1), 0) - && operand_equal_p (TREE_OPERAND (arg0, 1), - ! TREE_OPERAND (arg1, 0), 0)); - - case 'r': - *************** optimize_bit_field_compare (code, compar - *** 2212,2215 **** - --- 2247,2251 ---- - int lunsignedp, runsignedp; - int lvolatilep = 0, rvolatilep = 0; - + int alignment; - tree linner, rinner; - tree mask; - *************** optimize_bit_field_compare (code, compar - *** 2220,2224 **** - extraction at all and so can do nothing. */ - linner = get_inner_reference (lhs, &lbitsize, &lbitpos, &offset, &lmode, - ! &lunsignedp, &lvolatilep); - if (linner == lhs || lbitsize == GET_MODE_BITSIZE (lmode) || lbitsize < 0 - || offset != 0) - --- 2256,2260 ---- - extraction at all and so can do nothing. */ - linner = get_inner_reference (lhs, &lbitsize, &lbitpos, &offset, &lmode, - ! &lunsignedp, &lvolatilep, &alignment); - if (linner == lhs || lbitsize == GET_MODE_BITSIZE (lmode) || lbitsize < 0 - || offset != 0) - *************** optimize_bit_field_compare (code, compar - *** 2229,2234 **** - /* If this is not a constant, we can only do something if bit positions, - sizes, and signedness are the same. */ - ! rinner = get_inner_reference (rhs, &rbitsize, &rbitpos, &offset, - ! &rmode, &runsignedp, &rvolatilep); - - if (rinner == rhs || lbitpos != rbitpos || lbitsize != rbitsize - --- 2265,2270 ---- - /* If this is not a constant, we can only do something if bit positions, - sizes, and signedness are the same. */ - ! rinner = get_inner_reference (rhs, &rbitsize, &rbitpos, &offset, &rmode, - ! &runsignedp, &rvolatilep, &alignment); - - if (rinner == rhs || lbitpos != rbitpos || lbitsize != rbitsize - *************** decode_field_reference (exp, pbitsize, p - *** 2403,2406 **** - --- 2439,2443 ---- - tree unsigned_type; - int precision; - + int alignment; - - /* All the optimizations using this function assume integer fields. - *************** decode_field_reference (exp, pbitsize, p - *** 2423,2427 **** - - inner = get_inner_reference (exp, pbitsize, pbitpos, &offset, pmode, - ! punsignedp, pvolatilep); - if ((inner == exp && and_mask == 0) - || *pbitsize < 0 || offset != 0) - --- 2460,2464 ---- - - inner = get_inner_reference (exp, pbitsize, pbitpos, &offset, pmode, - ! punsignedp, pvolatilep, &alignment); - if ((inner == exp && and_mask == 0) - || *pbitsize < 0 || offset != 0) - *************** fold_truthop (code, truth_type, lhs, rhs - *** 2767,2770 **** - --- 2804,2810 ---- - { - /* Avoid evaluating the variable part twice. */ - + if (current_function_decl == 0) - + return 0; - + - ll_arg = save_expr (ll_arg); - lhs = build (lcode, TREE_TYPE (lhs), ll_arg, lr_arg); - *************** strip_compound_expr (t, s) - *** 3065,3068 **** - --- 3105,3208 ---- - } - - + /* Determine if first argument is a multiple of second argument. - + Return 0 if it is not, or is not easily determined to so be. - + - + An example of the sort of thing we care about (at this point -- - + this routine could surely be made more general, and expanded - + to do what the *_DIV_EXPR's fold() cases do now) is discovering - + that - + - + SAVE_EXPR (I) * SAVE_EXPR (J * 8) - + - + is a multiple of - + - + SAVE_EXPR (J * 8) - + - + when we know that the two `SAVE_EXPR (J * 8)' nodes are the - + same node (which means they will have the same value at run - + time, even though we don't know when they'll be assigned). - + - + This code also handles discovering that - + - + SAVE_EXPR (I) * SAVE_EXPR (J * 8) - + - + is a multiple of - + - + 8 - + - + (of course) so we don't have to worry about dealing with a - + possible remainder. - + - + Note that we _look_ inside a SAVE_EXPR only to determine - + how it was calculated; it is not safe for fold() to do much - + of anything else with the internals of a SAVE_EXPR, since - + fold() cannot know when it will be evaluated at run time. - + For example, the latter example above _cannot_ be implemented - + as - + - + SAVE_EXPR (I) * J - + - + or any variant thereof, since the value of J at evaluation time - + of the original SAVE_EXPR is not necessarily the same at the time - + the new expression is evaluated. The only optimization of this - + sort that would be valid is changing - + - + SAVE_EXPR (I) * SAVE_EXPR (SAVE_EXPR (J) * 8) - + divided by - + 8 - + - + to - + - + SAVE_EXPR (I) * SAVE_EXPR (J) - + - + (where the same SAVE_EXPR (J) is used in the original and the - + transformed version). */ - + - + static int - + multiple_of_p (type, top, bottom) - + tree type; - + tree top; - + tree bottom; - + { - + if (operand_equal_p (top, bottom, 0)) - + return 1; - + - + if (TREE_CODE (type) != INTEGER_TYPE) - + return 0; - + - + switch (TREE_CODE (top)) - + { - + case MULT_EXPR: - + return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom) - + || multiple_of_p (type, TREE_OPERAND (top, 1), bottom)); - + - + case PLUS_EXPR: - + case MINUS_EXPR: - + return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom) - + && multiple_of_p (type, TREE_OPERAND (top, 1), bottom)); - + - + case NOP_EXPR: - + /* Punt if conversion from non-integral or wider integral type. */ - + if ((TREE_CODE (TREE_TYPE (TREE_OPERAND (top, 0))) != INTEGER_TYPE) - + || (TYPE_PRECISION (type) - + < TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (top, 0))))) - + return 0; - + /* Fall through. */ - + case SAVE_EXPR: - + return multiple_of_p (type, TREE_OPERAND (top, 0), bottom); - + - + case INTEGER_CST: - + if ((TREE_CODE (bottom) != INTEGER_CST) - + || (tree_int_cst_sgn (top) < 0) - + || (tree_int_cst_sgn (bottom) < 0)) - + return 0; - + return integer_zerop (const_binop (TRUNC_MOD_EXPR, - + top, bottom, 0)); - + - + default: - + return 0; - + } - + } - + - /* Perform constant folding and related simplification of EXPR. - The related simplifications include x*1 => x, x*0 => 0, etc., - *************** fold (expr) - *** 3091,3096 **** - int wins = 1; - - ! /* Don't try to process an RTL_EXPR since its operands aren't trees. */ - ! if (code == RTL_EXPR) - return t; - - --- 3231,3237 ---- - int wins = 1; - - ! /* Don't try to process an RTL_EXPR since its operands aren't trees. - ! Likewise for a SAVE_EXPR that's already been evaluated. */ - ! if (code == RTL_EXPR || (code == SAVE_EXPR && SAVE_EXPR_RTL (t)) != 0) - return t; - - *************** fold (expr) - *** 3280,3285 **** - fold (build (code, type, - arg0, TREE_OPERAND (arg1, 1)))); - ! else if (TREE_CODE (arg1) == COND_EXPR - ! || TREE_CODE_CLASS (TREE_CODE (arg1)) == '<') - { - tree test, true_value, false_value; - --- 3421,3427 ---- - fold (build (code, type, - arg0, TREE_OPERAND (arg1, 1)))); - ! else if ((TREE_CODE (arg1) == COND_EXPR - ! || TREE_CODE_CLASS (TREE_CODE (arg1)) == '<') - ! && (! TREE_SIDE_EFFECTS (arg0) || current_function_decl != 0)) - { - tree test, true_value, false_value; - *************** fold (expr) - *** 3319,3323 **** - return fold (build (COND_EXPR, type, test, lhs, rhs)); - - ! arg0 = save_expr (arg0); - } - - --- 3461,3466 ---- - return fold (build (COND_EXPR, type, test, lhs, rhs)); - - ! if (current_function_decl != 0) - ! arg0 = save_expr (arg0); - } - - *************** fold (expr) - *** 3336,3341 **** - return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build (code, type, TREE_OPERAND (arg0, 1), arg1))); - ! else if (TREE_CODE (arg0) == COND_EXPR - ! || TREE_CODE_CLASS (TREE_CODE (arg0)) == '<') - { - tree test, true_value, false_value; - --- 3479,3485 ---- - return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build (code, type, TREE_OPERAND (arg0, 1), arg1))); - ! else if ((TREE_CODE (arg0) == COND_EXPR - ! || TREE_CODE_CLASS (TREE_CODE (arg0)) == '<') - ! && (! TREE_SIDE_EFFECTS (arg1) || current_function_decl != 0)) - { - tree test, true_value, false_value; - *************** fold (expr) - *** 3367,3371 **** - return fold (build (COND_EXPR, type, test, lhs, rhs)); - - ! arg1 = save_expr (arg1); - } - - --- 3511,3516 ---- - return fold (build (COND_EXPR, type, test, lhs, rhs)); - - ! if (current_function_decl != 0) - ! arg1 = save_expr (arg1); - } - - *************** fold (expr) - *** 3611,3615 **** - TREE_OPERAND (arg0, 1)))); - else if (TREE_CODE (arg0) == COMPLEX_CST) - ! return build_complex (TREE_OPERAND (arg0, 0), - fold (build1 (NEGATE_EXPR, - TREE_TYPE (TREE_TYPE (arg0)), - --- 3756,3760 ---- - TREE_OPERAND (arg0, 1)))); - else if (TREE_CODE (arg0) == COMPLEX_CST) - ! return build_complex (type, TREE_OPERAND (arg0, 0), - fold (build1 (NEGATE_EXPR, - TREE_TYPE (TREE_TYPE (arg0)), - *************** fold (expr) - *** 3889,3893 **** - return non_lvalue (convert (type, arg0)); - /* x*2 is x+x */ - ! if (! wins && real_twop (arg1)) - { - tree arg = save_expr (arg0); - --- 4034,4038 ---- - return non_lvalue (convert (type, arg0)); - /* x*2 is x+x */ - ! if (! wins && real_twop (arg1) && current_function_decl != 0) - { - tree arg = save_expr (arg0); - *************** fold (expr) - *** 4014,4018 **** - return non_lvalue (convert (type, arg0)); - if (integer_zerop (arg1)) - ! return t; - - /* If we have ((a / C1) / C2) where both division are the same type, try - --- 4159,4179 ---- - return non_lvalue (convert (type, arg0)); - if (integer_zerop (arg1)) - ! { - ! if (extra_warnings) - ! warning ("integer division by zero"); - ! return t; - ! } - ! - ! /* If arg0 is a multiple of arg1, then rewrite to the fastest div - ! operation, EXACT_DIV_EXPR. Otherwise, handle folding of - ! general divide. Note that only CEIL_DIV_EXPR is rewritten now, - ! only because the others seem to be faster in some cases, e.g. the - ! nonoptimized TRUNC_DIV_EXPR or FLOOR_DIV_EXPR on DEC Alpha. This - ! is probably just due to more work being done on it in expmed.c than - ! on EXACT_DIV_EXPR, and could presumably be fixed, since - ! EXACT_DIV_EXPR should _never_ be slower than *_DIV_EXPR. */ - ! if ((code == CEIL_DIV_EXPR) - ! && multiple_of_p (type, arg0, arg1)) - ! return fold (build (EXACT_DIV_EXPR, type, arg0, arg1)); - - /* If we have ((a / C1) / C2) where both division are the same type, try - *************** fold (expr) - *** 4049,4053 **** - tree xarg0 = arg0; - - ! if (TREE_CODE (xarg0) == SAVE_EXPR) - have_save_expr = 1, xarg0 = TREE_OPERAND (xarg0, 0); - - --- 4210,4214 ---- - tree xarg0 = arg0; - - ! if (TREE_CODE (xarg0) == SAVE_EXPR && SAVE_EXPR_RTL (xarg0) == 0) - have_save_expr = 1, xarg0 = TREE_OPERAND (xarg0, 0); - - *************** fold (expr) - *** 4067,4071 **** - } - - ! if (TREE_CODE (xarg0) == SAVE_EXPR) - have_save_expr = 1, xarg0 = TREE_OPERAND (xarg0, 0); - - --- 4228,4232 ---- - } - - ! if (TREE_CODE (xarg0) == SAVE_EXPR && SAVE_EXPR_RTL (xarg0) == 0) - have_save_expr = 1, xarg0 = TREE_OPERAND (xarg0, 0); - - *************** fold (expr) - *** 5050,5054 **** - case COMPLEX_EXPR: - if (wins) - ! return build_complex (arg0, arg1); - return t; - - --- 5211,5215 ---- - case COMPLEX_EXPR: - if (wins) - ! return build_complex (type, arg0, arg1); - return t; - - diff -rcp2N gcc-2.7.2.3/function.c gcc-2.7.2.3.f.2/function.c - *** gcc-2.7.2.3/function.c Wed Aug 13 17:23:26 1997 - --- gcc-2.7.2.3.f.2/function.c Sun Mar 1 03:35:26 1998 - *************** int current_function_has_nonlocal_label; - *** 125,128 **** - --- 125,135 ---- - int current_function_has_nonlocal_goto; - - + /* If reg-stack will be run and this function has a computed goto, we can't - + put pseudos into stack registers, since reg-stack will be unable to cope. - + This variable is nonzero if we have found a computed goto. This is - + computed in flow.c or in stupid.c. */ - + - + int current_function_has_computed_jump; - + - /* Nonzero if function being compiled contains nested functions. */ - - *************** assign_stack_temp (mode, size, keep) - *** 917,920 **** - --- 924,932 ---- - p->keep = keep; - } - + - + /* We may be reusing an old slot, so clear any MEM flags that may have been - + set from before. */ - + RTX_UNCHANGING_P (p->slot) = 0; - + MEM_IN_STRUCT_P (p->slot) = 0; - return p->slot; - } - *************** find_temp_slot_from_address (x) - *** 994,999 **** - if (! p->in_use) - continue; - ! else if (XEXP (p->slot, 0) == x - ! || p->address == x) - return p; - - --- 1006,1011 ---- - if (! p->in_use) - continue; - ! else if (rtx_equal_p (XEXP (p->slot, 0), x) - ! || rtx_equal_p (p->address, x)) - return p; - - *************** free_temps_for_rtl_expr (t) - *** 1184,1187 **** - --- 1196,1214 ---- - } - - + /* Mark all temporaries ever allocated in this functon as not suitable - + for reuse until the current level is exited. */ - + - + void - + mark_all_temps_used () - + { - + struct temp_slot *p; - + - + for (p = temp_slots; p; p = p->next) - + { - + p->in_use = p->keep = 1; - + p->level = MIN (p->level, temp_slot_level); - + } - + } - + - /* Push deeper into the nesting level for stack temporaries. */ - - *************** pop_temp_slots () - *** 1208,1211 **** - --- 1235,1249 ---- - temp_slot_level--; - } - + - + /* Initialize temporary slots. */ - + - + void - + init_temp_slots () - + { - + /* We have not allocated any temporaries yet. */ - + temp_slots = 0; - + temp_slot_level = 0; - + target_temp_slot_level = 0; - + } - - /* Retroactively move an auto variable from a register to a stack slot. - *************** instantiate_virtual_regs_1 (loc, object, - *** 2838,2842 **** - case MEM: - /* Most cases of MEM that convert to valid addresses have already been - ! handled by our scan of regno_reg_rtx. The only special handling we - need here is to make a copy of the rtx to ensure it isn't being - shared if we have to change it to a pseudo. - --- 2876,2880 ---- - case MEM: - /* Most cases of MEM that convert to valid addresses have already been - ! handled by our scan of decls. The only special handling we - need here is to make a copy of the rtx to ensure it isn't being - shared if we have to change it to a pseudo. - *************** instantiate_virtual_regs_1 (loc, object, - *** 2896,2900 **** - has less restrictions on an address that some other insn. - In that case, we will modify the shared address. This case - ! doesn't seem very likely, though. */ - - if (instantiate_virtual_regs_1 (&XEXP (x, 0), - --- 2934,2940 ---- - has less restrictions on an address that some other insn. - In that case, we will modify the shared address. This case - ! doesn't seem very likely, though. One case where this could - ! happen is in the case of a USE or CLOBBER reference, but we - ! take care of that below. */ - - if (instantiate_virtual_regs_1 (&XEXP (x, 0), - *************** instantiate_virtual_regs_1 (loc, object, - *** 2909,2914 **** - - /* Fall through to generic unary operation case. */ - - case USE: - - case CLOBBER: - case SUBREG: - case STRICT_LOW_PART: - --- 2949,2952 ---- - *************** instantiate_virtual_regs_1 (loc, object, - *** 2927,2930 **** - --- 2965,2985 ---- - goto restart; - - + case USE: - + case CLOBBER: - + /* If the operand is a MEM, see if the change is a valid MEM. If not, - + go ahead and make the invalid one, but do it to a copy. For a REG, - + just make the recursive call, since there's no chance of a problem. */ - + - + if ((GET_CODE (XEXP (x, 0)) == MEM - + && instantiate_virtual_regs_1 (&XEXP (XEXP (x, 0), 0), XEXP (x, 0), - + 0)) - + || (GET_CODE (XEXP (x, 0)) == REG - + && instantiate_virtual_regs_1 (&XEXP (x, 0), object, 0))) - + return 1; - + - + XEXP (x, 0) = copy_rtx (XEXP (x, 0)); - + loc = &XEXP (x, 0); - + goto restart; - + - case REG: - /* Try to replace with a PLUS. If that doesn't work, compute the sum - *************** assign_parms (fndecl, second_time) - *** 3404,3409 **** - - /* If this is a memory ref that contains aggregate components, - ! mark it as such for cse and loop optimize. */ - MEM_IN_STRUCT_P (stack_parm) = aggregate; - } - - --- 3459,3466 ---- - - /* If this is a memory ref that contains aggregate components, - ! mark it as such for cse and loop optimize. Likewise if it - ! is readonly. */ - MEM_IN_STRUCT_P (stack_parm) = aggregate; - + RTX_UNCHANGING_P (stack_parm) = TREE_READONLY (parm); - } - - *************** assign_parms (fndecl, second_time) - *** 3627,3631 **** - - parmreg = gen_reg_rtx (promoted_nominal_mode); - ! REG_USERVAR_P (parmreg) = 1; - - /* If this was an item that we received a pointer to, set DECL_RTL - --- 3684,3688 ---- - - parmreg = gen_reg_rtx (promoted_nominal_mode); - ! mark_user_reg (parmreg); - - /* If this was an item that we received a pointer to, set DECL_RTL - *************** assign_parms (fndecl, second_time) - *** 3695,3699 **** - Pmode above. We must use the actual mode of the parm. */ - parmreg = gen_reg_rtx (TYPE_MODE (TREE_TYPE (parm))); - ! REG_USERVAR_P (parmreg) = 1; - emit_move_insn (parmreg, DECL_RTL (parm)); - DECL_RTL (parm) = parmreg; - --- 3752,3756 ---- - Pmode above. We must use the actual mode of the parm. */ - parmreg = gen_reg_rtx (TYPE_MODE (TREE_TYPE (parm))); - ! mark_user_reg (parmreg); - emit_move_insn (parmreg, DECL_RTL (parm)); - DECL_RTL (parm) = parmreg; - *************** init_function_start (subr, filename, lin - *** 4814,4821 **** - rtl_expr_chain = 0; - - ! /* We have not allocated any temporaries yet. */ - ! temp_slots = 0; - ! temp_slot_level = 0; - ! target_temp_slot_level = 0; - - /* Within function body, compute a type's size as soon it is laid out. */ - --- 4871,4876 ---- - rtl_expr_chain = 0; - - ! /* Set up to allocate temporaries. */ - ! init_temp_slots (); - - /* Within function body, compute a type's size as soon it is laid out. */ - *************** expand_function_end (filename, line, end - *** 5295,5298 **** - --- 5350,5373 ---- - /* Put those insns at entry to the containing function (this one). */ - emit_insns_before (seq, tail_recursion_reentry); - + } - + - + /* If we are doing stack checking and this function makes calls, - + do a stack probe at the start of the function to ensure we have enough - + space for another stack frame. */ - + if (flag_stack_check && ! STACK_CHECK_BUILTIN) - + { - + rtx insn, seq; - + - + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - + if (GET_CODE (insn) == CALL_INSN) - + { - + start_sequence (); - + probe_stack_range (STACK_CHECK_PROTECT, - + GEN_INT (STACK_CHECK_MAX_FRAME_SIZE)); - + seq = get_insns (); - + end_sequence (); - + emit_insns_before (seq, tail_recursion_reentry); - + break; - + } - } - - diff -rcp2N gcc-2.7.2.3/gcc.c gcc-2.7.2.3.f.2/gcc.c - *** gcc-2.7.2.3/gcc.c Tue Jun 24 18:42:50 1997 - --- gcc-2.7.2.3.f.2/gcc.c Tue Sep 9 07:01:34 1997 - *************** static int is_directory PROTO((char *, - *** 296,300 **** - static void validate_switches PROTO((char *)); - static void validate_all_switches PROTO((void)); - ! static void give_switch PROTO((int, int)); - static int used_arg PROTO((char *, int)); - static int default_arg PROTO((char *, int)); - --- 296,300 ---- - static void validate_switches PROTO((char *)); - static void validate_all_switches PROTO((void)); - ! static void give_switch PROTO((int, int, int)); - static int used_arg PROTO((char *, int)); - static int default_arg PROTO((char *, int)); - *************** or with constant text in a single argume - *** 405,408 **** - --- 405,409 ---- - name starts with `o'. %{o*} would substitute this text, - including the space; thus, two arguments would be generated. - + %{^S*} likewise, but don't put a blank between a switch and any args. - %{S*:X} substitutes X if one or more switches whose names start with -S are - specified to CC. Note that the tail part of the -S option - *************** process_command (argc, argv) - *** 2649,2655 **** - else - { - ! char *string = xmalloc (len + 1); - strncpy (string, value, len-7); - ! strcat (string, "include"); - add_prefix (&include_prefixes, string, 1, 0, 0); - } - --- 2650,2656 ---- - else - { - ! char *string = xmalloc (len); - strncpy (string, value, len-7); - ! strcpy (string+len-7, "include"); - add_prefix (&include_prefixes, string, 1, 0, 0); - } - *************** process_command (argc, argv) - *** 2828,2831 **** - --- 2829,2835 ---- - infiles[n_infiles++].name = argv[i]; - } - + /* -save-temps overrides -pipe, so that temp files are produced */ - + else if (save_temps_flag && strcmp (argv[i], "-pipe") == 0) - + ; - else if (argv[i][0] == '-' && argv[i][1] != 0) - { - *************** handle_braces (p) - *** 3832,3835 **** - --- 3836,3844 ---- - int negate = 0; - int suffix = 0; - + int include_blanks = 1; - + - + if (*p == '^') - + /* A '^' after the open-brace means to not give blanks before args. */ - + include_blanks = 0, ++p; - - if (*p == '|') - *************** handle_braces (p) - *** 3897,3901 **** - if (!strncmp (switches[i].part1, filter, p - filter) - && check_live_switch (i, p - filter)) - ! give_switch (i, 0); - } - else - --- 3906,3910 ---- - if (!strncmp (switches[i].part1, filter, p - filter) - && check_live_switch (i, p - filter)) - ! give_switch (i, 0, include_blanks); - } - else - *************** handle_braces (p) - *** 3936,3940 **** - do_spec_1 (string, 0, &switches[i].part1[hard_match_len]); - /* Pass any arguments this switch has. */ - ! give_switch (i, 1); - } - - --- 3945,3949 ---- - do_spec_1 (string, 0, &switches[i].part1[hard_match_len]); - /* Pass any arguments this switch has. */ - ! give_switch (i, 1, 1); - } - - *************** handle_braces (p) - *** 3980,3984 **** - if (*p == '}') - { - ! give_switch (i, 0); - } - else - --- 3989,3993 ---- - if (*p == '}') - { - ! give_switch (i, 0, include_blanks); - } - else - *************** check_live_switch (switchnum, prefix_len - *** 4081,4090 **** - This cannot fail since it never finishes a command line. - - ! If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */ - - static void - ! give_switch (switchnum, omit_first_word) - int switchnum; - int omit_first_word; - { - if (!omit_first_word) - --- 4090,4103 ---- - This cannot fail since it never finishes a command line. - - ! If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. - ! - ! If INCLUDE_BLANKS is nonzero, then we include blanks before each argument - ! of the switch. */ - - static void - ! give_switch (switchnum, omit_first_word, include_blanks) - int switchnum; - int omit_first_word; - + int include_blanks; - { - if (!omit_first_word) - *************** give_switch (switchnum, omit_first_word) - *** 4093,4097 **** - do_spec_1 (switches[switchnum].part1, 1, NULL_PTR); - } - ! do_spec_1 (" ", 0, NULL_PTR); - if (switches[switchnum].args != 0) - { - --- 4106,4110 ---- - do_spec_1 (switches[switchnum].part1, 1, NULL_PTR); - } - ! - if (switches[switchnum].args != 0) - { - *************** give_switch (switchnum, omit_first_word) - *** 4099,4106 **** - for (p = switches[switchnum].args; *p; p++) - { - do_spec_1 (*p, 1, NULL_PTR); - - do_spec_1 (" ", 0, NULL_PTR); - } - } - switches[switchnum].valid = 1; - } - --- 4112,4122 ---- - for (p = switches[switchnum].args; *p; p++) - { - + if (include_blanks) - + do_spec_1 (" ", 0, NULL_PTR); - do_spec_1 (*p, 1, NULL_PTR); - } - } - + - + do_spec_1 (" ", 0, NULL_PTR); - switches[switchnum].valid = 1; - } - diff -rcp2N gcc-2.7.2.3/gcc.texi gcc-2.7.2.3.f.2/gcc.texi - *** gcc-2.7.2.3/gcc.texi Wed Jul 24 18:57:41 1996 - --- gcc-2.7.2.3.f.2/gcc.texi Tue Sep 9 07:01:35 1997 - *************** original English. - *** 149,152 **** - --- 149,153 ---- - @sp 3 - @center Last updated 29 June 1996 - + @center (Revised for GNU Fortran 1997-01-10) - @sp 1 - @c The version number appears twice more in this file. - diff -rcp2N gcc-2.7.2.3/genattrtab.c gcc-2.7.2.3.f.2/genattrtab.c - *** gcc-2.7.2.3/genattrtab.c Thu Jun 15 11:39:24 1995 - --- gcc-2.7.2.3.f.2/genattrtab.c Sun Mar 1 04:29:39 1998 - *************** static char *alternative_name; - *** 360,364 **** - - rtx frame_pointer_rtx, hard_frame_pointer_rtx, stack_pointer_rtx; - ! rtx arg_pointer_rtx; - - static rtx attr_rtx PVPROTO((enum rtx_code, ...)); - --- 360,364 ---- - - rtx frame_pointer_rtx, hard_frame_pointer_rtx, stack_pointer_rtx; - ! rtx arg_pointer_rtx, pc_rtx; - - static rtx attr_rtx PVPROTO((enum rtx_code, ...)); - diff -rcp2N gcc-2.7.2.3/glimits.h gcc-2.7.2.3.f.2/glimits.h - *** gcc-2.7.2.3/glimits.h Wed Sep 29 21:30:54 1993 - --- gcc-2.7.2.3.f.2/glimits.h Tue Sep 9 07:01:35 1997 - *************** - *** 64,68 **** - (Same as `int'). */ - #ifndef __LONG_MAX__ - ! #define __LONG_MAX__ 2147483647L - #endif - #undef LONG_MIN - --- 64,72 ---- - (Same as `int'). */ - #ifndef __LONG_MAX__ - ! # ifndef __alpha__ - ! # define __LONG_MAX__ 2147483647L - ! # else - ! # define __LONG_MAX__ 9223372036854775807LL - ! # endif /* __alpha__ */ - #endif - #undef LONG_MIN - diff -rcp2N gcc-2.7.2.3/global.c gcc-2.7.2.3.f.2/global.c - *** gcc-2.7.2.3/global.c Thu Jun 15 11:44:32 1995 - --- gcc-2.7.2.3.f.2/global.c Sun Mar 1 03:28:17 1998 - *************** global_conflicts () - *** 676,679 **** - --- 676,688 ---- - - record_conflicts (block_start_allocnos, ax); - + - + #ifdef STACK_REGS - + /* Pseudos can't go in stack regs at the start of a basic block - + that can be reached through a computed goto, since reg-stack - + can't handle computed gotos. */ - + if (basic_block_computed_jump_target[b]) - + for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++) - + record_one_conflict (ax); - + #endif - } - - diff -rcp2N gcc-2.7.2.3/integrate.c gcc-2.7.2.3.f.2/integrate.c - *** gcc-2.7.2.3/integrate.c Fri Oct 20 22:48:13 1995 - --- gcc-2.7.2.3.f.2/integrate.c Tue Sep 9 07:01:36 1997 - *************** static rtx copy_for_inline PROTO((rtx)); - *** 67,70 **** - --- 67,71 ---- - static void integrate_parm_decls PROTO((tree, struct inline_remap *, rtvec)); - static void integrate_decl_tree PROTO((tree, int, struct inline_remap *)); - + static void save_constants_in_decl_trees PROTO ((tree)); - static void subst_constants PROTO((rtx *, rtx, struct inline_remap *)); - static void restore_constants PROTO((rtx *)); - *************** save_for_inline_copying (fndecl) - *** 435,438 **** - --- 436,443 ---- - } - - + /* Also scan all decls, and replace any constant pool references with the - + actual constant. */ - + save_constants_in_decl_trees (DECL_INITIAL (fndecl)); - + - /* Clear out the constant pool so that we can recreate it with the - copied constants below. */ - *************** save_for_inline_nocopy (fndecl) - *** 781,784 **** - --- 786,793 ---- - } - - + /* Also scan all decls, and replace any constant pool references with the - + actual constant. */ - + save_constants_in_decl_trees (DECL_INITIAL (fndecl)); - + - /* We have now allocated all that needs to be allocated permanently - on the rtx obstack. Set our high-water mark, so that we - *************** expand_inline_function (fndecl, parms, t - *** 1571,1575 **** - if (GET_CODE (XEXP (loc, 0)) == REG) - { - ! temp = force_reg (Pmode, structure_value_addr); - map->reg_map[REGNO (XEXP (loc, 0))] = temp; - if ((CONSTANT_P (structure_value_addr) - --- 1580,1585 ---- - if (GET_CODE (XEXP (loc, 0)) == REG) - { - ! temp = force_reg (Pmode, - ! force_operand (structure_value_addr, NULL_RTX)); - map->reg_map[REGNO (XEXP (loc, 0))] = temp; - if ((CONSTANT_P (structure_value_addr) - *************** integrate_decl_tree (let, level, map) - *** 2029,2032 **** - --- 2039,2059 ---- - } - } - + } - + - + /* Given a BLOCK node LET, search for all DECL_RTL fields, and pass them - + through save_constants. */ - + - + static void - + save_constants_in_decl_trees (let) - + tree let; - + { - + tree t; - + - + for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t)) - + if (DECL_RTL (t) != 0) - + save_constants (&DECL_RTL (t)); - + - + for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t)) - + save_constants_in_decl_trees (t); - } - - diff -rcp2N gcc-2.7.2.3/invoke.texi gcc-2.7.2.3.f.2/invoke.texi - *** gcc-2.7.2.3/invoke.texi Tue Oct 3 15:40:43 1995 - --- gcc-2.7.2.3.f.2/invoke.texi Tue Sep 9 07:01:36 1997 - *************** - *** 1,3 **** - ! @c Copyright (C) 1988, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. - @c This is part of the GCC manual. - @c For copying conditions, see the file gcc.texi. - --- 1,3 ---- - ! @c Copyright (C) 1988, 89, 92-95, 1997 Free Software Foundation, Inc. - @c This is part of the GCC manual. - @c For copying conditions, see the file gcc.texi. - *************** in the following sections. - *** 149,152 **** - --- 149,153 ---- - -fschedule-insns2 -fstrength-reduce -fthread-jumps - -funroll-all-loops -funroll-loops - + -fmove-all-movables -freduce-all-givs -frerun-loop-opt - -O -O0 -O1 -O2 -O3 - @end smallexample - *************** in addition to the above: - *** 330,334 **** - -freg-struct-return -fshared-data -fshort-enums - -fshort-double -fvolatile -fvolatile-global - ! -fverbose-asm -fpack-struct +e0 +e1 - @end smallexample - @end table - --- 331,337 ---- - -freg-struct-return -fshared-data -fshort-enums - -fshort-double -fvolatile -fvolatile-global - ! -fverbose-asm -fpack-struct -fstack-check +e0 +e1 - ! -fargument-alias -fargument-noalias - ! -fargument-noalias-global - @end smallexample - @end table - *************** Print extra warning messages for these e - *** 1253,1256 **** - --- 1256,1304 ---- - - @itemize @bullet - + @cindex division by zero - + @cindex zero, division by - + @item - + An integer division by zero is detected. - + - + Some cases of division by zero might occur as the result - + of using so-called ``safe'' macros. - + For example: - + - + @smallexample - + #define BUCKETS(b) (((b) != NULL) ? (b)->buckets : 0) - + @dots{...} - + i = j / BUCKETS(b); - + @end smallexample - + - + Although analysis of the context of the above code could - + prove that @samp{b} is never null when it is executed, - + the division-by-zero warning is still useful, because - + @code{gcc} generates code to do the division by zero at - + run time so as to generate a run-time fault, - + and tidy programmers will want to find ways to prevent - + this needless code from being generated. - + - + Note that @code{gcc} transforms expressions so as to find - + opportunities for performing expensive operations - + (such as division) at compile time instead of generating - + code to perform them at run time. - + For example, @code{gcc} transforms: - + - + @smallexample - + 2 / (i == 0) - + @end smallexample - + - + into: - + - + @smallexample - + (i == 0) ? (2 / 1) : (2 / 0) - + @end smallexample - + - + As a result, the division-by-zero warning might occur - + in contexts where the divisor seems to be a non-constant. - + It is useful in this case as well, because programmers might want - + to clean up the code so the compiled code does not include - + dead code to divide by zero. - + - @cindex @code{longjmp} warnings - @item - *************** and usually makes programs run more slow - *** 1941,1944 **** - --- 1989,2037 ---- - implies @samp{-fstrength-reduce} as well as @samp{-frerun-cse-after-loop}. - - + @item -fmove-all-movables - + Forces all invariant computations in loops to be moved - + outside the loop. - + This option is provided primarily to improve performance - + for some Fortran code, though it might improve code written - + in other languages. - + - + @emph{Note:} When compiling programs written in Fortran, - + this option is enabled by default. - + - + Analysis of Fortran code optimization and the resulting - + optimizations triggered by this option, and the - + @samp{-freduce-all-givs} and @samp{-frerun-loop-opt} - + options as well, were - + contributed by Toon Moene (@code{toon@@moene.indiv.nluug.nl}). - + - + These three options are intended to be removed someday, once - + they have helped determine the efficacy of various - + approaches to improving the performance of Fortran code. - + - + Please let us (@code{fortran@@gnu.ai.mit.edu}) - + know how use of these options affects - + the performance of your production code. - + We're very interested in code that runs @emph{slower} - + when these options are @emph{enabled}. - + - + @item -freduce-all-givs - + Forces all general-induction variables in loops to be - + strength-reduced. - + This option is provided primarily to improve performance - + for some Fortran code, though it might improve code written - + in other languages. - + - + @emph{Note:} When compiling programs written in Fortran, - + this option is enabled by default. - + - + @item -frerun-loop-opt - + Runs loop optimizations a second time. - + This option is provided primarily to improve performance - + for some Fortran code, though it might improve code written - + in other languages. - + - + @emph{Note:} When compiling programs written in Fortran, - + this option is enabled by default. - + - @item -fno-peephole - Disable any machine-specific peephole optimizations. - *************** not want to use this option, since it ma - *** 4212,4215 **** - --- 4305,4315 ---- - the offsets of structure members won't agree with system libraries. - - + @item -fstack-check - + Generate code to verify that you do not go beyond the boundary of the - + stack. You should specify this flag if you are running in an - + environment with multiple threads, but only rarely need to specify it in - + a single-threaded environment since stack overflow is automatically - + detected on nearly all systems if there is only one stack. - + - @item +e0 - @itemx +e1 - *************** compilation). - *** 4229,4232 **** - --- 4329,4404 ---- - With @samp{+e1}, G++ actually generates the code implementing virtual - functions defined in the code, and makes them publicly visible. - + - + @cindex aliasing of parameters - + @cindex parameters, aliased - + @item -fargument-alias - + @item -fargument-noalias - + @item -fargument-noalias-global - + Specify the possible relationships among parameters and between - + parameters and global data. - + - + @samp{-fargument-alias} specifies that arguments (parameters) may - + alias each other and may alias global storage. - + @samp{-fargument-noalias} specifies that arguments do not alias - + each other, but may alias global storage. - + @samp{-fargument-noalias-global} specifies that arguments do not - + alias each other and do not alias global storage. - + - + For code written in C, C++, and Objective-C, @samp{-fargument-alias} - + is the default. - + For code written in Fortran, @samp{-fargument-noalias-global} is - + the default, though this is pertinent only on systems where - + @code{g77} is installed. - + (See the documentation for other compilers for information on the - + defaults for their respective languages.) - + - + Normally, @code{gcc} assumes that a write through a pointer - + passed as a parameter to the current function might modify a - + value pointed to by another pointer passed as a parameter, or - + in global storage. - + - + For example, consider this code: - + - + @example - + void x(int *i, int *j) - + @{ - + extern int k; - + - + ++*i; - + ++*j; - + ++k; - + @} - + @end example - + - + When compiling the above function, @code{gcc} assumes that @samp{i} might - + be a pointer to the same variable as @samp{j}, and that either @samp{i}, - + @samp{j}, or both might be a pointer to @samp{k}. - + - + Therefore, @code{gcc} does not assume it can generate code to read - + @samp{*i}, @samp{*j}, and @samp{k} into separate registers, increment - + each register, then write the incremented values back out. - + - + Instead, @code{gcc} must generate code that reads @samp{*i}, - + increments it, and writes it back before reading @samp{*j}, - + in case @samp{i} and @samp{j} are aliased, and, similarly, - + that writes @samp{*j} before reading @samp{k}. - + The result is code that, on many systems, takes longer to execute, - + due to the way many processors schedule instruction execution. - + - + Compiling the above code with the @samp{-fargument-noalias} option - + allows @code{gcc} to assume that @samp{i} and @samp{j} do not alias - + each other, but either might alias @samp{k}. - + - + Compiling the above code with the @samp{-fargument-noalias-global} - + option allows @code{gcc} to assume that no combination of @samp{i}, - + @samp{j}, and @samp{k} are aliases for each other. - + - + @emph{Note:} Use the @samp{-fargument-noalias} and - + @samp{-fargument-noalias-global} options with care. - + While they can result in faster executables, they can - + also result in executables with subtle bugs, bugs that - + show up only when compiled for specific target systems, - + or bugs that show up only when compiled by specific versions - + of @code{g77}. - @end table - - diff -rcp2N gcc-2.7.2.3/libgcc2.c gcc-2.7.2.3.f.2/libgcc2.c - *** gcc-2.7.2.3/libgcc2.c Sun Nov 26 19:39:21 1995 - --- gcc-2.7.2.3.f.2/libgcc2.c Tue Sep 9 07:01:36 1997 - *************** __gcc_bcmp (s1, s2, size) - *** 1193,1196 **** - --- 1193,1201 ---- - #endif - - + #ifdef L__dummy - + void - + __dummy () {} - + #endif - + - #ifdef L_varargs - #ifdef __i860__ - diff -rcp2N gcc-2.7.2.3/local-alloc.c gcc-2.7.2.3.f.2/local-alloc.c - *** gcc-2.7.2.3/local-alloc.c Mon Aug 21 17:15:44 1995 - --- gcc-2.7.2.3.f.2/local-alloc.c Tue Sep 9 07:01:37 1997 - *************** static int this_insn_number; - *** 243,246 **** - --- 243,250 ---- - static rtx this_insn; - - + /* Used to communicate changes made by update_equiv_regs to - + memref_referenced_p. */ - + static rtx *reg_equiv_replacement; - + - static void alloc_qty PROTO((int, enum machine_mode, int, int)); - static void alloc_qty_for_scratch PROTO((rtx, int, rtx, int, int)); - *************** validate_equiv_mem_from_store (dest, set - *** 545,549 **** - && reg_overlap_mentioned_p (dest, equiv_mem)) - || (GET_CODE (dest) == MEM - ! && true_dependence (dest, equiv_mem))) - equiv_mem_modified = 1; - } - --- 549,553 ---- - && reg_overlap_mentioned_p (dest, equiv_mem)) - || (GET_CODE (dest) == MEM - ! && true_dependence (dest, VOIDmode, equiv_mem, rtx_varies_p))) - equiv_mem_modified = 1; - } - *************** memref_referenced_p (memref, x) - *** 617,621 **** - switch (code) - { - - case REG: - case CONST_INT: - case CONST: - --- 621,624 ---- - *************** memref_referenced_p (memref, x) - *** 629,634 **** - return 0; - - case MEM: - ! if (true_dependence (memref, x)) - return 1; - break; - --- 632,642 ---- - return 0; - - + case REG: - + return (reg_equiv_replacement[REGNO (x)] == 0 - + || memref_referenced_p (memref, - + reg_equiv_replacement[REGNO (x)])); - + - case MEM: - ! if (true_dependence (memref, VOIDmode, x, rtx_varies_p)) - return 1; - break; - *************** optimize_reg_copy_1 (insn, dest, src) - *** 818,827 **** - if (sregno >= FIRST_PSEUDO_REGISTER) - { - ! reg_live_length[sregno] -= length; - ! /* reg_live_length is only an approximation after combine - ! if sched is not run, so make sure that we still have - ! a reasonable value. */ - ! if (reg_live_length[sregno] < 2) - ! reg_live_length[sregno] = 2; - reg_n_calls_crossed[sregno] -= n_calls; - } - --- 826,839 ---- - if (sregno >= FIRST_PSEUDO_REGISTER) - { - ! if (reg_live_length[sregno] >= 0) - ! { - ! reg_live_length[sregno] -= length; - ! /* reg_live_length is only an approximation after - ! combine if sched is not run, so make sure that we - ! still have a reasonable value. */ - ! if (reg_live_length[sregno] < 2) - ! reg_live_length[sregno] = 2; - ! } - ! - reg_n_calls_crossed[sregno] -= n_calls; - } - *************** optimize_reg_copy_1 (insn, dest, src) - *** 829,833 **** - if (dregno >= FIRST_PSEUDO_REGISTER) - { - ! reg_live_length[dregno] += d_length; - reg_n_calls_crossed[dregno] += d_n_calls; - } - --- 841,847 ---- - if (dregno >= FIRST_PSEUDO_REGISTER) - { - ! if (reg_live_length[dregno] >= 0) - ! reg_live_length[dregno] += d_length; - ! - reg_n_calls_crossed[dregno] += d_n_calls; - } - *************** update_equiv_regs () - *** 948,953 **** - { - rtx *reg_equiv_init_insn = (rtx *) alloca (max_regno * sizeof (rtx *)); - - rtx *reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx *)); - rtx insn; - - bzero ((char *) reg_equiv_init_insn, max_regno * sizeof (rtx *)); - --- 962,968 ---- - { - rtx *reg_equiv_init_insn = (rtx *) alloca (max_regno * sizeof (rtx *)); - rtx insn; - + - + reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx *)); - - bzero ((char *) reg_equiv_init_insn, max_regno * sizeof (rtx *)); - diff -rcp2N gcc-2.7.2.3/loop.c gcc-2.7.2.3.f.2/loop.c - *** gcc-2.7.2.3/loop.c Sat Jun 29 16:26:59 1996 - --- gcc-2.7.2.3.f.2/loop.c Tue Sep 9 07:01:37 1997 - *************** int *loop_number_exit_count; - *** 111,116 **** - unsigned HOST_WIDE_INT loop_n_iterations; - - ! /* Nonzero if there is a subroutine call in the current loop. - ! (unknown_address_altered is also nonzero in this case.) */ - - static int loop_has_call; - --- 111,115 ---- - unsigned HOST_WIDE_INT loop_n_iterations; - - ! /* Nonzero if there is a subroutine call in the current loop. */ - - static int loop_has_call; - *************** static char *moved_once; - *** 160,164 **** - here, we just turn on unknown_address_altered. */ - - ! #define NUM_STORES 20 - static rtx loop_store_mems[NUM_STORES]; - - --- 159,163 ---- - here, we just turn on unknown_address_altered. */ - - ! #define NUM_STORES 30 - static rtx loop_store_mems[NUM_STORES]; - - *************** scan_loop (loop_start, end, nregs) - *** 669,673 **** - { - temp = find_reg_note (p, REG_EQUAL, NULL_RTX); - ! if (temp && CONSTANT_P (XEXP (temp, 0))) - src = XEXP (temp, 0), move_insn = 1; - if (temp && find_reg_note (p, REG_RETVAL, NULL_RTX)) - --- 668,673 ---- - { - temp = find_reg_note (p, REG_EQUAL, NULL_RTX); - ! if (temp && CONSTANT_P (XEXP (temp, 0)) - ! && LEGITIMATE_CONSTANT_P (XEXP (temp, 0))) - src = XEXP (temp, 0), move_insn = 1; - if (temp && find_reg_note (p, REG_RETVAL, NULL_RTX)) - *************** move_movables (movables, threshold, insn - *** 1629,1632 **** - --- 1629,1633 ---- - - if (already_moved[regno] - + || flag_move_all_movables - || (threshold * savings * m->lifetime) >= insn_count - || (m->forces && m->forces->done - *************** prescan_loop (start, end) - *** 2199,2203 **** - else if (GET_CODE (insn) == CALL_INSN) - { - ! unknown_address_altered = 1; - loop_has_call = 1; - } - --- 2200,2205 ---- - else if (GET_CODE (insn) == CALL_INSN) - { - ! if (! CONST_CALL_P (insn)) - ! unknown_address_altered = 1; - loop_has_call = 1; - } - *************** invariant_p (x) - *** 2777,2781 **** - /* See if there is any dependence between a store and this load. */ - for (i = loop_store_mems_idx - 1; i >= 0; i--) - ! if (true_dependence (loop_store_mems[i], x)) - return 0; - - --- 2779,2783 ---- - /* See if there is any dependence between a store and this load. */ - for (i = loop_store_mems_idx - 1; i >= 0; i--) - ! if (true_dependence (loop_store_mems[i], VOIDmode, x, rtx_varies_p)) - return 0; - - *************** strength_reduce (scan_start, end, loop_t - *** 3821,3826 **** - exit. */ - - ! if (v->lifetime * threshold * benefit < insn_count - ! && ! bl->reversed) - { - if (loop_dump_stream) - --- 3823,3828 ---- - exit. */ - - ! if ( ! flag_reduce_all_givs && v->lifetime * threshold * benefit < insn_count - ! && ! bl->reversed ) - { - if (loop_dump_stream) - *************** record_giv (v, insn, src_reg, dest_reg, - *** 4375,4378 **** - --- 4377,4382 ---- - v->final_value = 0; - v->same_insn = 0; - + v->unrolled = 0; - + v->shared = 0; - - /* The v->always_computable field is used in update_giv_derive, to - *************** check_final_value (v, loop_start, loop_e - *** 4652,4657 **** - if (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) - && LABEL_NAME (JUMP_LABEL (p)) - ! && ((INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (v->insn) - ! && INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (loop_start)) - || (INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (last_giv_use) - && INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (loop_end)))) - --- 4656,4664 ---- - if (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) - && LABEL_NAME (JUMP_LABEL (p)) - ! && ((INSN_UID (JUMP_LABEL (p)) >= max_uid_for_loop) - ! || (INSN_UID (v->insn) >= max_uid_for_loop) - ! || (INSN_UID (last_giv_use) >= max_uid_for_loop) - ! || (INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (v->insn) - ! && INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (loop_start)) - || (INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (last_giv_use) - && INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (loop_end)))) - *************** emit_iv_add_mult (b, m, a, reg, insert_b - *** 5560,5563 **** - --- 5567,5572 ---- - - emit_insn_before (seq, insert_before); - + - + record_base_value (REGNO (reg), b); - } - - diff -rcp2N gcc-2.7.2.3/loop.h gcc-2.7.2.3.f.2/loop.h - *** gcc-2.7.2.3/loop.h Fri Jul 14 12:23:28 1995 - --- gcc-2.7.2.3.f.2/loop.h Tue Sep 9 07:01:38 1997 - *************** struct induction - *** 89,92 **** - --- 89,95 ---- - we won't use it to eliminate a biv, it - would probably lose. */ - + unsigned unrolled : 1; /* 1 if new register has been allocated in - + unrolled loop. */ - + unsigned shared : 1; - int lifetime; /* Length of life of this giv */ - int times_used; /* # times this giv is used. */ - diff -rcp2N gcc-2.7.2.3/md.texi gcc-2.7.2.3.f.2/md.texi - *** gcc-2.7.2.3/md.texi Sun Nov 26 19:05:33 1995 - --- gcc-2.7.2.3.f.2/md.texi Tue Sep 9 07:01:38 1997 - *************** Some machines require other operations s - *** 2334,2337 **** - --- 2334,2347 ---- - maintaining the back chain. Define this pattern to emit those - operations in addition to updating the stack pointer. - + - + @cindex @code{check_stack} instruction pattern - + @item @samp{check_stack} - + If stack checking cannot be done on your system by probing the stack with - + a load or store instruction (@pxref{Stack Checking}), define this pattern - + to perform the needed check and signaling an error if the stack - + has overflowed. The single operand is the location in the stack furthest - + from the current stack pointer that you need to validate. Normally, - + on machines where this pattern is needed, you would obtain the stack - + limit from a global or thread-specific variable or register. - @end table - - diff -rcp2N gcc-2.7.2.3/optabs.c gcc-2.7.2.3.f.2/optabs.c - *** gcc-2.7.2.3/optabs.c Sat Oct 21 22:16:13 1995 - --- gcc-2.7.2.3.f.2/optabs.c Tue Sep 9 07:01:39 1997 - *************** expand_fix (to, from, unsignedp) - *** 3878,3885 **** - } - - ! if (GET_MODE (to) == GET_MODE (target)) - ! emit_move_insn (to, target); - ! else - ! convert_move (to, target, 0); - } - - --- 3878,3888 ---- - } - - ! if (target != to) - ! { - ! if (GET_MODE (to) == GET_MODE (target)) - ! emit_move_insn (to, target); - ! else - ! convert_move (to, target, 0); - ! } - } - - diff -rcp2N gcc-2.7.2.3/real.c gcc-2.7.2.3.f.2/real.c - *** gcc-2.7.2.3/real.c Tue Aug 15 21:57:18 1995 - --- gcc-2.7.2.3.f.2/real.c Tue Sep 9 07:01:39 1997 - *************** make_nan (nan, sign, mode) - *** 5625,5633 **** - } - - ! /* Convert an SFmode target `float' value to a REAL_VALUE_TYPE. - ! This is the inverse of the function `etarsingle' invoked by - REAL_VALUE_TO_TARGET_SINGLE. */ - - REAL_VALUE_TYPE - ereal_from_float (f) - HOST_WIDE_INT f; - --- 5625,5699 ---- - } - - ! /* This is the inverse of the function `etarsingle' invoked by - REAL_VALUE_TO_TARGET_SINGLE. */ - - REAL_VALUE_TYPE - + ereal_unto_float (f) - + long f; - + { - + REAL_VALUE_TYPE r; - + unsigned EMUSHORT s[2]; - + unsigned EMUSHORT e[NE]; - + - + /* Convert 32 bit integer to array of 16 bit pieces in target machine order. - + This is the inverse operation to what the function `endian' does. */ - + if (REAL_WORDS_BIG_ENDIAN) - + { - + s[0] = (unsigned EMUSHORT) (f >> 16); - + s[1] = (unsigned EMUSHORT) f; - + } - + else - + { - + s[0] = (unsigned EMUSHORT) f; - + s[1] = (unsigned EMUSHORT) (f >> 16); - + } - + /* Convert and promote the target float to E-type. */ - + e24toe (s, e); - + /* Output E-type to REAL_VALUE_TYPE. */ - + PUT_REAL (e, &r); - + return r; - + } - + - + - + /* This is the inverse of the function `etardouble' invoked by - + REAL_VALUE_TO_TARGET_DOUBLE. */ - + - + REAL_VALUE_TYPE - + ereal_unto_double (d) - + long d[]; - + { - + REAL_VALUE_TYPE r; - + unsigned EMUSHORT s[4]; - + unsigned EMUSHORT e[NE]; - + - + /* Convert array of HOST_WIDE_INT to equivalent array of 16-bit pieces. */ - + if (REAL_WORDS_BIG_ENDIAN) - + { - + s[0] = (unsigned EMUSHORT) (d[0] >> 16); - + s[1] = (unsigned EMUSHORT) d[0]; - + s[2] = (unsigned EMUSHORT) (d[1] >> 16); - + s[3] = (unsigned EMUSHORT) d[1]; - + } - + else - + { - + /* Target float words are little-endian. */ - + s[0] = (unsigned EMUSHORT) d[0]; - + s[1] = (unsigned EMUSHORT) (d[0] >> 16); - + s[2] = (unsigned EMUSHORT) d[1]; - + s[3] = (unsigned EMUSHORT) (d[1] >> 16); - + } - + /* Convert target double to E-type. */ - + e53toe (s, e); - + /* Output E-type to REAL_VALUE_TYPE. */ - + PUT_REAL (e, &r); - + return r; - + } - + - + - + /* Convert an SFmode target `float' value to a REAL_VALUE_TYPE. - + This is somewhat like ereal_unto_float, but the input types - + for these are different. */ - + - + REAL_VALUE_TYPE - ereal_from_float (f) - HOST_WIDE_INT f; - *************** ereal_from_float (f) - *** 5658,5663 **** - - /* Convert a DFmode target `double' value to a REAL_VALUE_TYPE. - ! This is the inverse of the function `etardouble' invoked by - ! REAL_VALUE_TO_TARGET_DOUBLE. - - The DFmode is stored as an array of HOST_WIDE_INT in the target's - --- 5724,5729 ---- - - /* Convert a DFmode target `double' value to a REAL_VALUE_TYPE. - ! This is somewhat like ereal_unto_double, but the input types - ! for these are different. - - The DFmode is stored as an array of HOST_WIDE_INT in the target's - diff -rcp2N gcc-2.7.2.3/real.h gcc-2.7.2.3.f.2/real.h - *** gcc-2.7.2.3/real.h Thu Jun 15 11:57:56 1995 - --- gcc-2.7.2.3.f.2/real.h Tue Sep 9 07:01:39 1997 - *************** extern void ereal_to_decimal PROTO((REAL - *** 152,155 **** - --- 152,157 ---- - extern int ereal_cmp PROTO((REAL_VALUE_TYPE, REAL_VALUE_TYPE)); - extern int ereal_isneg PROTO((REAL_VALUE_TYPE)); - + extern REAL_VALUE_TYPE ereal_unto_float PROTO((long)); - + extern REAL_VALUE_TYPE ereal_unto_double PROTO((long *)); - extern REAL_VALUE_TYPE ereal_from_float PROTO((HOST_WIDE_INT)); - extern REAL_VALUE_TYPE ereal_from_double PROTO((HOST_WIDE_INT *)); - *************** extern REAL_VALUE_TYPE real_value_trunca - *** 197,200 **** - --- 199,208 ---- - /* IN is a REAL_VALUE_TYPE. OUT is a long. */ - #define REAL_VALUE_TO_TARGET_SINGLE(IN, OUT) ((OUT) = etarsingle ((IN))) - + - + /* Inverse of REAL_VALUE_TO_TARGET_DOUBLE. */ - + #define REAL_VALUE_UNTO_TARGET_DOUBLE(d) (ereal_unto_double (d)) - + - + /* Inverse of REAL_VALUE_TO_TARGET_SINGLE. */ - + #define REAL_VALUE_UNTO_TARGET_SINGLE(f) (ereal_unto_float (f)) - - /* d is an array of HOST_WIDE_INT that holds a double precision - diff -rcp2N gcc-2.7.2.3/recog.c gcc-2.7.2.3.f.2/recog.c - *** gcc-2.7.2.3/recog.c Sat Jul 1 10:52:35 1995 - --- gcc-2.7.2.3.f.2/recog.c Tue Sep 9 07:01:40 1997 - *************** register_operand (op, mode) - *** 872,876 **** - REGNO (SUBREG_REG (op))) - && (GET_MODE_SIZE (mode) - ! != GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))))) - return 0; - #endif - --- 872,878 ---- - REGNO (SUBREG_REG (op))) - && (GET_MODE_SIZE (mode) - ! != GET_MODE_SIZE (GET_MODE (SUBREG_REG (op)))) - ! && GET_MODE_CLASS (GET_MODE (SUBREG_REG (op))) != MODE_COMPLEX_INT - ! && GET_MODE_CLASS (GET_MODE (SUBREG_REG (op))) != MODE_COMPLEX_FLOAT) - return 0; - #endif - diff -rcp2N gcc-2.7.2.3/reg-stack.c gcc-2.7.2.3.f.2/reg-stack.c - *** gcc-2.7.2.3/reg-stack.c Thu Jun 15 21:36:05 1995 - --- gcc-2.7.2.3.f.2/reg-stack.c Sun Mar 1 05:16:06 1998 - *************** extern rtx emit_label_after (); - *** 241,245 **** - - static void find_blocks (); - - static uses_reg_or_mem (); - static void stack_reg_life_analysis (); - static void record_reg_life_pat (); - --- 241,244 ---- - *************** find_blocks (first) - *** 1326,1353 **** - rtx x; - - ! if (GET_CODE (pat) == PARALLEL) - ! { - ! int len = XVECLEN (pat, 0); - ! int has_use_labelref = 0; - ! int i; - ! - ! for (i = len - 1; i >= 0; i--) - ! if (GET_CODE (XVECEXP (pat, 0, i)) == USE - ! && GET_CODE (XEXP (XVECEXP (pat, 0, i), 0)) == LABEL_REF) - ! has_use_labelref = 1; - ! - ! if (! has_use_labelref) - ! for (i = len - 1; i >= 0; i--) - ! if (GET_CODE (XVECEXP (pat, 0, i)) == SET - ! && SET_DEST (XVECEXP (pat, 0, i)) == pc_rtx - ! && uses_reg_or_mem (SET_SRC (XVECEXP (pat, 0, i)))) - ! computed_jump = 1; - ! } - ! else if (GET_CODE (pat) == SET - ! && SET_DEST (pat) == pc_rtx - ! && uses_reg_or_mem (SET_SRC (pat))) - ! computed_jump = 1; - ! - ! if (computed_jump) - { - for (x = label_value_list; x; x = XEXP (x, 1)) - --- 1325,1329 ---- - rtx x; - - ! if (computed_jump_p (insn)) - { - for (x = label_value_list; x; x = XEXP (x, 1)) - *************** find_blocks (first) - *** 1367,1402 **** - } - - - /* Return 1 if X contain a REG or MEM that is not in the constant pool. */ - - - - static int - - uses_reg_or_mem (x) - - rtx x; - - { - - enum rtx_code code = GET_CODE (x); - - int i, j; - - char *fmt; - - - - if (code == REG - - || (code == MEM - - && ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF - - && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0))))) - - return 1; - - - - fmt = GET_RTX_FORMAT (code); - - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - - { - - if (fmt[i] == 'e' - - && uses_reg_or_mem (XEXP (x, i))) - - return 1; - - - - if (fmt[i] == 'E') - - for (j = 0; j < XVECLEN (x, i); j++) - - if (uses_reg_or_mem (XVECEXP (x, i, j))) - - return 1; - - } - - - - return 0; - - } - - - /* If current function returns its result in an fp stack register, - return the REG. Otherwise, return 0. */ - --- 1343,1346 ---- - *************** stack_reg_life_analysis (first, stackent - *** 1547,1550 **** - --- 1491,1495 ---- - block = jump_block; - must_restart = 1; - + break; - - win: - diff -rcp2N gcc-2.7.2.3/reload.c gcc-2.7.2.3.f.2/reload.c - *** gcc-2.7.2.3/reload.c Sat Nov 11 13:23:54 1995 - --- gcc-2.7.2.3.f.2/reload.c Tue Sep 9 07:01:41 1997 - *************** - *** 1,4 **** - /* Search an insn for pseudo regs that must be in hard regs and are not. - ! Copyright (C) 1987, 88, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. - - This file is part of GNU CC. - --- 1,4 ---- - /* Search an insn for pseudo regs that must be in hard regs and are not. - ! Copyright (C) 1987, 88, 89, 92-5, 1996 Free Software Foundation, Inc. - - This file is part of GNU CC. - *************** static int push_secondary_reload PROTO(( - *** 292,295 **** - --- 292,296 ---- - enum machine_mode, enum reload_type, - enum insn_code *)); - + static enum reg_class find_valid_class PROTO((enum machine_mode, int)); - static int push_reload PROTO((rtx, rtx, rtx *, rtx *, enum reg_class, - enum machine_mode, enum machine_mode, - *************** static struct decomposition decompose PR - *** 305,312 **** - static int immune_p PROTO((rtx, rtx, struct decomposition)); - static int alternative_allows_memconst PROTO((char *, int)); - ! static rtx find_reloads_toplev PROTO((rtx, int, enum reload_type, int, int)); - static rtx make_memloc PROTO((rtx, int)); - static int find_reloads_address PROTO((enum machine_mode, rtx *, rtx, rtx *, - ! int, enum reload_type, int)); - static rtx subst_reg_equivs PROTO((rtx)); - static rtx subst_indexed_address PROTO((rtx)); - --- 306,313 ---- - static int immune_p PROTO((rtx, rtx, struct decomposition)); - static int alternative_allows_memconst PROTO((char *, int)); - ! static rtx find_reloads_toplev PROTO((rtx, int, enum reload_type, int, int, short *)); - static rtx make_memloc PROTO((rtx, int)); - static int find_reloads_address PROTO((enum machine_mode, rtx *, rtx, rtx *, - ! int, enum reload_type, int, short *)); - static rtx subst_reg_equivs PROTO((rtx)); - static rtx subst_indexed_address PROTO((rtx)); - *************** push_secondary_reload (in_p, x, opnum, o - *** 590,599 **** - - if (in_p && icode == CODE_FOR_nothing - ! && SECONDARY_MEMORY_NEEDED (class, reload_class, reload_mode)) - ! get_secondary_mem (x, reload_mode, opnum, type); - - if (! in_p && icode == CODE_FOR_nothing - ! && SECONDARY_MEMORY_NEEDED (reload_class, class, reload_mode)) - ! get_secondary_mem (x, reload_mode, opnum, type); - #endif - } - --- 591,600 ---- - - if (in_p && icode == CODE_FOR_nothing - ! && SECONDARY_MEMORY_NEEDED (class, reload_class, mode)) - ! get_secondary_mem (x, mode, opnum, type); - - if (! in_p && icode == CODE_FOR_nothing - ! && SECONDARY_MEMORY_NEEDED (reload_class, class, mode)) - ! get_secondary_mem (x, mode, opnum, type); - #endif - } - *************** get_secondary_mem (x, mode, opnum, type) - *** 673,677 **** - - find_reloads_address (mode, NULL_PTR, XEXP (loc, 0), &XEXP (loc, 0), - ! opnum, type, 0); - } - - --- 674,678 ---- - - find_reloads_address (mode, NULL_PTR, XEXP (loc, 0), &XEXP (loc, 0), - ! opnum, type, 0, NULL); - } - - *************** clear_secondary_mem () - *** 689,692 **** - --- 690,725 ---- - #endif /* SECONDARY_MEMORY_NEEDED */ - - + /* Find the largest class for which every register number plus N is valid in - + M1 (if in range). Abort if no such class exists. */ - + - + static enum reg_class - + find_valid_class (m1, n) - + enum machine_mode m1; - + int n; - + { - + int class; - + int regno; - + enum reg_class best_class; - + int best_size = 0; - + - + for (class = 1; class < N_REG_CLASSES; class++) - + { - + int bad = 0; - + for (regno = 0; regno < FIRST_PSEUDO_REGISTER && ! bad; regno++) - + if (TEST_HARD_REG_BIT (reg_class_contents[class], regno) - + && TEST_HARD_REG_BIT (reg_class_contents[class], regno + n) - + && ! HARD_REGNO_MODE_OK (regno + n, m1)) - + bad = 1; - + - + if (! bad && reg_class_size[class] > best_size) - + best_class = class, best_size = reg_class_size[class]; - + } - + - + if (best_size == 0) - + abort (); - + - + return best_class; - + } - + - /* Record one reload that needs to be performed. - IN is an rtx saying where the data are to be found before this instruction. - *************** push_reload (in, out, inloc, outloc, cla - *** 894,898 **** - && GET_CODE (SUBREG_REG (in)) == REG - && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER - ! && (! HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (in)), inmode) - || (GET_MODE_SIZE (inmode) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - --- 927,932 ---- - && GET_CODE (SUBREG_REG (in)) == REG - && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER - ! && (! HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (in)) + SUBREG_WORD (in), - ! inmode) - || (GET_MODE_SIZE (inmode) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - *************** push_reload (in, out, inloc, outloc, cla - *** 909,913 **** - output before the outer reload. */ - push_reload (SUBREG_REG (in), NULL_RTX, &SUBREG_REG (in), NULL_PTR, - ! GENERAL_REGS, VOIDmode, VOIDmode, 0, 0, opnum, type); - dont_remove_subreg = 1; - } - --- 943,948 ---- - output before the outer reload. */ - push_reload (SUBREG_REG (in), NULL_RTX, &SUBREG_REG (in), NULL_PTR, - ! find_valid_class (inmode, SUBREG_WORD (in)), - ! VOIDmode, VOIDmode, 0, 0, opnum, type); - dont_remove_subreg = 1; - } - *************** push_reload (in, out, inloc, outloc, cla - *** 982,986 **** - && GET_CODE (SUBREG_REG (out)) == REG - && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER - ! && (! HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (out)), outmode) - || (GET_MODE_SIZE (outmode) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - --- 1017,1022 ---- - && GET_CODE (SUBREG_REG (out)) == REG - && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER - ! && (! HARD_REGNO_MODE_OK (REGNO (SUBREG_REG (out)) + SUBREG_WORD (out), - ! outmode) - || (GET_MODE_SIZE (outmode) <= UNITS_PER_WORD - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - *************** push_reload (in, out, inloc, outloc, cla - *** 998,1002 **** - dont_remove_subreg = 1; - push_reload (SUBREG_REG (out), SUBREG_REG (out), &SUBREG_REG (out), - ! &SUBREG_REG (out), ALL_REGS, VOIDmode, VOIDmode, 0, 0, - opnum, RELOAD_OTHER); - } - --- 1034,1040 ---- - dont_remove_subreg = 1; - push_reload (SUBREG_REG (out), SUBREG_REG (out), &SUBREG_REG (out), - ! &SUBREG_REG (out), - ! find_valid_class (outmode, SUBREG_WORD (out)), - ! VOIDmode, VOIDmode, 0, 0, - opnum, RELOAD_OTHER); - } - *************** find_reloads (insn, replace, ind_levels, - *** 2241,2244 **** - --- 2279,2283 ---- - int goal_earlyclobber, this_earlyclobber; - enum machine_mode operand_mode[MAX_RECOG_OPERANDS]; - + short force_update[MAX_RECOG_OPERANDS]; - - this_insn = insn; - *************** find_reloads (insn, replace, ind_levels, - *** 2272,2275 **** - --- 2311,2316 ---- - #endif - - + bzero ((char *) force_update, sizeof force_update); - + - /* Find what kind of insn this is. NOPERANDS gets number of operands. - Make OPERANDS point to a vector of operand values. - *************** find_reloads (insn, replace, ind_levels, - *** 2469,2473 **** - find_reloads_address (VOIDmode, NULL_PTR, - recog_operand[i], recog_operand_loc[i], - ! i, operand_type[i], ind_levels); - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - } - --- 2510,2515 ---- - find_reloads_address (VOIDmode, NULL_PTR, - recog_operand[i], recog_operand_loc[i], - ! i, operand_type[i], ind_levels, - ! &force_update[i]); - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - } - *************** find_reloads (insn, replace, ind_levels, - *** 2478,2482 **** - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, address_type[i], ind_levels)) - address_reloaded[i] = 1; - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - --- 2520,2525 ---- - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, address_type[i], ind_levels, - ! &force_update[i])) - address_reloaded[i] = 1; - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - *************** find_reloads (insn, replace, ind_levels, - *** 2487,2491 **** - ind_levels, - set != 0 - ! && &SET_DEST (set) == recog_operand_loc[i]); - else if (code == PLUS) - /* We can get a PLUS as an "operand" as a result of - --- 2530,2535 ---- - ind_levels, - set != 0 - ! && &SET_DEST (set) == recog_operand_loc[i], - ! &force_update[i]); - else if (code == PLUS) - /* We can get a PLUS as an "operand" as a result of - *************** find_reloads (insn, replace, ind_levels, - *** 2493,2497 **** - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i] - = find_reloads_toplev (recog_operand[i], i, address_type[i], - ! ind_levels, 0); - else if (code == REG) - { - --- 2537,2541 ---- - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i] - = find_reloads_toplev (recog_operand[i], i, address_type[i], - ! ind_levels, 0, &force_update[i]); - else if (code == REG) - { - *************** find_reloads (insn, replace, ind_levels, - *** 2505,2510 **** - if (reg_equiv_constant[regno] != 0 - && (set == 0 || &SET_DEST (set) != recog_operand_loc[i])) - ! substed_operand[i] = recog_operand[i] - ! = reg_equiv_constant[regno]; - #if 0 /* This might screw code in reload1.c to delete prior output-reload - that feeds this insn. */ - --- 2549,2557 ---- - if (reg_equiv_constant[regno] != 0 - && (set == 0 || &SET_DEST (set) != recog_operand_loc[i])) - ! { - ! substed_operand[i] = recog_operand[i] - ! = reg_equiv_constant[regno]; - ! force_update[i] = 1; - ! } - #if 0 /* This might screw code in reload1.c to delete prior output-reload - that feeds this insn. */ - *************** find_reloads (insn, replace, ind_levels, - *** 2545,2549 **** - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, address_type[i], ind_levels); - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - } - --- 2592,2597 ---- - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, address_type[i], ind_levels, - ! &force_update[i]); - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; - } - *************** find_reloads (insn, replace, ind_levels, - *** 3415,3419 **** - = find_reloads_toplev (force_const_mem (operand_mode[i], - recog_operand[i]), - ! i, address_type[i], ind_levels, 0); - if (alternative_allows_memconst (constraints1[i], - goal_alternative_number)) - --- 3463,3467 ---- - = find_reloads_toplev (force_const_mem (operand_mode[i], - recog_operand[i]), - ! i, address_type[i], ind_levels, 0, NULL); - if (alternative_allows_memconst (constraints1[i], - goal_alternative_number)) - *************** find_reloads (insn, replace, ind_levels, - *** 3595,3604 **** - Don't do this if we aren't making replacements because we might be - propagating things allocated by frame pointer elimination into places - ! it doesn't expect. */ - - ! if (insn_code_number >= 0 && replace) - for (i = insn_n_dups[insn_code_number] - 1; i >= 0; i--) - { - int opno = recog_dup_num[i]; - *recog_dup_loc[i] = *recog_operand_loc[opno]; - if (operand_reloadnum[opno] >= 0) - --- 3643,3657 ---- - Don't do this if we aren't making replacements because we might be - propagating things allocated by frame pointer elimination into places - ! it doesn't expect. However, always do it for replaces of pseudos - ! by constants. */ - - ! if (insn_code_number >= 0) - for (i = insn_n_dups[insn_code_number] - 1; i >= 0; i--) - { - int opno = recog_dup_num[i]; - + - + if (! replace && ! force_update[opno]) - + continue; - + - *recog_dup_loc[i] = *recog_operand_loc[opno]; - if (operand_reloadnum[opno] >= 0) - *************** find_reloads (insn, replace, ind_levels, - *** 3829,3832 **** - --- 3882,3886 ---- - register RTX_CODE code = GET_CODE (recog_operand[i]); - int is_set_dest = GET_CODE (body) == SET && (i == 0); - + short ign; - - if (insn_code_number >= 0) - *************** find_reloads (insn, replace, ind_levels, - *** 3834,3838 **** - find_reloads_address (VOIDmode, NULL_PTR, - recog_operand[i], recog_operand_loc[i], - ! i, RELOAD_FOR_INPUT, ind_levels); - - /* In these cases, we can't tell if the operand is an input - --- 3888,3892 ---- - find_reloads_address (VOIDmode, NULL_PTR, - recog_operand[i], recog_operand_loc[i], - ! i, RELOAD_FOR_INPUT, ind_levels, &ign); - - /* In these cases, we can't tell if the operand is an input - *************** find_reloads (insn, replace, ind_levels, - *** 3845,3853 **** - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, RELOAD_OTHER, ind_levels); - if (code == SUBREG) - recog_operand[i] = *recog_operand_loc[i] - = find_reloads_toplev (recog_operand[i], i, RELOAD_OTHER, - ! ind_levels, is_set_dest); - if (code == REG) - { - --- 3899,3907 ---- - XEXP (recog_operand[i], 0), - &XEXP (recog_operand[i], 0), - ! i, RELOAD_OTHER, ind_levels, &ign); - if (code == SUBREG) - recog_operand[i] = *recog_operand_loc[i] - = find_reloads_toplev (recog_operand[i], i, RELOAD_OTHER, - ! ind_levels, is_set_dest, &ign); - if (code == REG) - { - *************** alternative_allows_memconst (constraint, - *** 3908,3915 **** - - IS_SET_DEST is true if X is the destination of a SET, which is not - ! appropriate to be replaced by a constant. */ - - static rtx - ! find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest) - rtx x; - int opnum; - --- 3962,3972 ---- - - IS_SET_DEST is true if X is the destination of a SET, which is not - ! appropriate to be replaced by a constant. - ! - ! FORCE_UPDATE, if non-NULL, is the address of a SHORT that is set to - ! 1 if X is replaced with something based on reg_equiv_constant. */ - - static rtx - ! find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, force_update) - rtx x; - int opnum; - *************** find_reloads_toplev (x, opnum, type, ind - *** 3917,3920 **** - --- 3974,3978 ---- - int ind_levels; - int is_set_dest; - + short *force_update; - { - register RTX_CODE code = GET_CODE (x); - *************** find_reloads_toplev (x, opnum, type, ind - *** 3928,3932 **** - register int regno = REGNO (x); - if (reg_equiv_constant[regno] != 0 && !is_set_dest) - ! x = reg_equiv_constant[regno]; - #if 0 - /* This creates (subreg (mem...)) which would cause an unnecessary - --- 3986,3996 ---- - register int regno = REGNO (x); - if (reg_equiv_constant[regno] != 0 && !is_set_dest) - ! { - ! x = reg_equiv_constant[regno]; - ! if (force_update) - ! *force_update = 1; - ! else - ! abort (); /* Learn why this happens. */ - ! } - #if 0 - /* This creates (subreg (mem...)) which would cause an unnecessary - *************** find_reloads_toplev (x, opnum, type, ind - *** 3951,3955 **** - find_reloads_address (GET_MODE (x), NULL_PTR, - XEXP (x, 0), - ! &XEXP (x, 0), opnum, type, ind_levels); - } - return x; - --- 4015,4020 ---- - find_reloads_address (GET_MODE (x), NULL_PTR, - XEXP (x, 0), - ! &XEXP (x, 0), opnum, type, ind_levels, - ! force_update); - } - return x; - *************** find_reloads_toplev (x, opnum, type, ind - *** 3959,3963 **** - rtx tem = x; - find_reloads_address (GET_MODE (x), &tem, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels); - return tem; - } - --- 4024,4028 ---- - rtx tem = x; - find_reloads_address (GET_MODE (x), &tem, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels, force_update); - return tem; - } - *************** find_reloads_toplev (x, opnum, type, ind - *** 3982,3986 **** - && (tem = gen_lowpart_common (GET_MODE (x), - reg_equiv_constant[regno])) != 0) - ! return tem; - - if (GET_MODE_BITSIZE (GET_MODE (x)) == BITS_PER_WORD - --- 4047,4057 ---- - && (tem = gen_lowpart_common (GET_MODE (x), - reg_equiv_constant[regno])) != 0) - ! { - ! if (force_update) - ! *force_update = 1; - ! else - ! abort (); /* Learn why this happens. */ - ! return tem; - ! } - - if (GET_MODE_BITSIZE (GET_MODE (x)) == BITS_PER_WORD - *************** find_reloads_toplev (x, opnum, type, ind - *** 3990,3994 **** - SUBREG_WORD (x), 0, - GET_MODE (SUBREG_REG (x)))) != 0) - ! return tem; - - if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 - --- 4061,4071 ---- - SUBREG_WORD (x), 0, - GET_MODE (SUBREG_REG (x)))) != 0) - ! { - ! if (force_update) - ! *force_update = 1; - ! else - ! abort (); /* Learn why this happens. */ - ! return tem; - ! } - - if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 - *************** find_reloads_toplev (x, opnum, type, ind - *** 4040,4044 **** - find_reloads_address (GET_MODE (x), NULL_PTR, - XEXP (x, 0), - ! &XEXP (x, 0), opnum, type, ind_levels); - } - - --- 4117,4122 ---- - find_reloads_address (GET_MODE (x), NULL_PTR, - XEXP (x, 0), - ! &XEXP (x, 0), opnum, type, ind_levels, - ! force_update); - } - - *************** find_reloads_toplev (x, opnum, type, ind - *** 4049,4053 **** - if (fmt[i] == 'e') - XEXP (x, i) = find_reloads_toplev (XEXP (x, i), opnum, type, - ! ind_levels, is_set_dest); - } - return x; - --- 4127,4131 ---- - if (fmt[i] == 'e') - XEXP (x, i) = find_reloads_toplev (XEXP (x, i), opnum, type, - ! ind_levels, is_set_dest, NULL); - } - return x; - *************** make_memloc (ad, regno) - *** 4110,4114 **** - - static int - ! find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels) - enum machine_mode mode; - rtx *memrefloc; - --- 4188,4193 ---- - - static int - ! find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, - ! force_update) - enum machine_mode mode; - rtx *memrefloc; - *************** find_reloads_address (mode, memrefloc, a - *** 4118,4121 **** - --- 4197,4201 ---- - enum reload_type type; - int ind_levels; - + short *force_update; - { - register int regno; - *************** find_reloads_address (mode, memrefloc, a - *** 4134,4137 **** - --- 4214,4221 ---- - { - *loc = ad = reg_equiv_constant[regno]; - + if (force_update) - + *force_update = 1; - + else - + abort (); /* Learn why this happens. */ - return 1; - } - *************** find_reloads_address (mode, memrefloc, a - *** 4141,4145 **** - tem = make_memloc (ad, regno); - find_reloads_address (GET_MODE (tem), NULL_PTR, XEXP (tem, 0), - ! &XEXP (tem, 0), opnum, type, ind_levels); - push_reload (tem, NULL_RTX, loc, NULL_PTR, BASE_REG_CLASS, - GET_MODE (ad), VOIDmode, 0, 0, - --- 4225,4229 ---- - tem = make_memloc (ad, regno); - find_reloads_address (GET_MODE (tem), NULL_PTR, XEXP (tem, 0), - ! &XEXP (tem, 0), opnum, type, ind_levels, NULL); - push_reload (tem, NULL_RTX, loc, NULL_PTR, BASE_REG_CLASS, - GET_MODE (ad), VOIDmode, 0, 0, - *************** find_reloads_address (mode, memrefloc, a - *** 4214,4218 **** - tem = ad; - find_reloads_address (GET_MODE (ad), &tem, XEXP (ad, 0), &XEXP (ad, 0), - ! opnum, type, ind_levels == 0 ? 0 : ind_levels - 1); - - /* If tem was changed, then we must create a new memory reference to - --- 4298,4303 ---- - tem = ad; - find_reloads_address (GET_MODE (ad), &tem, XEXP (ad, 0), &XEXP (ad, 0), - ! opnum, type, ind_levels == 0 ? 0 : ind_levels - 1, - ! NULL); - - /* If tem was changed, then we must create a new memory reference to - *************** find_reloads_address_1 (x, context, loc, - *** 4722,4726 **** - /* First reload the memory location's address. */ - find_reloads_address (GET_MODE (tem), 0, XEXP (tem, 0), - ! &XEXP (tem, 0), opnum, type, ind_levels); - /* Put this inside a new increment-expression. */ - x = gen_rtx (GET_CODE (x), GET_MODE (x), tem); - --- 4807,4812 ---- - /* First reload the memory location's address. */ - find_reloads_address (GET_MODE (tem), 0, XEXP (tem, 0), - ! &XEXP (tem, 0), opnum, type, ind_levels, - ! NULL); - /* Put this inside a new increment-expression. */ - x = gen_rtx (GET_CODE (x), GET_MODE (x), tem); - *************** find_reloads_address_1 (x, context, loc, - *** 4788,4792 **** - find_reloads_address (GET_MODE (x), &XEXP (x, 0), - XEXP (XEXP (x, 0), 0), &XEXP (XEXP (x, 0), 0), - ! opnum, type, ind_levels); - - reloadnum = push_reload (x, NULL_RTX, loc, NULL_PTR, - --- 4874,4878 ---- - find_reloads_address (GET_MODE (x), &XEXP (x, 0), - XEXP (XEXP (x, 0), 0), &XEXP (XEXP (x, 0), 0), - ! opnum, type, ind_levels, NULL); - - reloadnum = push_reload (x, NULL_RTX, loc, NULL_PTR, - *************** find_reloads_address_1 (x, context, loc, - *** 4818,4822 **** - - find_reloads_address (GET_MODE (x), loc, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels); - push_reload (*loc, NULL_RTX, loc, NULL_PTR, - context ? INDEX_REG_CLASS : BASE_REG_CLASS, - --- 4904,4908 ---- - - find_reloads_address (GET_MODE (x), loc, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels, NULL); - push_reload (*loc, NULL_RTX, loc, NULL_PTR, - context ? INDEX_REG_CLASS : BASE_REG_CLASS, - *************** find_reloads_address_1 (x, context, loc, - *** 4852,4856 **** - x = make_memloc (x, regno); - find_reloads_address (GET_MODE (x), 0, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels); - } - - --- 4938,4942 ---- - x = make_memloc (x, regno); - find_reloads_address (GET_MODE (x), 0, XEXP (x, 0), &XEXP (x, 0), - ! opnum, type, ind_levels, NULL); - } - - *************** find_reloads_address_part (x, loc, class - *** 4965,4969 **** - rtx tem = x = force_const_mem (mode, x); - find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0), - ! opnum, type, ind_levels); - } - - --- 5051,5055 ---- - rtx tem = x = force_const_mem (mode, x); - find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0), - ! opnum, type, ind_levels, NULL); - } - - *************** find_reloads_address_part (x, loc, class - *** 4977,4981 **** - x = gen_rtx (PLUS, GET_MODE (x), XEXP (x, 0), tem); - find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0), - ! opnum, type, ind_levels); - } - - --- 5063,5067 ---- - x = gen_rtx (PLUS, GET_MODE (x), XEXP (x, 0), tem); - find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0), - ! opnum, type, ind_levels, NULL); - } - - *************** find_equiv_reg (goal, insn, class, other - *** 5518,5522 **** - and is also a register that appears in the address of GOAL. */ - - ! if (goal_mem && value == SET_DEST (PATTERN (where)) - && refers_to_regno_for_reload_p (valueno, - (valueno - --- 5604,5608 ---- - and is also a register that appears in the address of GOAL. */ - - ! if (goal_mem && value == SET_DEST (single_set (where)) - && refers_to_regno_for_reload_p (valueno, - (valueno - *************** debug_reload() - *** 5900,5904 **** - - if (reload_nocombine[r]) - ! fprintf (stderr, ", can combine", reload_nocombine[r]); - - if (reload_secondary_p[r]) - --- 5986,5990 ---- - - if (reload_nocombine[r]) - ! fprintf (stderr, ", can't combine %d", reload_nocombine[r]); - - if (reload_secondary_p[r]) - diff -rcp2N gcc-2.7.2.3/reload1.c gcc-2.7.2.3.f.2/reload1.c - *** gcc-2.7.2.3/reload1.c Sun Nov 5 16:22:22 1995 - --- gcc-2.7.2.3.f.2/reload1.c Tue Sep 9 07:01:42 1997 - *************** reload (first, global, dumpfile) - *** 542,546 **** - Also find all paradoxical subregs and find largest such for each pseudo. - On machines with small register classes, record hard registers that - ! are used for user variables. These can never be used for spills. */ - - for (insn = first; insn; insn = NEXT_INSN (insn)) - --- 542,548 ---- - Also find all paradoxical subregs and find largest such for each pseudo. - On machines with small register classes, record hard registers that - ! are used for user variables. These can never be used for spills. - ! Also look for a "constant" NOTE_INSN_SETJMP. This means that all - ! caller-saved registers must be marked live. */ - - for (insn = first; insn; insn = NEXT_INSN (insn)) - *************** reload (first, global, dumpfile) - *** 548,551 **** - --- 550,559 ---- - rtx set = single_set (insn); - - + if (GET_CODE (insn) == NOTE && CONST_CALL_P (insn) - + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP) - + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - + if (! call_used_regs[i]) - + regs_ever_live[i] = 1; - + - if (set != 0 && GET_CODE (SET_DEST (set)) == REG) - { - *************** reload (first, global, dumpfile) - *** 564,568 **** - if (GET_CODE (x) == MEM) - reg_equiv_memory_loc[i] = x; - ! else if (CONSTANT_P (x)) - { - if (LEGITIMATE_CONSTANT_P (x)) - --- 572,578 ---- - if (GET_CODE (x) == MEM) - reg_equiv_memory_loc[i] = x; - ! else if (CONSTANT_P (x) - ! && ! (GET_CODE (x) == CONST - ! && GET_CODE (XEXP (x, 0)) == MINUS)) - { - if (LEGITIMATE_CONSTANT_P (x)) - *************** reload (first, global, dumpfile) - *** 2013,2016 **** - --- 2023,2040 ---- - #endif - - + /* If we are doing stack checking, give a warning if this function's - + frame size is larger than we expect. */ - + if (flag_stack_check && ! STACK_CHECK_BUILTIN) - + { - + HOST_WIDE_INT size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE; - + - + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - + if (regs_ever_live[i] && ! fixed_regs[i] && call_used_regs[i]) - + size += UNITS_PER_WORD; - + - + if (size > STACK_CHECK_MAX_FRAME_SIZE) - + warning ("frame size too large for reliable stack checking"); - + } - + - /* Indicate that we no longer have known memory locations or constants. */ - reg_equiv_constant = 0; - *************** eliminate_regs (x, mem_mode, insn) - *** 2886,2890 **** - - /* Fall through to generic unary operation case. */ - - case USE: - case STRICT_LOW_PART: - case NEG: case NOT: - --- 2910,2913 ---- - *************** eliminate_regs (x, mem_mode, insn) - *** 2975,2978 **** - --- 2998,3014 ---- - return x; - - + case USE: - + /* If using a register that is the source of an eliminate we still - + think can be performed, note it cannot be performed since we don't - + know how this register is used. */ - + for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) - + if (ep->from_rtx == XEXP (x, 0)) - + ep->can_eliminate = 0; - + - + new = eliminate_regs (XEXP (x, 0), mem_mode, insn); - + if (new != XEXP (x, 0)) - + return gen_rtx (code, GET_MODE (x), new); - + return x; - + - case CLOBBER: - /* If clobbering a register that is the replacement register for an - *************** gen_reload (out, in, opnum, type) - *** 6736,6741 **** - --- 6772,6779 ---- - if (GET_CODE (in) == PLUS - && (GET_CODE (XEXP (in, 0)) == REG - + || GET_CODE (XEXP (in, 0)) == SUBREG - || GET_CODE (XEXP (in, 0)) == MEM) - && (GET_CODE (XEXP (in, 1)) == REG - + || GET_CODE (XEXP (in, 1)) == SUBREG - || CONSTANT_P (XEXP (in, 1)) - || GET_CODE (XEXP (in, 1)) == MEM)) - *************** gen_reload (out, in, opnum, type) - *** 6798,6807 **** - we emit below. */ - - ! if (CONSTANT_P (op1) || GET_CODE (op1) == MEM - || (GET_CODE (op1) == REG - && REGNO (op1) >= FIRST_PSEUDO_REGISTER)) - tem = op0, op0 = op1, op1 = tem; - - ! emit_insn (gen_move_insn (out, op0)); - - /* If OP0 and OP1 are the same, we can use OUT for OP1. - --- 6836,6845 ---- - we emit below. */ - - ! if (CONSTANT_P (op1) || GET_CODE (op1) == MEM || GET_CODE (op1) == SUBREG - || (GET_CODE (op1) == REG - && REGNO (op1) >= FIRST_PSEUDO_REGISTER)) - tem = op0, op0 = op1, op1 = tem; - - ! gen_reload (out, op0, opnum, type); - - /* If OP0 and OP1 are the same, we can use OUT for OP1. - *************** gen_reload (out, in, opnum, type) - *** 6831,6835 **** - delete_insns_since (last); - - ! emit_insn (gen_move_insn (out, op1)); - emit_insn (gen_add2_insn (out, op0)); - } - --- 6869,6873 ---- - delete_insns_since (last); - - ! gen_reload (out, op1, opnum, type); - emit_insn (gen_add2_insn (out, op0)); - } - *************** gen_reload (out, in, opnum, type) - *** 6852,6857 **** - in = gen_rtx (REG, GET_MODE (loc), REGNO (in)); - - ! emit_insn (gen_move_insn (loc, in)); - ! emit_insn (gen_move_insn (out, loc)); - } - #endif - --- 6890,6895 ---- - in = gen_rtx (REG, GET_MODE (loc), REGNO (in)); - - ! gen_reload (loc, in, opnum, type); - ! gen_reload (out, loc, opnum, type); - } - #endif - diff -rcp2N gcc-2.7.2.3/reorg.c gcc-2.7.2.3.f.2/reorg.c - *** gcc-2.7.2.3/reorg.c Fri Sep 15 21:38:55 1995 - --- gcc-2.7.2.3.f.2/reorg.c Tue Sep 9 07:01:43 1997 - *************** redundant_insn (insn, target, delay_list - *** 1961,1964 **** - --- 1961,1969 ---- - int i; - - + /* If INSN has any REG_UNUSED notes, it can't match anything since we - + are allowed to not actually assign to such a register. */ - + if (find_reg_note (insn, REG_UNUSED, NULL_RTX) != 0) - + return 0; - + - /* Scan backwards looking for a match. */ - for (trial = PREV_INSN (target); trial; trial = PREV_INSN (trial)) - *************** redundant_insn (insn, target, delay_list - *** 1999,2003 **** - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) - if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn) - ! && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat)) - break; - - --- 2004,2009 ---- - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) - if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn) - ! && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat) - ! && ! find_reg_note (XVECEXP (pat, 0, i), REG_UNUSED, NULL_RTX)) - break; - - *************** redundant_insn (insn, target, delay_list - *** 2007,2011 **** - } - - ! else if (GET_CODE (trial) == GET_CODE (insn) && rtx_equal_p (pat, ipat)) - break; - } - --- 2013,2018 ---- - } - - ! else if (GET_CODE (trial) == GET_CODE (insn) && rtx_equal_p (pat, ipat) - ! && ! find_reg_note (trial, REG_UNUSED, NULL_RTX)) - break; - } - diff -rcp2N gcc-2.7.2.3/rtl.c gcc-2.7.2.3.f.2/rtl.c - *** gcc-2.7.2.3/rtl.c Thu Jun 15 12:02:59 1995 - --- gcc-2.7.2.3.f.2/rtl.c Tue Sep 9 07:01:43 1997 - *************** char *reg_note_name[] = { "", "REG_DEAD" - *** 179,183 **** - "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED", - "REG_CC_SETTER", "REG_CC_USER", "REG_LABEL", - ! "REG_DEP_ANTI", "REG_DEP_OUTPUT" }; - - /* Allocate an rtx vector of N elements. - --- 179,183 ---- - "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED", - "REG_CC_SETTER", "REG_CC_USER", "REG_LABEL", - ! "REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_NOALIAS" }; - - /* Allocate an rtx vector of N elements. - diff -rcp2N gcc-2.7.2.3/rtl.h gcc-2.7.2.3.f.2/rtl.h - *** gcc-2.7.2.3/rtl.h Thu Jun 15 12:03:16 1995 - --- gcc-2.7.2.3.f.2/rtl.h Sun Mar 1 04:13:08 1998 - *************** enum reg_note { REG_DEAD = 1, REG_INC = - *** 349,353 **** - REG_NONNEG = 8, REG_NO_CONFLICT = 9, REG_UNUSED = 10, - REG_CC_SETTER = 11, REG_CC_USER = 12, REG_LABEL = 13, - ! REG_DEP_ANTI = 14, REG_DEP_OUTPUT = 15 }; - - /* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */ - --- 349,353 ---- - REG_NONNEG = 8, REG_NO_CONFLICT = 9, REG_UNUSED = 10, - REG_CC_SETTER = 11, REG_CC_USER = 12, REG_LABEL = 13, - ! REG_DEP_ANTI = 14, REG_DEP_OUTPUT = 15, REG_NOALIAS = 16 }; - - /* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */ - *************** extern char *reg_note_name[]; - *** 432,436 **** - #define NOTE_INSN_FUNCTION_BEG -13 - - - - #if 0 /* These are not used, and I don't know what they were for. --rms. */ - #define NOTE_DECL_NAME(INSN) ((INSN)->fld[3].rtstr) - --- 432,435 ---- - *************** extern char *note_insn_name[]; - *** 576,579 **** - --- 575,579 ---- - /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */ - #define TRAP_CONDITION(RTX) ((RTX)->fld[0].rtx) - + #define TRAP_CODE(RTX) ((RTX)->fld[1].rtint) - - /* 1 in a SYMBOL_REF if it addresses this function's constants pool. */ - *************** extern rtx eliminate_constant_term PROTO - *** 817,820 **** - --- 817,831 ---- - extern rtx expand_complex_abs PROTO((enum machine_mode, rtx, rtx, int)); - extern enum machine_mode choose_hard_reg_mode PROTO((int, int)); - + extern int rtx_varies_p PROTO((rtx)); - + extern int may_trap_p PROTO((rtx)); - + extern int side_effects_p PROTO((rtx)); - + extern int volatile_refs_p PROTO((rtx)); - + extern int volatile_insn_p PROTO((rtx)); - + extern void remove_note PROTO((rtx, rtx)); - + extern void note_stores PROTO((rtx, void (*)())); - + extern int refers_to_regno_p PROTO((int, int, rtx, rtx *)); - + extern int reg_overlap_mentioned_p PROTO((rtx, rtx)); - + extern int computed_jump_p PROTO((rtx)); - + - - /* Maximum number of parallel sets and clobbers in any insn in this fn. - *************** extern rtx *regno_reg_rtx; - *** 967,968 **** - --- 978,988 ---- - - extern int rtx_to_tree_code PROTO((enum rtx_code)); - + - + extern int true_dependence PROTO((rtx, enum machine_mode, rtx, int (*)())); - + extern int read_dependence PROTO((rtx, rtx)); - + extern int anti_dependence PROTO((rtx, rtx)); - + extern int output_dependence PROTO((rtx, rtx)); - + extern void init_alias_analysis PROTO((void)); - + extern void end_alias_analysis PROTO((void)); - + extern void mark_user_reg PROTO((rtx)); - + extern void mark_reg_pointer PROTO((rtx)); - diff -rcp2N gcc-2.7.2.3/rtlanal.c gcc-2.7.2.3.f.2/rtlanal.c - *** gcc-2.7.2.3/rtlanal.c Fri Oct 6 17:13:57 1995 - --- gcc-2.7.2.3.f.2/rtlanal.c Sun Mar 1 04:15:29 1998 - *************** void note_stores (); - *** 26,29 **** - --- 26,32 ---- - int reg_set_p (); - - + /* Forward declarations */ - + static int jmp_uses_reg_or_mem PROTO((rtx)); - + - /* Bit flags that specify the machine subtype we are compiling for. - Bits are tested using macros TARGET_... defined in the tm.h file - *************** replace_regs (x, reg_map, nregs, replace - *** 1838,1840 **** - --- 1841,1936 ---- - } - return x; - + } - + - + /* Return 1 if X, the SRC_SRC of SET of (pc) contain a REG or MEM that is - + not in the constant pool and not in the condition of an IF_THEN_ELSE. */ - + - + static int - + jmp_uses_reg_or_mem (x) - + rtx x; - + { - + enum rtx_code code = GET_CODE (x); - + int i, j; - + char *fmt; - + - + switch (code) - + { - + case CONST: - + case LABEL_REF: - + case PC: - + return 0; - + - + case REG: - + return 1; - + - + case MEM: - + return ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF - + && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0))); - + - + case IF_THEN_ELSE: - + return (jmp_uses_reg_or_mem (XEXP (x, 1)) - + || jmp_uses_reg_or_mem (XEXP (x, 2))); - + - + case PLUS: case MINUS: case MULT: - + return (jmp_uses_reg_or_mem (XEXP (x, 0)) - + || jmp_uses_reg_or_mem (XEXP (x, 1))); - + - + default: - + break; - + } - + - + fmt = GET_RTX_FORMAT (code); - + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - + { - + if (fmt[i] == 'e' - + && jmp_uses_reg_or_mem (XEXP (x, i))) - + return 1; - + - + if (fmt[i] == 'E') - + for (j = 0; j < XVECLEN (x, i); j++) - + if (jmp_uses_reg_or_mem (XVECEXP (x, i, j))) - + return 1; - + } - + - + return 0; - + } - + - + /* Return nonzero if INSN is an indirect jump (aka computed jump). - + - + Tablejumps and casesi insns are not considered indirect jumps; - + we can recognize them by a (use (lael_ref)). */ - + - + int - + computed_jump_p (insn) - + rtx insn; - + { - + int i; - + if (GET_CODE (insn) == JUMP_INSN) - + { - + rtx pat = PATTERN (insn); - + - + if (GET_CODE (pat) == PARALLEL) - + { - + int len = XVECLEN (pat, 0); - + int has_use_labelref = 0; - + - + for (i = len - 1; i >= 0; i--) - + if (GET_CODE (XVECEXP (pat, 0, i)) == USE - + && (GET_CODE (XEXP (XVECEXP (pat, 0, i), 0)) - + == LABEL_REF)) - + has_use_labelref = 1; - + - + if (! has_use_labelref) - + for (i = len - 1; i >= 0; i--) - + if (GET_CODE (XVECEXP (pat, 0, i)) == SET - + && SET_DEST (XVECEXP (pat, 0, i)) == pc_rtx - + && jmp_uses_reg_or_mem (SET_SRC (XVECEXP (pat, 0, i)))) - + return 1; - + } - + else if (GET_CODE (pat) == SET - + && SET_DEST (pat) == pc_rtx - + && jmp_uses_reg_or_mem (SET_SRC (pat))) - + return 1; - + } - + return 0; - } - diff -rcp2N gcc-2.7.2.3/sched.c gcc-2.7.2.3.f.2/sched.c - *** gcc-2.7.2.3/sched.c Thu Jun 15 12:06:39 1995 - --- gcc-2.7.2.3.f.2/sched.c Tue Sep 9 07:01:44 1997 - *************** Boston, MA 02111-1307, USA. */ - *** 126,129 **** - --- 126,132 ---- - #include "insn-attr.h" - - + extern char *reg_known_equiv_p; - + extern rtx *reg_known_value; - + - #ifdef INSN_SCHEDULING - /* Arrays set up by scheduling for the same respective purposes as - *************** static int *sched_reg_live_length; - *** 143,146 **** - --- 146,150 ---- - by splitting insns. */ - static rtx *reg_last_uses; - + static int reg_last_uses_size; - static rtx *reg_last_sets; - static regset reg_pending_sets; - *************** struct sometimes - *** 294,302 **** - - /* Forward declarations. */ - - static rtx canon_rtx PROTO((rtx)); - - static int rtx_equal_for_memref_p PROTO((rtx, rtx)); - - static rtx find_symbolic_term PROTO((rtx)); - - static int memrefs_conflict_p PROTO((int, rtx, int, rtx, - - HOST_WIDE_INT)); - static void add_dependence PROTO((rtx, rtx, enum reg_note)); - static void remove_dependence PROTO((rtx, rtx)); - --- 298,301 ---- - *************** static int priority PROTO((rtx)); - *** 314,318 **** - static void free_pending_lists PROTO((void)); - static void add_insn_mem_dependence PROTO((rtx *, rtx *, rtx, rtx)); - ! static void flush_pending_lists PROTO((rtx)); - static void sched_analyze_1 PROTO((rtx, rtx)); - static void sched_analyze_2 PROTO((rtx, rtx)); - --- 313,317 ---- - static void free_pending_lists PROTO((void)); - static void add_insn_mem_dependence PROTO((rtx *, rtx *, rtx, rtx)); - ! static void flush_pending_lists PROTO((rtx, int)); - static void sched_analyze_1 PROTO((rtx, rtx)); - static void sched_analyze_2 PROTO((rtx, rtx)); - *************** void schedule_insns PROTO((FILE *)); - *** 346,885 **** - #endif /* INSN_SCHEDULING */ - - - #define SIZE_FOR_MODE(X) (GET_MODE_SIZE (GET_MODE (X))) - - - - /* Vector indexed by N giving the initial (unchanging) value known - - for pseudo-register N. */ - - static rtx *reg_known_value; - - - - /* Vector recording for each reg_known_value whether it is due to a - - REG_EQUIV note. Future passes (viz., reload) may replace the - - pseudo with the equivalent expression and so we account for the - - dependences that would be introduced if that happens. */ - - /* ??? This is a problem only on the Convex. The REG_EQUIV notes created in - - assign_parms mention the arg pointer, and there are explicit insns in the - - RTL that modify the arg pointer. Thus we must ensure that such insns don't - - get scheduled across each other because that would invalidate the REG_EQUIV - - notes. One could argue that the REG_EQUIV notes are wrong, but solving - - the problem in the scheduler will likely give better code, so we do it - - here. */ - - static char *reg_known_equiv_p; - - - - /* Indicates number of valid entries in reg_known_value. */ - - static int reg_known_value_size; - - - - static rtx - - canon_rtx (x) - - rtx x; - - { - - if (GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER - - && REGNO (x) <= reg_known_value_size) - - return reg_known_value[REGNO (x)]; - - else if (GET_CODE (x) == PLUS) - - { - - rtx x0 = canon_rtx (XEXP (x, 0)); - - rtx x1 = canon_rtx (XEXP (x, 1)); - - - - if (x0 != XEXP (x, 0) || x1 != XEXP (x, 1)) - - { - - /* We can tolerate LO_SUMs being offset here; these - - rtl are used for nothing other than comparisons. */ - - if (GET_CODE (x0) == CONST_INT) - - return plus_constant_for_output (x1, INTVAL (x0)); - - else if (GET_CODE (x1) == CONST_INT) - - return plus_constant_for_output (x0, INTVAL (x1)); - - return gen_rtx (PLUS, GET_MODE (x), x0, x1); - - } - - } - - return x; - - } - - - - /* Set up all info needed to perform alias analysis on memory references. */ - - - - void - - init_alias_analysis () - - { - - int maxreg = max_reg_num (); - - rtx insn; - - rtx note; - - rtx set; - - - - reg_known_value_size = maxreg; - - - - reg_known_value - - = (rtx *) oballoc ((maxreg-FIRST_PSEUDO_REGISTER) * sizeof (rtx)) - - - FIRST_PSEUDO_REGISTER; - - bzero ((char *) (reg_known_value + FIRST_PSEUDO_REGISTER), - - (maxreg-FIRST_PSEUDO_REGISTER) * sizeof (rtx)); - - - - reg_known_equiv_p - - = (char *) oballoc ((maxreg -FIRST_PSEUDO_REGISTER) * sizeof (char)) - - - FIRST_PSEUDO_REGISTER; - - bzero (reg_known_equiv_p + FIRST_PSEUDO_REGISTER, - - (maxreg - FIRST_PSEUDO_REGISTER) * sizeof (char)); - - - - /* Fill in the entries with known constant values. */ - - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - - if ((set = single_set (insn)) != 0 - - && GET_CODE (SET_DEST (set)) == REG - - && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER - - && (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0 - - && reg_n_sets[REGNO (SET_DEST (set))] == 1) - - || (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0) - - && GET_CODE (XEXP (note, 0)) != EXPR_LIST) - - { - - int regno = REGNO (SET_DEST (set)); - - reg_known_value[regno] = XEXP (note, 0); - - reg_known_equiv_p[regno] = REG_NOTE_KIND (note) == REG_EQUIV; - - } - - - - /* Fill in the remaining entries. */ - - while (--maxreg >= FIRST_PSEUDO_REGISTER) - - if (reg_known_value[maxreg] == 0) - - reg_known_value[maxreg] = regno_reg_rtx[maxreg]; - - } - - - - /* Return 1 if X and Y are identical-looking rtx's. - - - - We use the data in reg_known_value above to see if two registers with - - different numbers are, in fact, equivalent. */ - - - - static int - - rtx_equal_for_memref_p (x, y) - - rtx x, y; - - { - - register int i; - - register int j; - - register enum rtx_code code; - - register char *fmt; - - - - if (x == 0 && y == 0) - - return 1; - - if (x == 0 || y == 0) - - return 0; - - x = canon_rtx (x); - - y = canon_rtx (y); - - - - if (x == y) - - return 1; - - - - code = GET_CODE (x); - - /* Rtx's of different codes cannot be equal. */ - - if (code != GET_CODE (y)) - - return 0; - - - - /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. - - (REG:SI x) and (REG:HI x) are NOT equivalent. */ - - - - if (GET_MODE (x) != GET_MODE (y)) - - return 0; - - - - /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ - - - - if (code == REG) - - return REGNO (x) == REGNO (y); - - if (code == LABEL_REF) - - return XEXP (x, 0) == XEXP (y, 0); - - if (code == SYMBOL_REF) - - return XSTR (x, 0) == XSTR (y, 0); - - - - /* For commutative operations, the RTX match if the operand match in any - - order. Also handle the simple binary and unary cases without a loop. */ - - if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c') - - return ((rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)) - - && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 1))) - - || (rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 1)) - - && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 0)))); - - else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2') - - return (rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)) - - && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 1))); - - else if (GET_RTX_CLASS (code) == '1') - - return rtx_equal_for_memref_p (XEXP (x, 0), XEXP (y, 0)); - - - - /* Compare the elements. If any pair of corresponding elements - - fail to match, return 0 for the whole things. */ - - - - fmt = GET_RTX_FORMAT (code); - - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - - { - - switch (fmt[i]) - - { - - case 'w': - - if (XWINT (x, i) != XWINT (y, i)) - - return 0; - - break; - - - - case 'n': - - case 'i': - - if (XINT (x, i) != XINT (y, i)) - - return 0; - - break; - - - - case 'V': - - case 'E': - - /* Two vectors must have the same length. */ - - if (XVECLEN (x, i) != XVECLEN (y, i)) - - return 0; - - - - /* And the corresponding elements must match. */ - - for (j = 0; j < XVECLEN (x, i); j++) - - if (rtx_equal_for_memref_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) - - return 0; - - break; - - - - case 'e': - - if (rtx_equal_for_memref_p (XEXP (x, i), XEXP (y, i)) == 0) - - return 0; - - break; - - - - case 'S': - - case 's': - - if (strcmp (XSTR (x, i), XSTR (y, i))) - - return 0; - - break; - - - - case 'u': - - /* These are just backpointers, so they don't matter. */ - - break; - - - - case '0': - - break; - - - - /* It is believed that rtx's at this level will never - - contain anything but integers and other rtx's, - - except for within LABEL_REFs and SYMBOL_REFs. */ - - default: - - abort (); - - } - - } - - return 1; - - } - - - - /* Given an rtx X, find a SYMBOL_REF or LABEL_REF within - - X and return it, or return 0 if none found. */ - - - - static rtx - - find_symbolic_term (x) - - rtx x; - - { - - register int i; - - register enum rtx_code code; - - register char *fmt; - - - - code = GET_CODE (x); - - if (code == SYMBOL_REF || code == LABEL_REF) - - return x; - - if (GET_RTX_CLASS (code) == 'o') - - return 0; - - - - fmt = GET_RTX_FORMAT (code); - - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - - { - - rtx t; - - - - if (fmt[i] == 'e') - - { - - t = find_symbolic_term (XEXP (x, i)); - - if (t != 0) - - return t; - - } - - else if (fmt[i] == 'E') - - break; - - } - - return 0; - - } - - - - /* Return nonzero if X and Y (memory addresses) could reference the - - same location in memory. C is an offset accumulator. When - - C is nonzero, we are testing aliases between X and Y + C. - - XSIZE is the size in bytes of the X reference, - - similarly YSIZE is the size in bytes for Y. - - - - If XSIZE or YSIZE is zero, we do not know the amount of memory being - - referenced (the reference was BLKmode), so make the most pessimistic - - assumptions. - - - - We recognize the following cases of non-conflicting memory: - - - - (1) addresses involving the frame pointer cannot conflict - - with addresses involving static variables. - - (2) static variables with different addresses cannot conflict. - - - - Nice to notice that varying addresses cannot conflict with fp if no - - local variables had their addresses taken, but that's too hard now. */ - - - - /* ??? In Fortran, references to a array parameter can never conflict with - - another array parameter. */ - - - - static int - - memrefs_conflict_p (xsize, x, ysize, y, c) - - rtx x, y; - - int xsize, ysize; - - HOST_WIDE_INT c; - - { - - if (GET_CODE (x) == HIGH) - - x = XEXP (x, 0); - - else if (GET_CODE (x) == LO_SUM) - - x = XEXP (x, 1); - - else - - x = canon_rtx (x); - - if (GET_CODE (y) == HIGH) - - y = XEXP (y, 0); - - else if (GET_CODE (y) == LO_SUM) - - y = XEXP (y, 1); - - else - - y = canon_rtx (y); - - - - if (rtx_equal_for_memref_p (x, y)) - - return (xsize == 0 || ysize == 0 || - - (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - - - - if (y == frame_pointer_rtx || y == hard_frame_pointer_rtx - - || y == stack_pointer_rtx) - - { - - rtx t = y; - - int tsize = ysize; - - y = x; ysize = xsize; - - x = t; xsize = tsize; - - } - - - - if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx - - || x == stack_pointer_rtx) - - { - - rtx y1; - - - - if (CONSTANT_P (y)) - - return 0; - - - - if (GET_CODE (y) == PLUS - - && canon_rtx (XEXP (y, 0)) == x - - && (y1 = canon_rtx (XEXP (y, 1))) - - && GET_CODE (y1) == CONST_INT) - - { - - c += INTVAL (y1); - - return (xsize == 0 || ysize == 0 - - || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - - } - - - - if (GET_CODE (y) == PLUS - - && (y1 = canon_rtx (XEXP (y, 0))) - - && CONSTANT_P (y1)) - - return 0; - - - - return 1; - - } - - - - if (GET_CODE (x) == PLUS) - - { - - /* The fact that X is canonicalized means that this - - PLUS rtx is canonicalized. */ - - rtx x0 = XEXP (x, 0); - - rtx x1 = XEXP (x, 1); - - - - if (GET_CODE (y) == PLUS) - - { - - /* The fact that Y is canonicalized means that this - - PLUS rtx is canonicalized. */ - - rtx y0 = XEXP (y, 0); - - rtx y1 = XEXP (y, 1); - - - - if (rtx_equal_for_memref_p (x1, y1)) - - return memrefs_conflict_p (xsize, x0, ysize, y0, c); - - if (rtx_equal_for_memref_p (x0, y0)) - - return memrefs_conflict_p (xsize, x1, ysize, y1, c); - - if (GET_CODE (x1) == CONST_INT) - - if (GET_CODE (y1) == CONST_INT) - - return memrefs_conflict_p (xsize, x0, ysize, y0, - - c - INTVAL (x1) + INTVAL (y1)); - - else - - return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1)); - - else if (GET_CODE (y1) == CONST_INT) - - return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); - - - - /* Handle case where we cannot understand iteration operators, - - but we notice that the base addresses are distinct objects. */ - - x = find_symbolic_term (x); - - if (x == 0) - - return 1; - - y = find_symbolic_term (y); - - if (y == 0) - - return 1; - - return rtx_equal_for_memref_p (x, y); - - } - - else if (GET_CODE (x1) == CONST_INT) - - return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1)); - - } - - else if (GET_CODE (y) == PLUS) - - { - - /* The fact that Y is canonicalized means that this - - PLUS rtx is canonicalized. */ - - rtx y0 = XEXP (y, 0); - - rtx y1 = XEXP (y, 1); - - - - if (GET_CODE (y1) == CONST_INT) - - return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); - - else - - return 1; - - } - - - - if (GET_CODE (x) == GET_CODE (y)) - - switch (GET_CODE (x)) - - { - - case MULT: - - { - - /* Handle cases where we expect the second operands to be the - - same, and check only whether the first operand would conflict - - or not. */ - - rtx x0, y0; - - rtx x1 = canon_rtx (XEXP (x, 1)); - - rtx y1 = canon_rtx (XEXP (y, 1)); - - if (! rtx_equal_for_memref_p (x1, y1)) - - return 1; - - x0 = canon_rtx (XEXP (x, 0)); - - y0 = canon_rtx (XEXP (y, 0)); - - if (rtx_equal_for_memref_p (x0, y0)) - - return (xsize == 0 || ysize == 0 - - || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - - - - /* Can't properly adjust our sizes. */ - - if (GET_CODE (x1) != CONST_INT) - - return 1; - - xsize /= INTVAL (x1); - - ysize /= INTVAL (x1); - - c /= INTVAL (x1); - - return memrefs_conflict_p (xsize, x0, ysize, y0, c); - - } - - } - - - - if (CONSTANT_P (x)) - - { - - if (GET_CODE (x) == CONST_INT && GET_CODE (y) == CONST_INT) - - { - - c += (INTVAL (y) - INTVAL (x)); - - return (xsize == 0 || ysize == 0 - - || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)); - - } - - - - if (GET_CODE (x) == CONST) - - { - - if (GET_CODE (y) == CONST) - - return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), - - ysize, canon_rtx (XEXP (y, 0)), c); - - else - - return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), - - ysize, y, c); - - } - - if (GET_CODE (y) == CONST) - - return memrefs_conflict_p (xsize, x, ysize, - - canon_rtx (XEXP (y, 0)), c); - - - - if (CONSTANT_P (y)) - - return (rtx_equal_for_memref_p (x, y) - - && (xsize == 0 || ysize == 0 - - || (c >= 0 && xsize > c) || (c < 0 && ysize+c > 0))); - - - - return 1; - - } - - return 1; - - } - - - - /* Functions to compute memory dependencies. - - - - Since we process the insns in execution order, we can build tables - - to keep track of what registers are fixed (and not aliased), what registers - - are varying in known ways, and what registers are varying in unknown - - ways. - - - - If both memory references are volatile, then there must always be a - - dependence between the two references, since their order can not be - - changed. A volatile and non-volatile reference can be interchanged - - though. - - - - A MEM_IN_STRUCT reference at a non-QImode varying address can never - - conflict with a non-MEM_IN_STRUCT reference at a fixed address. We must - - allow QImode aliasing because the ANSI C standard allows character - - pointers to alias anything. We are assuming that characters are - - always QImode here. */ - - - - /* Read dependence: X is read after read in MEM takes place. There can - - only be a dependence here if both reads are volatile. */ - - - - int - - read_dependence (mem, x) - - rtx mem; - - rtx x; - - { - - return MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem); - - } - - - - /* True dependence: X is read after store in MEM takes place. */ - - - - int - - true_dependence (mem, x) - - rtx mem; - - rtx x; - - { - - /* If X is an unchanging read, then it can't possibly conflict with any - - non-unchanging store. It may conflict with an unchanging write though, - - because there may be a single store to this address to initialize it. - - Just fall through to the code below to resolve the case where we have - - both an unchanging read and an unchanging write. This won't handle all - - cases optimally, but the possible performance loss should be - - negligible. */ - - if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem)) - - return 0; - - - - return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - - || (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0), - - SIZE_FOR_MODE (x), XEXP (x, 0), 0) - - && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem) - - && GET_MODE (mem) != QImode - - && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x)) - - && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x) - - && GET_MODE (x) != QImode - - && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)))); - - } - - - - /* Anti dependence: X is written after read in MEM takes place. */ - - - - int - - anti_dependence (mem, x) - - rtx mem; - - rtx x; - - { - - /* If MEM is an unchanging read, then it can't possibly conflict with - - the store to X, because there is at most one store to MEM, and it must - - have occurred somewhere before MEM. */ - - if (RTX_UNCHANGING_P (mem)) - - return 0; - - - - return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - - || (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0), - - SIZE_FOR_MODE (x), XEXP (x, 0), 0) - - && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem) - - && GET_MODE (mem) != QImode - - && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x)) - - && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x) - - && GET_MODE (x) != QImode - - && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)))); - - } - - - - /* Output dependence: X is written after store in MEM takes place. */ - - - - int - - output_dependence (mem, x) - - rtx mem; - - rtx x; - - { - - return ((MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) - - || (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0), - - SIZE_FOR_MODE (x), XEXP (x, 0), 0) - - && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem) - - && GET_MODE (mem) != QImode - - && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x)) - - && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x) - - && GET_MODE (x) != QImode - - && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)))); - - } - - - /* Helper functions for instruction scheduling. */ - - --- 345,348 ---- - *************** add_insn_mem_dependence (insn_list, mem_ - *** 1609,1621 **** - - /* Make a dependency between every memory reference on the pending lists - ! and INSN, thus flushing the pending lists. */ - - static void - ! flush_pending_lists (insn) - rtx insn; - { - rtx link; - - ! while (pending_read_insns) - { - add_dependence (insn, XEXP (pending_read_insns, 0), REG_DEP_ANTI); - --- 1072,1086 ---- - - /* Make a dependency between every memory reference on the pending lists - ! and INSN, thus flushing the pending lists. If ONLY_WRITE, don't flush - ! the read list. */ - - static void - ! flush_pending_lists (insn, only_write) - rtx insn; - + int only_write; - { - rtx link; - - ! while (pending_read_insns && ! only_write) - { - add_dependence (insn, XEXP (pending_read_insns, 0), REG_DEP_ANTI); - *************** sched_analyze_1 (x, insn) - *** 1746,1750 **** - this flush occurs 8 times for sparc, and 10 times for m88k using - the number 32. */ - ! flush_pending_lists (insn); - } - else - --- 1211,1215 ---- - this flush occurs 8 times for sparc, and 10 times for m88k using - the number 32. */ - ! flush_pending_lists (insn, 0); - } - else - *************** sched_analyze_2 (x, insn) - *** 1922,1926 **** - /* If a dependency already exists, don't create a new one. */ - if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn))) - ! if (true_dependence (XEXP (pending_mem, 0), x)) - add_dependence (insn, XEXP (pending, 0), 0); - - --- 1387,1392 ---- - /* If a dependency already exists, don't create a new one. */ - if (! find_insn_list (XEXP (pending, 0), LOG_LINKS (insn))) - ! if (true_dependence (XEXP (pending_mem, 0), VOIDmode, - ! x, rtx_varies_p)) - add_dependence (insn, XEXP (pending, 0), 0); - - *************** sched_analyze_2 (x, insn) - *** 1968,1972 **** - reg_pending_sets_all = 1; - - ! flush_pending_lists (insn); - } - - --- 1434,1438 ---- - reg_pending_sets_all = 1; - - ! flush_pending_lists (insn, 0); - } - - *************** sched_analyze_insn (x, insn, loop_notes) - *** 2021,2025 **** - register RTX_CODE code = GET_CODE (x); - rtx link; - ! int maxreg = max_reg_num (); - int i; - - --- 1487,1491 ---- - register RTX_CODE code = GET_CODE (x); - rtx link; - ! int maxreg = reg_last_uses_size; - int i; - - *************** sched_analyze_insn (x, insn, loop_notes) - *** 2058,2062 **** - if (loop_notes) - { - ! int max_reg = max_reg_num (); - rtx link; - - --- 1524,1528 ---- - if (loop_notes) - { - ! int max_reg = reg_last_uses_size; - rtx link; - - *************** sched_analyze_insn (x, insn, loop_notes) - *** 2072,2076 **** - reg_pending_sets_all = 1; - - ! flush_pending_lists (insn); - - link = loop_notes; - --- 1538,1542 ---- - reg_pending_sets_all = 1; - - ! flush_pending_lists (insn, 0); - - link = loop_notes; - *************** sched_analyze (head, tail) - *** 2202,2207 **** - && NOTE_LINE_NUMBER (NEXT_INSN (insn)) == NOTE_INSN_SETJMP) - { - ! int max_reg = max_reg_num (); - ! for (i = 0; i < max_reg; i++) - { - for (u = reg_last_uses[i]; u; u = XEXP (u, 1)) - --- 1668,1672 ---- - && NOTE_LINE_NUMBER (NEXT_INSN (insn)) == NOTE_INSN_SETJMP) - { - ! for (i = 0; i < reg_last_uses_size; i++) - { - for (u = reg_last_uses[i]; u; u = XEXP (u, 1)) - *************** sched_analyze (head, tail) - *** 2247,2259 **** - loop_notes = 0; - - ! /* We don't need to flush memory for a function call which does - ! not involve memory. */ - ! if (! CONST_CALL_P (insn)) - ! { - ! /* In the absence of interprocedural alias analysis, - ! we must flush all pending reads and writes, and - ! start new dependencies starting from here. */ - ! flush_pending_lists (insn); - ! } - - /* Depend this function call (actually, the user of this - --- 1712,1720 ---- - loop_notes = 0; - - ! /* In the absence of interprocedural alias analysis, we must flush - ! all pending reads and writes, and start new dependencies starting - ! from here. But only flush writes for constant calls (which may - ! be passed a pointer to something we haven't written yet). */ - ! flush_pending_lists (insn, CONST_CALL_P (insn)); - - /* Depend this function call (actually, the user of this - *************** sched_analyze (head, tail) - *** 2264,2270 **** - else if (GET_CODE (insn) == NOTE - && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG - ! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)) - ! loop_notes = gen_rtx (EXPR_LIST, REG_DEAD, - ! GEN_INT (NOTE_LINE_NUMBER (insn)), loop_notes); - - if (insn == tail) - --- 1725,1736 ---- - else if (GET_CODE (insn) == NOTE - && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG - ! || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END - ! || (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP - ! && GET_CODE (PREV_INSN (insn)) != CALL_INSN))) - ! { - ! loop_notes = gen_rtx (EXPR_LIST, REG_DEAD, - ! GEN_INT (NOTE_LINE_NUMBER (insn)), loop_notes); - ! CONST_CALL_P (loop_notes) = CONST_CALL_P (insn); - ! } - - if (insn == tail) - *************** sched_note_set (b, x, death) - *** 2372,2380 **** - - #define SCHED_SORT(READY, NEW_READY, OLD_READY) \ - ! do { if ((NEW_READY) - (OLD_READY) == 1) \ - ! swap_sort (READY, NEW_READY); \ - ! else if ((NEW_READY) - (OLD_READY) > 1) \ - ! qsort (READY, NEW_READY, sizeof (rtx), rank_for_schedule); } \ - ! while (0) - - /* Returns a positive value if y is preferred; returns a negative value if - --- 1838,1845 ---- - - #define SCHED_SORT(READY, NEW_READY, OLD_READY) \ - ! if ((NEW_READY) - (OLD_READY) == 1) \ - ! swap_sort (READY, NEW_READY); \ - ! else if ((NEW_READY) - (OLD_READY) > 1) \ - ! qsort (READY, NEW_READY, sizeof (rtx), rank_for_schedule); else \ - - /* Returns a positive value if y is preferred; returns a negative value if - *************** reemit_notes (insn, last) - *** 3128,3132 **** - { - if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP) - ! emit_note_after (INTVAL (XEXP (note, 0)), insn); - else - last = emit_note_before (INTVAL (XEXP (note, 0)), last); - --- 2593,2598 ---- - { - if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP) - ! CONST_CALL_P (emit_note_after (INTVAL (XEXP (note, 0)), insn)) - ! = CONST_CALL_P (note); - else - last = emit_note_before (INTVAL (XEXP (note, 0)), last); - *************** schedule_block (b, file) - *** 3174,3178 **** - b, INSN_UID (basic_block_head[b]), INSN_UID (basic_block_end[b])); - - ! i = max_reg_num (); - reg_last_uses = (rtx *) alloca (i * sizeof (rtx)); - bzero ((char *) reg_last_uses, i * sizeof (rtx)); - --- 2640,2644 ---- - b, INSN_UID (basic_block_head[b]), INSN_UID (basic_block_end[b])); - - ! reg_last_uses_size = i = max_reg_num (); - reg_last_uses = (rtx *) alloca (i * sizeof (rtx)); - bzero ((char *) reg_last_uses, i * sizeof (rtx)); - *************** schedule_block (b, file) - *** 3800,3804 **** - made live again later. */ - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - ! if (call_used_regs[i] || global_regs[i]) - { - register int offset = i / REGSET_ELT_BITS; - --- 3266,3271 ---- - made live again later. */ - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - ! if ((call_used_regs[i] && ! fixed_regs[i]) - ! || global_regs[i]) - { - register int offset = i / REGSET_ELT_BITS; - *************** schedule_insns (dump_file) - *** 4717,4721 **** - bcopy ((char *) reg_n_deaths, (char *) sched_reg_n_deaths, - max_regno * sizeof (short)); - - init_alias_analysis (); - } - else - --- 4184,4187 ---- - *************** schedule_insns (dump_file) - *** 4726,4732 **** - bb_dead_regs = 0; - bb_live_regs = 0; - - if (! flag_schedule_insns) - - init_alias_analysis (); - } - - if (write_symbols != NO_DEBUG) - --- 4192,4213 ---- - bb_dead_regs = 0; - bb_live_regs = 0; - } - + init_alias_analysis (); - + #if 0 - + if (dump_file) - + { - + extern rtx *reg_base_value; - + extern int reg_base_value_size; - + int i; - + for (i = 0; i < reg_base_value_size; i++) - + if (reg_base_value[i]) - + { - + fprintf (dump_file, ";; reg_base_value[%d] = ", i); - + print_rtl (dump_file, reg_base_value[i]); - + fputc ('\n', dump_file); - + } - + } - + #endif - + - - if (write_symbols != NO_DEBUG) - diff -rcp2N gcc-2.7.2.3/sdbout.c gcc-2.7.2.3.f.2/sdbout.c - *** gcc-2.7.2.3/sdbout.c Thu Jun 15 12:07:11 1995 - --- gcc-2.7.2.3.f.2/sdbout.c Tue Sep 9 07:01:44 1997 - *************** plain_type_1 (type, level) - *** 539,543 **** - sdb_dims[sdb_n_dims++] - = (TYPE_DOMAIN (type) - ! ? TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) + 1 - : 0); - return PUSH_DERIVED_LEVEL (DT_ARY, m); - --- 539,546 ---- - sdb_dims[sdb_n_dims++] - = (TYPE_DOMAIN (type) - ! && TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST - ! && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST - ! ? (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) - ! - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1) - : 0); - return PUSH_DERIVED_LEVEL (DT_ARY, m); - diff -rcp2N gcc-2.7.2.3/stmt.c gcc-2.7.2.3.f.2/stmt.c - *** gcc-2.7.2.3/stmt.c Tue Sep 12 23:01:54 1995 - --- gcc-2.7.2.3.f.2/stmt.c Tue Dec 23 19:52:10 1997 - *************** fixup_gotos (thisblock, stack_level, cle - *** 1244,1249 **** - poplevel (1, 0, 0); - end_sequence (); - ! f->before_jump - ! = emit_insns_after (cleanup_insns, f->before_jump); - - f->cleanup_list_list = TREE_CHAIN (lists); - --- 1244,1250 ---- - poplevel (1, 0, 0); - end_sequence (); - ! if (cleanup_insns != 0) - ! f->before_jump - ! = emit_insns_after (cleanup_insns, f->before_jump); - - f->cleanup_list_list = TREE_CHAIN (lists); - *************** expand_expr_stmt (exp) - *** 1721,1725 **** - - last_expr_type = TREE_TYPE (exp); - ! if (! flag_syntax_only) - last_expr_value = expand_expr (exp, - (expr_stmts_for_value - --- 1722,1726 ---- - - last_expr_type = TREE_TYPE (exp); - ! if (! flag_syntax_only || expr_stmts_for_value) - last_expr_value = expand_expr (exp, - (expr_stmts_for_value - *************** expand_end_bindings (vars, mark_ends, do - *** 3160,3163 **** - --- 3161,3169 ---- - #endif - - + #ifdef HAVE_nonlocal_goto_receiver - + if (HAVE_nonlocal_goto_receiver) - + emit_insn (gen_nonlocal_goto_receiver ()); - + #endif - + - /* The handler expects the desired label address in the static chain - register. It tests the address and does an appropriate jump - *************** expand_decl (decl) - *** 3369,3395 **** - = promote_mode (type, DECL_MODE (decl), &unsignedp, 0); - - ! if (TREE_CODE (type) == COMPLEX_TYPE) - ! { - ! rtx realpart, imagpart; - ! enum machine_mode partmode = TYPE_MODE (TREE_TYPE (type)); - - ! /* For a complex type variable, make a CONCAT of two pseudos - ! so that the real and imaginary parts - ! can be allocated separately. */ - ! realpart = gen_reg_rtx (partmode); - ! REG_USERVAR_P (realpart) = 1; - ! imagpart = gen_reg_rtx (partmode); - ! REG_USERVAR_P (imagpart) = 1; - ! DECL_RTL (decl) = gen_rtx (CONCAT, reg_mode, realpart, imagpart); - ! } - ! else - ! { - ! DECL_RTL (decl) = gen_reg_rtx (reg_mode); - ! if (TREE_CODE (type) == POINTER_TYPE) - ! mark_reg_pointer (DECL_RTL (decl)); - ! REG_USERVAR_P (DECL_RTL (decl)) = 1; - ! } - } - ! else if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) - { - /* Variable of fixed size that goes on the stack. */ - --- 3375,3389 ---- - = promote_mode (type, DECL_MODE (decl), &unsignedp, 0); - - ! DECL_RTL (decl) = gen_reg_rtx (reg_mode); - ! mark_user_reg (DECL_RTL (decl)); - - ! if (TREE_CODE (type) == POINTER_TYPE) - ! mark_reg_pointer (DECL_RTL (decl)); - } - ! else if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST - ! && ! (flag_stack_check && ! STACK_CHECK_BUILTIN - ! && (TREE_INT_CST_HIGH (DECL_SIZE (decl)) != 0 - ! || (TREE_INT_CST_LOW (DECL_SIZE (decl)) - ! > STACK_CHECK_MAX_VAR_SIZE * BITS_PER_UNIT)))) - { - /* Variable of fixed size that goes on the stack. */ - *************** expand_decl (decl) - *** 3462,3468 **** - free_temp_slots (); - - ! /* Allocate space on the stack for the variable. */ - address = allocate_dynamic_stack_space (size, NULL_RTX, - ! DECL_ALIGN (decl)); - - /* Reference the variable indirect through that rtx. */ - --- 3456,3465 ---- - free_temp_slots (); - - ! /* Allocate space on the stack for the variable. Note that - ! DECL_ALIGN says how the variable is to be aligned and we - ! cannot use it to conclude anything about the alignment of - ! the size. */ - address = allocate_dynamic_stack_space (size, NULL_RTX, - ! TYPE_ALIGN (TREE_TYPE (decl))); - - /* Reference the variable indirect through that rtx. */ - *************** pushcase (value, converter, label, dupli - *** 4133,4141 **** - } - - ! /* Like pushcase but this case applies to all values - ! between VALUE1 and VALUE2 (inclusive). - ! The return value is the same as that of pushcase - ! but there is one additional error code: - ! 4 means the specified range was empty. */ - - int - --- 4130,4141 ---- - } - - ! /* Like pushcase but this case applies to all values between VALUE1 and - ! VALUE2 (inclusive). If VALUE1 is NULL, the range starts at the lowest - ! value of the index type and ends at VALUE2. If VALUE2 is NULL, the range - ! starts at VALUE1 and ends at the highest value of the index type. - ! If both are NULL, this case applies to all values. - ! - ! The return value is the same as that of pushcase but there is one - ! additional error code: 4 means the specified range was empty. */ - - int - *************** pushcase_range (value1, value2, converte - *** 4187,4209 **** - case_stack->data.case_stmt.seenlabel = 1; - - ! /* Convert VALUEs to type in which the comparisons are nominally done. */ - ! if (value1 == 0) /* Negative infinity. */ - ! value1 = TYPE_MIN_VALUE(index_type); - ! value1 = (*converter) (nominal_type, value1); - - ! if (value2 == 0) /* Positive infinity. */ - ! value2 = TYPE_MAX_VALUE(index_type); - value2 = (*converter) (nominal_type, value2); - - /* Fail if these values are out of range. */ - ! if (! int_fits_type_p (value1, index_type)) - return 3; - - ! if (! int_fits_type_p (value2, index_type)) - return 3; - - - - /* Fail if the range is empty. */ - - if (tree_int_cst_lt (value2, value1)) - - return 4; - - /* If the bounds are equal, turn this into the one-value case. */ - --- 4187,4213 ---- - case_stack->data.case_stmt.seenlabel = 1; - - ! /* Convert VALUEs to type in which the comparisons are nominally done - ! and replace any unspecified value with the corresponding bound. */ - ! if (value1 == 0) - ! value1 = TYPE_MIN_VALUE (index_type); - ! if (value2 == 0) - ! value2 = TYPE_MAX_VALUE (index_type); - ! - ! /* Fail if the range is empty. Do this before any conversion since - ! we want to allow out-of-range empty ranges. */ - ! if (tree_int_cst_lt (value2, value1)) - ! return 4; - - ! value1 = (*converter) (nominal_type, value1); - value2 = (*converter) (nominal_type, value2); - - /* Fail if these values are out of range. */ - ! if (TREE_CONSTANT_OVERFLOW (value1) - ! || ! int_fits_type_p (value1, index_type)) - return 3; - - ! if (TREE_CONSTANT_OVERFLOW (value2) - ! || ! int_fits_type_p (value2, index_type)) - return 3; - - /* If the bounds are equal, turn this into the one-value case. */ - diff -rcp2N gcc-2.7.2.3/stor-layout.c gcc-2.7.2.3.f.2/stor-layout.c - *** gcc-2.7.2.3/stor-layout.c Sat Jun 29 16:26:51 1996 - --- gcc-2.7.2.3.f.2/stor-layout.c Tue Sep 9 07:01:46 1997 - *************** layout_decl (decl, known_align) - *** 255,259 **** - if (maximum_field_alignment != 0) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment); - ! else if (flag_pack_struct) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT); - } - --- 255,259 ---- - if (maximum_field_alignment != 0) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment); - ! else if (DECL_PACKED (decl)) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT); - } - *************** layout_decl (decl, known_align) - *** 261,265 **** - if (DECL_BIT_FIELD (decl) - && TYPE_SIZE (type) != 0 - ! && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST) - { - register enum machine_mode xmode - --- 261,266 ---- - if (DECL_BIT_FIELD (decl) - && TYPE_SIZE (type) != 0 - ! && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - ! && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT) - { - register enum machine_mode xmode - *************** layout_decl (decl, known_align) - *** 278,281 **** - --- 279,291 ---- - } - - + /* Turn off DECL_BIT_FIELD if we won't need it set. */ - + if (DECL_BIT_FIELD (decl) && TYPE_MODE (type) == BLKmode - + && known_align % TYPE_ALIGN (type) == 0 - + && DECL_SIZE (decl) != 0 - + && (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST - + || (TREE_INT_CST_LOW (DECL_SIZE (decl)) % BITS_PER_UNIT) == 0) - + && DECL_ALIGN (decl) >= TYPE_ALIGN (type)) - + DECL_BIT_FIELD (decl) = 0; - + - /* Evaluate nonconstant size only once, either now or as soon as safe. */ - if (DECL_SIZE (decl) != 0 && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) - *************** layout_record (rec) - *** 380,384 **** - if (maximum_field_alignment != 0) - type_align = MIN (type_align, maximum_field_alignment); - ! else if (flag_pack_struct) - type_align = MIN (type_align, BITS_PER_UNIT); - - --- 390,394 ---- - if (maximum_field_alignment != 0) - type_align = MIN (type_align, maximum_field_alignment); - ! else if (TYPE_PACKED (rec)) - type_align = MIN (type_align, BITS_PER_UNIT); - - *************** layout_record (rec) - *** 422,428 **** - && DECL_BIT_FIELD_TYPE (field) - && !DECL_PACKED (field) - - /* If #pragma pack is in effect, turn off this feature. */ - && maximum_field_alignment == 0 - - && !flag_pack_struct - && !integer_zerop (DECL_SIZE (field))) - { - --- 432,436 ---- - *************** layout_record (rec) - *** 459,463 **** - if (maximum_field_alignment != 0) - type_align = MIN (type_align, maximum_field_alignment); - ! else if (flag_pack_struct) - type_align = MIN (type_align, BITS_PER_UNIT); - - --- 467,471 ---- - if (maximum_field_alignment != 0) - type_align = MIN (type_align, maximum_field_alignment); - ! else if (TYPE_PACKED (rec)) - type_align = MIN (type_align, BITS_PER_UNIT); - - *************** layout_record (rec) - *** 500,505 **** - /* Do nothing. */; - else if (TREE_CODE (dsize) == INTEGER_CST - && TREE_INT_CST_HIGH (dsize) == 0 - ! && TREE_INT_CST_LOW (dsize) + const_size > const_size) - /* Use const_size if there's no overflow. */ - const_size += TREE_INT_CST_LOW (dsize); - --- 508,514 ---- - /* Do nothing. */; - else if (TREE_CODE (dsize) == INTEGER_CST - + && ! TREE_CONSTANT_OVERFLOW (dsize) - && TREE_INT_CST_HIGH (dsize) == 0 - ! && TREE_INT_CST_LOW (dsize) + const_size >= const_size) - /* Use const_size if there's no overflow. */ - const_size += TREE_INT_CST_LOW (dsize); - *************** get_best_mode (bitsize, bitpos, align, l - *** 1172,1175 **** - --- 1181,1192 ---- - enum machine_mode mode; - int unit; - + - + if (bitpos < 0) - + { - + /* For correct calculations and convenience, bias negative bitpos - + to become a non-negative value that is [1,bitsize], such that - + the relative bit offset to a multiple of bitsize is preserved. */ - + bitpos = bitsize - ((-bitpos) % bitsize); - + } - - /* Find the narrowest integer mode that contains the bit field. */ - diff -rcp2N gcc-2.7.2.3/stupid.c gcc-2.7.2.3.f.2/stupid.c - *** gcc-2.7.2.3/stupid.c Sun Oct 29 12:45:22 1995 - --- gcc-2.7.2.3.f.2/stupid.c Sun Mar 1 03:40:50 1998 - *************** static int *uid_suid; - *** 66,69 **** - --- 66,74 ---- - static int last_call_suid; - - + /* Record the suid of the last NOTE_INSN_SETJMP - + so we can tell whether a pseudo reg crosses any setjmp. */ - + - + static int last_setjmp_suid; - + - /* Element N is suid of insn where life span of pseudo reg N ends. - Element is 0 if register N has not been seen yet on backward scan. */ - *************** static char *regs_live; - *** 89,92 **** - --- 94,101 ---- - static char *regs_change_size; - - + /* Indexed by reg number, nonzero if reg crosses a setjmp. */ - + - + static char *regs_crosses_setjmp; - + - /* Indexed by insn's suid, the set of hard regs live after that insn. */ - - *************** stupid_life_analysis (f, nregs, file) - *** 121,124 **** - --- 130,135 ---- - int max_uid, max_suid; - - + current_function_has_computed_jump = 0; - + - bzero (regs_ever_live, sizeof regs_ever_live); - - *************** stupid_life_analysis (f, nregs, file) - *** 149,152 **** - --- 160,164 ---- - - last_call_suid = i + 1; - + last_setjmp_suid = i + 1; - max_suid = i + 1; - - *************** stupid_life_analysis (f, nregs, file) - *** 167,170 **** - --- 179,185 ---- - bzero ((char *) regs_change_size, nregs * sizeof (char)); - - + regs_crosses_setjmp = (char *) alloca (nregs * sizeof (char)); - + bzero ((char *) regs_crosses_setjmp, nregs * sizeof (char)); - + - reg_renumber = (short *) oballoc (nregs * sizeof (short)); - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - *************** stupid_life_analysis (f, nregs, file) - *** 216,219 **** - --- 231,238 ---- - stupid_mark_refs (PATTERN (insn), insn); - - + if (GET_CODE (insn) == NOTE - + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP) - + last_setjmp_suid = INSN_SUID (insn); - + - /* Mark all call-clobbered regs as live after each call insn - so that a pseudo whose life span includes this insn - *************** stupid_life_analysis (f, nregs, file) - *** 237,240 **** - --- 256,263 ---- - stupid_mark_refs (CALL_INSN_FUNCTION_USAGE (insn), insn); - } - + #ifdef STACK_REGS - + if (GET_CODE (insn) == JUMP_INSN && computed_jump_p (insn)) - + current_function_has_computed_jump = 1; - + #endif - } - - *************** stupid_life_analysis (f, nregs, file) - *** 254,259 **** - register int r = reg_order[i]; - - ! /* Some regnos disappear from the rtl. Ignore them to avoid crash. */ - ! if (regno_reg_rtx[r] == 0) - continue; - - --- 277,283 ---- - register int r = reg_order[i]; - - ! /* Some regnos disappear from the rtl. Ignore them to avoid crash. - ! Also don't allocate registers that cross a setjmp. */ - ! if (regno_reg_rtx[r] == 0 || regs_crosses_setjmp[r]) - continue; - - *************** stupid_reg_compare (r1p, r2p) - *** 309,314 **** - that can hold a value of machine-mode MODE - (but actually we test only the first of the block for holding MODE) - ! currently free from after insn whose suid is BIRTH - ! through the insn whose suid is DEATH, - and return the number of the first of them. - Return -1 if such a block cannot be found. - --- 333,338 ---- - that can hold a value of machine-mode MODE - (but actually we test only the first of the block for holding MODE) - ! currently free from after insn whose suid is BORN_INSN - ! through the insn whose suid is DEAD_INSN, - and return the number of the first of them. - Return -1 if such a block cannot be found. - *************** stupid_find_reg (call_preserved, class, - *** 338,341 **** - --- 362,372 ---- - #endif - - + /* If this register's life is more than 5,000 insns, we probably - + can't allocate it, so don't waste the time trying. This avoid - + quadratic behavior on programs that have regularly-occurring - + SAVE_EXPRs. */ - + if (dead_insn > born_insn + 5000) - + return -1; - + - COPY_HARD_REG_SET (used, - call_preserved ? call_used_reg_set : fixed_reg_set); - *************** stupid_find_reg (call_preserved, class, - *** 354,357 **** - --- 385,394 ---- - IOR_HARD_REG_SET (used, after_insn_hard_regs[ins]); - - + #ifdef STACK_REGS - + if (current_function_has_computed_jump) - + for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) - + SET_HARD_REG_BIT (used, i); - + #endif - + - IOR_COMPL_HARD_REG_SET (used, reg_class_contents[(int) class]); - - *************** stupid_mark_refs (x, insn) - *** 488,491 **** - --- 525,531 ---- - if (last_call_suid < reg_where_dead[regno]) - reg_n_calls_crossed[regno] += 1; - + - + if (last_setjmp_suid < reg_where_dead[regno]) - + regs_crosses_setjmp[regno] = 1; - } - } - diff -rcp2N gcc-2.7.2.3/texinfo.tex gcc-2.7.2.3.f.2/texinfo.tex - *** gcc-2.7.2.3/texinfo.tex Sun Nov 26 19:57:26 1995 - --- gcc-2.7.2.3.f.2/texinfo.tex Wed Dec 24 01:36:39 1997 - *************** - *** 1,5 **** - ! %% TeX macros to handle texinfo files - - ! % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. - - %This texinfo.tex file is free software; you can redistribute it and/or - --- 1,7 ---- - ! %% TeX macros to handle Texinfo files. - ! %% $Id: texinfo.tex,v 2.220 1997/12/23 16:33:04 karl Exp $ - - ! % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, - ! % 94, 95, 96, 97 Free Software Foundation, Inc. - - %This texinfo.tex file is free software; you can redistribute it and/or - *************** - *** 15,20 **** - %You should have received a copy of the GNU General Public License - %along with this texinfo.tex file; see the file COPYING. If not, write - ! %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, - ! %USA. - - - --- 17,22 ---- - %You should have received a copy of the GNU General Public License - %along with this texinfo.tex file; see the file COPYING. If not, write - ! %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - ! %Boston, MA 02111-1307, USA. - - - *************** - *** 35,39 **** - % This automatically updates the version number based on RCS. - \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} - ! \deftexinfoversion$Revision: 2.150 $ - \message{Loading texinfo package [Version \texinfoversion]:} - - --- 37,41 ---- - % This automatically updates the version number based on RCS. - \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} - ! \deftexinfoversion$Revision: 2.220 $ - \message{Loading texinfo package [Version \texinfoversion]:} - - *************** - *** 46,63 **** - % Save some parts of plain tex whose names we will redefine. - - - \let\ptextilde=\~ - - \let\ptexlbrace=\{ - - \let\ptexrbrace=\} - - \let\ptexdots=\dots - - \let\ptexdot=\. - - \let\ptexstar=\* - - \let\ptexend=\end - - \let\ptexbullet=\bullet - \let\ptexb=\b - \let\ptexc=\c - \let\ptexi=\i - \let\ptext=\t - - \let\ptexl=\l - - \let\ptexL=\L - - % Be sure we're in horizontal mode when doing a tie, since we make space - --- 48,64 ---- - % Save some parts of plain tex whose names we will redefine. - - \let\ptexb=\b - + \let\ptexbullet=\bullet - \let\ptexc=\c - + \let\ptexcomma=\, - + \let\ptexdot=\. - + \let\ptexdots=\dots - + \let\ptexend=\end - + \let\ptexequiv = \equiv - \let\ptexi=\i - + \let\ptexlbrace=\{ - + \let\ptexrbrace=\} - + \let\ptexstar=\* - \let\ptext=\t - - % Be sure we're in horizontal mode when doing a tie, since we make space - *************** - *** 70,76 **** - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - ! \gdef\tie{\lvvmode\penalty\tiepenalty\ } - } - ! \let\~ = \tie % And make it available as @~. - - \message{Basics,} - --- 71,77 ---- - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - ! \gdef\tie{\leavevmode\penalty\tiepenalty\ } - } - ! - - \message{Basics,} - *************** - *** 101,110 **** - \hyphenation{mini-buf-fer mini-buf-fers} - \hyphenation{eshell} - - % Margin to add to right of even pages, to left of odd pages. - ! \newdimen \bindingoffset \bindingoffset=0pt - ! \newdimen \normaloffset \normaloffset=\hoffset - \newdimen\pagewidth \newdimen\pageheight - - \pagewidth=\hsize \pageheight=\vsize - - % Sometimes it is convenient to have everything in the transcript file - --- 102,111 ---- - \hyphenation{mini-buf-fer mini-buf-fers} - \hyphenation{eshell} - + \hyphenation{white-space} - - % Margin to add to right of even pages, to left of odd pages. - ! \newdimen \bindingoffset - ! \newdimen \normaloffset - \newdimen\pagewidth \newdimen\pageheight - - % Sometimes it is convenient to have everything in the transcript file - *************** - *** 119,131 **** - }% - - ! %---------------------Begin change----------------------- - % - ! %%%% For @cropmarks command. - ! % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 - % - \newdimen\cornerlong \newdimen\cornerthick - ! \newdimen \topandbottommargin - ! \newdimen \outerhsize \newdimen \outervsize - ! \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks - \outerhsize=7in - %\outervsize=9.5in - --- 120,136 ---- - }% - - ! % For @cropmarks command. - ! % Do @cropmarks to get crop marks. - ! % - ! \newif\ifcropmarks - ! \let\cropmarks = \cropmarkstrue - % - ! % Dimensions to add cropmarks at corners. - ! % Added by P. A. MacKay, 12 Nov. 1986 - % - \newdimen\cornerlong \newdimen\cornerthick - ! \newdimen\topandbottommargin - ! \newdimen\outerhsize \newdimen\outervsize - ! \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks - \outerhsize=7in - %\outervsize=9.5in - *************** - *** 133,187 **** - \outervsize=9.25in - \topandbottommargin=.75in - ! % - ! %---------------------End change----------------------- - - % \onepageout takes a vbox as an argument. Note that \pagecontents - ! % does insertions itself, but you have to call it yourself. - ! \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} - ! \def\onepageout#1{\hoffset=\normaloffset - ! \ifodd\pageno \advance\hoffset by \bindingoffset - ! \else \advance\hoffset by -\bindingoffset\fi - ! {\escapechar=`\\\relax % makes sure backslash is used in output files. - ! \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% - ! {\let\hsize=\pagewidth \makefootline}}}% - ! \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} - ! - ! %%%% For @cropmarks command %%%% - ! - ! % Here is a modification of the main output routine for Near East Publications - ! % This provides right-angle cropmarks at all four corners. - ! % The contents of the page are centerlined into the cropmarks, - ! % and any desired binding offset is added as an \hskip on either - ! % site of the centerlined box. (P. A. MacKay, 12 November, 1986) - ! % - ! \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up - ! {\escapechar=`\\\relax % makes sure backslash is used in output files. - ! \shipout - ! \vbox to \outervsize{\hsize=\outerhsize - ! \vbox{\line{\ewtop\hfill\ewtop}} - ! \nointerlineskip - ! \line{\vbox{\moveleft\cornerthick\nstop} - ! \hfill - ! \vbox{\moveright\cornerthick\nstop}} - ! \vskip \topandbottommargin - ! \centerline{\ifodd\pageno\hskip\bindingoffset\fi - ! \vbox{ - ! {\let\hsize=\pagewidth \makeheadline} - ! \pagebody{#1} - ! {\let\hsize=\pagewidth \makefootline}} - ! \ifodd\pageno\else\hskip\bindingoffset\fi} - ! \vskip \topandbottommargin plus1fill minus1fill - ! \boxmaxdepth\cornerthick - ! \line{\vbox{\moveleft\cornerthick\nsbot} - ! \hfill - ! \vbox{\moveright\cornerthick\nsbot}} - ! \nointerlineskip - ! \vbox{\line{\ewbot\hfill\ewbot}} - ! }} - \advancepageno - ! \ifnum\outputpenalty>-20000 \else\dosupereject\fi} - ! % - ! % Do @cropmarks to get crop marks - ! \def\cropmarks{\let\onepageout=\croppageout } - - \newinsert\margin \dimen\margin=\maxdimen - --- 138,217 ---- - \outervsize=9.25in - \topandbottommargin=.75in - ! - ! % Main output routine. - ! \chardef\PAGE = 255 - ! \output = {\onepageout{\pagecontents\PAGE}} - ! - ! \newbox\headlinebox - ! \newbox\footlinebox - - % \onepageout takes a vbox as an argument. Note that \pagecontents - ! % does insertions, but you have to call it yourself. - ! \def\onepageout#1{% - ! \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi - ! % - ! \ifodd\pageno \advance\hoffset by \bindingoffset - ! \else \advance\hoffset by -\bindingoffset\fi - ! % - ! % Do this outside of the \shipout so @code etc. will be expanded in - ! % the headline as they should be, not taken literally (outputting ''code). - ! \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% - ! \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% - ! % - ! {% - ! % Have to do this stuff outside the \shipout because we want it to - ! % take effect in \write's, yet the group defined by the \vbox ends - ! % before the \shipout runs. - ! % - ! \escapechar = `\\ % use backslash in output files. - ! \indexdummies % don't expand commands in the output. - ! \normalturnoffactive % \ in index entries must not stay \, e.g., if - ! % the page break happens to be in the middle of an example. - ! \shipout\vbox{% - ! \ifcropmarks \vbox to \outervsize\bgroup - ! \hsize = \outerhsize - ! \line{\ewtop\hfil\ewtop}% - ! \nointerlineskip - ! \line{% - ! \vbox{\moveleft\cornerthick\nstop}% - ! \hfill - ! \vbox{\moveright\cornerthick\nstop}% - ! }% - ! \vskip\topandbottommargin - ! \line\bgroup - ! \hfil % center the page within the outer (page) hsize. - ! \ifodd\pageno\hskip\bindingoffset\fi - ! \vbox\bgroup - ! \fi - ! % - ! \unvbox\headlinebox - ! \pagebody{#1}% - ! \ifdim\ht\footlinebox > 0pt - ! % Only leave this space if the footline is nonempty. - ! % (We lessened \vsize for it in \oddfootingxxx.) - ! % The \baselineskip=24pt in plain's \makefootline has no effect. - ! \vskip 2\baselineskip - ! \unvbox\footlinebox - ! \fi - ! % - ! \ifcropmarks - ! \egroup % end of \vbox\bgroup - ! \hfil\egroup % end of (centering) \line\bgroup - ! \vskip\topandbottommargin plus1fill minus1fill - ! \boxmaxdepth = \cornerthick - ! \line{% - ! \vbox{\moveleft\cornerthick\nsbot}% - ! \hfill - ! \vbox{\moveright\cornerthick\nsbot}% - ! }% - ! \nointerlineskip - ! \line{\ewbot\hfil\ewbot}% - ! \egroup % \vbox from first cropmarks clause - ! \fi - ! }% end of \shipout\vbox - ! }% end of group with \turnoffactive - \advancepageno - ! \ifnum\outputpenalty>-20000 \else\dosupereject\fi - ! } - - \newinsert\margin \dimen\margin=\maxdimen - *************** - *** 198,202 **** - } - - - % - % Here are the rules for the cropmarks. Note that they are - % offset so that the space between them is truly \outerhsize or \outervsize - --- 228,231 ---- - *************** - *** 366,374 **** - - % Used to generate quoted braces. - - - \def\mylbrace {{\tt \char '173}} - \def\myrbrace {{\tt \char '175}} - \let\{=\mylbrace - \let\}=\myrbrace - - % @: forces normal size whitespace following. - --- 395,435 ---- - - % Used to generate quoted braces. - \def\mylbrace {{\tt \char '173}} - \def\myrbrace {{\tt \char '175}} - \let\{=\mylbrace - \let\}=\myrbrace - + \begingroup - + % Definitions to produce actual \{ & \} command in an index. - + \catcode`\{ = 12 \catcode`\} = 12 - + \catcode`\[ = 1 \catcode`\] = 2 - + \catcode`\@ = 0 \catcode`\\ = 12 - + @gdef@lbracecmd[\{]% - + @gdef@rbracecmd[\}]% - + @endgroup - + - + % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent - + % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. - + \let\, = \c - + \let\dotaccent = \. - + \def\ringaccent#1{{\accent23 #1}} - + \let\tieaccent = \t - + \let\ubaraccent = \b - + \let\udotaccent = \d - + - + % Other special characters: @questiondown @exclamdown - + % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. - + \def\questiondown{?`} - + \def\exclamdown{!`} - + - + % Dotless i and dotless j, used for accents. - + \def\imacro{i} - + \def\jmacro{j} - + \def\dotless#1{% - + \def\temp{#1}% - + \ifx\temp\imacro \ptexi - + \else\ifx\temp\jmacro \j - + \else \errmessage{@dotless can be used only with i or j}% - + \fi\fi - + } - - % @: forces normal size whitespace following. - *************** where each line of input produces a line - *** 537,551 **** - \leftline{\hskip\leftskip{\rm#1}}}} - - %\hbox{{\rm#1}}\hfil\break}} - - % @include file insert text of that file as input. - ! - ! \def\include{\parsearg\includezzz} - ! %Use \input\thisfile to avoid blank after \input, which may be an active - ! %char (in which case the blank would become the \input argument). - ! %The grouping keeps the value of \thisfile correct even when @include - ! %is nested. - ! \def\includezzz #1{\begingroup - ! \def\thisfile{#1}\input\thisfile - \endgroup} - - --- 598,629 ---- - \leftline{\hskip\leftskip{\rm#1}}}} - - + % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. - + - + \def\inmargin#1{% - + \strut\vadjust{\nobreak\kern-\strutdepth - + \vtop to \strutdepth{\baselineskip\strutdepth\vss - + \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} - + \newskip\inmarginspacing \inmarginspacing=1cm - + \def\strutdepth{\dp\strutbox} - + - %\hbox{{\rm#1}}\hfil\break}} - - % @include file insert text of that file as input. - ! % Allow normal characters that we make active in the argument (a file name). - ! \def\include{\begingroup - ! \catcode`\\=12 - ! \catcode`~=12 - ! \catcode`^=12 - ! \catcode`_=12 - ! \catcode`|=12 - ! \catcode`<=12 - ! \catcode`>=12 - ! \catcode`+=12 - ! \parsearg\includezzz} - ! % Restore active chars for included file. - ! \def\includezzz#1{\endgroup\begingroup - ! % Read the included file in a group so nested @include's work. - ! \def\thisfile{#1}% - ! \input\thisfile - \endgroup} - - *************** where each line of input produces a line - *** 562,566 **** - - \def\sp{\parsearg\spxxx} - ! \def\spxxx #1{\par \vskip #1\baselineskip} - - % @comment ...line which is ignored... - --- 640,644 ---- - - \def\sp{\parsearg\spxxx} - ! \def\spxxx #1{\vskip #1\baselineskip} - - % @comment ...line which is ignored... - *************** where each line of input produces a line - *** 575,578 **** - --- 653,659 ---- - \let\c=\comment - - + % @paragraphindent is defined for the Info formatting commands only. - + \let\paragraphindent=\comment - + - % Prevent errors for section commands. - % Used in @ignore and in failing conditionals. - *************** where each line of input produces a line - *** 609,612 **** - --- 690,694 ---- - % - \def\ignoremorecommands{% - + \let\defcodeindex = \relax - \let\defcv = \relax - \let\deffn = \relax - *************** where each line of input produces a line - *** 632,635 **** - --- 714,726 ---- - \let\pxref = \relax - \let\settitle = \relax - + \let\setchapternewpage = \relax - + \let\setchapterstyle = \relax - + \let\everyheading = \relax - + \let\evenheading = \relax - + \let\oddheading = \relax - + \let\everyfooting = \relax - + \let\evenfooting = \relax - + \let\oddfooting = \relax - + \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - *************** where each line of input produces a line - *** 640,644 **** - \let\clear = \relax - \let\item = \relax - - \let\message = \relax - } - - --- 731,734 ---- - *************** where each line of input produces a line - *** 647,658 **** - \def\ignore{\doignore{ignore}} - - ! % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. - % - \def\ifinfo{\doignore{ifinfo}} - \def\ifhtml{\doignore{ifhtml}} - \def\html{\doignore{html}} - \def\menu{\doignore{menu}} - \def\direntry{\doignore{direntry}} - - % Ignore text until a line `@end #1'. - % - --- 737,759 ---- - \def\ignore{\doignore{ignore}} - - ! % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. - % - \def\ifinfo{\doignore{ifinfo}} - \def\ifhtml{\doignore{ifhtml}} - + \def\ifnottex{\doignore{ifnottex}} - \def\html{\doignore{html}} - \def\menu{\doignore{menu}} - \def\direntry{\doignore{direntry}} - - + % Also ignore @macro ... @end macro. The user must run texi2dvi, - + % which runs makeinfo to do macro expansion. Ignore @unmacro, too. - + \def\macro{\doignore{macro}} - + \let\unmacro = \comment - + - + - + % @dircategory CATEGORY -- specify a category of the dir file - + % which this file should belong to. Ignore this in TeX. - + \let\dircategory = \comment - + - % Ignore text until a line `@end #1'. - % - *************** where each line of input produces a line - *** 667,670 **** - --- 768,775 ---- - \catcode32 = 10 - % - + % Ignore braces, too, so mismatched braces don't cause trouble. - + \catcode`\{ = 9 - + \catcode`\} = 9 - + % - % And now expand that command. - \doignoretext - *************** where each line of input produces a line - *** 686,694 **** - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - ! \warnedobstrue - \fi - } - --- 791,800 ---- - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - + \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - ! \global\warnedobstrue - \fi - } - *************** where each line of input produces a line - *** 757,761 **** - % - % Do not execute instructions in @tex - ! \def\tex{\doignore{tex}} - } - - --- 863,867 ---- - % - % Do not execute instructions in @tex - ! \def\tex{\doignore{tex}}% - } - - *************** where each line of input produces a line - *** 766,772 **** - % empty), we can't just use \parsearg; we have to insert a space of our - % own to delimit the rest of the line, and then take it out again if we - ! % didn't need it. - % - ! \def\set{\parsearg\setxxx} - \def\setxxx#1{\setyyy#1 \endsetyyy} - \def\setyyy#1 #2\endsetyyy{% - --- 872,881 ---- - % empty), we can't just use \parsearg; we have to insert a space of our - % own to delimit the rest of the line, and then take it out again if we - ! % didn't need it. Make sure the catcode of space is correct to avoid - ! % losing inside @example, for instance. - % - ! \def\set{\begingroup\catcode` =10 - ! \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - ! \parsearg\setxxx} - \def\setxxx#1{\setyyy#1 \endsetyyy} - \def\setyyy#1 #2\endsetyyy{% - *************** where each line of input produces a line - *** 775,778 **** - --- 884,888 ---- - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - + \endgroup - } - % Can't use \xdef to pre-expand #2 and save some time, since \temp or - *************** where each line of input produces a line - *** 788,795 **** - % @value{foo} gets the text saved in variable foo. - % - ! \def\value#1{\expandafter - ! \ifx\csname SET#1\endcsname\relax - ! {\{No value for ``#1''\}} - ! \else \csname SET#1\endcsname \fi} - - % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined - --- 898,911 ---- - % @value{foo} gets the text saved in variable foo. - % - ! \def\value{\begingroup - ! \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - ! \valuexxx} - ! \def\valuexxx#1{% - ! \expandafter\ifx\csname SET#1\endcsname\relax - ! {\{No value for ``#1''\}}% - ! \else - ! \csname SET#1\endcsname - ! \fi - ! \endgroup} - - % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined - *************** where each line of input produces a line - *** 823,831 **** - \defineunmatchedend{ifclear} - - ! % @iftex always succeeds; we read the text following, through @end - ! % iftex). But `@end iftex' should be valid only after an @iftex. - % - \def\iftex{\conditionalsucceed{iftex}} - \defineunmatchedend{iftex} - - % We can't just want to start a group at @iftex (for example) and end it - --- 939,952 ---- - \defineunmatchedend{ifclear} - - ! % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text - ! % following, through the first @end iftex (etc.). Make `@end iftex' - ! % (etc.) valid only after an @iftex. - % - \def\iftex{\conditionalsucceed{iftex}} - + \def\ifnothtml{\conditionalsucceed{ifnothtml}} - + \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} - \defineunmatchedend{iftex} - + \defineunmatchedend{ifnothtml} - + \defineunmatchedend{ifnotinfo} - - % We can't just want to start a group at @iftex (for example) and end it - *************** where each line of input produces a line - *** 891,894 **** - --- 1012,1016 ---- - \global\let\lastnode=\relax} - - + % @refill is a no-op. - \let\refill=\relax - - *************** where each line of input produces a line - *** 902,913 **** - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. - \comment % Ignore the actual filename. - } - - \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - - ! \def\inforef #1{\inforefzzz #1,,,,**} - ! \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - ! node \samp{\ignorespaces#1{}}} - - \message{fonts,} - --- 1024,1057 ---- - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. - + % - + % If texinfo.cnf is present on the system, read it. - + % Useful for site-wide @afourpaper, etc. - + % Just to be on the safe side, close the input stream before the \input. - + \openin 1 texinfo.cnf - + \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - + \closein1 - + \temp - + % - \comment % Ignore the actual filename. - } - - + % @bye. - \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - - ! % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} - ! % \def\macroxxx#1#2 \end macro{% - ! % \expandafter\gdef\macrotemp#1{#2}% - ! % \endgroup} - ! - ! %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} - ! %\def\linemacroxxx#1#2 \end linemacro{% - ! %\let\parsearg=\relax - ! %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% - ! %\expandafter\xdef\macrotemp{\parsearg\macrotempx}% - ! %\expandafter\gdef\macrotempx#1{#2}% - ! %\endgroup} - ! - ! %\def\butfirst#1{} - ! - - \message{fonts,} - *************** where each line of input produces a line - *** 921,930 **** - \let\li = \sf % Sometimes we call it \li, not \sf. - - ! %% Try out Computer Modern fonts at \magstephalf - ! \let\mainmagstep=\magstephalf - - % Set the font macro #1 to the font named #2, adding on the - % specified font prefix (normally `cm'). - ! \def\setfont#1#2{\font#1=\fontprefix#2} - - % Use cm as the default font prefix. - --- 1065,1079 ---- - \let\li = \sf % Sometimes we call it \li, not \sf. - - ! % We don't need math for this one. - ! \def\ttsl{\tenttsl} - ! - ! % Use Computer Modern fonts at \magstephalf (11pt). - ! \newcount\mainmagstep - ! \mainmagstep=\magstephalf - - % Set the font macro #1 to the font named #2, adding on the - % specified font prefix (normally `cm'). - ! % #3 is the font's design size, #4 is a scale factor - ! \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} - - % Use cm as the default font prefix. - *************** where each line of input produces a line - *** 934,1029 **** - \def\fontprefix{cm} - \fi - - \ifx\bigger\relax - \let\mainmagstep=\magstep1 - ! \setfont\textrm{r12} - ! \setfont\texttt{tt12} - \else - ! \setfont\textrm{r10 scaled \mainmagstep} - ! \setfont\texttt{tt10 scaled \mainmagstep} - \fi - % Instead of cmb10, you many want to use cmbx10. - % cmbx10 is a prettier font on its own, but cmb10 - % looks better when embedded in a line with cmr10. - ! \setfont\textbf{b10 scaled \mainmagstep} - ! \setfont\textit{ti10 scaled \mainmagstep} - ! \setfont\textsl{sl10 scaled \mainmagstep} - ! \setfont\textsf{ss10 scaled \mainmagstep} - ! \setfont\textsc{csc10 scaled \mainmagstep} - \font\texti=cmmi10 scaled \mainmagstep - \font\textsy=cmsy10 scaled \mainmagstep - - % A few fonts for @defun, etc. - ! \setfont\defbf{bx10 scaled \magstep1} %was 1314 - ! \setfont\deftt{tt10 scaled \magstep1} - \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} - - ! % Fonts for indices and small examples. - % We actually use the slanted font rather than the italic, - % because texinfo normally uses the slanted fonts for that. - % Do not make many font distinctions in general in the index, since they - % aren't very useful. - ! \setfont\ninett{tt9} - ! \setfont\indrm{r9} - ! \setfont\indit{sl9} - \let\indsl=\indit - \let\indtt=\ninett - \let\indsf=\indrm - \let\indbf=\indrm - ! \setfont\indsc{csc10 at 9pt} - \font\indi=cmmi9 - \font\indsy=cmsy9 - - ! % Fonts for headings - ! \setfont\chaprm{bx12 scaled \magstep2} - ! \setfont\chapit{ti12 scaled \magstep2} - ! \setfont\chapsl{sl12 scaled \magstep2} - ! \setfont\chaptt{tt12 scaled \magstep2} - ! \setfont\chapsf{ss12 scaled \magstep2} - \let\chapbf=\chaprm - ! \setfont\chapsc{csc10 scaled\magstep3} - \font\chapi=cmmi12 scaled \magstep2 - \font\chapsy=cmsy10 scaled \magstep3 - - ! \setfont\secrm{bx12 scaled \magstep1} - ! \setfont\secit{ti12 scaled \magstep1} - ! \setfont\secsl{sl12 scaled \magstep1} - ! \setfont\sectt{tt12 scaled \magstep1} - ! \setfont\secsf{ss12 scaled \magstep1} - ! \setfont\secbf{bx12 scaled \magstep1} - ! \setfont\secsc{csc10 scaled\magstep2} - \font\seci=cmmi12 scaled \magstep1 - \font\secsy=cmsy10 scaled \magstep2 - - ! % \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. - ! % \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. - ! % \setfont\ssecsl{sl10 scaled \magstep1} - ! % \setfont\ssectt{tt10 scaled \magstep1} - ! % \setfont\ssecsf{ss10 scaled \magstep1} - ! - ! %\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. - ! %\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than - ! %\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. - ! %\setfont\ssectt{tt10 scaled 1315} - ! %\setfont\ssecsf{ss10 scaled 1315} - - %\let\ssecbf=\ssecrm - - ! \setfont\ssecrm{bx12 scaled \magstephalf} - ! \setfont\ssecit{ti12 scaled \magstephalf} - ! \setfont\ssecsl{sl12 scaled \magstephalf} - ! \setfont\ssectt{tt12 scaled \magstephalf} - ! \setfont\ssecsf{ss12 scaled \magstephalf} - ! \setfont\ssecbf{bx12 scaled \magstephalf} - ! \setfont\ssecsc{csc10 scaled \magstep1} - \font\sseci=cmmi12 scaled \magstephalf - ! \font\ssecsy=cmsy10 scaled \magstep1 - % The smallcaps and symbol fonts should actually be scaled \magstep1.5, - % but that is not a standard magnification. - - - % Fonts for title page: - - \setfont\titlerm{bx12 scaled \magstep3} - - \let\authorrm = \secrm - - - % In order for the font changes to affect most math symbols and letters, - % we have to define the \textfont of the standard families. Since - --- 1083,1210 ---- - \def\fontprefix{cm} - \fi - + % Support font families that don't use the same naming scheme as CM. - + \def\rmshape{r} - + \def\rmbshape{bx} %where the normal face is bold - + \def\bfshape{b} - + \def\bxshape{bx} - + \def\ttshape{tt} - + \def\ttbshape{tt} - + \def\ttslshape{sltt} - + \def\itshape{ti} - + \def\itbshape{bxti} - + \def\slshape{sl} - + \def\slbshape{bxsl} - + \def\sfshape{ss} - + \def\sfbshape{ss} - + \def\scshape{csc} - + \def\scbshape{csc} - - \ifx\bigger\relax - \let\mainmagstep=\magstep1 - ! \setfont\textrm\rmshape{12}{1000} - ! \setfont\texttt\ttshape{12}{1000} - \else - ! \setfont\textrm\rmshape{10}{\mainmagstep} - ! \setfont\texttt\ttshape{10}{\mainmagstep} - \fi - % Instead of cmb10, you many want to use cmbx10. - % cmbx10 is a prettier font on its own, but cmb10 - % looks better when embedded in a line with cmr10. - ! \setfont\textbf\bfshape{10}{\mainmagstep} - ! \setfont\textit\itshape{10}{\mainmagstep} - ! \setfont\textsl\slshape{10}{\mainmagstep} - ! \setfont\textsf\sfshape{10}{\mainmagstep} - ! \setfont\textsc\scshape{10}{\mainmagstep} - ! \setfont\textttsl\ttslshape{10}{\mainmagstep} - \font\texti=cmmi10 scaled \mainmagstep - \font\textsy=cmsy10 scaled \mainmagstep - - % A few fonts for @defun, etc. - ! \setfont\defbf\bxshape{10}{\magstep1} %was 1314 - ! \setfont\deftt\ttshape{10}{\magstep1} - \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} - - ! % Fonts for indices and small examples (9pt). - % We actually use the slanted font rather than the italic, - % because texinfo normally uses the slanted fonts for that. - % Do not make many font distinctions in general in the index, since they - % aren't very useful. - ! \setfont\ninett\ttshape{9}{1000} - ! \setfont\indrm\rmshape{9}{1000} - ! \setfont\indit\slshape{9}{1000} - \let\indsl=\indit - \let\indtt=\ninett - + \let\indttsl=\ninett - \let\indsf=\indrm - \let\indbf=\indrm - ! \setfont\indsc\scshape{10}{900} - \font\indi=cmmi9 - \font\indsy=cmsy9 - - ! % Fonts for title page: - ! \setfont\titlerm\rmbshape{12}{\magstep3} - ! \setfont\titleit\itbshape{10}{\magstep4} - ! \setfont\titlesl\slbshape{10}{\magstep4} - ! \setfont\titlett\ttbshape{12}{\magstep3} - ! \setfont\titlettsl\ttslshape{10}{\magstep4} - ! \setfont\titlesf\sfbshape{17}{\magstep1} - ! \let\titlebf=\titlerm - ! \setfont\titlesc\scbshape{10}{\magstep4} - ! \font\titlei=cmmi12 scaled \magstep3 - ! \font\titlesy=cmsy10 scaled \magstep4 - ! \def\authorrm{\secrm} - ! - ! % Chapter (and unnumbered) fonts (17.28pt). - ! \setfont\chaprm\rmbshape{12}{\magstep2} - ! \setfont\chapit\itbshape{10}{\magstep3} - ! \setfont\chapsl\slbshape{10}{\magstep3} - ! \setfont\chaptt\ttbshape{12}{\magstep2} - ! \setfont\chapttsl\ttslshape{10}{\magstep3} - ! \setfont\chapsf\sfbshape{17}{1000} - \let\chapbf=\chaprm - ! \setfont\chapsc\scbshape{10}{\magstep3} - \font\chapi=cmmi12 scaled \magstep2 - \font\chapsy=cmsy10 scaled \magstep3 - - ! % Section fonts (14.4pt). - ! \setfont\secrm\rmbshape{12}{\magstep1} - ! \setfont\secit\itbshape{10}{\magstep2} - ! \setfont\secsl\slbshape{10}{\magstep2} - ! \setfont\sectt\ttbshape{12}{\magstep1} - ! \setfont\secttsl\ttslshape{10}{\magstep2} - ! \setfont\secsf\sfbshape{12}{\magstep1} - ! \let\secbf\secrm - ! \setfont\secsc\scbshape{10}{\magstep2} - \font\seci=cmmi12 scaled \magstep1 - \font\secsy=cmsy10 scaled \magstep2 - - ! % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. - ! % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. - ! % \setfont\ssecsl\slshape{10}{\magstep1} - ! % \setfont\ssectt\ttshape{10}{\magstep1} - ! % \setfont\ssecsf\sfshape{10}{\magstep1} - ! - ! %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. - ! %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than - ! %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. - ! %\setfont\ssectt\ttshape{10}{1315} - ! %\setfont\ssecsf\sfshape{10}{1315} - - %\let\ssecbf=\ssecrm - - ! % Subsection fonts (13.15pt). - ! \setfont\ssecrm\rmbshape{12}{\magstephalf} - ! \setfont\ssecit\itbshape{10}{1315} - ! \setfont\ssecsl\slbshape{10}{1315} - ! \setfont\ssectt\ttbshape{12}{\magstephalf} - ! \setfont\ssecttsl\ttslshape{10}{1315} - ! \setfont\ssecsf\sfbshape{12}{\magstephalf} - ! \let\ssecbf\ssecrm - ! \setfont\ssecsc\scbshape{10}{\magstep1} - \font\sseci=cmmi12 scaled \magstephalf - ! \font\ssecsy=cmsy10 scaled 1315 - % The smallcaps and symbol fonts should actually be scaled \magstep1.5, - % but that is not a standard magnification. - - % In order for the font changes to affect most math symbols and letters, - % we have to define the \textfont of the standard families. Since - *************** where each line of input produces a line - *** 1042,1073 **** - % of just \STYLE. We do this so that font changes will continue to work - % in math mode, where it is the current \fam that is relevant in most - ! % cases, not the current. Plain TeX does, for example, - ! % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need - ! % to redefine \bf itself. - \def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - ! \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy - \resetmathfonts} - \def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - ! \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - ! \resetmathfonts} - \def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - ! \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - ! \resetmathfonts} - \def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - ! \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - ! \resetmathfonts} - \def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - ! \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy - ! \resetmathfonts} - - % Set up the default fonts, so we can use them for creating boxes. - --- 1223,1262 ---- - % of just \STYLE. We do this so that font changes will continue to work - % in math mode, where it is the current \fam that is relevant in most - ! % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam - ! % \tenbf}, for example. By redefining \tenbf, we obviate the need to - ! % redefine \bf itself. - \def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - ! \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl - \resetmathfonts} - + \def\titlefonts{% - + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl - + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc - + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy - + \let\tenttsl=\titlettsl - + \resetmathfonts \setleading{25pt}} - + \def\titlefont#1{{\titlefonts\rm #1}} - \def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - ! \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl - ! \resetmathfonts \setleading{19pt}} - \def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - ! \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl - ! \resetmathfonts \setleading{16pt}} - \def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - ! \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl - ! \resetmathfonts \setleading{15pt}} - ! \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? - \def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - ! \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl - ! \resetmathfonts \setleading{12pt}} - - % Set up the default fonts, so we can use them for creating boxes. - *************** where each line of input produces a line - *** 1079,1085 **** - - % Fonts for short table of contents. - ! \setfont\shortcontrm{r12} - ! \setfont\shortcontbf{bx12} - ! \setfont\shortcontsl{sl12} - - %% Add scribe-like font environments, plus @l for inline lisp (usually sans - --- 1268,1274 ---- - - % Fonts for short table of contents. - ! \setfont\shortcontrm\rmshape{12}{1000} - ! \setfont\shortcontbf\bxshape{12}{1000} - ! \setfont\shortcontsl\slshape{12}{1000} - - %% Add scribe-like font environments, plus @l for inline lisp (usually sans - *************** where each line of input produces a line - *** 1113,1117 **** - \let\ttfont=\t - \def\samp #1{`\tclose{#1}'\null} - ! \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} - \def\ctrl #1{{\tt \rawbackslash \hat}#1} - - --- 1302,1315 ---- - \let\ttfont=\t - \def\samp #1{`\tclose{#1}'\null} - ! \setfont\smallrm\rmshape{8}{1000} - ! \font\smallsy=cmsy9 - ! \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% - ! \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% - ! \vbox{\hrule\kern-0.4pt - ! \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% - ! \kern-0.4pt\hrule}% - ! \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} - ! % The old definition, with no lozenge: - ! %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} - \def\ctrl #1{{\tt \rawbackslash \hat}#1} - - *************** where each line of input produces a line - *** 1142,1146 **** - - % We *must* turn on hyphenation at `-' and `_' in \code. - ! % Otherwise, it is too hard to avoid overful hboxes - % in the Emacs manual, the Library manual, etc. - - --- 1340,1344 ---- - - % We *must* turn on hyphenation at `-' and `_' in \code. - ! % Otherwise, it is too hard to avoid overfull hboxes - % in the Emacs manual, the Library manual, etc. - - *************** where each line of input produces a line - *** 1148,1156 **** - % both hyphenation at - and hyphenation within words. - % We must therefore turn them both off (\tclose does that) - ! % and arrange explicitly to hyphenate an a dash. - % -- rms. - { - \catcode`\-=\active - \catcode`\_=\active - \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} - % The following is used by \doprintindex to insure that long function names - --- 1346,1355 ---- - % both hyphenation at - and hyphenation within words. - % We must therefore turn them both off (\tclose does that) - ! % and arrange explicitly to hyphenate at a dash. - % -- rms. - { - \catcode`\-=\active - \catcode`\_=\active - + \catcode`\|=\active - \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} - % The following is used by \doprintindex to insure that long function names - *************** where each line of input produces a line - *** 1158,1168 **** - % read from the file, as \entry parses the arguments long before \code is - % ever called. -- mycroft - ! \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} - } - - \def\realdash{-} - - \def\realunder{_} - \def\codedash{-\discretionary{}{}{}} - ! \def\codeunder{\normalunderscore\discretionary{}{}{}} - \def\codex #1{\tclose{#1}\endgroup} - - --- 1357,1371 ---- - % read from the file, as \entry parses the arguments long before \code is - % ever called. -- mycroft - ! % _ is always active; and it shouldn't be \let = to an _ that is a - ! % subscript character anyway. Then, @cindex @samp{_} (for example) - ! % fails. --karl - ! \global\def\indexbreaks{% - ! \catcode`\-=\active \let-\realdash - ! } - } - - \def\realdash{-} - \def\codedash{-\discretionary{}{}{}} - ! \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} - \def\codex #1{\tclose{#1}\endgroup} - - *************** where each line of input produces a line - *** 1172,1180 **** - % then @kbd has no effect. - - \def\xkey{\key} - \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% - \ifx\one\xkey\ifx\threex\three \key{#2}% - ! \else\tclose{\look}\fi - ! \else\tclose{\look}\fi} - - % Typeset a dimension, e.g., `in' or `pt'. The only reason for the - --- 1375,1434 ---- - % then @kbd has no effect. - - + % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), - + % `example' (@kbd uses ttsl only inside of @example and friends), - + % or `code' (@kbd uses normal tty font always). - + \def\kbdinputstyle{\parsearg\kbdinputstylexxx} - + \def\kbdinputstylexxx#1{% - + \def\arg{#1}% - + \ifx\arg\worddistinct - + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% - + \else\ifx\arg\wordexample - + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% - + \else\ifx\arg\wordcode - + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% - + \fi\fi\fi - + } - + \def\worddistinct{distinct} - + \def\wordexample{example} - + \def\wordcode{code} - + - + % Default is kbdinputdistinct. (Too much of a hassle to call the macro, - + % the catcodes are wrong for parsearg to work.) - + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} - + - \def\xkey{\key} - \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% - \ifx\one\xkey\ifx\threex\three \key{#2}% - ! \else{\tclose{\kbdfont\look}}\fi - ! \else{\tclose{\kbdfont\look}}\fi} - ! - ! % @url. Quotes do not seem necessary, so use \code. - ! \let\url=\code - ! - ! % @uref (abbreviation for `urlref') takes an optional second argument - ! % specifying the text to display. First (mandatory) arg is the url. - ! % Perhaps eventually put in a hypertex \special here. - ! % - ! \def\uref#1{\urefxxx #1,,\finish} - ! \def\urefxxx#1,#2,#3\finish{% - ! \setbox0 = \hbox{\ignorespaces #2}% - ! \ifdim\wd0 > 0pt - ! \unhbox0\ (\code{#1})% - ! \else - ! \code{#1}% - ! \fi - ! } - ! - ! % rms does not like the angle brackets --karl, 17may97. - ! % So now @email is just like @uref. - ! %\def\email#1{$\langle${\tt #1}$\rangle$} - ! \let\email=\uref - ! - ! % Check if we are currently using a typewriter font. Since all the - ! % Computer Modern typewriter fonts have zero interword stretch (and - ! % shrink), and it is reasonable to expect all typewriter fonts to have - ! % this property, we can check that font parameter. - ! % - ! \def\ifmonospace{\ifdim\fontdimen3\font=0pt } - - % Typeset a dimension, e.g., `in' or `pt'. The only reason for the - *************** where each line of input produces a line - *** 1186,1195 **** - \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - - ! \def\l#1{{\li #1}\null} % - - ! \def\r#1{{\rm #1}} % roman font - % Use of \lowercase was suggested. - ! \def\sc#1{{\smallcaps#1}} % smallcaps font - ! \def\ii#1{{\it #1}} % italic font - - \message{page headings,} - --- 1440,1456 ---- - \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - - ! % @l was never documented to mean ``switch to the Lisp font'', - ! % and it is not used as such in any manual I can find. We need it for - ! % Polish suppressed-l. --karl, 22sep96. - ! %\def\l#1{{\li #1}\null} - - ! \def\r#1{{\rm #1}} % roman font - % Use of \lowercase was suggested. - ! \def\sc#1{{\smallcaps#1}} % smallcaps font - ! \def\ii#1{{\it #1}} % italic font - ! - ! % @pounds{} is a sterling sign. - ! \def\pounds{{\it\$}} - ! - - \message{page headings,} - *************** where each line of input produces a line - *** 1199,1204 **** - - % First the title page. Must do @settitle before @titlepage. - - \def\titlefont#1{{\titlerm #1}} - - - \newif\ifseenauthor - \newif\iffinishedtitlepage - --- 1460,1463 ---- - *************** where each line of input produces a line - *** 1206,1210 **** - \def\shorttitlepage{\parsearg\shorttitlepagezzz} - \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - ! \endgroup\page\hbox{}\page} - - \def\titlepage{\begingroup \parindent=0pt \textfonts - --- 1465,1469 ---- - \def\shorttitlepage{\parsearg\shorttitlepagezzz} - \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - ! \endgroup\page\hbox{}\page} - - \def\titlepage{\begingroup \parindent=0pt \textfonts - *************** where each line of input produces a line - *** 1222,1229 **** - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - ! \def\titlezzz##1{\leftline{\titlefont{##1}} - ! % print a rule at the page bottom also. - ! \finishedtitlepagefalse - ! \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - --- 1481,1488 ---- - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - ! \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - ! % print a rule at the page bottom also. - ! \finishedtitlepagefalse - ! \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - *************** where each line of input produces a line - *** 1243,1247 **** - \def\page{% - \iffinishedtitlepage\else - ! \finishtitlepage - \fi - \oldpage - --- 1502,1506 ---- - \def\page{% - \iffinishedtitlepage\else - ! \finishtitlepage - \fi - \oldpage - *************** where each line of input produces a line - *** 1311,1318 **** - \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - - ! \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} - ! \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% - ! \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} - ! \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - - \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} - --- 1570,1574 ---- - \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - - ! \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% - - \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} - *************** where each line of input produces a line - *** 1322,1342 **** - \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} - \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% - ! \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - - ! \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} - ! \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% - ! \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} - ! \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - % - }% unbind the catcode of @. - - ! % @headings double turns headings on for double-sided printing. - ! % @headings single turns headings on for single-sided printing. - ! % @headings off turns them off. - ! % @headings on same as @headings double, retained for compatibility. - ! % @headings after turns on double-sided headings after this page. - ! % @headings doubleafter turns on double-sided headings after this page. - % @headings singleafter turns on single-sided headings after this page. - ! % By default, they are off. - - \def\headings #1 {\csname HEADINGS#1\endcsname} - --- 1578,1602 ---- - \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} - \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% - ! \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% - ! % - ! % Leave some space for the footline. Hopefully ok to assume - ! % @evenfooting will not be used by itself. - ! \global\advance\pageheight by -\baselineskip - ! \global\advance\vsize by -\baselineskip - ! } - - ! \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} - % - }% unbind the catcode of @. - - ! % @headings double turns headings on for double-sided printing. - ! % @headings single turns headings on for single-sided printing. - ! % @headings off turns them off. - ! % @headings on same as @headings double, retained for compatibility. - ! % @headings after turns on double-sided headings after this page. - ! % @headings doubleafter turns on double-sided headings after this page. - % @headings singleafter turns on single-sided headings after this page. - ! % By default, they are off at the start of a document, - ! % and turned `on' after @end titlepage. - - \def\headings #1 {\csname HEADINGS#1\endcsname} - *************** where each line of input produces a line - *** 1352,1356 **** - % edge of all pages. - \def\HEADINGSdouble{ - - %\pagealignmacro - \global\pageno=1 - \global\evenfootline={\hfil} - --- 1612,1615 ---- - *************** where each line of input produces a line - *** 1358,1366 **** - \global\evenheadline={\line{\folio\hfil\thistitle}} - \global\oddheadline={\line{\thischapter\hfil\folio}} - } - % For single-sided printing, chapter title goes across top left of page, - % page number on top right. - \def\HEADINGSsingle{ - - %\pagealignmacro - \global\pageno=1 - \global\evenfootline={\hfil} - --- 1617,1627 ---- - \global\evenheadline={\line{\folio\hfil\thistitle}} - \global\oddheadline={\line{\thischapter\hfil\folio}} - + \global\let\contentsalignmacro = \chapoddpage - } - + \let\contentsalignmacro = \chappager - + - % For single-sided printing, chapter title goes across top left of page, - % page number on top right. - \def\HEADINGSsingle{ - \global\pageno=1 - \global\evenfootline={\hfil} - *************** where each line of input produces a line - *** 1368,1371 **** - --- 1629,1633 ---- - \global\evenheadline={\line{\thischapter\hfil\folio}} - \global\oddheadline={\line{\thischapter\hfil\folio}} - + \global\let\contentsalignmacro = \chappager - } - \def\HEADINGSon{\HEADINGSdouble} - *************** where each line of input produces a line - *** 1378,1381 **** - --- 1640,1644 ---- - \global\evenheadline={\line{\folio\hfil\thistitle}} - \global\oddheadline={\line{\thischapter\hfil\folio}} - + \global\let\contentsalignmacro = \chapoddpage - } - - *************** where each line of input produces a line - *** 1386,1389 **** - --- 1649,1653 ---- - \global\evenheadline={\line{\thischapter\hfil\folio}} - \global\oddheadline={\line{\thischapter\hfil\folio}} - + \global\let\contentsalignmacro = \chappager - } - - *************** July\or August\or September\or October\o - *** 1409,1412 **** - --- 1673,1677 ---- - \def\settitlezzz #1{\gdef\thistitle{#1}} - - + - \message{tables,} - - *************** July\or August\or September\or October\o - *** 1441,1445 **** - \newif\ifitemxneedsnegativevskip - - ! \def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} - - \def\internalBitem{\smallbreak \parsearg\itemzzz} - --- 1706,1710 ---- - \newif\ifitemxneedsnegativevskip - - ! \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} - - \def\internalBitem{\smallbreak \parsearg\itemzzz} - *************** July\or August\or September\or October\o - *** 1705,1709 **** - \advance\itemno by 1 - {\let\par=\endgraf \smallbreak}% - ! \ifhmode \errmessage{\in hmode at itemizeitem}\fi - {\parskip=0in \hskip 0pt - \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% - --- 1970,1974 ---- - \advance\itemno by 1 - {\let\par=\endgraf \smallbreak}% - ! \ifhmode \errmessage{In hmode at itemizeitem}\fi - {\parskip=0in \hskip 0pt - \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% - *************** July\or August\or September\or October\o - *** 1712,1719 **** - - % @multitable macros - ! % Amy Hendrickson, 8/18/94 - % - ! % @multitable ... @endmultitable will make as many columns as desired. - ! % Contents of each column will wrap at width given in preamble. Width - % can be specified either with sample text given in a template line, - % or in percent of \hsize, the current width of text on page. - --- 1977,1984 ---- - - % @multitable macros - ! % Amy Hendrickson, 8/18/94, 3/6/96 - % - ! % @multitable ... @end multitable will make as many columns as desired. - ! % Contents of each column will wrap at width given in preamble. Width - % can be specified either with sample text given in a template line, - % or in percent of \hsize, the current width of text on page. - *************** July\or August\or September\or October\o - *** 1723,1746 **** - % To make preamble: - % - ! % Either define widths of columns in terms of percent of \hsize: - ! % @multitable @percentofhsize .2 .3 .5 - % @item ... - % - ! % Numbers following @percentofhsize are the percent of the total - % current hsize to be used for each column. You may use as many - % columns as desired. - - % Or use a template: - % @multitable {Column 1 template} {Column 2 template} {Column 3 template} - % @item ... - % using the widest term desired in each column. - - ! - ! % Each new table line starts with @item, each subsequent new column - % starts with @tab. Empty columns may be produced by supplying @tab's - % with nothing between them for as many times as empty columns are needed, - % ie, @tab@tab@tab will produce two empty columns. - - ! % @item, @tab, @multicolumn or @endmulticolumn do not need to be on their - % own lines, but it will not hurt if they are. - - --- 1988,2021 ---- - % To make preamble: - % - ! % Either define widths of columns in terms of percent of \hsize: - ! % @multitable @columnfractions .25 .3 .45 - % @item ... - % - ! % Numbers following @columnfractions are the percent of the total - % current hsize to be used for each column. You may use as many - % columns as desired. - - + - % Or use a template: - % @multitable {Column 1 template} {Column 2 template} {Column 3 template} - % @item ... - % using the widest term desired in each column. - + % - + % For those who want to use more than one line's worth of words in - + % the preamble, break the line within one argument and it - + % will parse correctly, i.e., - + % - + % @multitable {Column 1 template} {Column 2 template} {Column 3 - + % template} - + % Not: - + % @multitable {Column 1 template} {Column 2 template} - + % {Column 3 template} - - ! % Each new table line starts with @item, each subsequent new column - % starts with @tab. Empty columns may be produced by supplying @tab's - % with nothing between them for as many times as empty columns are needed, - % ie, @tab@tab@tab will produce two empty columns. - - ! % @item, @tab, @multitable or @end multitable do not need to be on their - % own lines, but it will not hurt if they are. - - *************** July\or August\or September\or October\o - *** 1749,1782 **** - % @multitable {Column 1 template} {Column 2 template} {Column 3 template} - % @item first col stuff @tab second col stuff @tab third col - ! % @item - ! % first col stuff - ! % @tab - ! % second col stuff - ! % @tab - ! % third col - ! % @item first col stuff @tab second col stuff - % @tab Many paragraphs of text may be used in any column. - ! % - % They will wrap at the width determined by the template. - % @item@tab@tab This will be in third column. - ! % @endmultitable - - % Default dimensions may be reset by user. - ! % @intableparskip will set vertical space between paragraphs in table. - ! % @intableparindent will set paragraph indent in table. - ! % @spacebetweencols will set horizontal space to be left between columns. - ! % @spacebetweenlines will set vertical space to be left between lines. - - %%%% - ! % Dimensions - - ! \newdimen\intableparskip - ! \newdimen\intableparindent - ! \newdimen\spacebetweencols - ! \newdimen\spacebetweenlines - ! \intableparskip=0pt - ! \intableparindent=6pt - ! \spacebetweencols=12pt - ! \spacebetweenlines=12pt - - %%%% - --- 2024,2059 ---- - % @multitable {Column 1 template} {Column 2 template} {Column 3 template} - % @item first col stuff @tab second col stuff @tab third col - ! % @item - ! % first col stuff - ! % @tab - ! % second col stuff - ! % @tab - ! % third col - ! % @item first col stuff @tab second col stuff - % @tab Many paragraphs of text may be used in any column. - ! % - % They will wrap at the width determined by the template. - % @item@tab@tab This will be in third column. - ! % @end multitable - - % Default dimensions may be reset by user. - ! % @multitableparskip is vertical space between paragraphs in table. - ! % @multitableparindent is paragraph indent in table. - ! % @multitablecolmargin is horizontal space to be left between columns. - ! % @multitablelinespace is space to leave between table items, baseline - ! % to baseline. - ! % 0pt means it depends on current normal line spacing. - - %%%% - ! % Dimensions - - ! \newskip\multitableparskip - ! \newskip\multitableparindent - ! \newdimen\multitablecolspace - ! \newskip\multitablelinespace - ! \multitableparskip=0pt - ! \multitableparindent=6pt - ! \multitablecolspace=12pt - ! \multitablelinespace=0pt - - %%%% - *************** July\or August\or September\or October\o - *** 1784,1841 **** - \let\endsetuptable\relax - \def\xendsetuptable{\endsetuptable} - ! \let\percentofhsize\relax - ! \def\xpercentofhsize{\percentofhsize} - \newif\ifsetpercent - - \newcount\colcount - \def\setuptable#1{\def\firstarg{#1}% - \ifx\firstarg\xendsetuptable\let\go\relax% - \else - ! \ifx\firstarg\xpercentofhsize\global\setpercenttrue% - \else - \ifsetpercent - ! \if#1.\else% - ! \global\advance\colcount by1 % - ! \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% - ! \fi - \else - \global\advance\colcount by1 - ! \setbox0=\hbox{#1}% - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi% - \fi% - ! \let\go\setuptable% - \fi\go} - %%%% - % multitable syntax - ! \def\tab{&} - - %%%% - ! % @multitable ... @endmultitable definitions: - - ! \def\multitable#1\item{\bgroup - \let\item\cr - \tolerance=9500 - \hbadness=9500 - ! \parskip=\intableparskip - ! \parindent=\intableparindent - \overfullrule=0pt - \global\colcount=0\relax% - \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : - ! \def\one{#1}\expandafter\setuptable\one\endsetuptable - % Need to reset this to 0 after \setuptable. - ! \global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - ! % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax% - ! \vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % In order to keep entries from bumping into each other - ! % we will add a \leftskip of \spacebetweencols to all columns after - % the first one. - ! % If a template has been used, we will add \spacebetweencols - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - --- 2061,2131 ---- - \let\endsetuptable\relax - \def\xendsetuptable{\endsetuptable} - ! \let\columnfractions\relax - ! \def\xcolumnfractions{\columnfractions} - \newif\ifsetpercent - - + %% 2/1/96, to allow fractions to be given with more than one digit. - + \def\pickupwholefraction#1 {\global\advance\colcount by1 % - + \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% - + \setuptable} - + - \newcount\colcount - \def\setuptable#1{\def\firstarg{#1}% - \ifx\firstarg\xendsetuptable\let\go\relax% - \else - ! \ifx\firstarg\xcolumnfractions\global\setpercenttrue% - \else - \ifsetpercent - ! \let\go\pickupwholefraction % In this case arg of setuptable - ! % is the decimal point before the - ! % number given in percent of hsize. - ! % We don't need this so we don't use it. - \else - \global\advance\colcount by1 - ! \setbox0=\hbox{#1 }% Add a normal word space as a separator; - ! % typically that is always in the input, anyway. - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi% - \fi% - ! \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% - \fi\go} - + - %%%% - % multitable syntax - ! \def\tab{&\hskip1sp\relax} % 2/2/96 - ! % tiny skip here makes sure this column space is - ! % maintained, even if it is never used. - ! - - %%%% - ! % @multitable ... @end multitable definitions: - - ! \def\multitable{\parsearg\dotable} - ! - ! \def\dotable#1{\bgroup - \let\item\cr - \tolerance=9500 - \hbadness=9500 - ! \setmultitablespacing - ! \parskip=\multitableparskip - ! \parindent=\multitableparindent - \overfullrule=0pt - \global\colcount=0\relax% - \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : - ! \setuptable#1 \endsetuptable - % Need to reset this to 0 after \setuptable. - ! \global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - ! % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax% - ! \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % In order to keep entries from bumping into each other - ! % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - ! % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - *************** July\or August\or September\or October\o - *** 1849,1866 **** - \else - % If user has set preamble in terms of percent of \hsize - ! % we will advance \hsize by \spacebetweencols - ! \advance\hsize by \spacebetweencols - \fi - ! % In either case we will make \leftskip=\spacebetweencols: - ! \leftskip=\spacebetweencols - \fi - ! \noindent##}\cr% - % \everycr will reset column counter, \colcount, at the end of - ! % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - ! \global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines - ! \filbreak%% keeps underfull box messages off when table breaks over pages. - ! \global\colcount=0\relax}}} - - \message{indexing,} - --- 2139,2194 ---- - \else - % If user has set preamble in terms of percent of \hsize - ! % we will advance \hsize by \multitablecolspace - ! \advance\hsize by \multitablecolspace - \fi - ! % In either case we will make \leftskip=\multitablecolspace: - ! \leftskip=\multitablecolspace - \fi - ! % Ignoring space at the beginning and end avoids an occasional spurious - ! % blank line, when TeX decides to break the line at the space before the - ! % box from the multistrut, so the strut ends up on a line by itself. - ! % For example: - ! % @multitable @columnfractions .11 .89 - ! % @item @code{#} - ! % @tab Legal holiday which is valid in major parts of the whole country. - ! % Is automatically provided with highlighting sequences respectively marking - ! % characters. - ! \noindent\ignorespaces##\unskip\multistrut}\cr - % \everycr will reset column counter, \colcount, at the end of - ! % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - ! \global\everycr{\noalign{% - ! % \filbreak%% keeps underfull box messages off when table breaks over pages. - ! % Maybe so, but it also creates really weird page breaks when the table - ! % breaks over pages Wouldn't \vfil be better? Wait until the problem - ! % manifests itself, so it can be fixed for real --karl. - ! \global\colcount=0\relax}} - ! } - ! - ! \def\setmultitablespacing{% test to see if user has set \multitablelinespace. - ! % If so, do nothing. If not, give it an appropriate dimension based on - ! % current baselineskip. - ! \ifdim\multitablelinespace=0pt - ! %% strut to put in table in case some entry doesn't have descenders, - ! %% to keep lines equally spaced - ! \let\multistrut = \strut - ! %% Test to see if parskip is larger than space between lines of - ! %% table. If not, do nothing. - ! %% If so, set to same dimension as multitablelinespace. - ! \else - ! \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 - ! width0pt\relax} \fi - ! \ifdim\multitableparskip>\multitablelinespace - ! \global\multitableparskip=\multitablelinespace - ! \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - ! %% than skip between lines in the table. - ! \fi% - ! \ifdim\multitableparskip=0pt - ! \global\multitableparskip=\multitablelinespace - ! \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - ! %% than skip between lines in the table. - ! \fi} - ! - - \message{indexing,} - *************** July\or August\or September\or October\o - *** 1876,1880 **** - % \fooindex ...rest of line... puts an entry in the index foo. - % It also defines \fooindfile to be the number of the output channel for - ! % the file that accumulates this index. The file's extension is foo. - % The name of an index should be no more than 2 characters long - % for the sake of vms. - --- 2204,2208 ---- - % \fooindex ...rest of line... puts an entry in the index foo. - % It also defines \fooindfile to be the number of the output channel for - ! % the file that accumulates this index. The file's extension is foo. - % The name of an index should be no more than 2 characters long - % for the sake of vms. - *************** July\or August\or September\or October\o - *** 1882,1887 **** - \def\newindex #1{ - \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file - ! \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\doindex {#1}} - } - --- 2210,2215 ---- - \def\newindex #1{ - \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file - ! \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\doindex {#1}} - } - *************** July\or August\or September\or October\o - *** 1895,1900 **** - \def\newcodeindex #1{ - \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file - ! \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\docodeindex {#1}} - } - --- 2223,2228 ---- - \def\newcodeindex #1{ - \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file - ! \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\docodeindex {#1}} - } - *************** July\or August\or September\or October\o - *** 1907,1911 **** - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\doindex {#2}}% - } - --- 2235,2239 ---- - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\doindex {#2}}% - } - *************** July\or August\or September\or October\o - *** 1916,1920 **** - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\docodeindex {#2}}% - } - --- 2244,2248 ---- - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - ! \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex - \noexpand\docodeindex {#2}}% - } - *************** July\or August\or September\or October\o - *** 1964,1971 **** - \def\ss{\realbackslash ss}% - % Take care of texinfo commands likely to appear in an index entry. - \def\_{{\realbackslash _}}% - \def\w{\realbackslash w }% - \def\bf{\realbackslash bf }% - ! \def\rm{\realbackslash rm }% - \def\sl{\realbackslash sl }% - \def\sf{\realbackslash sf}% - --- 2292,2304 ---- - \def\ss{\realbackslash ss}% - % Take care of texinfo commands likely to appear in an index entry. - + % (Must be a way to avoid doing expansion at all, and thus not have to - + % laboriously list every single command here.) - + \def\@{@}% will be @@ when we switch to @ as escape char. - + %\let\{ = \lbracecmd - + %\let\} = \rbracecmd - \def\_{{\realbackslash _}}% - \def\w{\realbackslash w }% - \def\bf{\realbackslash bf }% - ! %\def\rm{\realbackslash rm }% - \def\sl{\realbackslash sl }% - \def\sf{\realbackslash sf}% - *************** July\or August\or September\or October\o - *** 1974,1988 **** - \def\less{\realbackslash less}% - \def\hat{\realbackslash hat}% - ! \def\char{\realbackslash char}% - \def\TeX{\realbackslash TeX}% - \def\dots{\realbackslash dots }% - ! \def\copyright{\realbackslash copyright }% - \def\tclose##1{\realbackslash tclose {##1}}% - \def\code##1{\realbackslash code {##1}}% - \def\samp##1{\realbackslash samp {##1}}% - ! \def\t##1{\realbackslash r {##1}}% - \def\r##1{\realbackslash r {##1}}% - \def\i##1{\realbackslash i {##1}}% - \def\b##1{\realbackslash b {##1}}% - \def\cite##1{\realbackslash cite {##1}}% - \def\key##1{\realbackslash key {##1}}% - --- 2307,2330 ---- - \def\less{\realbackslash less}% - \def\hat{\realbackslash hat}% - ! %\def\char{\realbackslash char}% - \def\TeX{\realbackslash TeX}% - \def\dots{\realbackslash dots }% - ! \def\result{\realbackslash result}% - ! \def\equiv{\realbackslash equiv}% - ! \def\expansion{\realbackslash expansion}% - ! \def\print{\realbackslash print}% - ! \def\error{\realbackslash error}% - ! \def\point{\realbackslash point}% - ! \def\copyright{\realbackslash copyright}% - \def\tclose##1{\realbackslash tclose {##1}}% - \def\code##1{\realbackslash code {##1}}% - + \def\dotless##1{\realbackslash dotless {##1}}% - \def\samp##1{\realbackslash samp {##1}}% - ! \def\,##1{\realbackslash ,{##1}}% - ! \def\t##1{\realbackslash t {##1}}% - \def\r##1{\realbackslash r {##1}}% - \def\i##1{\realbackslash i {##1}}% - \def\b##1{\realbackslash b {##1}}% - + \def\sc##1{\realbackslash sc {##1}}% - \def\cite##1{\realbackslash cite {##1}}% - \def\key##1{\realbackslash key {##1}}% - *************** July\or August\or September\or October\o - *** 1992,1995 **** - --- 2334,2338 ---- - \def\dfn##1{\realbackslash dfn {##1}}% - \def\emph##1{\realbackslash emph {##1}}% - + \def\value##1{\realbackslash value {##1}}% - \unsepspaces - } - *************** July\or August\or September\or October\o - *** 2009,2012 **** - --- 2352,2356 ---- - \def\indexnofonts{% - % Just ignore accents. - + \let\,=\indexdummyfont - \let\"=\indexdummyfont - \let\`=\indexdummyfont - *************** July\or August\or September\or October\o - *** 2021,2024 **** - --- 2365,2369 ---- - \let\v=\indexdummyfont - \let\H=\indexdummyfont - + \let\dotless=\indexdummyfont - % Take care of the plain tex special European modified letters. - \def\oe{oe}% - *************** July\or August\or September\or October\o - *** 2054,2057 **** - --- 2399,2403 ---- - \let\TeX=\indexdummytex - \let\dots=\indexdummydots - + \def\@{@}% - } - - *************** July\or August\or September\or October\o - *** 2069,2095 **** - % #1 is name of index, #2 is stuff to put there - \def\doind #1#2{% - ! % Put the index entry in the margin if desired. - ! \ifx\SETmarginindex\relax\else% - ! \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% - ! \fi% - ! {\count10=\lastpenalty % - ! {\indexdummies % Must do this here, since \bf, etc expand at this stage - ! \escapechar=`\\% - ! {\let\folio=0% Expand all macros now EXCEPT \folio - ! \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - ! % so it will be output as is; and it will print as backslash in the indx. - ! % - ! % Now process the index-string once, with all font commands turned off, - ! % to get the string to sort the index by. - ! {\indexnofonts - ! \xdef\temp1{#2}% - ! }% - ! % Now produce the complete index entry. We process the index-string again, - ! % this time with font commands expanded, to get what to print in the index. - ! \edef\temp{% - ! \write \csname#1indfile\endcsname{% - ! \realbackslash entry {\temp1}{\folio}{#2}}}% - ! \temp }% - ! }\penalty\count10}} - - \def\dosubind #1#2#3{% - --- 2415,2449 ---- - % #1 is name of index, #2 is stuff to put there - \def\doind #1#2{% - ! % Put the index entry in the margin if desired. - ! \ifx\SETmarginindex\relax\else - ! \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% - ! \fi - ! {% - ! \count255=\lastpenalty - ! {% - ! \indexdummies % Must do this here, since \bf, etc expand at this stage - ! \escapechar=`\\ - ! {% - ! \let\folio=0% We will expand all macros now EXCEPT \folio. - ! \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - ! % so it will be output as is; and it will print as backslash. - ! % - ! % First process the index-string with all font commands turned off - ! % to get the string to sort by. - ! {\indexnofonts \xdef\indexsorttmp{#2}}% - ! % - ! % Now produce the complete index entry, with both the sort key and the - ! % original text, including any font commands. - ! \toks0 = {#2}% - ! \edef\temp{% - ! \write\csname#1indfile\endcsname{% - ! \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - ! }% - ! \temp - ! }% - ! }% - ! \penalty\count255 - ! }% - ! } - - \def\dosubind #1#2#3{% - *************** July\or August\or September\or October\o - *** 2145,2176 **** - % Define the macros used in formatting output of the sorted index material. - - ! % This is what you call to cause a particular index to get printed. - ! % Write - ! % @unnumbered Function Index - ! % @printindex fn - ! - \def\printindex{\parsearg\doprintindex} - ! - ! \def\doprintindex#1{% - ! \tex - ! \dobreak \chapheadingskip {10000} - ! \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - ! \catcode`\$=\other - ! \catcode`\~=\other - ! \indexbreaks - % - ! % The following don't help, since the chars were translated - ! % when the raw index was written, and their fonts were discarded - ! % due to \indexnofonts. - ! %\catcode`\"=\active - ! %\catcode`\^=\active - ! %\catcode`\_=\active - ! %\catcode`\|=\active - ! %\catcode`\<=\active - ! %\catcode`\>=\active - ! % % - ! \def\indexbackslash{\rawbackslashxx} - ! \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt - ! \begindoublecolumns - % - % See if the index file exists and is nonempty. - --- 2499,2512 ---- - % Define the macros used in formatting output of the sorted index material. - - ! % @printindex causes a particular index (the ??s file) to get printed. - ! % It does not print any chapter heading (usually an @unnumbered). - ! % - \def\printindex{\parsearg\doprintindex} - ! \def\doprintindex#1{\begingroup - ! \dobreak \chapheadingskip{10000}% - % - ! \indexfonts \rm - ! \tolerance = 9500 - ! \indexbreaks - % - % See if the index file exists and is nonempty. - *************** July\or August\or September\or October\o - *** 2182,2186 **** - % there is some text. - (Index is nonexistent) - ! \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - --- 2518,2522 ---- - % there is some text. - (Index is nonexistent) - ! \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - *************** July\or August\or September\or October\o - *** 2191,2201 **** - (Index is empty) - \else - \input \jobname.#1s - \fi - \fi - \closein 1 - ! \enddoublecolumns - ! \Etex - ! } - - % These macros are used by the sorted index file itself. - --- 2527,2544 ---- - (Index is empty) - \else - + % Index files are almost Texinfo source, but we use \ as the escape - + % character. It would be better to use @, but that's too big a change - + % to make right now. - + \def\indexbackslash{\rawbackslashxx}% - + \catcode`\\ = 0 - + \catcode`\@ = 11 - + \escapechar = `\\ - + \begindoublecolumns - \input \jobname.#1s - + \enddoublecolumns - \fi - \fi - \closein 1 - ! \endgroup} - - % These macros are used by the sorted index file itself. - *************** July\or August\or September\or October\o - *** 2288,2307 **** - }} - - ! %% Define two-column mode, which is used in indexes. - ! %% Adapted from the TeXbook, page 416. - ! \catcode `\@=11 - - \newbox\partialpage - - - \newdimen\doublecolumnhsize - - ! \def\begindoublecolumns{\begingroup - % Grab any single-column material above us. - ! \output = {\global\setbox\partialpage - ! =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% - \eject - % - ! % Now switch to the double-column output routine. - ! \output={\doublecolumnout}% - % - % Change the page size parameters. We could do this once outside this - --- 2631,2665 ---- - }} - - ! % Define two-column mode, which we use to typeset indexes. - ! % Adapted from the TeXbook, page 416, which is to say, - ! % the manmac.tex format used to print the TeXbook itself. - ! \catcode`\@=11 - - \newbox\partialpage - \newdimen\doublecolumnhsize - - ! \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns - % Grab any single-column material above us. - ! \output = {\global\setbox\partialpage = \vbox{% - ! % - ! % Here is a possibility not foreseen in manmac: if we accumulate a - ! % whole lot of material, we might end up calling this \output - ! % routine twice in a row (see the doublecol-lose test, which is - ! % essentially a couple of indexes with @setchapternewpage off). In - ! % that case, we must prevent the second \partialpage from - ! % simply overwriting the first, causing us to lose the page. - ! % This will preserve it until a real output routine can ship it - ! % out. Generally, \partialpage will be empty when this runs and - ! % this will be a no-op. - ! \unvbox\partialpage - ! % - ! % Unvbox the main output page. - ! \unvbox255 - ! \kern-\topskip \kern\baselineskip - ! }}% - \eject - % - ! % Use the double-column output routine for subsequent pages. - ! \output = {\doublecolumnout}% - % - % Change the page size parameters. We could do this once outside this - *************** July\or August\or September\or October\o - *** 2309,2319 **** - % format, but then we repeat the same computation. Repeating a couple - % of assignments once per index is clearly meaningless for the - ! % execution time, so we may as well do it once. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - ! % below is chosen so that the gutter has the same value (well, +- < - ! % 1pt) as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - --- 2667,2677 ---- - % format, but then we repeat the same computation. Repeating a couple - % of assignments once per index is clearly meaningless for the - ! % execution time, so we may as well do it in one place. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - ! % below is chosen so that the gutter has the same value (well, +-<1pt) - ! % as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - *************** July\or August\or September\or October\o - *** 2329,2392 **** - % since nobody clobbers \vsize.) - \vsize = 2\vsize - - \doublecolumnpagegoal - } - - - - \def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} - - - - \def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth - - \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage - - \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} - - \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} - - \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - - \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - - } - - \def\doublecolumnpagegoal{% - - \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ - - } - - \def\pagesofar{\unvbox\partialpage % - - \hsize=\doublecolumnhsize % have to restore this since output routine - - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} - \def\doublecolumnout{% - ! \setbox5=\copy255 - ! {\vbadness=10000 \doublecolumnsplit} - ! \ifvbox255 - ! \setbox0=\vtop to\dimen@{\unvbox0} - ! \setbox2=\vtop to\dimen@{\unvbox2} - ! \onepageout\pagesofar \unvbox255 \penalty\outputpenalty - ! \else - ! \setbox0=\vbox{\unvbox5} - ! \ifvbox0 - ! \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip - ! \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth - ! {\vbadness=10000 - ! \loop \global\setbox5=\copy0 - ! \setbox1=\vsplit5 to\dimen@ - ! \setbox3=\vsplit5 to\dimen@ - ! \ifvbox5 \global\advance\dimen@ by1pt \repeat - ! \setbox0=\vbox to\dimen@{\unvbox1} - ! \setbox2=\vbox to\dimen@{\unvbox3} - ! \global\setbox\partialpage=\vbox{\pagesofar} - ! \doublecolumnpagegoal - ! } - ! \fi - ! \fi - } - - - \catcode `\@=\other - \message{sectioning,} - % Define chapters, sections, etc. - - ! \newcount \chapno - ! \newcount \secno \secno=0 - ! \newcount \subsecno \subsecno=0 - ! \newcount \subsubsecno \subsubsecno=0 - - % This counter is funny since it counts through charcodes of letters A, B, ... - ! \newcount \appendixno \appendixno = `\@ - \def\appendixletter{\char\the\appendixno} - - ! \newwrite \contentsfile - % This is called from \setfilename. - ! \def\opencontents{\openout \contentsfile = \jobname.toc} - - % Each @chapter defines this as the name of the chapter. - --- 2687,2754 ---- - % since nobody clobbers \vsize.) - \vsize = 2\vsize - } - \def\doublecolumnout{% - ! \splittopskip=\topskip \splitmaxdepth=\maxdepth - ! % Get the available space for the double columns -- the normal - ! % (undoubled) page height minus any material left over from the - ! % previous page. - ! \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage - ! % box0 will be the left-hand column, box2 the right. - ! \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ - ! \onepageout\pagesofar - ! \unvbox255 - ! \penalty\outputpenalty - ! } - ! \def\pagesofar{% - ! % Re-output the contents of the output page -- any previous material, - ! % followed by the two boxes we just split. - ! \unvbox\partialpage - ! \hsize = \doublecolumnhsize - ! \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% - ! } - ! \def\enddoublecolumns{% - ! \output = {\balancecolumns}\eject % split what we have - ! \endgroup % started in \begindoublecolumns - ! % - ! % Back to normal single-column typesetting, but take account of the - ! % fact that we just accumulated some stuff on the output page. - ! \pagegoal = \vsize - ! } - ! \def\balancecolumns{% - ! % Called at the end of the double column material. - ! \setbox0 = \vbox{\unvbox255}% - ! \dimen@ = \ht0 - ! \advance\dimen@ by \topskip - ! \advance\dimen@ by-\baselineskip - ! \divide\dimen@ by 2 - ! \splittopskip = \topskip - ! % Loop until we get a decent breakpoint. - ! {\vbadness=10000 \loop - ! \global\setbox3=\copy0 - ! \global\setbox1=\vsplit3 to\dimen@ - ! \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt - ! \repeat}% - ! \setbox0=\vbox to\dimen@{\unvbox1}% - ! \setbox2=\vbox to\dimen@{\unvbox3}% - ! \pagesofar - } - + \catcode`\@ = \other - + - - \message{sectioning,} - % Define chapters, sections, etc. - - ! \newcount\chapno - ! \newcount\secno \secno=0 - ! \newcount\subsecno \subsecno=0 - ! \newcount\subsubsecno \subsubsecno=0 - - % This counter is funny since it counts through charcodes of letters A, B, ... - ! \newcount\appendixno \appendixno = `\@ - \def\appendixletter{\char\the\appendixno} - - ! \newwrite\contentsfile - % This is called from \setfilename. - ! \def\opencontents{\openout\contentsfile = \jobname.toc } - - % Each @chapter defines this as the name of the chapter. - *************** July\or August\or September\or October\o - *** 2394,2433 **** - - \def\thischapter{} \def\thissection{} - ! \def\seccheck#1{\if \pageno<0 % - ! \errmessage{@#1 not allowed after generating table of contents}\fi - ! % - ! } - - \def\chapternofonts{% - ! \let\rawbackslash=\relax% - ! \let\frenchspacing=\relax% - ! \def\result{\realbackslash result} - ! \def\equiv{\realbackslash equiv} - ! \def\expansion{\realbackslash expansion} - ! \def\print{\realbackslash print} - ! \def\TeX{\realbackslash TeX} - ! \def\dots{\realbackslash dots} - ! \def\copyright{\realbackslash copyright} - ! \def\tt{\realbackslash tt} - ! \def\bf{\realbackslash bf } - ! \def\w{\realbackslash w} - ! \def\less{\realbackslash less} - ! \def\gtr{\realbackslash gtr} - ! \def\hat{\realbackslash hat} - ! \def\char{\realbackslash char} - ! \def\tclose##1{\realbackslash tclose {##1}} - ! \def\code##1{\realbackslash code {##1}} - ! \def\samp##1{\realbackslash samp {##1}} - ! \def\r##1{\realbackslash r {##1}} - ! \def\b##1{\realbackslash b {##1}} - ! \def\key##1{\realbackslash key {##1}} - ! \def\file##1{\realbackslash file {##1}} - ! \def\kbd##1{\realbackslash kbd {##1}} - ! % These are redefined because @smartitalic wouldn't work inside xdef. - ! \def\i##1{\realbackslash i {##1}} - ! \def\cite##1{\realbackslash cite {##1}} - ! \def\var##1{\realbackslash var {##1}} - ! \def\emph##1{\realbackslash emph {##1}} - ! \def\dfn##1{\realbackslash dfn {##1}} - } - - --- 2756,2800 ---- - - \def\thischapter{} \def\thissection{} - ! \def\seccheck#1{\ifnum \pageno<0 - ! \errmessage{@#1 not allowed after generating table of contents}% - ! \fi} - - \def\chapternofonts{% - ! \let\rawbackslash=\relax - ! \let\frenchspacing=\relax - ! \def\result{\realbackslash result}% - ! \def\equiv{\realbackslash equiv}% - ! \def\expansion{\realbackslash expansion}% - ! \def\print{\realbackslash print}% - ! \def\TeX{\realbackslash TeX}% - ! \def\dots{\realbackslash dots}% - ! \def\result{\realbackslash result}% - ! \def\equiv{\realbackslash equiv}% - ! \def\expansion{\realbackslash expansion}% - ! \def\print{\realbackslash print}% - ! \def\error{\realbackslash error}% - ! \def\point{\realbackslash point}% - ! \def\copyright{\realbackslash copyright}% - ! \def\tt{\realbackslash tt}% - ! \def\bf{\realbackslash bf}% - ! \def\w{\realbackslash w}% - ! \def\less{\realbackslash less}% - ! \def\gtr{\realbackslash gtr}% - ! \def\hat{\realbackslash hat}% - ! \def\char{\realbackslash char}% - ! \def\tclose##1{\realbackslash tclose{##1}}% - ! \def\code##1{\realbackslash code{##1}}% - ! \def\samp##1{\realbackslash samp{##1}}% - ! \def\r##1{\realbackslash r{##1}}% - ! \def\b##1{\realbackslash b{##1}}% - ! \def\key##1{\realbackslash key{##1}}% - ! \def\file##1{\realbackslash file{##1}}% - ! \def\kbd##1{\realbackslash kbd{##1}}% - ! % These are redefined because @smartitalic wouldn't work inside xdef. - ! \def\i##1{\realbackslash i{##1}}% - ! \def\cite##1{\realbackslash cite{##1}}% - ! \def\var##1{\realbackslash var{##1}}% - ! \def\emph##1{\realbackslash emph{##1}}% - ! \def\dfn##1{\realbackslash dfn{##1}}% - } - - *************** July\or August\or September\or October\o - *** 2516,2520 **** - \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% - {\chapternofonts% - ! \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2883,2888 ---- - \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2535,2540 **** - \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% - {\chapternofonts% - ! \edef\temp{{\realbackslash chapentry - ! {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2903,2909 ---- - \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash chapentry{\the\toks0}% - ! {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2545,2548 **** - --- 2914,2921 ---- - }} - - + % @centerchap is like @unnumbered, but the heading is centered. - + \outer\def\centerchap{\parsearg\centerchapyyy} - + \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} - + - \outer\def\top{\parsearg\unnumberedyyy} - \outer\def\unnumbered{\parsearg\unnumberedyyy} - *************** July\or August\or September\or October\o - *** 2566,2570 **** - \gdef\thischapter{#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2939,2944 ---- - \gdef\thischapter{#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2581,2586 **** - \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% - {\chapternofonts% - \edef\temp{{\realbackslash secentry % - ! {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2955,2961 ---- - \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% - {\chapternofonts% - + \toks0 = {#1}% - \edef\temp{{\realbackslash secentry % - ! {\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2596,2601 **** - \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% - {\chapternofonts% - \edef\temp{{\realbackslash secentry % - ! {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2971,2977 ---- - \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% - {\chapternofonts% - + \toks0 = {#1}% - \edef\temp{{\realbackslash secentry % - ! {\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2609,2613 **** - \plainsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2985,2990 ---- - \plainsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2622,2627 **** - \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% - {\chapternofonts% - \edef\temp{{\realbackslash subsecentry % - ! {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 2999,3005 ---- - \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% - {\chapternofonts% - + \toks0 = {#1}% - \edef\temp{{\realbackslash subsecentry % - ! {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2636,2641 **** - \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% - {\chapternofonts% - \edef\temp{{\realbackslash subsecentry % - ! {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 3014,3020 ---- - \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% - {\chapternofonts% - + \toks0 = {#1}% - \edef\temp{{\realbackslash subsecentry % - ! {\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2647,2653 **** - \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz - \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% - ! \plainsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 3026,3033 ---- - \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz - \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% - ! \plainsubsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2663,2668 **** - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - {\chapternofonts% - ! \edef\temp{{\realbackslash subsubsecentry % - ! {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% - --- 3043,3048 ---- - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash subsubsecentry{\the\toks0} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% - *************** July\or August\or September\or October\o - *** 2680,2684 **** - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - {\chapternofonts% - ! \edef\temp{{\realbackslash subsubsecentry{#1}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% - --- 3060,3065 ---- - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% - *************** July\or August\or September\or October\o - *** 2692,2698 **** - \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz - \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% - ! \plainsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - --- 3073,3080 ---- - \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz - \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% - ! \plainsubsubsecheading {#1}\gdef\thissection{#1}% - {\chapternofonts% - ! \toks0 = {#1}% - ! \edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% - \escapechar=`\\% - \write \contentsfile \temp % - *************** July\or August\or September\or October\o - *** 2730,2737 **** - % NOTE on use of \vbox for chapter headings, section headings, and - % such: - ! % 1) We use \vbox rather than the earlier \line to permit - ! % overlong headings to fold. - ! % 2) \hyphenpenalty is set to 10000 because hyphenation in a - ! % heading is obnoxious; this forbids it. - % 3) Likewise, headings look best if no \parindent is used, and - % if justification is not attempted. Hence \raggedright. - --- 3112,3119 ---- - % NOTE on use of \vbox for chapter headings, section headings, and - % such: - ! % 1) We use \vbox rather than the earlier \line to permit - ! % overlong headings to fold. - ! % 2) \hyphenpenalty is set to 10000 because hyphenation in a - ! % heading is obnoxious; this forbids it. - % 3) Likewise, headings look best if no \parindent is used, and - % if justification is not attempted. Hence \raggedright. - *************** July\or August\or September\or October\o - *** 2751,2759 **** - \rm #1\hfill}}\bigskip \par\penalty 200} - - ! \def\heading{\parsearg\secheadingi} - ! - ! \def\subheading{\parsearg\subsecheadingi} - ! - ! \def\subsubheading{\parsearg\subsubsecheadingi} - - % These macros generate a chapter, section, etc. heading only - --- 3133,3140 ---- - \rm #1\hfill}}\bigskip \par\penalty 200} - - ! % @heading, @subheading, @subsubheading. - ! \def\heading{\parsearg\plainsecheading} - ! \def\subheading{\parsearg\plainsubsecheading} - ! \def\subsubheading{\parsearg\plainsubsubsecheading} - - % These macros generate a chapter, section, etc. heading only - *************** July\or August\or September\or October\o - *** 2769,2773 **** - % Parameter controlling skip before chapter headings (if needed) - - ! \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt - - \def\chapbreak{\dobreak \chapheadingskip {-4000}} - --- 3150,3154 ---- - % Parameter controlling skip before chapter headings (if needed) - - ! \newskip\chapheadingskip - - \def\chapbreak{\dobreak \chapheadingskip {-4000}} - *************** July\or August\or September\or October\o - *** 2778,2785 **** - --- 3159,3168 ---- - - \def\CHAPPAGoff{ - + \global\let\contentsalignmacro = \chappager - \global\let\pchapsepmacro=\chapbreak - \global\let\pagealignmacro=\chappager} - - \def\CHAPPAGon{ - + \global\let\contentsalignmacro = \chappager - \global\let\pchapsepmacro=\chappager - \global\let\pagealignmacro=\chappager - *************** July\or August\or September\or October\o - *** 2787,2790 **** - --- 3170,3174 ---- - - \def\CHAPPAGodd{ - + \global\let\contentsalignmacro = \chapoddpage - \global\let\pchapsepmacro=\chapoddpage - \global\let\pagealignmacro=\chapoddpage - *************** July\or August\or September\or October\o - *** 2795,2817 **** - \def\CHAPFplain{ - \global\let\chapmacro=\chfplain - ! \global\let\unnumbchapmacro=\unnchfplain} - - ! \def\chfplain #1#2{% - \pchapsepmacro - {% - ! \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - ! \parindent=0pt\raggedright - ! \rm #2\enspace #1}% - }% - ! \bigskip - ! \penalty5000 - } - - ! \def\unnchfplain #1{% - ! \pchapsepmacro % - ! {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - ! \parindent=0pt\raggedright - ! \rm #1\hfill}}\bigskip \par\penalty 10000 % - ! } - \CHAPFplain % The default - - --- 3179,3215 ---- - \def\CHAPFplain{ - \global\let\chapmacro=\chfplain - ! \global\let\unnumbchapmacro=\unnchfplain - ! \global\let\centerchapmacro=\centerchfplain} - - ! % Plain chapter opening. - ! % #1 is the text, #2 the chapter number or empty if unnumbered. - ! \def\chfplain#1#2{% - \pchapsepmacro - {% - ! \chapfonts \rm - ! \def\chapnum{#2}% - ! \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% - ! \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - ! \hangindent = \wd0 \centerparametersmaybe - ! \unhbox0 #1\par}% - }% - ! \nobreak\bigskip % no page break after a chapter title - ! \nobreak - } - - ! % Plain opening for unnumbered. - ! \def\unnchfplain#1{\chfplain{#1}{}} - ! - ! % @centerchap -- centered and unnumbered. - ! \let\centerparametersmaybe = \relax - ! \def\centerchfplain#1{{% - ! \def\centerparametersmaybe{% - ! \advance\rightskip by 3\rightskip - ! \leftskip = \rightskip - ! \parfillskip = 0pt - ! }% - ! \chfplain{#1}{}% - ! }} - ! - \CHAPFplain % The default - - *************** July\or August\or September\or October\o - *** 2827,2883 **** - } - - \def\CHAPFopen{ - \global\let\chapmacro=\chfopen - ! \global\let\unnumbchapmacro=\unnchfopen} - - - % Parameter controlling skip before section headings. - - ! \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt - ! \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} - ! - ! \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt - \def\secheadingbreak{\dobreak \secheadingskip {-1000}} - - ! % @paragraphindent is defined for the Info formatting commands only. - ! \let\paragraphindent=\comment - - ! % Section fonts are the base font at magstep2, which produces - ! % a size a bit more than 14 points in the default situation. - - - \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} - - \def\plainsecheading #1{\secheadingi {#1}} - - \def\secheadingi #1{{\advance \secheadingskip by \parskip % - - \secheadingbreak}% - - {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - - \parindent=0pt\raggedright - - \rm #1\hfill}}% - - \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - - - - - % Subsection fonts are the base font at magstep1, - - % which produces a size of 12 points. - - - - \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} - - \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % - - \subsecheadingbreak}% - - {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - - \parindent=0pt\raggedright - - \rm #1\hfill}}% - - \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - - - \def\subsubsecfonts{\subsecfonts} % Maybe this should change: - - % Perhaps make sssec fonts scaled - - % magstep half - - \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} - - \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % - - \subsecheadingbreak}% - - {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - - \parindent=0pt\raggedright - - \rm #1\hfill}}% - - \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} - - - - \message{toc printing,} - - % Finish up the main text and prepare to read what we've written - % to \contentsfile. - --- 3225,3285 ---- - } - - + \def\centerchfopen #1{% - + \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - + \parindent=0pt - + \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % - + } - + - \def\CHAPFopen{ - \global\let\chapmacro=\chfopen - ! \global\let\unnumbchapmacro=\unnchfopen - ! \global\let\centerchapmacro=\centerchfopen} - - - ! % Section titles. - ! \newskip\secheadingskip - \def\secheadingbreak{\dobreak \secheadingskip {-1000}} - + \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} - + \def\plainsecheading#1{\sectionheading{sec}{}{#1}} - - ! % Subsection titles. - ! \newskip \subsecheadingskip - ! \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} - ! \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} - ! \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} - - ! % Subsubsection titles. - ! \let\subsubsecheadingskip = \subsecheadingskip - ! \let\subsubsecheadingbreak = \subsecheadingbreak - ! \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} - ! \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} - - - + % Print any size section title. - + % - + % #1 is the section type (sec/subsec/subsubsec), #2 is the section - + % number (maybe empty), #3 the text. - + \def\sectionheading#1#2#3{% - + {% - + \expandafter\advance\csname #1headingskip\endcsname by \parskip - + \csname #1headingbreak\endcsname - + }% - + {% - + % Switch to the right set of fonts. - + \csname #1fonts\endcsname \rm - + % - + % Only insert the separating space if we have a section number. - + \def\secnum{#2}% - + \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% - + % - + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - + \hangindent = \wd0 % zero if no section number - + \unhbox0 #3}% - + }% - + \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak - + } - - - + \message{toc printing,} - % Finish up the main text and prepare to read what we've written - % to \contentsfile. - *************** July\or August\or September\or October\o - *** 2885,2899 **** - \newskip\contentsrightmargin \contentsrightmargin=1in - \def\startcontents#1{% - ! \pagealignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - ! \pageno = -1 % Request roman numbered pages. - \fi - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - ! \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - ! \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - --- 3287,3307 ---- - \newskip\contentsrightmargin \contentsrightmargin=1in - \def\startcontents#1{% - ! % If @setchapternewpage on, and @headings double, the contents should - ! % start on an odd page, unlike chapters. Thus, we maintain - ! % \contentsalignmacro in parallel with \pagealignmacro. - ! % From: Torbjorn Granlund - ! \contentsalignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - ! \pageno = -1 % Request roman numbered pages. - \fi - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - ! \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - ! % We can't do this, because then an actual ^ in a section - ! % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - ! %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - *************** July\or August\or September\or October\o - *** 2919,2922 **** - --- 3327,3331 ---- - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - + \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - *************** July\or August\or September\or October\o - *** 2962,2966 **** - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - ! % the label; that gets put in in \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% - --- 3371,3375 ---- - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - ! % the label; that gets put in by \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% - *************** July\or August\or September\or October\o - *** 2983,2987 **** - \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - - - - % This parameter controls the indentation of the various levels. - \newdimen\tocindent \tocindent = 3pc - --- 3392,3395 ---- - *************** July\or August\or September\or October\o - *** 2990,3002 **** - % page number. - % - ! % If the toc has to be broken over pages, we would want to be at chapters - % if at all possible; hence the \penalty. - \def\dochapentry#1#2{% - ! \penalty-300 \vskip\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno{#2}}% - \endgroup - ! \nobreak\vskip .25\baselineskip - } - - --- 3398,3410 ---- - % page number. - % - ! % If the toc has to be broken over pages, we want it to be at chapters - % if at all possible; hence the \penalty. - \def\dochapentry#1#2{% - ! \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno{#2}}% - \endgroup - ! \nobreak\vskip .25\baselineskip plus.1\baselineskip - } - - *************** July\or August\or September\or October\o - *** 3023,3027 **** - % \turnoffactive is for the sake of @" used for umlauts. - \def\tocentry#1#2{\begingroup - ! \hyphenpenalty = 10000 - \entry{\turnoffactive #1}{\turnoffactive #2}% - \endgroup} - --- 3431,3435 ---- - % \turnoffactive is for the sake of @" used for umlauts. - \def\tocentry#1#2{\begingroup - ! \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - \entry{\turnoffactive #1}{\turnoffactive #2}% - \endgroup} - *************** July\or August\or September\or October\o - *** 3048,3053 **** - \newbox\equivbox \newbox\errorbox - - - \let\ptexequiv = \equiv - - - %{\tentt - %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} - --- 3456,3459 ---- - *************** July\or August\or September\or October\o - *** 3060,3069 **** - %} - - \def\point{$\star$} - - - \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} - \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} - \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - - - \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - - --- 3466,3474 ---- - %} - - + % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. - \def\point{$\star$} - \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} - \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} - \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - - *************** July\or August\or September\or October\o - *** 3097,3101 **** - \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie - \catcode `\%=14 - ! \catcode 43=12 - \catcode`\"=12 - \catcode`\==12 - --- 3502,3506 ---- - \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie - \catcode `\%=14 - ! \catcode 43=12 % plus - \catcode`\"=12 - \catcode`\==12 - *************** July\or August\or September\or October\o - *** 3105,3109 **** - \escapechar=`\\ - % - ! \let\~=\ptextilde - \let\{=\ptexlbrace - \let\}=\ptexrbrace - --- 3510,3514 ---- - \escapechar=`\\ - % - ! \let\,=\ptexcomma - \let\{=\ptexlbrace - \let\}=\ptexrbrace - *************** July\or August\or September\or October\o - *** 3111,3118 **** - \let\*=\ptexstar - \let\dots=\ptexdots - \def\@{@}% - \let\bullet=\ptexbullet - ! \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl - ! \let\L=\ptexL - % - \let\Etex=\endgroup} - --- 3516,3524 ---- - \let\*=\ptexstar - \let\dots=\ptexdots - + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% - + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% - \def\@{@}% - \let\bullet=\ptexbullet - ! \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext - % - \let\Etex=\endgroup} - *************** July\or August\or September\or October\o - *** 3173,3181 **** - \def\cbr{{\hskip 6pt\circle\char'011}} - \def\carttop{\hbox to \cartouter{\hskip\lskip - ! \ctl\leaders\hrule height\circthick\hfil\ctr - ! \hskip\rskip}} - \def\cartbot{\hbox to \cartouter{\hskip\lskip - ! \cbl\leaders\hrule height\circthick\hfil\cbr - ! \hskip\rskip}} - % - \newskip\lskip\newskip\rskip - --- 3579,3587 ---- - \def\cbr{{\hskip 6pt\circle\char'011}} - \def\carttop{\hbox to \cartouter{\hskip\lskip - ! \ctl\leaders\hrule height\circthick\hfil\ctr - ! \hskip\rskip}} - \def\cartbot{\hbox to \cartouter{\hskip\lskip - ! \cbl\leaders\hrule height\circthick\hfil\cbr - ! \hskip\rskip}} - % - \newskip\lskip\newskip\rskip - *************** July\or August\or September\or October\o - *** 3183,3220 **** - \long\def\cartouche{% - \begingroup - ! \lskip=\leftskip \rskip=\rightskip - ! \leftskip=0pt\rightskip=0pt %we want these *outside*. - ! \cartinner=\hsize \advance\cartinner by-\lskip - ! \advance\cartinner by-\rskip - ! \cartouter=\hsize - ! \advance\cartouter by 18pt % allow for 3pt kerns on either - ! % side, and for 6pt waste from - ! % each corner char - ! \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - ! % Flag to tell @lisp, etc., not to narrow margin. - ! \let\nonarrowing=\comment - ! \vbox\bgroup - ! \baselineskip=0pt\parskip=0pt\lineskip=0pt - ! \carttop - ! \hbox\bgroup - ! \hskip\lskip - ! \vrule\kern3pt - ! \vbox\bgroup - ! \hsize=\cartinner - ! \kern3pt - ! \begingroup - ! \baselineskip=\normbskip - ! \lineskip=\normlskip - ! \parskip=\normpskip - ! \vskip -\parskip - \def\Ecartouche{% - ! \endgroup - ! \kern3pt - ! \egroup - ! \kern3pt\vrule - ! \hskip\rskip - ! \egroup - ! \cartbot - ! \egroup - \endgroup - }} - --- 3589,3626 ---- - \long\def\cartouche{% - \begingroup - ! \lskip=\leftskip \rskip=\rightskip - ! \leftskip=0pt\rightskip=0pt %we want these *outside*. - ! \cartinner=\hsize \advance\cartinner by-\lskip - ! \advance\cartinner by-\rskip - ! \cartouter=\hsize - ! \advance\cartouter by 18pt % allow for 3pt kerns on either - ! % side, and for 6pt waste from - ! % each corner char - ! \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - ! % Flag to tell @lisp, etc., not to narrow margin. - ! \let\nonarrowing=\comment - ! \vbox\bgroup - ! \baselineskip=0pt\parskip=0pt\lineskip=0pt - ! \carttop - ! \hbox\bgroup - ! \hskip\lskip - ! \vrule\kern3pt - ! \vbox\bgroup - ! \hsize=\cartinner - ! \kern3pt - ! \begingroup - ! \baselineskip=\normbskip - ! \lineskip=\normlskip - ! \parskip=\normpskip - ! \vskip -\parskip - \def\Ecartouche{% - ! \endgroup - ! \kern3pt - ! \egroup - ! \kern3pt\vrule - ! \hskip\rskip - ! \egroup - ! \cartbot - ! \egroup - \endgroup - }} - *************** July\or August\or September\or October\o - *** 3252,3260 **** - \def\nonfillfinish{\afterenvbreak\endgroup}% - - - % This macro is - \def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \rawbackslash % have \ input char produce \ char from current font - \gobble - --- 3658,3667 ---- - \def\nonfillfinish{\afterenvbreak\endgroup}% - - \def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - + % Make @kbd do something special, if requested. - + \let\kbdfont\kbdexamplefont - \rawbackslash % have \ input char produce \ char from current font - \gobble - *************** July\or August\or September\or October\o - *** 3279,3284 **** - \let\Esmallexample = \nonfillfinish - % - ! % Smaller interline space and fonts for small examples. - ! \setleading{10pt}% - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - --- 3686,3690 ---- - \let\Esmallexample = \nonfillfinish - % - ! % Smaller fonts for small examples. - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - *************** July\or August\or September\or October\o - *** 3375,3380 **** - % Definitions of (, ) and & used in args for functions. - % This is the definition of ( outside of all parentheses. - ! \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % - ! \global\advance\parencount by 1 } - % - % This is the definition of ( when already inside a level of parens. - --- 3781,3787 ---- - % Definitions of (, ) and & used in args for functions. - % This is the definition of ( outside of all parentheses. - ! \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - ! \global\advance\parencount by 1 - ! } - % - % This is the definition of ( when already inside a level of parens. - *************** July\or August\or September\or October\o - *** 3382,3388 **** - % - \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - ! % also in that case restore the outer-level definition of (. - ! \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - ! \global\advance \parencount by -1 } - % If we encounter &foo, then turn on ()-hacking afterwards - \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } - --- 3789,3795 ---- - % - \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - ! % also in that case restore the outer-level definition of (. - ! \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - ! \global\advance \parencount by -1 } - % If we encounter &foo, then turn on ()-hacking afterwards - \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } - *************** July\or August\or September\or October\o - *** 3392,3397 **** - %% These parens (in \boldbrax) actually are a little bolder than the - %% contained text. This is especially needed for [ and ] - ! \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} - ! \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} - - % First, defname, which formats the header line itself. - --- 3799,3807 ---- - %% These parens (in \boldbrax) actually are a little bolder than the - %% contained text. This is especially needed for [ and ] - ! \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } - ! \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } - ! \def\ampnr{\&} - ! \def\lbrb{{\bf\char`\[}} - ! \def\rbrb{{\bf\char`\]}} - - % First, defname, which formats the header line itself. - *************** July\or August\or September\or October\o - *** 3486,3490 **** - % This is used for \def{tp,vr}parsebody. It could probably be used for - % some of the others, too, with some judicious conditionals. - ! % - \def\parsebodycommon#1#2#3{% - \begingroup\inENV % - --- 3896,3900 ---- - % This is used for \def{tp,vr}parsebody. It could probably be used for - % some of the others, too, with some judicious conditionals. - ! % - \def\parsebodycommon#1#2#3{% - \begingroup\inENV % - *************** July\or August\or September\or October\o - *** 3520,3534 **** - - % Fine, but then we have to eventually remove the \empty *and* the - ! % braces (if any). That's what this does, putting the result in \tptemp. - ! % - ! \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% - - % After \spacesplit has done its work, this is called -- #1 is the final - % thing to call, #2 the type name (which starts with \empty), and #3 - % (which might be empty) the arguments. - ! % - \def\parsetpheaderline#1#2#3{% - ! \removeemptybraces#2\relax - ! #1{\tptemp}{#3}% - }% - - --- 3930,3943 ---- - - % Fine, but then we have to eventually remove the \empty *and* the - ! % braces (if any). That's what this does. - ! % - ! \def\removeemptybraces\empty#1\relax{#1} - - % After \spacesplit has done its work, this is called -- #1 is the final - % thing to call, #2 the type name (which starts with \empty), and #3 - % (which might be empty) the arguments. - ! % - \def\parsetpheaderline#1#2#3{% - ! #1{\removeemptybraces#2\relax}{#3}% - }% - - *************** July\or August\or September\or October\o - *** 3571,3575 **** - #1% - \hyphenchar\tensl=45 - ! \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% - \interlinepenalty=10000 - \advance\rightskip by 0pt plus 1fil - --- 3980,3984 ---- - #1% - \hyphenchar\tensl=45 - ! \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% - \interlinepenalty=10000 - \advance\rightskip by 0pt plus 1fil - *************** July\or August\or September\or October\o - *** 3672,3675 **** - --- 4081,4085 ---- - \def\defspecx #1 {\errmessage{@defspecx in invalid context}} - \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} - + \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} - \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} - - *************** July\or August\or September\or October\o - *** 3687,3690 **** - --- 4097,4110 ---- - } - - + % @deftypemethod foo-class return-type foo-method args - + % - + \def\deftypemethod{% - + \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} - + % - + % #1 is the class name, #2 the data type, #3 the method name, #4 the args. - + \def\deftypemethodheader#1#2#3#4{% - + \deftypefnheaderx{Method on #1}{#2}#3 #4\relax - + } - + - % @defmethod == @defop Method - - *************** July\or August\or September\or October\o - *** 3764,3774 **** - \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - - ! % #1 is the data type. #2 is the name. - \def\deftypevarheader #1#2{% - ! \doind {vr}{\code{#2}}% Make entry in variables index - \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% - \interlinepenalty=10000 - \endgraf\penalty 10000\vskip -\parskip\penalty 10000 - \endgroup} - - % @deftypevr {Global Flag} int enable - --- 4184,4196 ---- - \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - - ! % #1 is the data type. #2 is the name, perhaps followed by text that - ! % is actually part of the data type, which should not be put into the index. - \def\deftypevarheader #1#2{% - ! \dovarind#2 \relax% Make entry in variables index - \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% - \interlinepenalty=10000 - \endgraf\penalty 10000\vskip -\parskip\penalty 10000 - \endgroup} - + \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} - - % @deftypevr {Global Flag} int enable - *************** July\or August\or September\or October\o - *** 3776,3780 **** - \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - - ! \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% - \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} - \interlinepenalty=10000 - --- 4198,4202 ---- - \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - - ! \def\deftypevrheader #1#2#3{\dovarind#3 \relax% - \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} - \interlinepenalty=10000 - *************** July\or August\or September\or October\o - *** 3808,3811 **** - --- 4230,4234 ---- - \def\deftpx #1 {\errmessage{@deftpx in invalid context}} - - + - \message{cross reference,} - % Define cross-reference macros - *************** July\or August\or September\or October\o - *** 3815,3818 **** - --- 4238,4246 ---- - \newif\ifwarnedxrefs % True if we warned once that they aren't known. - - + % @inforef is simple. - + \def\inforef #1{\inforefzzz #1,,,,**} - + \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - + node \samp{\ignorespaces#1{}}} - + - % \setref{foo} defines a cross-reference point named foo. - - *************** July\or August\or September\or October\o - *** 3848,3852 **** - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - ! \ifx\SETxref-automatic-section-title\thisisundefined - % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% - --- 4276,4280 ---- - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - ! \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax - % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% - *************** July\or August\or September\or October\o - *** 3893,3897 **** - % Use \turnoffactive so that punctuation chars such as underscore - % work in node names. - ! \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% - \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% - \next}} - --- 4321,4325 ---- - % Use \turnoffactive so that punctuation chars such as underscore - % work in node names. - ! \def\dosetq #1#2{{\let\folio=0 \turnoffactive - \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% - \next}} - *************** July\or August\or September\or October\o - *** 3962,4043 **** - } - - - % Read the last existing aux file, if any. No error if none exists. - - - % This is the macro invoked by entries in the aux file. - ! \def\xrdef #1#2{ - ! {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} - - ! \def\readauxfile{% - ! \begingroup - ! \catcode `\^^@=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\^^C=\other - ! \catcode `\^^D=\other - ! \catcode `\^^E=\other - ! \catcode `\^^F=\other - ! \catcode `\^^G=\other - ! \catcode `\^^H=\other - ! \catcode `\ =\other - ! \catcode `\^^L=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode `\=\other - ! \catcode 26=\other - ! \catcode `\^^[=\other - ! \catcode `\^^\=\other - ! \catcode `\^^]=\other - ! \catcode `\^^^=\other - ! \catcode `\^^_=\other - ! \catcode `\@=\other - ! \catcode `\^=\other - ! \catcode `\~=\other - ! \catcode `\[=\other - ! \catcode `\]=\other - ! \catcode`\"=\other - ! \catcode`\_=\other - ! \catcode`\|=\other - ! \catcode`\<=\other - ! \catcode`\>=\other - ! \catcode `\$=\other - ! \catcode `\#=\other - ! \catcode `\&=\other - ! % `\+ does not work, so use 43. - ! \catcode 43=\other - ! % Make the characters 128-255 be printing characters - ! {% - ! \count 1=128 - ! \def\loop{% - ! \catcode\count 1=\other - ! \advance\count 1 by 1 - ! \ifnum \count 1<256 \loop \fi - }% - ! }% - ! % the aux file uses ' as the escape. - ! % Turn off \ as an escape so we do not lose on - ! % entries which were dumped with control sequences in their names. - ! % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ - ! % Reference to such entries still does not work the way one would wish, - ! % but at least they do not bomb out when the aux file is read in. - ! \catcode `\{=1 \catcode `\}=2 - ! \catcode `\%=\other - ! \catcode `\'=0 - ! \catcode`\^=7 % to make ^^e4 etc usable in xref tags - ! \catcode `\\=\other - ! \openin 1 \jobname.aux - ! \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue - ! \global\warnedobstrue - ! \fi - ! % Open the new aux file. Tex will close it automatically at exit. - ! \openout \auxfile=\jobname.aux - \endgroup} - - --- 4390,4486 ---- - } - - % This is the macro invoked by entries in the aux file. - ! \def\xrdef #1#2{{% - ! \catcode`\'=\other - ! \expandafter\gdef\csname X#1\endcsname{#2}% - ! }} - - ! % Read the last existing aux file, if any. No error if none exists. - ! \def\readauxfile{\begingroup - ! \catcode`\^^@=\other - ! \catcode`\^^A=\other - ! \catcode`\^^B=\other - ! \catcode`\^^C=\other - ! \catcode`\^^D=\other - ! \catcode`\^^E=\other - ! \catcode`\^^F=\other - ! \catcode`\^^G=\other - ! \catcode`\^^H=\other - ! \catcode`\^^K=\other - ! \catcode`\^^L=\other - ! \catcode`\^^N=\other - ! \catcode`\^^P=\other - ! \catcode`\^^Q=\other - ! \catcode`\^^R=\other - ! \catcode`\^^S=\other - ! \catcode`\^^T=\other - ! \catcode`\^^U=\other - ! \catcode`\^^V=\other - ! \catcode`\^^W=\other - ! \catcode`\^^X=\other - ! \catcode`\^^Z=\other - ! \catcode`\^^[=\other - ! \catcode`\^^\=\other - ! \catcode`\^^]=\other - ! \catcode`\^^^=\other - ! \catcode`\^^_=\other - ! \catcode`\@=\other - ! \catcode`\^=\other - ! % It was suggested to define this as 7, which would allow ^^e4 etc. - ! % in xref tags, i.e., node names. But since ^^e4 notation isn't - ! % supported in the main text, it doesn't seem desirable. Furthermore, - ! % that is not enough: for node names that actually contain a ^ - ! % character, we would end up writing a line like this: 'xrdef {'hat - ! % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first - ! % argument, and \hat is not an expandable control sequence. It could - ! % all be worked out, but why? Either we support ^^ or we don't. - ! % - ! % The other change necessary for this was to define \auxhat: - ! % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter - ! % and then to call \auxhat in \setq. - ! % - ! \catcode`\~=\other - ! \catcode`\[=\other - ! \catcode`\]=\other - ! \catcode`\"=\other - ! \catcode`\_=\other - ! \catcode`\|=\other - ! \catcode`\<=\other - ! \catcode`\>=\other - ! \catcode`\$=\other - ! \catcode`\#=\other - ! \catcode`\&=\other - ! % `\+ does not work, so use 43. - ! \catcode43=\other - ! % Make the characters 128-255 be printing characters - ! {% - ! \count 1=128 - ! \def\loop{% - ! \catcode\count 1=\other - ! \advance\count 1 by 1 - ! \ifnum \count 1<256 \loop \fi - ! }% - }% - ! % The aux file uses ' as the escape (for now). - ! % Turn off \ as an escape so we do not lose on - ! % entries which were dumped with control sequences in their names. - ! % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ - ! % Reference to such entries still does not work the way one would wish, - ! % but at least they do not bomb out when the aux file is read in. - ! \catcode`\{=1 - ! \catcode`\}=2 - ! \catcode`\%=\other - ! \catcode`\'=0 - ! \catcode`\\=\other - ! % - ! \openin 1 \jobname.aux - ! \ifeof 1 \else - ! \closein 1 - ! \input \jobname.aux - ! \global\havexrefstrue - ! \global\warnedobstrue - ! \fi - ! % Open the new aux file. TeX will close it automatically at exit. - ! \openout\auxfile=\jobname.aux - \endgroup} - - *************** July\or August\or September\or October\o - *** 4050,4057 **** - % vital for proper filling; pages come out unaligned when you do a - % pagealignmacro call if that space before the closing brace is - ! % removed. - \def\supereject{\par\penalty -20000\footnoteno =0 } - - ! % @footnotestyle is meaningful for info output only.. - \let\footnotestyle=\comment - - --- 4493,4501 ---- - % vital for proper filling; pages come out unaligned when you do a - % pagealignmacro call if that space before the closing brace is - ! % removed. (Generally, numeric constants should always be followed by a - ! % space to prevent strange expansion errors.) - \def\supereject{\par\penalty -20000\footnoteno =0 } - - ! % @footnotestyle is meaningful for info output only. - \let\footnotestyle=\comment - - *************** July\or August\or September\or October\o - *** 4079,4083 **** - % footnote text as a parameter. Our footnotes don't need to be so general. - % - ! \long\gdef\footnotezzz#1{\insert\footins{% - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - --- 4523,4531 ---- - % footnote text as a parameter. Our footnotes don't need to be so general. - % - ! % Oh yes, they do; otherwise, @ifset and anything else that uses - ! % \parseargline fail inside footnotes because the tokens are fixed when - ! % the footnote is read. --karl, 16nov96. - ! % - ! \long\gdef\footnotezzz{\insert\footins\bgroup - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - *************** July\or August\or September\or October\o - *** 4101,4106 **** - % provide a place where TeX can split the footnote. - \footstrut - ! #1\strut}% - } - - }%end \catcode `\@=11 - --- 4549,4559 ---- - % provide a place where TeX can split the footnote. - \footstrut - ! \futurelet\next\fo@t - } - + \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t - + \else\let\next\f@t\fi \next} - + \def\f@@t{\bgroup\aftergroup\@foot\let\next} - + \def\f@t#1{#1\@foot} - + \def\@foot{\strut\egroup} - - }%end \catcode `\@=11 - *************** July\or August\or September\or October\o - *** 4159,4165 **** - --- 4612,4660 ---- - \def\finalout{\overfullrule=0pt} - - + % @image. We use the macros from epsf.tex to support this. - + % If epsf.tex is not installed and @image is used, we complain. - + % - + % Check for and read epsf.tex up front. If we read it only at @image - + % time, we might be inside a group, and then its definitions would get - + % undone and the next image would fail. - + \openin 1 = epsf.tex - + \ifeof 1 \else - + \closein 1 - + \def\epsfannounce{\toks0 = }% do not bother showing banner - + \input epsf.tex - + \fi - + % - + \newif\ifwarnednoepsf - + \newhelp\noepsfhelp{epsf.tex must be installed for images to - + work. It is also included in the Texinfo distribution, or you can get - + it from ftp://ftp.tug.org/tex/epsf.tex.} - + % - + % Only complain once about lack of epsf.tex. - + \def\image#1{% - + \ifx\epsfbox\undefined - + \ifwarnednoepsf \else - + \errhelp = \noepsfhelp - + \errmessage{epsf.tex not found, images will be ignored}% - + \global\warnednoepsftrue - + \fi - + \else - + \imagexxx #1,,,\finish - + \fi - + } - + % - + % Arguments to @image: - + % #1 is (mandatory) image filename; we tack on .eps extension. - + % #2 is (optional) width, #3 is (optional) height. - + % #4 is just the usual extra ignored arg for parsing this stuff. - + \def\imagexxx#1,#2,#3,#4\finish{% - + % \epsfbox itself resets \epsf?size at each figure. - + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - + \epsfbox{#1.eps}% - + } - - % End of control word definitions. - - + - \message{and turning on texinfo input format.} - - *************** July\or August\or September\or October\o - *** 4175,4185 **** - % Set some numeric style parameters, for 8.5 x 11 format. - - ! %\hsize = 6.5in - \newdimen\defaultparindent \defaultparindent = 15pt - \parindent = \defaultparindent - ! \parskip 18pt plus 1pt - ! \setleading{15pt} - \advance\topskip by 1.2cm - - % Prevent underfull vbox error messages. - \vbadness=10000 - --- 4670,4685 ---- - % Set some numeric style parameters, for 8.5 x 11 format. - - ! \hsize = 6in - ! \hoffset = .25in - \newdimen\defaultparindent \defaultparindent = 15pt - \parindent = \defaultparindent - ! \parskip 3pt plus 2pt minus 1pt - ! \setleading{13.2pt} - \advance\topskip by 1.2cm - - + \chapheadingskip = 15pt plus 4pt minus 2pt - + \secheadingskip = 12pt plus 3pt minus 2pt - + \subsecheadingskip = 9pt plus 2pt minus 2pt - + - % Prevent underfull vbox error messages. - \vbadness=10000 - *************** July\or August\or September\or October\o - *** 4204,4231 **** - % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) - \def\smallbook{ - ! - ! % These values for secheadingskip and subsecheadingskip are - ! % experiments. RJC 7 Aug 1992 - ! \global\secheadingskip = 17pt plus 6pt minus 3pt - ! \global\subsecheadingskip = 14pt plus 6pt minus 3pt - ! - ! \global\lispnarrowing = 0.3in - ! \setleading{12pt} - ! \advance\topskip by -1cm - ! \global\parskip 3pt plus 1pt - ! \global\hsize = 5in - ! \global\vsize=7.5in - ! \global\tolerance=700 - ! \global\hfuzz=1pt - ! \global\contentsrightmargin=0pt - ! \global\deftypemargin=0pt - ! \global\defbodyindent=.5cm - ! - ! \global\pagewidth=\hsize - ! \global\pageheight=\vsize - ! - ! \global\let\smalllisp=\smalllispx - ! \global\let\smallexample=\smalllispx - ! \global\def\Esmallexample{\Esmalllisp} - } - - --- 4704,4729 ---- - % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) - \def\smallbook{ - ! \global\chapheadingskip = 15pt plus 4pt minus 2pt - ! \global\secheadingskip = 12pt plus 3pt minus 2pt - ! \global\subsecheadingskip = 9pt plus 2pt minus 2pt - ! % - ! \global\lispnarrowing = 0.3in - ! \setleading{12pt} - ! \advance\topskip by -1cm - ! \global\parskip 2pt plus 1pt - ! \global\hsize = 5in - ! \global\vsize=7.5in - ! \global\tolerance=700 - ! \global\hfuzz=1pt - ! \global\contentsrightmargin=0pt - ! \global\deftypemargin=0pt - ! \global\defbodyindent=.5cm - ! % - ! \global\pagewidth=\hsize - ! \global\pageheight=\vsize - ! % - ! \global\let\smalllisp=\smalllispx - ! \global\let\smallexample=\smalllispx - ! \global\def\Esmallexample{\Esmalllisp} - } - - *************** July\or August\or September\or October\o - *** 4250,4259 **** - } - - % Allow control of the text dimensions. Parameters in order: textheight; - ! % textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; - % header is additional; added length extends the bottom of the page. - - ! \def\changepagesizes#1#2#3#4#5{ - \global\vsize= #1 - \advance\vsize by \topskip - \global\voffset= #3 - --- 4748,4764 ---- - } - - + \bindingoffset=0pt - + \normaloffset=\hoffset - + \pagewidth=\hsize - + \pageheight=\vsize - + - % Allow control of the text dimensions. Parameters in order: textheight; - ! % textwidth; voffset; hoffset; binding offset; topskip. - ! % All require a dimension; - % header is additional; added length extends the bottom of the page. - - ! \def\changepagesizes#1#2#3#4#5#6{ - \global\vsize= #1 - + \global\topskip= #6 - \advance\vsize by \topskip - \global\voffset= #3 - *************** July\or August\or September\or October\o - *** 4268,4278 **** - \global\bindingoffset= #5} - - ! % This layout is compatible with Latex on A4 paper. - ! - ! \def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} - - % Use @afourwide to print on European A4 paper in wide format. - \def\afourwide{\afourpaper - ! \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} - - % Define macros to output various characters with catcode for normal text. - --- 4773,4790 ---- - \global\bindingoffset= #5} - - ! % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin - ! % 29mm, hence bottom margin 28mm, nominal side margin 3cm. - ! \def\afourlatex - ! {\global\tolerance=700 - ! \global\hfuzz=1pt - ! \setleading{12pt} - ! \global\parskip 15pt plus 1pt - ! \advance\baselineskip by 1.6pt - ! \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} - ! } - - % Use @afourwide to print on European A4 paper in wide format. - \def\afourwide{\afourpaper - ! \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} - - % Define macros to output various characters with catcode for normal text. - *************** July\or August\or September\or October\o - *** 4317,4321 **** - \chardef\hat=`\^ - \catcode`\^=\active - - \def\auxhat{\def^{'hat}} - \def^{{\tt \hat}} - - --- 4829,4832 ---- - *************** July\or August\or September\or October\o - *** 4323,4334 **** - \def_{\ifusingtt\normalunderscore\_} - % Subroutine for the previous macro. - ! \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}} - ! - ! % \lvvmode is equivalent in function to \leavevmode. - ! % Using \leavevmode runs into trouble when written out to - ! % an index file due to the expansion of \leavevmode into ``\unhbox - ! % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our - ! % magic tricks with @. - ! \def\lvvmode{\vbox to 0pt{}} - - \catcode`\|=\active - --- 4834,4838 ---- - \def_{\ifusingtt\normalunderscore\_} - % Subroutine for the previous macro. - ! \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} - - \catcode`\|=\active - diff -rcp2N gcc-2.7.2.3/tm.texi gcc-2.7.2.3.f.2/tm.texi - *** gcc-2.7.2.3/tm.texi Sun Sep 3 12:59:01 1995 - --- gcc-2.7.2.3.f.2/tm.texi Tue Sep 9 07:01:47 1997 - *************** This describes the stack layout and call - *** 1951,1954 **** - --- 1951,1955 ---- - @menu - * Frame Layout:: - + * Stack Checking:: - * Frame Registers:: - * Elimination:: - *************** This discusses registers that address th - *** 2070,2073 **** - --- 2071,2156 ---- - @table @code - @findex STACK_POINTER_REGNUM - + @end table - + - + @node Stack Checking - + @subsection Specifying How Stack Checking is Done - + - + GNU CC will check that stack references are within the boundaries of - + the stack, if the @samp{-fstack-check} is specified, in one of three ways: - + - + @enumerate - + @item - + If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GNU CC - + will assume that you have arranged for stack checking to be done at - + appropriate places in the configuration files, e.g., in - + @code{FUNCTION_PROLOGUE}. GNU CC will do not other special processing. - + - + @item - + If @code{STACK_CHECK_BUILTIN} is zero and you defined a named pattern - + called @code{check_stack} in your @file{md} file, GNU CC will call that - + pattern with one argument which is the address to compare the stack - + value against. You must arrange for this pattern to report an error if - + the stack pointer is out of range. - + - + @item - + If neither of the above are true, GNU CC will generate code to periodically - + ``probe'' the stack pointer using the values of the macros defined below. - + @end enumerate - + - + Normally, you will use the default values of these macros, so GNU CC - + will use the third approach. - + - + @table @code - + @findex STACK_CHECK_BUILTIN - + @item STACK_CHECK_BUILTIN - + A nonzero value if stack checking is done by the configuration files in a - + machine-dependent manner. You should define this macro if stack checking - + is require by the ABI of your machine or if you would like to have to stack - + checking in some more efficient way than GNU CC's portable approach. - + The default value of this macro is zero. - + - + @findex STACK_CHECK_PROBE_INTERVAL - + @item STACK_CHECK_PROBE_INTERVAL - + An integer representing the interval at which GNU CC must generate stack - + probe instructions. You will normally define this macro to be no larger - + than the size of the ``guard pages'' at the end of a stack area. The - + default value of 4096 is suitable for most systems. - + - + @findex STACK_CHECK_PROBE_LOAD - + @item STACK_CHECK_PROBE_LOAD - + A integer which is nonzero if GNU CC should perform the stack probe - + as a load instruction and zero if GNU CC should use a store instruction. - + The default is zero, which is the most efficient choice on most systems. - + - + @findex STACK_CHECK_PROTECT - + @item STACK_CHECK_PROTECT - + The number of bytes of stack needed to recover from a stack overflow, - + for languages where such a recovery is supported. The default value of - + 75 words should be adequate for most machines. - + - + @findex STACK_CHECK_MAX_FRAME_SIZE - + @item STACK_CHECK_MAX_FRAME_SIZE - + The maximum size of a stack frame, in bytes. GNU CC will generate probe - + instructions in non-leaf functions to ensure at least this many bytes of - + stack are available. If a stack frame is larger than this size, stack - + checking will not be reliable and GNU CC will issue a warning. The - + default is chosen so that GNU CC only generates one instruction on most - + systems. You should normally not change the default value of this macro. - + - + @findex STACK_CHECK_FIXED_FRAME_SIZE - + @item STACK_CHECK_FIXED_FRAME_SIZE - + GNU CC uses this value to generate the above warning message. It - + represents the amount of fixed frame used by a function, not including - + space for any callee-saved registers, temporaries and user variables. - + You need only specify an upper bound for this amount and will normally - + use the default of four words. - + - + @findex STACK_CHECK_MAX_VAR_SIZE - + @item STACK_CHECK_MAX_VAR_SIZE - + The maximum size, in bytes, of an object that GNU CC will place in the - + fixed area of the stack frame when the user specifies - + @samp{-fstack-check}. - + GNU CC computed the default from the values of the above macros and you will - + normally not need to override that default. - @item STACK_POINTER_REGNUM - The register number of the stack pointer register, which must also be a - diff -rcp2N gcc-2.7.2.3/toplev.c gcc-2.7.2.3.f.2/toplev.c - *** gcc-2.7.2.3/toplev.c Fri Oct 20 21:56:35 1995 - --- gcc-2.7.2.3.f.2/toplev.c Tue Sep 9 07:01:47 1997 - *************** int flag_unroll_loops; - *** 388,391 **** - --- 388,405 ---- - int flag_unroll_all_loops; - - + /* Nonzero forces all invariant computations in loops to be moved - + outside the loop. */ - + - + int flag_move_all_movables = 0; - + - + /* Nonzero forces all general induction variables in loops to be - + strength reduced. */ - + - + int flag_reduce_all_givs = 0; - + - + /* Nonzero gets another run of loop_optimize performed. */ - + - + int flag_rerun_loop_opt = 0; - + - /* Nonzero for -fwritable-strings: - store string constants in data segment and don't uniquize them. */ - *************** int flag_gnu_linker = 1; - *** 522,525 **** - --- 536,554 ---- - int flag_pack_struct = 0; - - + /* 1 if alias checking is on (by default, when -O). */ - + int flag_alias_check = 0; - + - + /* 0 if pointer arguments may alias each other. True in C. - + 1 if pointer arguments may not alias each other but may alias - + global variables. - + 2 if pointer arguments may not alias each other and may not - + alias global variables. True in Fortran. - + This defaults to 0 for C. */ - + int flag_argument_noalias = 0; - + - + /* Emit code to check for stack overflow; also may cause large objects - + to be allocated dynamically. */ - + int flag_stack_check; - + - /* Table of language-independent -f options. - STRING is the option name. VARIABLE is the address of the variable. - *************** struct { char *string; int *variable; in - *** 542,545 **** - --- 571,577 ---- - {"unroll-loops", &flag_unroll_loops, 1}, - {"unroll-all-loops", &flag_unroll_all_loops, 1}, - + {"move-all-movables", &flag_move_all_movables, 1}, - + {"reduce-all-givs", &flag_reduce_all_givs, 1}, - + {"rerun-loop-opt", &flag_rerun_loop_opt, 1}, - {"writable-strings", &flag_writable_strings, 1}, - {"peephole", &flag_no_peephole, 0}, - *************** struct { char *string; int *variable; in - *** 568,572 **** - {"gnu-linker", &flag_gnu_linker, 1}, - {"pack-struct", &flag_pack_struct, 1}, - ! {"bytecode", &output_bytecode, 1} - }; - - --- 600,609 ---- - {"gnu-linker", &flag_gnu_linker, 1}, - {"pack-struct", &flag_pack_struct, 1}, - ! {"bytecode", &output_bytecode, 1}, - ! {"alias-check", &flag_alias_check, 1}, - ! {"argument-alias", &flag_argument_noalias, 0}, - ! {"argument-noalias", &flag_argument_noalias, 1}, - ! {"argument-noalias-global", &flag_argument_noalias, 2}, - ! {"stack-check", &flag_stack_check, 1} - }; - - *************** rest_of_compilation (decl) - *** 2715,2725 **** - finish_compilation will call rest_of_compilation again - for those functions that need to be output. Also defer those - ! functions that we are supposed to defer. */ - ! - ! if (DECL_DEFER_OUTPUT (decl) - ! || ((specd || DECL_INLINE (decl)) - ! && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl) - ! && ! flag_keep_inline_functions) - ! || DECL_EXTERNAL (decl)))) - { - DECL_DEFER_OUTPUT (decl) = 1; - --- 2752,2765 ---- - finish_compilation will call rest_of_compilation again - for those functions that need to be output. Also defer those - ! functions that we are supposed to defer. We cannot defer - ! functions containing nested functions since the nested function - ! data is in our non-saved obstack. */ - ! - ! if (! current_function_contains_functions - ! && (DECL_DEFER_OUTPUT (decl) - ! || ((specd || DECL_INLINE (decl)) - ! && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl) - ! && ! flag_keep_inline_functions) - ! || DECL_EXTERNAL (decl))))) - { - DECL_DEFER_OUTPUT (decl) = 1; - *************** rest_of_compilation (decl) - *** 2893,2897 **** - --- 2933,2956 ---- - TIMEVAR (loop_time, - { - + int save_unroll_flag; - + int save_unroll_all_flag; - + - + if (flag_rerun_loop_opt) - + { - + save_unroll_flag = flag_unroll_loops; - + save_unroll_all_flag = flag_unroll_all_loops; - + flag_unroll_loops = 0; - + flag_unroll_all_loops = 0; - + } - + - loop_optimize (insns, loop_dump_file); - + - + if (flag_rerun_loop_opt) - + { - + flag_unroll_loops = save_unroll_flag; - + flag_unroll_all_loops = save_unroll_all_flag; - + - + loop_optimize (insns, loop_dump_file); - + } - }); - } - *************** rest_of_compilation (decl) - *** 3280,3283 **** - --- 3339,3346 ---- - resume_temporary_allocation (); - - + /* Show no temporary slots allocated. */ - + - + init_temp_slots (); - + - /* The parsing time is all the time spent in yyparse - *except* what is spent in this function. */ - *************** main (argc, argv, envp) - *** 3383,3386 **** - --- 3446,3450 ---- - flag_omit_frame_pointer = 1; - #endif - + flag_alias_check = 1; - } - - diff -rcp2N gcc-2.7.2.3/tree.c gcc-2.7.2.3.f.2/tree.c - *** gcc-2.7.2.3/tree.c Mon Oct 2 01:26:56 1995 - --- gcc-2.7.2.3.f.2/tree.c Tue Sep 9 07:01:48 1997 - *************** build_string (len, str) - *** 1428,1436 **** - /* Return a newly constructed COMPLEX_CST node whose value is - specified by the real and imaginary parts REAL and IMAG. - ! Both REAL and IMAG should be constant nodes. - ! The TREE_TYPE is not initialized. */ - - tree - ! build_complex (real, imag) - tree real, imag; - { - --- 1428,1437 ---- - /* Return a newly constructed COMPLEX_CST node whose value is - specified by the real and imaginary parts REAL and IMAG. - ! Both REAL and IMAG should be constant nodes. TYPE, if specified, - ! will be the type of the COMPLEX_CST; otherwise a new type will be made. */ - - tree - ! build_complex (type, real, imag) - ! tree type; - tree real, imag; - { - *************** build_complex (real, imag) - *** 1439,1443 **** - TREE_REALPART (t) = real; - TREE_IMAGPART (t) = imag; - ! TREE_TYPE (t) = build_complex_type (TREE_TYPE (real)); - TREE_OVERFLOW (t) = TREE_OVERFLOW (real) | TREE_OVERFLOW (imag); - TREE_CONSTANT_OVERFLOW (t) - --- 1440,1444 ---- - TREE_REALPART (t) = real; - TREE_IMAGPART (t) = imag; - ! TREE_TYPE (t) = type ? type : build_complex_type (TREE_TYPE (real)); - TREE_OVERFLOW (t) = TREE_OVERFLOW (real) | TREE_OVERFLOW (imag); - TREE_CONSTANT_OVERFLOW (t) - *************** integer_zerop (expr) - *** 1484,1487 **** - --- 1485,1489 ---- - - return ((TREE_CODE (expr) == INTEGER_CST - + && ! TREE_CONSTANT_OVERFLOW (expr) - && TREE_INT_CST_LOW (expr) == 0 - && TREE_INT_CST_HIGH (expr) == 0) - *************** integer_onep (expr) - *** 1501,1504 **** - --- 1503,1507 ---- - - return ((TREE_CODE (expr) == INTEGER_CST - + && ! TREE_CONSTANT_OVERFLOW (expr) - && TREE_INT_CST_LOW (expr) == 1 - && TREE_INT_CST_HIGH (expr) == 0) - *************** integer_all_onesp (expr) - *** 1525,1529 **** - return 1; - - ! else if (TREE_CODE (expr) != INTEGER_CST) - return 0; - - --- 1528,1533 ---- - return 1; - - ! else if (TREE_CODE (expr) != INTEGER_CST - ! || TREE_CONSTANT_OVERFLOW (expr)) - return 0; - - *************** integer_pow2p (expr) - *** 1574,1578 **** - return 1; - - ! if (TREE_CODE (expr) != INTEGER_CST) - return 0; - - --- 1578,1582 ---- - return 1; - - ! if (TREE_CODE (expr) != INTEGER_CST || TREE_CONSTANT_OVERFLOW (expr)) - return 0; - - *************** real_zerop (expr) - *** 1596,1599 **** - --- 1600,1604 ---- - - return ((TREE_CODE (expr) == REAL_CST - + && ! TREE_CONSTANT_OVERFLOW (expr) - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)) - || (TREE_CODE (expr) == COMPLEX_CST - *************** real_onep (expr) - *** 1611,1614 **** - --- 1616,1620 ---- - - return ((TREE_CODE (expr) == REAL_CST - + && ! TREE_CONSTANT_OVERFLOW (expr) - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)) - || (TREE_CODE (expr) == COMPLEX_CST - *************** real_twop (expr) - *** 1626,1629 **** - --- 1632,1636 ---- - - return ((TREE_CODE (expr) == REAL_CST - + && ! TREE_CONSTANT_OVERFLOW (expr) - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)) - || (TREE_CODE (expr) == COMPLEX_CST - *************** staticp (arg) - *** 2055,2061 **** - return 1; - - case COMPONENT_REF: - case BIT_FIELD_REF: - ! return staticp (TREE_OPERAND (arg, 0)); - - #if 0 - --- 2062,2073 ---- - return 1; - - + /* If we are referencing a bitfield, we can't evaluate an - + ADDR_EXPR at compile time and so it isn't a constant. */ - case COMPONENT_REF: - + return (! DECL_BIT_FIELD (TREE_OPERAND (arg, 1)) - + && staticp (TREE_OPERAND (arg, 0))); - + - case BIT_FIELD_REF: - ! return 0; - - #if 0 - *************** save_expr (expr) - *** 2141,2148 **** - - /* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size - ! or offset that depends on a field within a record. - ! - ! Note that we only allow such expressions within simple arithmetic - ! or a COND_EXPR. */ - - int - --- 2153,2157 ---- - - /* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size - ! or offset that depends on a field within a record. */ - - int - *************** contains_placeholder_p (exp) - *** 2151,2155 **** - { - register enum tree_code code = TREE_CODE (exp); - - tree inner; - - /* If we have a WITH_RECORD_EXPR, it "cancels" any PLACEHOLDER_EXPR - --- 2160,2163 ---- - *************** contains_placeholder_p (exp) - *** 2157,2173 **** - if (code == WITH_RECORD_EXPR) - return 0; - - switch (TREE_CODE_CLASS (code)) - { - case 'r': - ! for (inner = TREE_OPERAND (exp, 0); - ! TREE_CODE_CLASS (TREE_CODE (inner)) == 'r'; - ! inner = TREE_OPERAND (inner, 0)) - ! ; - ! return TREE_CODE (inner) == PLACEHOLDER_EXPR; - - case '1': - case '2': case '<': - case 'e': - switch (tree_code_length[(int) code]) - { - --- 2165,2203 ---- - if (code == WITH_RECORD_EXPR) - return 0; - + else if (code == PLACEHOLDER_EXPR) - + return 1; - - switch (TREE_CODE_CLASS (code)) - { - case 'r': - ! /* Don't look at any PLACEHOLDER_EXPRs that might be in index or bit - ! position computations since they will be converted into a - ! WITH_RECORD_EXPR involving the reference, which will assume - ! here will be valid. */ - ! return contains_placeholder_p (TREE_OPERAND (exp, 0)); - - case '1': - case '2': case '<': - case 'e': - + switch (code) - + { - + case COMPOUND_EXPR: - + /* Ignoring the first operand isn't quite right, but works best. */ - + return contains_placeholder_p (TREE_OPERAND (exp, 1)); - + - + case RTL_EXPR: - + case CONSTRUCTOR: - + return 0; - + - + case COND_EXPR: - + return (contains_placeholder_p (TREE_OPERAND (exp, 0)) - + || contains_placeholder_p (TREE_OPERAND (exp, 1)) - + || contains_placeholder_p (TREE_OPERAND (exp, 2))); - + - + case SAVE_EXPR: - + return (SAVE_EXPR_RTL (exp) == 0 - + && contains_placeholder_p (TREE_OPERAND (exp, 0))); - + } - + - switch (tree_code_length[(int) code]) - { - *************** contains_placeholder_p (exp) - *** 2175,2189 **** - return contains_placeholder_p (TREE_OPERAND (exp, 0)); - case 2: - ! return (code != RTL_EXPR - ! && code != CONSTRUCTOR - ! && ! (code == SAVE_EXPR && SAVE_EXPR_RTL (exp) != 0) - ! && code != WITH_RECORD_EXPR - ! && (contains_placeholder_p (TREE_OPERAND (exp, 0)) - ! || contains_placeholder_p (TREE_OPERAND (exp, 1)))); - ! case 3: - ! return (code == COND_EXPR - ! && (contains_placeholder_p (TREE_OPERAND (exp, 0)) - ! || contains_placeholder_p (TREE_OPERAND (exp, 1)) - ! || contains_placeholder_p (TREE_OPERAND (exp, 2)))); - } - } - --- 2205,2210 ---- - return contains_placeholder_p (TREE_OPERAND (exp, 0)); - case 2: - ! return (contains_placeholder_p (TREE_OPERAND (exp, 0)) - ! || contains_placeholder_p (TREE_OPERAND (exp, 1))); - } - } - *************** substitute_in_expr (exp, f, r) - *** 2204,2207 **** - --- 2225,2229 ---- - { - enum tree_code code = TREE_CODE (exp); - + tree op0, op1, op2; - tree new = 0; - tree inner; - *************** substitute_in_expr (exp, f, r) - *** 2225,2231 **** - { - case 1: - ! new = fold (build1 (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), - ! f, r))); - break; - - --- 2247,2255 ---- - { - case 1: - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! if (op0 == TREE_OPERAND (exp, 0)) - ! return exp; - ! - ! new = fold (build1 (code, TREE_TYPE (exp), op0)); - break; - - *************** substitute_in_expr (exp, f, r) - *** 2238,2245 **** - abort (); - - ! new = fold (build (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 1), - ! f, r))); - break; - - --- 2262,2271 ---- - abort (); - - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); - ! if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)) - ! return exp; - ! - ! new = fold (build (code, TREE_TYPE (exp), op0, op1)); - break; - - *************** substitute_in_expr (exp, f, r) - *** 2253,2261 **** - abort (); - - ! new = fold (build (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 1), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 2), - ! f, r))); - } - - --- 2279,2290 ---- - abort (); - - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); - ! op2 = substitute_in_expr (TREE_OPERAND (exp, 2), f, r); - ! if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1) - ! && op2 == TREE_OPERAND (exp, 2)) - ! return exp; - ! - ! new = fold (build (code, TREE_TYPE (exp), op0, op1, op2)); - } - - *************** substitute_in_expr (exp, f, r) - *** 2276,2302 **** - return r; - - ! new = fold (build (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), f, r), - TREE_OPERAND (exp, 1))); - break; - - case BIT_FIELD_REF: - ! new = fold (build (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 1), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 2), f, r))); - break; - - case INDIRECT_REF: - case BUFFER_REF: - ! new = fold (build1 (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), - ! f, r))); - break; - - case OFFSET_REF: - ! new = fold (build (code, TREE_TYPE (exp), - ! substitute_in_expr (TREE_OPERAND (exp, 0), f, r), - ! substitute_in_expr (TREE_OPERAND (exp, 1), f, r))); - break; - } - --- 2305,2349 ---- - return r; - - ! /* If this expression hasn't been completed let, leave it - ! alone. */ - ! if (TREE_CODE (inner) == PLACEHOLDER_EXPR - ! && TREE_TYPE (inner) == 0) - ! return exp; - ! - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! if (op0 == TREE_OPERAND (exp, 0)) - ! return exp; - ! - ! new = fold (build (code, TREE_TYPE (exp), op0, - TREE_OPERAND (exp, 1))); - break; - - case BIT_FIELD_REF: - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); - ! op2 = substitute_in_expr (TREE_OPERAND (exp, 2), f, r); - ! if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1) - ! && op2 == TREE_OPERAND (exp, 2)) - ! return exp; - ! - ! new = fold (build (code, TREE_TYPE (exp), op0, op1, op2)); - break; - - case INDIRECT_REF: - case BUFFER_REF: - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! if (op0 == TREE_OPERAND (exp, 0)) - ! return exp; - ! - ! new = fold (build1 (code, TREE_TYPE (exp), op0)); - break; - - case OFFSET_REF: - ! op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - ! op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); - ! if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)) - ! return exp; - ! - ! new = fold (build (code, TREE_TYPE (exp), op0, op1)); - break; - } - *************** substitute_in_expr (exp, f, r) - *** 2311,2454 **** - } - - - /* Given a type T, a FIELD_DECL F, and a replacement value R, - - return a new type with all size expressions that contain F - - updated by replacing F with R. */ - - - - tree - - substitute_in_type (t, f, r) - - tree t, f, r; - - { - - switch (TREE_CODE (t)) - - { - - case POINTER_TYPE: - - case VOID_TYPE: - - return t; - - case INTEGER_TYPE: - - case ENUMERAL_TYPE: - - case BOOLEAN_TYPE: - - case CHAR_TYPE: - - if ((TREE_CODE (TYPE_MIN_VALUE (t)) != INTEGER_CST - - && contains_placeholder_p (TYPE_MIN_VALUE (t))) - - || (TREE_CODE (TYPE_MAX_VALUE (t)) != INTEGER_CST - - && contains_placeholder_p (TYPE_MAX_VALUE (t)))) - - return build_range_type (t, - - substitute_in_expr (TYPE_MIN_VALUE (t), f, r), - - substitute_in_expr (TYPE_MAX_VALUE (t), f, r)); - - return t; - - - - case REAL_TYPE: - - if ((TYPE_MIN_VALUE (t) != 0 - - && TREE_CODE (TYPE_MIN_VALUE (t)) != REAL_CST - - && contains_placeholder_p (TYPE_MIN_VALUE (t))) - - || (TYPE_MAX_VALUE (t) != 0 - - && TREE_CODE (TYPE_MAX_VALUE (t)) != REAL_CST - - && contains_placeholder_p (TYPE_MAX_VALUE (t)))) - - { - - t = build_type_copy (t); - - - - if (TYPE_MIN_VALUE (t)) - - TYPE_MIN_VALUE (t) = substitute_in_expr (TYPE_MIN_VALUE (t), f, r); - - if (TYPE_MAX_VALUE (t)) - - TYPE_MAX_VALUE (t) = substitute_in_expr (TYPE_MAX_VALUE (t), f, r); - - } - - return t; - - - - case COMPLEX_TYPE: - - return build_complex_type (substitute_in_type (TREE_TYPE (t), f, r)); - - - - case OFFSET_TYPE: - - case METHOD_TYPE: - - case REFERENCE_TYPE: - - case FILE_TYPE: - - case SET_TYPE: - - case FUNCTION_TYPE: - - case LANG_TYPE: - - /* Don't know how to do these yet. */ - - abort (); - - - - case ARRAY_TYPE: - - t = build_array_type (substitute_in_type (TREE_TYPE (t), f, r), - - substitute_in_type (TYPE_DOMAIN (t), f, r)); - - TYPE_SIZE (t) = 0; - - layout_type (t); - - return t; - - - - case RECORD_TYPE: - - case UNION_TYPE: - - case QUAL_UNION_TYPE: - - { - - tree new = copy_node (t); - - tree field; - - tree last_field = 0; - - - - /* Start out with no fields, make new fields, and chain them - - in. */ - - - - TYPE_FIELDS (new) = 0; - - TYPE_SIZE (new) = 0; - - - - for (field = TYPE_FIELDS (t); field; - - field = TREE_CHAIN (field)) - - { - - tree new_field = copy_node (field); - - - - TREE_TYPE (new_field) - - = substitute_in_type (TREE_TYPE (new_field), f, r); - - - - /* If this is an anonymous field and the type of this field is - - a UNION_TYPE or RECORD_TYPE with no elements, ignore it. If - - the type just has one element, treat that as the field. - - But don't do this if we are processing a QUAL_UNION_TYPE. */ - - if (TREE_CODE (t) != QUAL_UNION_TYPE && DECL_NAME (new_field) == 0 - - && (TREE_CODE (TREE_TYPE (new_field)) == UNION_TYPE - - || TREE_CODE (TREE_TYPE (new_field)) == RECORD_TYPE)) - - { - - if (TYPE_FIELDS (TREE_TYPE (new_field)) == 0) - - continue; - - - - if (TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new_field))) == 0) - - new_field = TYPE_FIELDS (TREE_TYPE (new_field)); - - } - - - - DECL_CONTEXT (new_field) = new; - - DECL_SIZE (new_field) = 0; - - - - if (TREE_CODE (t) == QUAL_UNION_TYPE) - - { - - /* Do the substitution inside the qualifier and if we find - - that this field will not be present, omit it. */ - - DECL_QUALIFIER (new_field) - - = substitute_in_expr (DECL_QUALIFIER (field), f, r); - - if (integer_zerop (DECL_QUALIFIER (new_field))) - - continue; - - } - - - - if (last_field == 0) - - TYPE_FIELDS (new) = new_field; - - else - - TREE_CHAIN (last_field) = new_field; - - - - last_field = new_field; - - - - /* If this is a qualified type and this field will always be - - present, we are done. */ - - if (TREE_CODE (t) == QUAL_UNION_TYPE - - && integer_onep (DECL_QUALIFIER (new_field))) - - break; - - } - - - - /* If this used to be a qualified union type, but we now know what - - field will be present, make this a normal union. */ - - if (TREE_CODE (new) == QUAL_UNION_TYPE - - && (TYPE_FIELDS (new) == 0 - - || integer_onep (DECL_QUALIFIER (TYPE_FIELDS (new))))) - - TREE_SET_CODE (new, UNION_TYPE); - - - - layout_type (new); - - return new; - - } - - } - - } - - - /* Stabilize a reference so that we can use it any number of times - without causing its operands to be evaluated more than once. - --- 2358,2361 ---- - *************** build_type_variant (type, constp, volati - *** 3141,3145 **** - preserve the TYPE_NAME, since there is code that depends on this. */ - - ! for (t = TYPE_MAIN_VARIANT(type); t; t = TYPE_NEXT_VARIANT (t)) - if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t) - && TYPE_NAME (t) == TYPE_NAME (type)) - --- 3048,3052 ---- - preserve the TYPE_NAME, since there is code that depends on this. */ - - ! for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) - if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t) - && TYPE_NAME (t) == TYPE_NAME (type)) - *************** get_unwidened (op, for_type) - *** 4051,4055 **** - if (TREE_CODE (op) == COMPONENT_REF - /* Since type_for_size always gives an integer type. */ - ! && TREE_CODE (type) != REAL_TYPE) - { - unsigned innerprec = TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (op, 1))); - --- 3958,3964 ---- - if (TREE_CODE (op) == COMPONENT_REF - /* Since type_for_size always gives an integer type. */ - ! && TREE_CODE (type) != REAL_TYPE - ! /* Don't crash if field not layed out yet. */ - ! && DECL_SIZE (TREE_OPERAND (op, 1)) != 0) - { - unsigned innerprec = TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (op, 1))); - diff -rcp2N gcc-2.7.2.3/tree.h gcc-2.7.2.3.f.2/tree.h - *** gcc-2.7.2.3/tree.h Mon Sep 25 21:49:40 1995 - --- gcc-2.7.2.3.f.2/tree.h Mon Oct 27 07:40:49 1997 - *************** enum built_in_function - *** 98,101 **** - --- 98,103 ---- - BUILT_IN_APPLY, - BUILT_IN_RETURN, - + BUILT_IN_SETJMP, - + BUILT_IN_LONGJMP, - - /* C++ extensions */ - *************** struct tree_int_cst - *** 408,411 **** - --- 410,415 ---- - { - char common[sizeof (struct tree_common)]; - + struct rtx_def *rtl; /* acts as link to register transfer language - + (rtl) info */ - HOST_WIDE_INT int_cst_low; - HOST_WIDE_INT int_cst_high; - *************** struct tree_type - *** 957,960 **** - --- 961,967 ---- - #define DECL_STATIC_DESTRUCTOR(NODE) ((NODE)->decl.static_dtor_flag) - - + /* In a PARM_DECL, nonzero if this is a restricted pointer. */ - + #define DECL_RESTRICT(NODE) (NODE)->decl.static_ctor_flag - + - /* Used to indicate that this DECL represents a compiler-generated entity. */ - #define DECL_ARTIFICIAL(NODE) ((NODE)->decl.artificial_flag) - *************** extern tree build_int_2_wide PROTO((HOS - *** 1176,1180 **** - extern tree build_real PROTO((tree, REAL_VALUE_TYPE)); - extern tree build_real_from_int_cst PROTO((tree, tree)); - ! extern tree build_complex PROTO((tree, tree)); - extern tree build_string PROTO((int, char *)); - extern tree build1 PROTO((enum tree_code, tree, tree)); - --- 1183,1187 ---- - extern tree build_real PROTO((tree, REAL_VALUE_TYPE)); - extern tree build_real_from_int_cst PROTO((tree, tree)); - ! extern tree build_complex PROTO((tree, tree, tree)); - extern tree build_string PROTO((int, char *)); - extern tree build1 PROTO((enum tree_code, tree, tree)); - *************** extern int contains_placeholder_p PROTO( - *** 1378,1387 **** - extern tree substitute_in_expr PROTO((tree, tree, tree)); - - - /* Given a type T, a FIELD_DECL F, and a replacement value R, - - return a new type with all size expressions that contain F - - updated by replacing the reference to F with R. */ - - - - extern tree substitute_in_type PROTO((tree, tree, tree)); - - - /* variable_size (EXP) is like save_expr (EXP) except that it - is for the special case of something that is part of a - --- 1385,1388 ---- - *************** extern tree maybe_build_cleanup PROTO(( - *** 1456,1460 **** - and find the ultimate containing object, which is returned. */ - - ! extern tree get_inner_reference PROTO((tree, int *, int *, tree *, enum machine_mode *, int *, int *)); - - /* Return the FUNCTION_DECL which provides this _DECL with its context, - --- 1457,1463 ---- - and find the ultimate containing object, which is returned. */ - - ! extern tree get_inner_reference PROTO((tree, int *, int *, tree *, - ! enum machine_mode *, int *, - ! int *, int *)); - - /* Return the FUNCTION_DECL which provides this _DECL with its context, - diff -rcp2N gcc-2.7.2.3/unroll.c gcc-2.7.2.3.f.2/unroll.c - *** gcc-2.7.2.3/unroll.c Tue Jun 24 18:42:51 1997 - --- gcc-2.7.2.3.f.2/unroll.c Tue Sep 9 07:01:48 1997 - *************** unroll_loop (loop_end, insn_count, loop_ - *** 268,273 **** - structure of the function. This can happen as a result of the - "if (foo) bar; else break;" optimization in jump.c. */ - - ! if (write_symbols != NO_DEBUG) - { - int block_begins = 0; - --- 268,277 ---- - structure of the function. This can happen as a result of the - "if (foo) bar; else break;" optimization in jump.c. */ - + /* ??? Gcc has a general policy that -g is never supposed to change the code - + that the compiler emits, so we must disable this optimization always, - + even if debug info is not being output. This is rare, so this should - + not be a significant performance problem. */ - - ! if (1 /* write_symbols != NO_DEBUG */) - { - int block_begins = 0; - *************** unroll_loop (loop_end, insn_count, loop_ - *** 633,636 **** - --- 637,657 ---- - } - - + if (unroll_type == UNROLL_NAIVE - + && GET_CODE (last_loop_insn) == JUMP_INSN - + && start_label != JUMP_LABEL (last_loop_insn)) - + { - + /* ??? The loop ends with a conditional branch that does not branch back - + to the loop start label. In this case, we must emit an unconditional - + branch to the loop exit after emitting the final branch. - + copy_loop_body does not have support for this currently, so we - + give up. It doesn't seem worthwhile to unroll anyways since - + unrolling would increase the number of branch instructions - + executed. */ - + if (loop_dump_stream) - + fprintf (loop_dump_stream, - + "Unrolling failure: final conditional branch not to loop start\n"); - + return; - + } - + - /* Allocate a translation table for the labels and insn numbers. - They will be filled in as we copy the insns in the loop. */ - *************** unroll_loop (loop_end, insn_count, loop_ - *** 995,999 **** - for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) - if (local_regno[j]) - ! map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); - - /* The last copy needs the compare/branch insns at the end, - --- 1016,1024 ---- - for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) - if (local_regno[j]) - ! { - ! map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); - ! record_base_value (REGNO (map->reg_map[j]), - ! regno_reg_rtx[j]); - ! } - - /* The last copy needs the compare/branch insns at the end, - *************** unroll_loop (loop_end, insn_count, loop_ - *** 1136,1140 **** - for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) - if (local_regno[j]) - ! map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); - - /* If loop starts with a branch to the test, then fix it so that - --- 1161,1169 ---- - for (j = FIRST_PSEUDO_REGISTER; j < max_reg_before_loop; j++) - if (local_regno[j]) - ! { - ! map->reg_map[j] = gen_reg_rtx (GET_MODE (regno_reg_rtx[j])); - ! record_base_value (REGNO (map->reg_map[j]), - ! regno_reg_rtx[j]); - ! } - - /* If loop starts with a branch to the test, then fix it so that - *************** copy_loop_body (copy_start, copy_end, ma - *** 1605,1608 **** - --- 1634,1641 ---- - int this_giv_inc = INTVAL (giv_inc); - - + /* If this DEST_ADDR giv was not split, then ignore it. */ - + if (*tv->location != tv->dest_reg) - + continue; - + - /* Scale this_giv_inc if the multiplicative factors of - the two givs are different. */ - *************** copy_loop_body (copy_start, copy_end, ma - *** 1631,1635 **** - incrementing the shared pseudo reg more than - once. */ - ! if (! tv->same_insn) - { - /* tv->dest_reg may actually be a (PLUS (REG) - --- 1664,1668 ---- - incrementing the shared pseudo reg more than - once. */ - ! if (! tv->same_insn && ! tv->shared) - { - /* tv->dest_reg may actually be a (PLUS (REG) - *************** copy_loop_body (copy_start, copy_end, ma - *** 1757,1760 **** - --- 1790,1794 ---- - giv_dest_reg = tem; - map->reg_map[regno] = tem; - + record_base_value (REGNO (tem), giv_src_reg); - } - else - *************** iteration_info (iteration_var, initial_v - *** 2220,2231 **** - return; - } - ! /* Reject iteration variables larger than the host long size, since they - could result in a number of iterations greater than the range of our - ! `unsigned long' variable loop_n_iterations. */ - ! else if (GET_MODE_BITSIZE (GET_MODE (iteration_var)) > HOST_BITS_PER_LONG) - { - if (loop_dump_stream) - fprintf (loop_dump_stream, - ! "Loop unrolling: Iteration var rejected because mode larger than host long.\n"); - return; - } - --- 2254,2266 ---- - return; - } - ! /* Reject iteration variables larger than the host wide int size, since they - could result in a number of iterations greater than the range of our - ! `unsigned HOST_WIDE_INT' variable loop_n_iterations. */ - ! else if ((GET_MODE_BITSIZE (GET_MODE (iteration_var)) - ! > HOST_BITS_PER_WIDE_INT)) - { - if (loop_dump_stream) - fprintf (loop_dump_stream, - ! "Loop unrolling: Iteration var rejected because mode too large.\n"); - return; - } - *************** find_splittable_regs (unroll_type, loop_ - *** 2443,2447 **** - { - rtx tem = gen_reg_rtx (bl->biv->mode); - ! - emit_insn_before (gen_move_insn (tem, bl->biv->src_reg), - loop_start); - --- 2478,2483 ---- - { - rtx tem = gen_reg_rtx (bl->biv->mode); - ! - ! record_base_value (REGNO (tem), bl->biv->add_val); - emit_insn_before (gen_move_insn (tem, bl->biv->src_reg), - loop_start); - *************** find_splittable_regs (unroll_type, loop_ - *** 2500,2503 **** - --- 2536,2541 ---- - exits. */ - rtx tem = gen_reg_rtx (bl->biv->mode); - + record_base_value (REGNO (tem), bl->biv->add_val); - + - emit_insn_before (gen_move_insn (tem, bl->biv->src_reg), - loop_start); - *************** find_splittable_givs (bl, unroll_type, l - *** 2675,2678 **** - --- 2713,2717 ---- - rtx tem = gen_reg_rtx (bl->biv->mode); - - + record_base_value (REGNO (tem), bl->biv->add_val); - emit_insn_before (gen_move_insn (tem, bl->biv->src_reg), - loop_start); - *************** find_splittable_givs (bl, unroll_type, l - *** 2716,2719 **** - --- 2755,2759 ---- - { - rtx tem = gen_reg_rtx (v->mode); - + record_base_value (REGNO (tem), v->add_val); - emit_iv_add_mult (bl->initial_value, v->mult_val, - v->add_val, tem, loop_start); - *************** find_splittable_givs (bl, unroll_type, l - *** 2734,2747 **** - register for the split addr giv, just to be safe. */ - - ! /* ??? If there are multiple address givs which have been - ! combined with the same dest_reg giv, then we may only need - ! one new register for them. Pulling out constants below will - ! catch some of the common cases of this. Currently, I leave - ! the work of simplifying multiple address givs to the - ! following cse pass. */ - ! - ! /* As a special case, if we have multiple identical address givs - ! within a single instruction, then we do use a single pseudo - ! reg for both. This is necessary in case one is a match_dup - of the other. */ - - --- 2774,2780 ---- - register for the split addr giv, just to be safe. */ - - ! /* If we have multiple identical address givs within a - ! single instruction, then use a single pseudo reg for - ! both. This is necessary in case one is a match_dup - of the other. */ - - *************** find_splittable_givs (bl, unroll_type, l - *** 2756,2759 **** - --- 2789,2812 ---- - INSN_UID (v->insn)); - } - + /* If multiple address GIVs have been combined with the - + same dest_reg GIV, do not create a new register for - + each. */ - + else if (unroll_type != UNROLL_COMPLETELY - + && v->giv_type == DEST_ADDR - + && v->same && v->same->giv_type == DEST_ADDR - + && v->same->unrolled - + #ifdef ADDRESS_COST - + /* combine_givs_p may return true when ADDRESS_COST is - + defined even if the multiply and add values are - + not equal. To share a register here, the values - + must be equal, as well as related. */ - + && rtx_equal_p (v->mult_val, v->same->mult_val) - + && rtx_equal_p (v->add_val, v->same->add_val) - + #endif - + ) - + { - + v->dest_reg = v->same->dest_reg; - + v->shared = 1; - + } - else if (unroll_type != UNROLL_COMPLETELY) - { - *************** find_splittable_givs (bl, unroll_type, l - *** 2761,2765 **** - register to hold the split value of the DEST_ADDR giv. - Emit insn to initialize its value before loop start. */ - ! tem = gen_reg_rtx (v->mode); - - /* If the address giv has a constant in its new_reg value, - --- 2814,2821 ---- - register to hold the split value of the DEST_ADDR giv. - Emit insn to initialize its value before loop start. */ - ! - ! rtx tem = gen_reg_rtx (v->mode); - ! record_base_value (REGNO (tem), v->add_val); - ! v->unrolled = 1; - - /* If the address giv has a constant in its new_reg value, - *************** find_splittable_givs (bl, unroll_type, l - *** 2772,2781 **** - v->dest_reg - = plus_constant (tem, INTVAL (XEXP (v->new_reg,1))); - ! - /* Only succeed if this will give valid addresses. - Try to validate both the first and the last - address resulting from loop unrolling, if - one fails, then can't do const elim here. */ - ! if (! verify_addresses (v, giv_inc, unroll_number)) - { - /* Save the negative of the eliminated const, so - --- 2828,2837 ---- - v->dest_reg - = plus_constant (tem, INTVAL (XEXP (v->new_reg,1))); - ! - /* Only succeed if this will give valid addresses. - Try to validate both the first and the last - address resulting from loop unrolling, if - one fails, then can't do const elim here. */ - ! if (verify_addresses (v, giv_inc, unroll_number)) - { - /* Save the negative of the eliminated const, so - *************** final_biv_value (bl, loop_start, loop_en - *** 3068,3071 **** - --- 3124,3128 ---- - - tem = gen_reg_rtx (bl->biv->mode); - + record_base_value (REGNO (tem), bl->biv->add_val); - /* Make sure loop_end is not the last insn. */ - if (NEXT_INSN (loop_end) == 0) - *************** final_giv_value (v, loop_start, loop_end - *** 3161,3164 **** - --- 3218,3222 ---- - /* Put the final biv value in tem. */ - tem = gen_reg_rtx (bl->biv->mode); - + record_base_value (REGNO (tem), bl->biv->add_val); - emit_iv_add_mult (increment, GEN_INT (loop_n_iterations), - bl->initial_value, tem, insert_before); - diff -rcp2N gcc-2.7.2.3/varasm.c gcc-2.7.2.3.f.2/varasm.c - *** gcc-2.7.2.3/varasm.c Wed Aug 13 17:23:27 1997 - --- gcc-2.7.2.3.f.2/varasm.c Tue Sep 9 07:01:49 1997 - *************** assemble_variable (decl, top_level, at_e - *** 1067,1070 **** - --- 1067,1072 ---- - if (! dont_output_data) - { - + int size; - + - if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) - goto finish; - *************** assemble_variable (decl, top_level, at_e - *** 1072,1078 **** - /* This is better than explicit arithmetic, since it avoids overflow. */ - size_tree = size_binop (CEIL_DIV_EXPR, - ! DECL_SIZE (decl), size_int (BITS_PER_UNIT)); - - ! if (TREE_INT_CST_HIGH (size_tree) != 0) - { - error_with_decl (decl, "size of variable `%s' is too large"); - --- 1074,1082 ---- - /* This is better than explicit arithmetic, since it avoids overflow. */ - size_tree = size_binop (CEIL_DIV_EXPR, - ! DECL_SIZE (decl), size_int (BITS_PER_UNIT)); - - ! size = TREE_INT_CST_LOW (size_tree); - ! if (TREE_INT_CST_HIGH (size_tree) != 0 - ! || size != TREE_INT_CST_LOW (size_tree)) - { - error_with_decl (decl, "size of variable `%s' is too large"); - *************** decode_addr_const (exp, value) - *** 2134,2137 **** - --- 2138,2142 ---- - case COMPLEX_CST: - case CONSTRUCTOR: - + case INTEGER_CST: - x = TREE_CST_RTL (target); - break; - *************** const_hash (exp) - *** 2249,2253 **** - return const_hash (TREE_OPERAND (exp, 0)) * 9 - + const_hash (TREE_OPERAND (exp, 1)); - ! else if (code == NOP_EXPR || code == CONVERT_EXPR) - return const_hash (TREE_OPERAND (exp, 0)) * 7 + 2; - - --- 2254,2258 ---- - return const_hash (TREE_OPERAND (exp, 0)) * 9 - + const_hash (TREE_OPERAND (exp, 1)); - ! else if (code == NOP_EXPR || code == CONVERT_EXPR || code == NON_LVALUE_EXPR) - return const_hash (TREE_OPERAND (exp, 0)) * 7 + 2; - - *************** compare_constant_1 (exp, p) - *** 2314,2317 **** - --- 2319,2324 ---- - if (flag_writable_strings) - return 0; - + if (*p++ != TYPE_MODE (TREE_TYPE (exp))) - + return 0; - strp = TREE_STRING_POINTER (exp); - len = TREE_STRING_LENGTH (exp); - *************** compare_constant_1 (exp, p) - *** 2403,2407 **** - return p; - } - ! else if (code == NOP_EXPR || code == CONVERT_EXPR) - { - p = compare_constant_1 (TREE_OPERAND (exp, 0), p); - --- 2410,2414 ---- - return p; - } - ! else if (code == NOP_EXPR || code == CONVERT_EXPR || code == NON_LVALUE_EXPR) - { - p = compare_constant_1 (TREE_OPERAND (exp, 0), p); - *************** record_constant_1 (exp) - *** 2469,2472 **** - --- 2476,2480 ---- - return; - - + obstack_1grow (&permanent_obstack, TYPE_MODE (TREE_TYPE (exp))); - strp = TREE_STRING_POINTER (exp); - len = TREE_STRING_LENGTH (exp); - *************** copy_constant (exp) - *** 2635,2639 **** - - case COMPLEX_CST: - ! return build_complex (copy_constant (TREE_REALPART (exp)), - copy_constant (TREE_IMAGPART (exp))); - - --- 2643,2648 ---- - - case COMPLEX_CST: - ! return build_complex (TREE_TYPE (exp), - ! copy_constant (TREE_REALPART (exp)), - copy_constant (TREE_IMAGPART (exp))); - - *************** copy_constant (exp) - *** 2646,2649 **** - --- 2655,2659 ---- - case NOP_EXPR: - case CONVERT_EXPR: - + case NON_LVALUE_EXPR: - return build1 (TREE_CODE (exp), TREE_TYPE (exp), - copy_constant (TREE_OPERAND (exp, 0))); - *************** output_constant_def (exp) - *** 2692,2698 **** - register rtx def; - - - if (TREE_CODE (exp) == INTEGER_CST) - - abort (); /* No TREE_CST_RTL slot in these. */ - - - if (TREE_CST_RTL (exp)) - return TREE_CST_RTL (exp); - --- 2702,2705 ---- - *************** bc_assemble_integer (exp, size) - *** 3622,3626 **** - exp = fold (exp); - - ! while (TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR) - exp = TREE_OPERAND (exp, 0); - if (TREE_CODE (exp) == INTEGER_CST) - --- 3629,3634 ---- - exp = fold (exp); - - ! while (TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR - ! || TREE_CODE (exp) == NON_LVALUE_EXPR) - exp = TREE_OPERAND (exp, 0); - if (TREE_CODE (exp) == INTEGER_CST) - *************** bc_assemble_integer (exp, size) - *** 3633,3641 **** - const_part = TREE_OPERAND (exp, 0); - while (TREE_CODE (const_part) == NOP_EXPR - ! || TREE_CODE (const_part) == CONVERT_EXPR) - const_part = TREE_OPERAND (const_part, 0); - addr_part = TREE_OPERAND (exp, 1); - while (TREE_CODE (addr_part) == NOP_EXPR - ! || TREE_CODE (addr_part) == CONVERT_EXPR) - addr_part = TREE_OPERAND (addr_part, 0); - if (TREE_CODE (const_part) != INTEGER_CST) - --- 3641,3651 ---- - const_part = TREE_OPERAND (exp, 0); - while (TREE_CODE (const_part) == NOP_EXPR - ! || TREE_CODE (const_part) == CONVERT_EXPR - ! || TREE_CODE (const_part) == NON_LVALUE_EXPR) - const_part = TREE_OPERAND (const_part, 0); - addr_part = TREE_OPERAND (exp, 1); - while (TREE_CODE (addr_part) == NOP_EXPR - ! || TREE_CODE (addr_part) == CONVERT_EXPR - ! || TREE_CODE (addr_part) == NON_LVALUE_EXPR) - addr_part = TREE_OPERAND (addr_part, 0); - if (TREE_CODE (const_part) != INTEGER_CST) - diff -rcp2N gcc-2.7.2.3/version.c gcc-2.7.2.3.f.2/version.c - *** gcc-2.7.2.3/version.c Tue Aug 19 21:26:09 1997 - --- gcc-2.7.2.3.f.2/version.c Tue Sep 16 06:07:36 1997 - *************** - *** 1 **** - ! char *version_string = "2.7.2.3"; - --- 1 ---- - ! char *version_string = "2.7.2.3.f.2"; - diff -rcp2N gcc-2.7.2.3/c-gperf.h gcc-2.7.2.3.f.2/c-gperf.h - *** gcc-2.7.2.3/c-gperf.h Fri Mar 4 19:15:53 1994 - --- gcc-2.7.2.3.f.2/c-gperf.h Mon Sep 29 20:55:29 1997 - *************** - *** 1,15 **** - /* C code produced by gperf version 2.5 (GNU C++ version) */ - ! /* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ c-parse.gperf */ - struct resword { char *name; short token; enum rid rid; }; - - ! #define TOTAL_KEYWORDS 79 - #define MIN_WORD_LENGTH 2 - #define MAX_WORD_LENGTH 20 - ! #define MIN_HASH_VALUE 10 - ! #define MAX_HASH_VALUE 144 - ! /* maximum key range = 135, duplicates = 0 */ - - #ifdef __GNUC__ - ! __inline - #endif - static unsigned int - --- 1,16 ---- - /* C code produced by gperf version 2.5 (GNU C++ version) */ - ! /* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ../g77-new/c-parse.gperf */ - ! /* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */ - struct resword { char *name; short token; enum rid rid; }; - - ! #define TOTAL_KEYWORDS 81 - #define MIN_WORD_LENGTH 2 - #define MAX_WORD_LENGTH 20 - ! #define MIN_HASH_VALUE 13 - ! #define MAX_HASH_VALUE 223 - ! /* maximum key range = 211, duplicates = 0 */ - - #ifdef __GNUC__ - ! inline - #endif - static unsigned int - *************** hash (str, len) - *** 20,36 **** - static unsigned char asso_values[] = - { - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 25, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - ! 145, 145, 145, 145, 145, 1, 145, 46, 8, 15, - ! 61, 6, 36, 48, 3, 5, 145, 18, 63, 25, - ! 29, 76, 1, 145, 13, 2, 1, 51, 37, 9, - ! 9, 1, 3, 145, 145, 145, 145, 145, - }; - register int hval = len; - --- 21,37 ---- - static unsigned char asso_values[] = - { - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 36, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - ! 224, 224, 224, 224, 224, 1, 224, 68, 6, 51, - ! 53, 6, 34, 36, 2, 13, 224, 2, 68, 16, - ! 48, 66, 4, 224, 19, 98, 1, 22, 38, 2, - ! 12, 2, 2, 224, 224, 224, 224, 224, - }; - register int hval = len; - *************** hash (str, len) - *** 44,47 **** - --- 45,49 ---- - case 1: - hval += asso_values[str[0]]; - + break; - } - return hval + asso_values[str[len - 1]]; - *************** hash (str, len) - *** 50,166 **** - static struct resword wordlist[] = - { - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, - ! {"int", TYPESPEC, RID_INT}, - ! {"",}, {"",}, - ! {"__typeof__", TYPEOF, NORID}, - ! {"__signed__", TYPESPEC, RID_SIGNED}, - ! {"__imag__", IMAGPART, NORID}, - ! {"switch", SWITCH, NORID}, - ! {"__inline__", SCSPEC, RID_INLINE}, - ! {"else", ELSE, NORID}, - ! {"__iterator__", SCSPEC, RID_ITERATOR}, - ! {"__inline", SCSPEC, RID_INLINE}, - ! {"__extension__", EXTENSION, NORID}, - ! {"struct", STRUCT, NORID}, - ! {"__real__", REALPART, NORID}, - ! {"__const", TYPE_QUAL, RID_CONST}, - ! {"while", WHILE, NORID}, - ! {"__const__", TYPE_QUAL, RID_CONST}, - ! {"case", CASE, NORID}, - ! {"__complex__", TYPESPEC, RID_COMPLEX}, - ! {"__iterator", SCSPEC, RID_ITERATOR}, - ! {"bycopy", TYPE_QUAL, RID_BYCOPY}, - ! {"",}, {"",}, {"",}, - ! {"__complex", TYPESPEC, RID_COMPLEX}, - ! {"",}, - ! {"in", TYPE_QUAL, RID_IN}, - ! {"break", BREAK, NORID}, - ! {"@defs", DEFS, NORID}, - ! {"",}, {"",}, {"",}, - ! {"extern", SCSPEC, RID_EXTERN}, - ! {"if", IF, NORID}, - ! {"typeof", TYPEOF, NORID}, - ! {"typedef", SCSPEC, RID_TYPEDEF}, - ! {"__typeof", TYPEOF, NORID}, - ! {"sizeof", SIZEOF, NORID}, - ! {"",}, - ! {"return", RETURN, NORID}, - ! {"const", TYPE_QUAL, RID_CONST}, - ! {"__volatile__", TYPE_QUAL, RID_VOLATILE}, - ! {"@private", PRIVATE, NORID}, - ! {"@selector", SELECTOR, NORID}, - ! {"__volatile", TYPE_QUAL, RID_VOLATILE}, - ! {"__asm__", ASM_KEYWORD, NORID}, - ! {"",}, {"",}, - ! {"continue", CONTINUE, NORID}, - ! {"__alignof__", ALIGNOF, NORID}, - ! {"__imag", IMAGPART, NORID}, - ! {"__attribute__", ATTRIBUTE, NORID}, - ! {"",}, {"",}, - ! {"__attribute", ATTRIBUTE, NORID}, - ! {"for", FOR, NORID}, - ! {"",}, - ! {"@encode", ENCODE, NORID}, - ! {"id", OBJECTNAME, RID_ID}, - ! {"static", SCSPEC, RID_STATIC}, - ! {"@interface", INTERFACE, NORID}, - ! {"",}, - ! {"__signed", TYPESPEC, RID_SIGNED}, - ! {"",}, - ! {"__label__", LABEL, NORID}, - ! {"",}, {"",}, - ! {"__asm", ASM_KEYWORD, NORID}, - ! {"char", TYPESPEC, RID_CHAR}, - ! {"",}, - ! {"inline", SCSPEC, RID_INLINE}, - ! {"out", TYPE_QUAL, RID_OUT}, - ! {"register", SCSPEC, RID_REGISTER}, - ! {"__real", REALPART, NORID}, - ! {"short", TYPESPEC, RID_SHORT}, - ! {"",}, - ! {"enum", ENUM, NORID}, - ! {"inout", TYPE_QUAL, RID_INOUT}, - ! {"",}, - ! {"oneway", TYPE_QUAL, RID_ONEWAY}, - ! {"union", UNION, NORID}, - ! {"",}, - ! {"__alignof", ALIGNOF, NORID}, - ! {"",}, - ! {"@implementation", IMPLEMENTATION, NORID}, - ! {"",}, - ! {"@class", CLASS, NORID}, - ! {"",}, - ! {"@public", PUBLIC, NORID}, - ! {"asm", ASM_KEYWORD, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"default", DEFAULT, NORID}, - ! {"",}, - ! {"void", TYPESPEC, RID_VOID}, - ! {"",}, - ! {"@protected", PROTECTED, NORID}, - ! {"@protocol", PROTOCOL, NORID}, - ! {"",}, {"",}, {"",}, - ! {"volatile", TYPE_QUAL, RID_VOLATILE}, - ! {"",}, {"",}, - ! {"signed", TYPESPEC, RID_SIGNED}, - ! {"float", TYPESPEC, RID_FLOAT}, - ! {"@end", END, NORID}, - ! {"",}, {"",}, - ! {"unsigned", TYPESPEC, RID_UNSIGNED}, - ! {"@compatibility_alias", ALIAS, NORID}, - ! {"double", TYPESPEC, RID_DOUBLE}, - ! {"",}, {"",}, - ! {"auto", SCSPEC, RID_AUTO}, - ! {"",}, - ! {"goto", GOTO, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"do", DO, NORID}, - ! {"",}, {"",}, {"",}, {"",}, - ! {"long", TYPESPEC, RID_LONG}, - }; - - #ifdef __GNUC__ - ! __inline - #endif - struct resword * - --- 52,184 ---- - static struct resword wordlist[] = - { - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, {"",}, {"",}, {"",}, - ! {"__typeof__", TYPEOF, NORID}, - ! {"",}, {"",}, {"",}, {"",}, - ! {"int", TYPESPEC, RID_INT}, - ! {"break", BREAK, NORID}, - ! {"",}, - ! {"__extension__", EXTENSION, NORID}, - ! {"",}, - ! {"__imag__", IMAGPART, NORID}, - ! {"",}, - ! {"__inline__", SCSPEC, RID_INLINE}, - ! {"while", WHILE, NORID}, - ! {"__iterator__", SCSPEC, RID_ITERATOR}, - ! {"__inline", SCSPEC, RID_INLINE}, - ! {"__real__", REALPART, NORID}, - ! {"",}, - ! {"__restrict", TYPE_QUAL, RID_RESTRICT}, - ! {"",}, - ! {"__restrict__", TYPE_QUAL, RID_RESTRICT}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"__iterator", SCSPEC, RID_ITERATOR}, - ! {"__typeof", TYPEOF, NORID}, - ! {"typeof", TYPEOF, NORID}, - ! {"typedef", SCSPEC, RID_TYPEDEF}, - ! {"",}, - ! {"enum", ENUM, NORID}, - ! {"if", IF, NORID}, - ! {"",}, {"",}, - ! {"__volatile__", TYPE_QUAL, RID_VOLATILE}, - ! {"",}, {"",}, - ! {"__volatile", TYPE_QUAL, RID_VOLATILE}, - ! {"__imag", IMAGPART, NORID}, - ! {"",}, {"",}, {"",}, - ! {"__const", TYPE_QUAL, RID_CONST}, - ! {"extern", SCSPEC, RID_EXTERN}, - ! {"__const__", TYPE_QUAL, RID_CONST}, - ! {"in", TYPE_QUAL, RID_IN}, - ! {"__complex__", TYPESPEC, RID_COMPLEX}, - ! {"bycopy", TYPE_QUAL, RID_BYCOPY}, - ! {"",}, {"",}, - ! {"id", OBJECTNAME, RID_ID}, - ! {"@private", PRIVATE, NORID}, - ! {"@selector", SELECTOR, NORID}, - ! {"out", TYPE_QUAL, RID_OUT}, - ! {"",}, - ! {"__complex", TYPESPEC, RID_COMPLEX}, - ! {"return", RETURN, NORID}, - ! {"for", FOR, NORID}, - ! {"",}, - ! {"__asm__", ASM_KEYWORD, NORID}, - ! {"",}, - ! {"__label__", LABEL, NORID}, - ! {"oneway", TYPE_QUAL, RID_ONEWAY}, - ! {"__alignof__", ALIGNOF, NORID}, - ! {"register", SCSPEC, RID_REGISTER}, - ! {"__attribute__", ATTRIBUTE, NORID}, - ! {"",}, - ! {"inout", TYPE_QUAL, RID_INOUT}, - ! {"__attribute", ATTRIBUTE, NORID}, - ! {"double", TYPESPEC, RID_DOUBLE}, - ! {"union", UNION, NORID}, - ! {"",}, - ! {"__asm", ASM_KEYWORD, NORID}, - ! {"",}, {"",}, - ! {"inline", SCSPEC, RID_INLINE}, - ! {"__real", REALPART, NORID}, - ! {"default", DEFAULT, NORID}, - ! {"",}, - ! {"@encode", ENCODE, NORID}, - ! {"",}, {"",}, - ! {"@interface", INTERFACE, NORID}, - ! {"",}, {"",}, - ! {"asm", ASM_KEYWORD, NORID}, - ! {"",}, - ! {"const", TYPE_QUAL, RID_CONST}, - ! {"float", TYPESPEC, RID_FLOAT}, - ! {"goto", GOTO, NORID}, - ! {"void", TYPESPEC, RID_VOID}, - ! {"",}, - ! {"__signed__", TYPESPEC, RID_SIGNED}, - ! {"",}, - ! {"__alignof", ALIGNOF, NORID}, - ! {"continue", CONTINUE, NORID}, - ! {"else", ELSE, NORID}, - ! {"@implementation", IMPLEMENTATION, NORID}, - ! {"@public", PUBLIC, NORID}, - ! {"",}, - ! {"@protected", PROTECTED, NORID}, - ! {"switch", SWITCH, NORID}, - ! {"volatile", TYPE_QUAL, RID_VOLATILE}, - ! {"do", DO, NORID}, - ! {"",}, {"",}, - ! {"struct", STRUCT, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"@protocol", PROTOCOL, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"auto", SCSPEC, RID_AUTO}, - ! {"sizeof", SIZEOF, NORID}, - ! {"@end", END, NORID}, - ! {"char", TYPESPEC, RID_CHAR}, - ! {"",}, {"",}, - ! {"@defs", DEFS, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, - ! {"long", TYPESPEC, RID_LONG}, - ! {"",}, {"",}, - ! {"case", CASE, NORID}, - ! {"__signed", TYPESPEC, RID_SIGNED}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"short", TYPESPEC, RID_SHORT}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, - ! {"unsigned", TYPESPEC, RID_UNSIGNED}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, {"",}, - ! {"signed", TYPESPEC, RID_SIGNED}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"@class", CLASS, NORID}, - ! {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - ! {"",}, {"",}, - ! {"@compatibility_alias", ALIAS, NORID}, - ! {"",}, {"",}, - ! {"static", SCSPEC, RID_STATIC}, - }; - - #ifdef __GNUC__ - ! inline - #endif - struct resword * --- 0 ---- diff -rcp2N g77-0.5.22/f/gbe/README g77-0.5.23/f/gbe/README *** g77-0.5.22/f/gbe/README Wed Dec 24 02:05:59 1997 --- g77-0.5.23/f/gbe/README Thu Jan 1 00:00:00 1970 *************** *** 1,50 **** - 1997-12-23 - - This directory contains .diff files for various GNU CC distributions - supported by this version of GNU Fortran. - - The name of a file includes which gcc version to which it applies. - For example, 2.7.2.3.diff is the patch file for gcc version 2.7.2.3. - - To use this file, you must have a working version of `patch' - installed. For best results, ensure that the command - `patch --version' reports that it is GNU patch, version 2.5 - or higher. - - To apply a .diff file to, say, gcc 2.7.2.3, one might use the following - command (where the current directory contains the gcc source distribution - after merging into it the g77 source distribution, which would be - named gcc-2.7.2.3 in this example): - - patch -p1 -d gcc-2.7.2.3 < gcc-2.7.2.3/f/gbe/2.7.2.3.diff - - - This version of g77 is best combined with gcc versions 2.7.2.3. - - However, note that applying any of these patches does _not_ update - the gcc.info* files that constitute the Info documentation for gcc. - Therefore, after applying the patch, you must rebuild the Info - documentation yourself via: - - cd gcc; make -f Makefile.in gcc.info - - If the above command doesn't work because you don't have makeinfo - installed, you are STRONGLY encouraged to obtain the most recent - version of the GNU texinfo package (texinfo-3.11.tar.gz as of this - writing), build, and install it, then try the above command (as - makeinfo is part of texinfo). - - This distribution of g77 is not supported for versions of gcc prior - to 2.7.2.3. - - If you are using a version of gcc more recent than the most - recent .diff file's version, try the most recent .diff ONLY - if the difference is in the third field. E.g. the above - patch might work on gcc-2.7.3 or gcc-2.7.4 if these were - released. On the other hand, it probably wouldn't work for - a more major release like gcc-2.8.0 or gcc-3.0.0, and you - shouldn't try it. If the .diff file is missing, don't bother - asking for it -- it is certainly - being worked on. In the meantime, watch our progress at - for information on support - for the recent versions of gcc. --- 0 ---- diff -rcp2N g77-0.5.22/f/glimits.j g77-0.5.23/f/glimits.j *** g77-0.5.22/f/glimits.j Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/glimits.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* glimits.j -- Wrapper for GCC's glimits.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* glimits.j -- Wrapper for GCC's glimits.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/global.c g77-0.5.23/f/global.c *** g77-0.5.22/f/global.c Tue Sep 9 06:11:36 1997 --- g77-0.5.23/f/global.c Tue Apr 28 13:23:02 1998 *************** *** 1,5 **** /* global.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* global.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffeglobal_ref_progunit_ (ffesymbol s, ff *** 1361,1364 **** --- 1361,1367 ---- g->t = ffelex_token_use (t); g->type = type; + #ifdef FFECOM_globalHOOK + g->hook = FFECOM_globalNULL; /* Discard previous _DECL. */ + #endif g->u.proc.n_args = -1; } diff -rcp2N g77-0.5.22/f/global.h g77-0.5.23/f/global.h *** g77-0.5.22/f/global.h Tue Sep 9 06:11:36 1997 --- g77-0.5.23/f/global.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* global.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* global.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/hconfig.j g77-0.5.23/f/hconfig.j *** g77-0.5.22/f/hconfig.j Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/hconfig.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* hconfig.j -- Wrapper for GCC's hconfig.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* hconfig.j -- Wrapper for GCC's hconfig.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/implic.c g77-0.5.23/f/implic.c *** g77-0.5.22/f/implic.c Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/implic.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* implic.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* implic.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/implic.h g77-0.5.23/f/implic.h *** g77-0.5.22/f/implic.h Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/implic.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* implic.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* implic.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/info-b.def g77-0.5.23/f/info-b.def *** g77-0.5.22/f/info-b.def Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/info-b.def Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* info-b.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* info-b.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/info-k.def g77-0.5.23/f/info-k.def *** g77-0.5.22/f/info-k.def Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/info-k.def Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* info-k.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* info-k.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/info-w.def g77-0.5.23/f/info-w.def *** g77-0.5.22/f/info-w.def Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/info-w.def Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* info-w.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* info-w.def -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/info.c g77-0.5.23/f/info.c *** g77-0.5.22/f/info.c Mon Mar 25 23:14:53 1996 --- g77-0.5.23/f/info.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* info.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* info.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/info.h g77-0.5.23/f/info.h *** g77-0.5.22/f/info.h Mon Feb 17 07:11:57 1997 --- g77-0.5.23/f/info.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* info.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* info.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/input.j g77-0.5.23/f/input.j *** g77-0.5.22/f/input.j Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/input.j Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* input.j -- Wrapper for GCC's input.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* input.j -- Wrapper for GCC's input.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/install.texi g77-0.5.23/f/install.texi *** g77-0.5.22/f/install.texi Sun Mar 15 11:39:41 1998 --- g77-0.5.23/f/install.texi Thu Jan 1 00:00:00 1970 *************** *** 1,2197 **** - @c Copyright (C) 1995-1997 Free Software Foundation, Inc. - @c This is part of the G77 manual. - @c For copying conditions, see the file g77.texi. - - @c The text of this file appears in the file INSTALL - @c in the G77 distribution, as well as in the G77 manual. - - @c 1998-03-15 - - @set version-g77 0.5.22 - @set version-gcc 2.7.2.3 - @set version-gcc-patched 2.7.2.3.f.2 - @set version-gzip 1.2.4 - @set version-tar 1.12 - @set version-patch 2.5 - @set version-make 3.76.1 - @set version-bison 1.25 - @set version-makeinfo 1.68 - @set version-texinfo 3.11 - @set version-sed 2.05 - - @ifclear INSTALLONLY - @node Installation - @chapter Installing GNU Fortran - @end ifclear - @cindex installing GNU Fortran - - The following information describes how to install @code{g77}. - - The information in this file generally pertains to dealing - with @emph{source} distributions of @code{g77} and @code{gcc}. - It is possible that some of this information will be applicable - to some @emph{binary} distributions of these products---however, - since these distributions are not made by the maintainers of - @code{g77}, responsibility for binary distributions rests with - whoever built and first distributed them. - - Nevertheless, efforts to make @code{g77} easier to both build - and install from source and package up as a binary distribution - are ongoing. - - @menu - * Prerequisites:: Make sure your system is ready for @code{g77}. - * Problems Installing:: Known trouble areas. - * Settings:: Changing @code{g77} internals before building. - * Quick Start:: The easier procedure for non-experts. - * Complete Installation:: For experts, or those who want to be: the details. - * Distributing Binaries:: If you plan on distributing your @code{g77}. - @end menu - - @node Prerequisites - @section Prerequisites - @cindex prerequisites - - The procedures described to unpack, configure, build, and - install @code{g77} assume your system has certain programs - already installed. - - The following prerequisites should be met by your - system before you follow the @code{g77} installation instructions: - - @table @asis - @item @code{gzip} - To unpack the @code{gcc} and @code{g77} distributions, - you'll need the @code{gunzip} utility in the @code{gzip} - distribution. - Most UNIX systems already have @code{gzip} installed. - If yours doesn't, you can get it from the FSF. - - Note that you'll need @code{tar} and other utilities - as well, but all UNIX systems have these. - There are GNU versions of all these available---in fact, - a complete GNU UNIX system can be put together on - most systems, if desired. - - The version of GNU @code{gzip} used to package this release - is @value{version-gzip}. - (The version of GNU @code{tar} used to package this release - is @value{version-tar}.) - - @item @file{gcc-@value{version-gcc}.tar.gz} - You need to have this, or some other applicable, version - of @code{gcc} on your system. - The version should be an exact copy of a distribution - from the FSF. - Its size is approximately 7.1MB. - - If you've already unpacked @file{gcc-@value{version-gcc}.tar.gz} into a - directory (named @file{gcc-@value{version-gcc}}) called the @dfn{source tree} - for @code{gcc}, you can delete the distribution - itself, but you'll need to remember to skip any instructions to unpack - this distribution. - - Without an applicable @code{gcc} source tree, you cannot - build @code{g77}. - You can obtain an FSF distribution of @code{gcc} from the FSF. - - @item @file{g77-@value{version-g77}.tar.gz} - You probably have already unpacked this package, - or you are reading an advance copy of these installation instructions, - which are contained in this distribution. - The size of this package is approximately 1.5MB. - - You can obtain an FSF distribution of @code{g77} from the FSF, - the same way you obtained @code{gcc}. - - @item Enough disk space - The amount of disk space needed to unpack, build, install, - and use @code{g77} depends on the type of system you're - using, how you build @code{g77}, and how much of it you - install (primarily, which languages you install). - - The sizes shown below assume all languages distributed - in @code{gcc-@value{version-gcc}}, plus @code{g77}, will be built - and installed. - These sizes are indicative of GNU/Linux systems on - Intel x86 running COFF and on Digital Alpha (AXP) systems - running ELF. - These should be fairly representative of 32-bit and 64-bit - systems, respectively. - - Note that all sizes are approximate and subject to change without - notice! - They are based on preliminary releases of g77 made shortly - before the public beta release. - - @itemize --- - @item - @code{gcc} and @code{g77} distributions occupy 8.6MB - packed, 35MB unpacked. - These consist of the source code and documentation, - plus some derived files (mostly documentation), for - @code{gcc} and @code{g77}. - Any deviations from these numbers for different - kinds of systems are likely to be very minor. - - @item - A ``bootstrap'' build requires an additional 67.3MB - for a total of 102MB on an ix86, and an additional - 98MB for a total of 165MB on an Alpha. - - @item - Removing @file{gcc/stage1} after the build recovers - 10.7MB for a total of 91MB on an ix86, and recovers - ??MB for a total of ??MB on an Alpha. - - After doing this, the integrity of the build can - still be verified via @samp{make compare}, and the - @code{gcc} compiler modified and used to build itself for - testing fairly quickly, using the copy of the compiler - kept in @code{gcc/stage2}. - - @item - Removing @file{gcc/stage2} after the build further - recovers 27.3MB for a total of 64.3MB, and recovers - ??MB for a total of ??MB on an Alpha. - - After doing this, the compiler can still be installed, - especially if GNU @code{make} is used to avoid - gratuitous rebuilds (or, the installation can be done - by hand). - - @item - Installing @code{gcc} and @code{g77} copies - 14.9MB onto the @samp{--prefix} disk for a total of 79.2MB - on an ix86, and copies ??MB onto the @samp{--prefix} - disk for a total of ??MB on an Alpha. - @end itemize - - After installation, if no further modifications and - builds of @code{gcc} or @code{g77} are planned, the - source and build directory may be removed, leaving - the total impact on a system's disk storage as - that of the amount copied during installation. - - Systems with the appropriate version of @code{gcc} - installed don't require the complete - bootstrap build. - Doing a ``straight build'' requires about as much - space as does a bootstrap build followed by removing - both the @file{gcc/stage1} and @file{gcc/stage2} - directories. - - Installing @code{gcc} and @code{g77} over existing - versions might require less @emph{new} disk space, - but note that, unlike many products, @code{gcc} - installs itself in a way that avoids overwriting other - installed versions of itself, so that other versions may - easily be invoked (via @samp{gcc -V @var{version}}). - - So, the amount of space saved as a result of having - an existing version of @code{gcc} and @code{g77} - already installed is not much---typically only the - command drivers (@code{gcc}, @code{g77}, @code{g++}, - and so on, which are small) and the documentation - is overwritten by the new installation. - The rest of the new installation is done without - replacing existing installed versions (assuming - they have different version numbers). - - @item @code{patch} - Although you can do everything @code{patch} does yourself, - by hand, without much trouble, having @code{patch} installed - makes installation of new versions of GNU utilities such as - @code{g77} so much easier that it is worth getting. - You can obtain @code{patch} the same way you obtained - @code{gcc} and @code{g77}. - - In any case, you can apply patches by hand---patch files - are designed for humans to read them. - - The version of GNU @code{patch} used to develop this release - is @value{version-patch}. - - @item @code{make} - Your system must have @code{make}, and you will probably save - yourself a lot of trouble if it is GNU @code{make} (sometimes - referred to as @code{gmake}). - - The version of GNU @code{make} used to develop this release - is @value{version-make}. - - @item @code{cc} - Your system must have a working C compiler. - - @xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, - for more information on prerequisites for installing @code{gcc}. - - @item @code{bison} - If you do not have @code{bison} installed, you can usually - work around any need for it, since @code{g77} itself does - not use it, and @code{gcc} normally includes all files - generated by running it in its distribution. - You can obtain @code{bison} the same way you obtained - @code{gcc} and @code{g77}. - - The version of GNU @code{bison} used to develop this release - is @value{version-bison}. - - @xref{Missing bison?}, - for information on how to work around not having @code{bison}. - - @item @code{makeinfo} - If you are missing @code{makeinfo}, you can usually work - around any need for it. - You can obtain @code{makeinfo} the same way you obtained - @code{gcc} and @code{g77}. - - The version of GNU @code{makeinfo} used to develop this release - is @value{version-makeinfo}, from - GNU @code{texinfo} version @value{version-texinfo}. - - @xref{Missing makeinfo?}, - for information on getting around the lack of @code{makeinfo}. - - @item @code{sed} - All UNIX systems have @code{sed}, but some have a broken - version that cannot handle configuring, building, or - installing @code{gcc} or @code{g77}. - - The version of GNU @code{sed} used to develop this release - is @value{version-sed}. - (Note that GNU @code{sed} version 3.0 was withdrawn by the - FSF---if you happen to have this version installed, replace - it with version @value{version-sed} immediately. - See a GNU distribution site for further explanation.) - - @item @code{root} access or equivalent - To perform the complete installation procedures on a system, - you need to have @code{root} access to that system, or - equivalent access to the @samp{--prefix} directory tree - specified on the @code{configure} command line. - - Portions of the procedure (such as configuring and building - @code{g77}) can be performed by any user with enough disk - space and virtual memory. - - However, these instructions are oriented towards less-experienced - users who want to install @code{g77} on their own personal - systems. - - System administrators with more experience will want to - determine for themselves how they want to modify the - procedures described below to suit the needs of their - installation. - @end table - - @node Problems Installing - @section Problems Installing - @cindex problems installing - @cindex installation problems - - This is a list of problems (and some apparent problems which don't - really mean anything is wrong) that show up when configuring, - building, installing, or porting GNU Fortran. - - @xref{Installation Problems,,,gcc,Using and Porting GNU CC}, - for more information on installation problems that can afflict - either @code{gcc} or @code{g77}. - - @menu - * General Problems:: Problems afflicting most or all systems. - * System-specific Problems:: Problems afflicting particular systems. - * Cross-compiler Problems:: Problems afflicting cross-compilation setups. - @end menu - - @node General Problems - @subsection General Problems - - These problems can occur on most or all systems. - - @menu - * GNU C Required:: Why even ANSI C is not enough. - * Patching GNU CC Necessary:: Why @code{gcc} must be patched first. - * Building GNU CC Necessary:: Why you can't build @emph{just} Fortran. - * Missing strtoul:: If linking @code{f771} fails due to an - unresolved reference to @code{strtoul}. - * Object File Differences:: It's okay that @samp{make compare} will - flag @file{f/zzz.o}. - * Cleanup Kills Stage Directories:: A minor nit for @code{g77} developers. - * Missing gperf?:: When building requires @code{gperf}. - @end menu - - @node GNU C Required - @subsubsection GNU C Required - @cindex GNU C required - @cindex requirements, GNU C - - Compiling @code{g77} requires GNU C, not just ANSI C. - Fixing this wouldn't - be very hard (just tedious), but the code using GNU extensions to - the C language is expected to be rewritten for 0.6 anyway, - so there are no plans for an interim fix. - - This requirement does not mean you must already have @code{gcc} - installed to build @code{g77}. - As long as you have a working C compiler, you can use a - bootstrap build to automate the process of first building - @code{gcc} using the working C compiler you have, then building - @code{g77} and rebuilding @code{gcc} using that just-built @code{gcc}, - and so on. - - @node Patching GNU CC Necessary - @subsubsection Patching GNU CC Necessary - @cindex patch files - @cindex GBE - - @code{g77} currently requires application of a patch file to the gcc compiler - tree. - The necessary patches should be folded in to the mainline gcc distribution. - - Some combinations - of versions of @code{g77} and @code{gcc} might actually @emph{require} no - patches, but the patch files will be provided anyway as long as - there are more changes expected in subsequent releases. - These patch files might contain - unnecessary, but possibly helpful, patches. - As a result, it is possible this issue might never be - resolved, except by eliminating the need for the person - configuring @code{g77} to apply a patch by hand, by going - to a more automated approach (such as configure-time patching). - - @node Building GNU CC Necessary - @subsubsection Building GNU CC Necessary - @cindex gcc, building - @cindex building gcc - - It should be possible to build the runtime without building @code{cc1} - and other non-Fortran items, but, for now, an easy way to do that - is not yet established. - - @node Missing strtoul - @subsubsection Missing strtoul - @cindex strtoul - @cindex _strtoul - @cindex undefined reference (_strtoul) - @cindex f771, linking error for - @cindex linking error for f771 - @cindex ld error for f771 - @cindex ld can't find _strtoul - @cindex SunOS4 - - On SunOS4 systems, linking the @code{f771} program produces - an error message concerning an undefined symbol named - @samp{_strtoul}. - - This is not a @code{g77} bug. - @xref{Patching GNU Fortran}, for information on - a workaround provided by @code{g77}. - - The proper fix is either to upgrade your system to one that - provides a complete ANSI C environment, or improve @code{gcc} so - that it provides one for all the languages and configurations it supports. - - @emph{Note:} In earlier versions of @code{g77}, an automated - workaround for this problem was attempted. - It worked for systems without @samp{_strtoul}, substituting - the incomplete-yet-sufficient version supplied with @code{g77} - for those systems. - However, the automated workaround failed mysteriously for systems - that appeared to have conforming ANSI C environments, and it - was decided that, lacking resources to more fully investigate - the problem, it was better to not punish users of those systems - either by requiring them to work around the problem by hand or - by always substituting an incomplete @code{strtoul()} implementation - when their systems had a complete, working one. - Unfortunately, this meant inconveniencing users of systems not - having @code{strtoul()}, but they're using obsolete (and generally - unsupported) systems anyway. - - @node Object File Differences - @subsubsection Object File Differences - @cindex zzz.o - @cindex zzz.c - @cindex object file, differences - @cindex differences between object files - @cindex make compare - - A comparison of object files after building Stage 3 during a - bootstrap build will result in @file{gcc/f/zzz.o} being flagged - as different from the Stage 2 version. - That is because it - contains a string with an expansion of the @code{__TIME__} macro, - which expands to the current time of day. - It is nothing to worry about, since - @file{gcc/f/zzz.c} doesn't contain any actual code. - It does allow you to override its use of @code{__DATE__} and - @code{__TIME__} by defining macros for the compilation---see the - source code for details. - - @node Cleanup Kills Stage Directories - @subsubsection Cleanup Kills Stage Directories - @cindex stage directories - @cindex make clean - - It'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in} - would create the various @file{stage@var{n}} directories and their - subdirectories, so developers and expert installers wouldn't have to - reconfigure after cleaning up. - - @node Missing gperf? - @subsubsection Missing @code{gperf}? - @cindex @code{gperf} - @cindex missing @code{gperf} - - If a build aborts trying to invoke @code{gperf}, that - strongly suggests an improper method was used to - create the @code{gcc} source directory, - such as the UNIX @samp{cp -r} command instead - of @samp{cp -pr}, since this problem very likely - indicates that the date-time-modified information on - the @code{gcc} source files is incorrect. - - The proper solution is to recreate the @code{gcc} source - directory from a @code{gcc} distribution known to be - provided by the FSF. - - It is possible you might be able to temporarily - work around the problem, however, by trying these - commands: - - @example - sh# @kbd{cd gcc} - sh# @kbd{touch c-gperf.h} - sh# - @end example - - These commands update the date-time-modified information for - the file produced by the invocation of @code{gperf} - in the current versions of @code{gcc}, so that @code{make} no - longer believes it needs to update it. - This file should already exist in a @code{gcc} - distribution, but mistakes made when copying the @code{gcc} - directory can leave the modification information - set such that the @code{gperf} input files look more ``recent'' - than the corresponding output files. - - If the above does not work, definitely start from scratch - and avoid copying the @code{gcc} using any method that does - not reliably preserve date-time-modified information, such - as the UNIX @samp{cp -r} command (use @samp{cp -pr} instead). - - @node System-specific Problems - @subsection System-specific Problems - - @cindex Digital Alpha - @cindex Alpha, Digital - @cindex DEC Alpha - @cindex AXP - If your system is based on a Digital Alpha (AXP) architecture - and employs a 64-bit operating system (such as GNU/Linux), - you might consider using @code{egcs} instead of versions - of @code{g77} based on versions of @code{gcc} prior to 2.8. - @uref{http://www.cygnus.com/egcs} for information on @code{egcs}, - or obtain a copy from @uref{ftp://egcs.cygnus.com/pub/egcs}. - - @cindex Irix 6 - @cindex SGI - If your system is Irix 6, to obtain a working version of @code{gcc}, - @uref{http://reality.sgi.com/knobi/gcc-2.7.2.x-on-irix-6.2-6.3}. - - @node Cross-compiler Problems - @subsection Cross-compiler Problems - @cindex cross-compiler, problems - - @code{g77} has been in alpha testing since September of - 1992, and in public beta testing since February of 1995. - Alpha testing was done by a small number of people worldwide on a fairly - wide variety of machines, involving self-compilation in most or - all cases. - Beta testing has been done primarily via self-compilation, - but in more and more cases, cross-compilation (and ``criss-cross - compilation'', where a version of a compiler is built on one machine - to run on a second and generate code that runs on a third) has - been tried and has succeeded, to varying extents. - - Generally, @code{g77} can be ported to any configuration to which - @code{gcc}, @code{f2c}, and @code{libf2c} can be ported and made - to work together, aside from the known problems described in this - manual. - If you want to port @code{g77} to a particular configuration, - you should first make sure @code{gcc} and @code{libf2c} can be - ported to that configuration before focusing on @code{g77}, because - @code{g77} is so dependent on them. - - Even for cases where @code{gcc} and @code{libf2c} work, - you might run into problems with cross-compilation on certain machines, - for several reasons. - - @itemize @bullet - @item - There is one known bug - (a design bug to be fixed in 0.6) that prevents configuration of - @code{g77} as a cross-compiler in some cases, - though there are assumptions made during - configuration that probably make doing non-self-hosting builds - a hassle, requiring manual intervention. - - @item - @code{gcc} might still have some trouble being configured - for certain combinations of machines. - For example, it might not know how to handle floating-point - constants. - - @item - Improvements to the way @code{libf2c} is built could make - building @code{g77} as a cross-compiler easier---for example, - passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriate - ways. - - @item - There are still some challenges putting together the right - run-time libraries (needed by @code{libf2c}) for a target - system, depending on the systems involved in the configuration. - (This is a general problem with cross-compilation, and with - @code{gcc} in particular.) - @end itemize - - @node Settings - @section Changing Settings Before Building - - Here are some internal @code{g77} settings that can be changed - by editing source files in @file{gcc/f/} before building. - - This information, and perhaps even these settings, represent - stop-gap solutions to problems people doing various ports - of @code{g77} have encountered. - As such, none of the following information is expected to - be pertinent in future versions of @code{g77}. - - @menu - * Larger File Unit Numbers:: Raising @samp{MXUNIT}. - * Always Flush Output:: Synchronizing write errors. - * Maximum Stackable Size:: Large arrays forced off the stack. - * Floating-point Bit Patterns:: Possible programs building @code{g77} - as a cross-compiler. - * Large Initialization:: Large arrays with @code{DATA} - initialization. - * Alpha Problems Fixed:: Problems with 64-bit systems like - Alphas now fixed? - @end menu - - @node Larger File Unit Numbers - @subsection Larger File Unit Numbers - @cindex MXUNIT - @cindex unit numbers - @cindex maximum unit number - @cindex illegal unit number - @cindex increasing maximum unit number - - As distributed, whether as part of @code{f2c} or @code{g77}, - @code{libf2c} accepts file unit numbers only in the range - 0 through 99. - For example, a statement such as @samp{WRITE (UNIT=100)} causes - a run-time crash in @code{libf2c}, because the unit number, - 100, is out of range. - - If you know that Fortran programs at your installation require - the use of unit numbers higher than 99, you can change the - value of the @samp{MXUNIT} macro, which represents the maximum unit - number, to an appropriately higher value. - - To do this, edit the file @file{f/runtime/libI77/fio.h} in your - @code{g77} source tree, changing the following line: - - @example - #define MXUNIT 100 - @end example - - Change the line so that the value of @samp{MXUNIT} is defined to be - at least one @emph{greater} than the maximum unit number used by - the Fortran programs on your system. - - (For example, a program that does @samp{WRITE (UNIT=255)} would require - @samp{MXUNIT} set to at least 256 to avoid crashing.) - - Then build or rebuild @code{g77} as appropriate. - - @emph{Note:} Changing this macro has @emph{no} effect on other limits - your system might place on the number of files open at the same time. - That is, the macro might allow a program to do @samp{WRITE (UNIT=100)}, - but the library and operating system underlying @code{libf2c} might - disallow it if many other files have already been opened (via @code{OPEN} or - implicitly via @code{READ}, @code{WRITE}, and so on). - Information on how to increase these other limits should be found - in your system's documentation. - - @node Always Flush Output - @subsection Always Flush Output - @cindex ALWAYS_FLUSH - @cindex synchronous write errors - @cindex disk full - @cindex flushing output - @cindex fflush() - @cindex I/O, flushing - @cindex output, flushing - @cindex writes, flushing - @cindex NFS - @cindex network file system - - Some Fortran programs require output - (writes) to be flushed to the operating system (under UNIX, - via the @code{fflush()} library call) so that errors, - such as disk full, are immediately flagged via the relevant - @code{ERR=} and @code{IOSTAT=} mechanism, instead of such - errors being flagged later as subsequent writes occur, forcing - the previously written data to disk, or when the file is - closed. - - Essentially, the difference can be viewed as synchronous error - reporting (immediate flagging of errors during writes) versus - asynchronous, or, more precisely, buffered error reporting - (detection of errors might be delayed). - - @code{libf2c} supports flagging write errors immediately when - it is built with the @samp{ALWAYS_FLUSH} macro defined. - This results in a @code{libf2c} that runs slower, sometimes - quite a bit slower, under certain circumstances---for example, - accessing files via the networked file system NFS---but the - effect can be more reliable, robust file I/O. - - If you know that Fortran programs requiring this level of precision - of error reporting are to be compiled using the - version of @code{g77} you are building, you might wish to - modify the @code{g77} source tree so that the version of - @code{libf2c} is built with the @samp{ALWAYS_FLUSH} macro - defined, enabling this behavior. - - To do this, find this line in @file{f/runtime/configure.in} in - your @code{g77} source tree: - - @example - dnl AC_DEFINE(ALWAYS_FLUSH) - @end example - - Remove the leading @samp{dnl@w{ }}, so the line begins with - @samp{AC_DEFINE(}, and run @code{autoconf} in that file's directory. - (Or, if you don't have @code{autoconf}, you can modify @file{f2c.h.in} - in the same directory to include the line @samp{#define ALWAYS_FLUSH} - after @samp{#define F2C_INCLUDE}.) - - Then build or rebuild @code{g77} as appropriate. - - @node Maximum Stackable Size - @subsection Maximum Stackable Size - @vindex FFECOM_sizeMAXSTACKITEM - @cindex code, stack variables - @cindex maximum stackable size - @cindex stack allocation - @cindex segmentation violation - @code{g77}, on most machines, puts many variables and arrays on the stack - where possible, and can be configured (by changing - @samp{FFECOM_sizeMAXSTACKITEM} in @file{gcc/f/com.c}) to force - smaller-sized entities into static storage (saving - on stack space) or permit larger-sized entities to be put on the - stack (which can improve run-time performance, as it presents - more opportunities for the GBE to optimize the generated code). - - @emph{Note:} Putting more variables and arrays on the stack - might cause problems due to system-dependent limits on stack size. - Also, the value of @samp{FFECOM_sizeMAXSTACKITEM} has no - effect on automatic variables and arrays. - @xref{But-bugs}, for more information. - - @node Floating-point Bit Patterns - @subsection Floating-point Bit Patterns - - @cindex cross-compiler, building - @cindex floating-point bit patterns - @cindex bit patterns - The @code{g77} build will crash if an attempt is made to build - it as a cross-compiler - for a target when @code{g77} cannot reliably determine the bit pattern of - floating-point constants for the target. - Planned improvements for version 0.6 of @code{g77} - will give it the capabilities it needs to not have to crash the build - but rather generate correct code for the target. - (Currently, @code{g77} - would generate bad code under such circumstances if it didn't crash - during the build, e.g. when compiling a source file that does - something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.) - - @node Large Initialization - @subsection Initialization of Large Aggregate Areas - - @cindex speed, compiler - @cindex slow compiler - @cindex memory utilization - @cindex large initialization - @cindex aggregate initialization - A warning message is issued when @code{g77} sees code that provides - initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON} - or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER} - variable) - that is large enough to increase @code{g77}'s compile time by roughly - a factor of 10. - - This size currently is quite small, since @code{g77} - currently has a known bug requiring too much memory - and time to handle such cases. - In @file{gcc/f/data.c}, the macro - @samp{FFEDATA_sizeTOO_BIG_INIT_} is defined - to the minimum size for the warning to appear. - The size is specified in storage units, - which can be bytes, words, or whatever, on a case-by-case basis. - - After changing this macro definition, you must - (of course) rebuild and reinstall @code{g77} for - the change to take effect. - - Note that, as of version 0.5.18, improvements have - reduced the scope of the problem for @emph{sparse} - initialization of large arrays, especially those - with large, contiguous uninitialized areas. - However, the warning is issued at a point prior to - when @code{g77} knows whether the initialization is sparse, - and delaying the warning could mean it is produced - too late to be helpful. - - Therefore, the macro definition should not be adjusted to - reflect sparse cases. - Instead, adjust it to generate the warning when densely - initialized arrays begin to cause responses noticeably slower - than linear performance would suggest. - - @node Alpha Problems Fixed - @subsection Alpha Problems Fixed - - @cindex Alpha, support - @cindex 64-bit systems - @code{g77} used to warn when it was used to compile Fortran code - for a target configuration that is not basically a 32-bit - machine (such as an Alpha, which is a 64-bit machine, especially - if it has a 64-bit operating system running on it). - That was because @code{g77} was known to not work - properly on such configurations. - - As of version 0.5.20, @code{g77} is believed to work well - enough on such systems. - So, the warning is no longer needed or provided. - - However, support for 64-bit systems, especially in - areas such as cross-compilation and handling of - intrinsics, is still incomplete. - The symptoms - are believed to be compile-time diagnostics rather - than the generation of bad code. - It is hoped that version 0.6 will completely support 64-bit - systems. - - @node Quick Start - @section Quick Start - @cindex quick start - - This procedure configures, builds, and installs @code{g77} - ``out of the box'' and works on most UNIX systems. - Each command is identified by a unique number, - used in the explanatory text that follows. - For the most part, the output of each command is not shown, - though indications of the types of responses are given in a - few cases. - - To perform this procedure, the installer must be logged - in as user @code{root}. - Much of it can be done while not logged in as @code{root}, - and users experienced with UNIX administration should be - able to modify the procedure properly to do so. - - Following traditional UNIX conventions, it is assumed that - the source trees for @code{g77} and @code{gcc} will be - placed in @file{/usr/src}. - It also is assumed that the source distributions themselves - already reside in @file{/usr/FSF}, a naming convention - used by the author of @code{g77} on his own system: - - @example - /usr/FSF/gcc-@value{version-gcc}.tar.gz - /usr/FSF/g77-@value{version-g77}.tar.gz - @end example - - @c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or - @c the equivalent of it obtained by applying the - @c patch distributed as @file{gcc-2.7.2-2.7.2.1.diff.gz} - @c to version 2.7.2 of @code{gcc}, - @c if you remember to make the appropriate adjustments in the - @c instructions below.) - - @cindex SunOS4 - Users of the following systems should not blindly follow - these quick-start instructions, because of problems their - systems have coping with straightforward installation of - @code{g77}: - - @itemize @bullet - @item - SunOS4 - @end itemize - - Instead, see @ref{Complete Installation}, for detailed information - on how to configure, build, and install @code{g77} for your - particular system. - Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran}, - for information on bugs and other problems known to afflict the - installation process, and how to report newly discovered ones. - - If your system is @emph{not} on the above list, and @emph{is} - a UNIX system or one of its variants, you should be able to - follow the instructions below. - If you vary @emph{any} of the steps below, you might run into - trouble, including possibly breaking existing programs for - other users of your system. - Before doing so, it is wise to review the explanations of some - of the steps. - These explanations follow this list of steps. - - @example - sh[ 1]# @kbd{cd /usr/src} - @set source-dir 1 - sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -} - [Might say "Broken pipe"...that is normal on some systems.] - @set unpack-gcc 2 - sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} - ["Broken pipe" again possible.] - @set unpack-g77 3 - sh[ 4]# @kbd{ln -s gcc-@value{version-gcc} gcc} - @set link-gcc 4 - sh[ 5]# @kbd{ln -s g77-@value{version-g77} g77} - @set link-g77 5 - sh[ 6]# @kbd{mv -i g77/* gcc} - [No questions should be asked by mv here; or, you made a mistake.] - @set merge-g77 6 - sh[ 7]# @kbd{patch -p1 -E -V t -d gcc < gcc/f/gbe/@value{version-gcc}.diff} - [Unless patch complains about rejected patches, this step worked.] - @set apply-patch 7 - sh[ 8]# @kbd{cd gcc} - sh[ 9]# @kbd{touch f77-install-ok} - [Do not do the above if your system already has an f77 - command, unless you've checked that overwriting it - is okay.] - @set f77-install-ok 9 - sh[10]# @kbd{touch f2c-install-ok} - [Do not do the above if your system already has an f2c - command, unless you've checked that overwriting it - is okay. Else, @kbd{touch f2c-exists-ok}.] - @set f2c-install-ok 10 - sh[11]# @kbd{./configure --prefix=/usr} - [Do not do the above if gcc is not installed in /usr/bin. - You might need a different @kbd{--prefix=@dots{}}, as - described below.] - @set configure-gcc 11 - sh[12]# @kbd{make bootstrap} - [This takes a long time, and is where most problems occur.] - @set build-gcc 12 - sh[13]# @kbd{make compare} - [This verifies that the compiler is `sane'. Only - the file `f/zzz.o' (aka `tmp-foo1' and `tmp-foo2') - should be in the list of object files this command - prints as having different contents. If other files - are printed, you have likely found a g77 bug.] - @set compare-gcc 13 - sh[14]# @kbd{rm -fr stage1} - @set rm-stage1 14 - sh[15]# @kbd{make -k install} - [The actual installation.] - @set install-g77 15 - sh[16]# @kbd{g77 -v} - [Verify that g77 is installed, obtain version info.] - @set show-version 16 - sh[17]# - @set end-procedure 17 - @end example - - @xref{Updating Documentation,,Updating Your Info Directory}, for - information on how to update your system's top-level @code{info} - directory to contain a reference to this manual, so that - users of @code{g77} can easily find documentation instead - of having to ask you for it. - - Elaborations of many of the above steps follows: - - @table @asis - @item Step @value{source-dir}: @kbd{cd /usr/src} - You can build @code{g77} pretty much anyplace. - By convention, this manual assumes @file{/usr/src}. - It might be helpful if other users on your system - knew where to look for the source code for the - installed version of @code{g77} and @code{gcc} in any case. - - @c @item Step @value{unpack-gcc}: @kbd{gunzip -d @dots{}} - @c Here, you might wish to use @file{gcc-2.7.2.1.tar.gz} - @c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve - @c similar results. - - @item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} - It is not always necessary to obtain the latest version of - @code{g77} as a complete @file{.tar.gz} file if you have - a complete, earlier distribution of @code{g77}. - If appropriate, you can unpack that earlier - version of @code{g77}, and then apply the appropriate patches - to achieve the same result---a source tree containing version - @value{version-g77} of @code{g77}. - - @item Step @value{link-gcc}: @kbd{ln -s gcc-@value{version-gcc} gcc} - @item Step @value{link-g77}: @kbd{ln -s g77-@value{version-g77} g77} - These commands mainly help reduce typing, - and help reduce visual clutter in examples - in this manual showing what to type to install @code{g77}. - - @c Of course, if appropriate, @kbd{ln -s gcc-2.7.2.1 gcc} or - @c similar. - - @xref{Unpacking}, for information on - using distributions of @code{g77} made by organizations - other than the FSF. - - @item Step @value{merge-g77}: @kbd{mv -i g77/* gcc} - After doing this, you can, if you like, type - @samp{rm g77} and @samp{rmdir g77-@value{version-g77}} to remove - the empty directory and the symbol link to it. - But, it might be helpful to leave them around as - quick reminders of which version(s) of @code{g77} are - installed on your system. - - @xref{Unpacking}, for information - on the contents of the @file{g77} directory (as merged - into the @file{gcc} directory). - - @item Step @value{apply-patch}: @kbd{patch -p1 @dots{}} - @c (Or `@kbd{@dots{} < gcc/f/gbe/2.7.2.1.diff}', if appropriate.) - @c - If you are using - GNU @code{patch} version @value{version-patch} or later, - this should produce a list of files patched. - (Other versions of @code{patch} might not work - properly.) - - If messages about ``fuzz'', ``offset'', or - especially ``reject files'' are printed, it might - mean you applied the wrong patch file. - If you believe this is the case, it is best to restart - the sequence after deleting (or at least renaming to unused - names) the top-level directories for @code{g77} and @code{gcc} - and their symbolic links. - - After this command finishes, the @code{gcc} directory might - have old versions of several files as saved by @code{patch}. - To remove these, after @kbd{cd gcc}, type @kbd{rm -i *.~*~}. - - @xref{Merging Distributions}, for more information. - - @emph{Note:} @code{gcc} versions circa 2.7.2.2 and 2.7.2.3 - are known to have slightly differing versions of the - @code{gcc/ChangeLog} file, - depending on how they are obtained. - You can safely ignore diagnostics @code{patch} reports - when patching this particular file, - since it is purely a documentation file for implementors. - See @file{gcc/f/gbe/2.7.2.3.diff} for more information. - - @item Step @value{f77-install-ok}: @kbd{touch f77-install-ok} - Don't do this if you don't want to overwrite an existing - version of @code{f77} (such as a native compiler, or a - script that invokes @code{f2c}). - Otherwise, installation will overwrite the @code{f77} command - and the @code{f77} man pages with copies of the corresponding - @code{g77} material. - - @xref{Installing f77,,Installing @code{f77}}, for more - information. - - @item Step @value{f2c-install-ok}: @kbd{touch f2c-install-ok} - Don't do this if you don't want to overwrite an existing - installation of @code{libf2c} (though, chances are, you do). - Instead, @kbd{touch f2c-exists-ok} to allow the installation - to continue without any error messages about @file{/usr/lib/libf2c.a} - already existing. - - @xref{Installing f2c,,Installing @code{f2c}}, for more - information. - - @item Step @value{configure-gcc}: @kbd{./configure --prefix=/usr} - This is where you specify that the @file{g77} executable is to be - installed in @file{/usr/bin/}, the @file{libf2c.a} library is - to be installed in @file{/usr/lib/}, and so on. - - You should ensure that any existing installation of the @file{gcc} - executable is in @file{/usr/bin/}. - Otherwise, installing @code{g77} so that it does not fully - replace the existing installation of @code{gcc} is likely - to result in the inability to compile Fortran programs. - - @xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?}, - for more information on determining where to install @code{g77}. - @xref{Configuring gcc}, for more information on the - configuration process triggered by invoking the @file{./configure} - script. - - @item Step @value{build-gcc}: @kbd{make bootstrap} - @xref{Installation,,Installing GNU CC, - gcc,Using and Porting GNU CC}, for information - on the kinds of diagnostics you should expect during - this procedure. - - @xref{Building gcc}, for complete @code{g77}-specific - information on this step. - - @item Step @value{compare-gcc}: @kbd{make compare} - @xref{Bug Lists,,Where to Port Bugs}, for information - on where to report that you observed more than - @file{f/zzz.o} having different contents during this - phase. - - @xref{Bug Reporting,,How to Report Bugs}, for - information on @emph{how} to report bugs like this. - - @item Step @value{rm-stage1}: @kbd{rm -fr stage1} - You don't need to do this, but it frees up disk space. - - @item Step @value{install-g77}: @kbd{make -k install} - If this doesn't seem to work, try: - - @example - make -k install install-libf77 install-f2c-all - @end example - - @xref{Installation of Binaries}, for more information. - - @xref{Updating Documentation,,Updating Your Info Directory}, - for information on entering this manual into your - system's list of texinfo manuals. - - @item Step @value{show-version}: @kbd{g77 -v} - If this command prints approximately 25 lines of output, - including the GNU Fortran Front End version number (which - should be the same as the version number for the version - of @code{g77} you just built and installed) and the - version numbers for the three parts of the @code{libf2c} - library (@code{libF77}, @code{libI77}, @code{libU77}), and - those version numbers are all in agreement, then there is - a high likelihood that the installation has been successfully - completed. - - You might consider doing further testing. - For example, log in as a non-privileged user, then create - a small Fortran program, such as: - - @example - PROGRAM SMTEST - DO 10 I=1, 10 - PRINT *, 'Hello World #', I - 10 CONTINUE - END - @end example - - Compile, link, and run the above program, and, assuming you named - the source file @file{smtest.f}, the session should look like this: - - @example - sh# @kbd{g77 -o smtest smtest.f} - sh# @kbd{./smtest} - Hello World # 1 - Hello World # 2 - Hello World # 3 - Hello World # 4 - Hello World # 5 - Hello World # 6 - Hello World # 7 - Hello World # 8 - Hello World # 9 - Hello World # 10 - sh# - @end example - - After proper installation, you don't - need to keep your gcc and g77 source and build directories - around anymore. - Removing them can free up a lot of disk space. - @end table - - @node Complete Installation - @section Complete Installation - - Here is the complete @code{g77}-specific information on how - to configure, build, and install @code{g77}. - - @menu - * Unpacking:: - * Merging Distributions:: - * f77: Installing f77. - * f2c: Installing f2c. - * Patching GNU Fortran:: - * Where to Install:: - * Configuring gcc:: - * Building gcc:: - * Pre-installation Checks:: - * Installation of Binaries:: - * Updating Documentation:: - * bison: Missing bison?. - * makeinfo: Missing makeinfo?. - @end menu - - @node Unpacking - @subsection Unpacking - @cindex unpacking distributions - @cindex distributions, unpacking - @cindex code, source - @cindex source code - @cindex source tree - @cindex packages - - The @code{gcc} source distribution is a stand-alone distribution. - It is designed to be unpacked (producing the @code{gcc} - source tree) and built as is, assuming certain - prerequisites are met (including the availability of compatible - UNIX programs such as @code{make}, @code{cc}, and so on). - - However, before building @code{gcc}, you will want to unpack - and merge the @code{g77} distribution in with it, so that you - build a Fortran-capable version of @code{gcc}, which includes - the @code{g77} command, the necessary run-time libraries, - and this manual. - - Unlike @code{gcc}, the @code{g77} source distribution - is @emph{not} a stand-alone distribution. - It is designed to be unpacked and, afterwards, immediately merged - into an applicable @code{gcc} source tree. - That is, the @code{g77} distribution @emph{augments} a - @code{gcc} distribution---without @code{gcc}, generally - only the documentation is immediately usable. - - A sequence of commands typically used to unpack @code{gcc} - and @code{g77} is: - - @example - sh# @kbd{cd /usr/src} - sh# @kbd{gunzip -c /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -} - sh# @kbd{gunzip -c /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -} - sh# @kbd{ln -s gcc-@value{version-gcc} gcc} - sh# @kbd{ln -s g77-@value{version-g77} g77} - sh# @kbd{mv -i g77/* gcc} - @end example - - @emph{Notes:} The commands beginning with @samp{gunzip@dots{}} might - print @samp{Broken pipe@dots{}} as they complete. - That is nothing to worry about, unless you actually - @emph{hear} a pipe breaking. - The @code{ln} commands are helpful in reducing typing - and clutter in installation examples in this manual. - Hereafter, the top level of @code{gcc} source tree is referred to - as @file{gcc}, and the top level of just the @code{g77} - source tree (prior to issuing the @code{mv} command, above) - is referred to as @file{g77}. - - There are three top-level names in a @code{g77} distribution: - - @example - g77/COPYING.g77 - g77/README.g77 - g77/f - @end example - - All three entries should be moved (or copied) into a @code{gcc} - source tree (typically named after its version number and - as it appears in the FSF distributions---e.g. @file{gcc-@value{version-gcc}}). - - @file{g77/f} is the subdirectory containing all of the - code, documentation, and other information that is specific - to @code{g77}. - The other two files exist to provide information on @code{g77} - to someone encountering a @code{gcc} source tree with @code{g77} - already present, who has not yet read these installation - instructions and thus needs help understanding that the - source tree they are looking at does not come from a single - FSF distribution. - They also help people encountering an unmerged @code{g77} source - tree for the first time. - - @cindex modifying @code{g77} - @cindex code, modifying - @cindex Pentium optimizations - @cindex optimizations, Pentium - @emph{Note:} Please use @strong{only} @code{gcc} and @code{g77} - source trees as distributed by the FSF. - Use of modified versions, such as the Pentium-specific-optimization - port of @code{gcc}, is likely to result in problems that appear to be - in the @code{g77} code but, in fact, are not. - Do not use such modified versions - unless you understand all the differences between them and the versions - the FSF distributes---in which case you should be able to modify the - @code{g77} (or @code{gcc}) source trees appropriately so @code{g77} - and @code{gcc} can coexist as they do in the stock FSF distributions. - - @node Merging Distributions - @subsection Merging Distributions - @cindex merging distributions - @cindex @code{gcc} versions supported by @code{g77} - @cindex versions of @code{gcc} - @cindex support for @code{gcc} versions - - After merging the @code{g77} source tree into the @code{gcc} - source tree, the final merge step is done by applying the - pertinent patches the @code{g77} distribution provides for - the @code{gcc} source tree. - - Read the file @file{gcc/f/gbe/README}, and apply the appropriate - patch file for the version of the GNU CC compiler you have, if - that exists. - If the directory exists but the appropriate file - does not exist, you are using either an old, unsupported version, - or a release one that is newer than the newest @code{gcc} version - supported by the version of @code{g77} you have. - - @cindex gcc version numbering - @cindex version numbering - @cindex g77 version number - @cindex GNU version numbering - As of version 0.5.18, @code{g77} modifies the version number - of @code{gcc} via the pertinent patches. - This is done because the resulting version of @code{gcc} is - deemed sufficiently different from the vanilla distribution - to make it worthwhile to present, to the user, information - signaling the fact that there are some differences. - - GNU version numbers make it easy to figure out whether a - particular version of a distribution is newer or older than - some other version of that distribution. - The format is, - generally, @var{major}.@var{minor}.@var{patch}, with - each field being a decimal number. - (You can safely ignore - leading zeros; for example, 1.5.3 is the same as 1.5.03.)@ - The @var{major} field only increases with time. - The other two fields are reset to 0 when the field to - their left is incremented; otherwise, they, too, only - increase with time. - So, version 2.6.2 is newer than version 2.5.8, and - version 3.0 is newer than both. - (Trailing @samp{.0} fields often are omitted in - announcements and in names for distributions and - the directories they create.) - - If your version of @code{gcc} is older than the oldest version - supported by @code{g77} (as casually determined by listing - the contents of @file{gcc/f/gbe/}), you should obtain a newer, - supported version of @code{gcc}. - (You could instead obtain an older version of @code{g77}, - or try and get your @code{g77} to work with the old - @code{gcc}, but neither approach is recommended, and - you shouldn't bother reporting any bugs you find if you - take either approach, because they're probably already - fixed in the newer versions you're not using.) - - If your version of @code{gcc} is newer than the newest version - supported by @code{g77}, it is possible that your @code{g77} - will work with it anyway. - If the version number for @code{gcc} differs only in the - @var{patch} field, you might as well try applying the @code{g77} patch - that is for the newest version of @code{gcc} having the same - @var{major} and @var{minor} fields, as this is likely to work. - - So, for example, if a particular version of @code{g77} has support for - @code{gcc} versions 2.7.0 and 2.7.1, - it is likely that @file{gcc-2.7.2} would work well with @code{g77} - by using the @file{2.7.1.diff} patch file provided - with @code{g77} (aside from some offsets reported by @code{patch}, - which usually are harmless). - - However, @file{gcc-2.8.0} would almost certainly - not work with that version of @code{g77} no matter which patch file was - used, so a new version of @code{g77} would be needed (and you should - wait for it rather than bothering the maintainers---@pxref{Changes,, - User-Visible Changes}). - - @cindex distributions, why separate - @cindex separate distributions - @cindex why separate distributions - This complexity is the result of @code{gcc} and @code{g77} being - separate distributions. - By keeping them separate, each product is able to be independently - improved and distributed to its user base more frequently. - - However, @code{g77} often requires changes to contemporary - versions of @code{gcc}. - Also, the GBE interface defined by @code{gcc} typically - undergoes some incompatible changes at least every time the - @var{minor} field of the version number is incremented, - and such changes require corresponding changes to - the @code{g77} front end (FFE). - - It is hoped that the GBE interface, and the @code{gcc} and - @code{g77} products in general, will stabilize sufficiently - for the need for hand-patching to disappear. - - If you are using - GNU @code{patch} version @value{version-patch} or later, - this should produce a list of files patched. - (Other versions of @code{patch} might not work - properly.) - - If messages about ``fuzz'', ``offset'', or - especially ``reject files'' are printed, it might - mean you applied the wrong patch file. - If you believe this is the case, it is best to restart - the sequence after deleting (or at least renaming to unused - names) the top-level directories for @code{g77} and @code{gcc} - and their symbolic links. - That is because @code{patch} might have partially patched - some @code{gcc} source files, so reapplying the correct - patch file might result in the correct patches being - applied incorrectly (due to the way @code{patch} necessarily - works). - - After @code{patch} finishes, the @code{gcc} directory might - have old versions of several files as saved by @code{patch}. - To remove these, after @kbd{cd gcc}, type @kbd{rm -i *.~*~}. - - @emph{Note:} @code{gcc} versions circa 2.7.2.2 and 2.7.2.3 - are known to have slightly differing versions of the - @code{gcc/ChangeLog} file, - depending on how they are obtained. - You can safely ignore diagnostics @code{patch} reports - when patching this particular file, - since it is purely a documentation file for implementors. - See @file{gcc/f/gbe/2.7.2.3.diff} for more information. - - @pindex config-lang.in - @emph{Note:} @code{g77}'s configuration file @file{gcc/f/config-lang.in} - ensures that the source code for the version of @code{gcc} - being configured has at least one indication of being patched - as required specifically by @code{g77}. - This configuration-time - checking should catch failure to apply the correct patch and, - if so caught, should abort the configuration with an explanation. - @emph{Please} do not try to disable the check, - otherwise @code{g77} might well appear to build - and install correctly, and even appear to compile correctly, - but could easily produce broken code. - - @cindex creating patch files - @cindex patch files, creating - @pindex gcc/f/gbe/ - @samp{LC_ALL=C TZ=UTC0 diff -rcp2N} is used to create the patch files - in @file{gcc/f/gbe/}. - - @node Installing f77 - @subsection Installing @code{f77} - @cindex f77 command - @cindex commands, f77 - @cindex native compiler - - You should decide whether you want installation of @code{g77} - to also install an @code{f77} command. - On systems with a native @code{f77}, this is not - normally desired, so @code{g77} does not do this by - default. - - @pindex f77-install-ok - @vindex F77_INSTALL_FLAG - If you want @code{f77} installed, create the file @file{f77-install-ok} - (e.g. via the UNIX command @samp{touch f77-install-ok}) in the - source or build top-level directory (the same directory in - which the @code{g77} @file{f} directory resides, not the @file{f} directory - itself), or edit @file{gcc/f/Make-lang.in} and change the definition - of the @samp{F77_INSTALL_FLAG} macro appropriately. - - Usually, this means that, after typing @samp{cd gcc}, you - would type @samp{touch f77-install-ok}. - - When you enable installation of @code{f77}, either a link to or a - direct copy of the @code{g77} command is made. - Similarly, @file{f77.1} is installed as a man page. - - (The @code{uninstall} target in the @file{gcc/Makefile} also tests - this macro and file, when invoked, to determine whether to delete the - installed copies of @code{f77} and @file{f77.1}.) - - @emph{Note:} No attempt is yet made - to install a program (like a shell script) that provides - compatibility with any other @code{f77} programs. - Only the most rudimentary invocations of @code{f77} will - work the same way with @code{g77}. - - @node Installing f2c - @subsection Installing @code{f2c} - - Currently, @code{g77} does not include @code{f2c} itself in its - distribution. - However, it does include a modified version of the @code{libf2c}. - This version is normally compatible with @code{f2c}, but has been - modified to meet the needs of @code{g77} in ways that might possibly - be incompatible with some versions or configurations of @code{f2c}. - - Decide how installation of @code{g77} should affect any existing installation - of @code{f2c} on your system. - - @pindex f2c - @pindex f2c.h - @pindex libf2c.a - @pindex libF77.a - @pindex libI77.a - If you do not have @code{f2c} on your system (e.g. no @file{/usr/bin/f2c}, - no @file{/usr/include/f2c.h}, and no @file{/usr/lib/libf2c.a}, - @file{/usr/lib/libF77.a}, or @file{/usr/lib/libI77.a}), you don't need to - be concerned with this item. - - If you do have @code{f2c} on your system, you need to decide how users - of @code{f2c} will be affected by your installing @code{g77}. - Since @code{g77} is - currently designed to be object-code-compatible with @code{f2c} (with - very few, clear exceptions), users of @code{f2c} might want to combine - @code{f2c}-compiled object files with @code{g77}-compiled object files in a - single executable. - - To do this, users of @code{f2c} should use the same copies of @file{f2c.h} and - @file{libf2c.a} that @code{g77} uses (and that get built as part of - @code{g77}). - - If you do nothing here, the @code{g77} installation process will not - overwrite the @file{include/f2c.h} and @file{lib/libf2c.a} files with its - own versions, and in fact will not even install @file{libf2c.a} for use - with the newly installed versions of @code{gcc} and @code{g77} if it sees - that @file{lib/libf2c.a} exists---instead, it will print an explanatory - message and skip this part of the installation. - - @pindex f2c-install-ok - @vindex F2C_INSTALL_FLAG - To install @code{g77}'s versions of @file{f2c.h} and @file{libf2c.a} - in the appropriate - places, create the file @file{f2c-install-ok} (e.g. via the UNIX - command @samp{touch f2c-install-ok}) in the source or build top-level - directory (the same directory in which the @code{g77} @file{f} directory - resides, not the @file{f} directory itself), or edit @file{gcc/f/Make-lang.in} - and change the definition of the @samp{F2C_INSTALL_FLAG} macro appropriately. - - Usually, this means that, after typing @samp{cd gcc}, you - would type @samp{touch f2c-install-ok}. - - Make sure that when you enable the overwriting of @file{f2c.h} - and @file{libf2c.a} - as used by @code{f2c}, you have a recent and properly configured version of - @file{bin/f2c} so that it generates code that is compatible with @code{g77}. - - @pindex f2c-exists-ok - @vindex F2CLIBOK - If you don't want installation of @code{g77} to overwrite @code{f2c}'s existing - installation, but you do want @code{g77} installation to proceed with - installation of its own versions of @file{f2c.h} and @file{libf2c.a} in places - where @code{g77} will pick them up (even when linking @code{f2c}-compiled - object files---which might lead to incompatibilities), create - the file @file{f2c-exists-ok} (e.g. via the UNIX command - @samp{touch f2c-exists-ok}) in the source or build top-level directory, - or edit @file{gcc/f/Make-lang.in} and change the definition of the - @samp{F2CLIBOK} macro appropriately. - - @node Patching GNU Fortran - @subsection Patching GNU Fortran - - If you're using a SunOS4 system, you'll need to make the following - change to @file{gcc/f/proj.h}: edit the line reading - - @example - #define FFEPROJ_STRTOUL 1 @dots{} - @end example - - @noindent - by replacing the @samp{1} with @samp{0}. - Or, you can avoid editing the source by adding - @example - CFLAGS='-DFFEPROJ_STRTOUL=0 -g -O' - @end example - to the command line for @code{make} when you invoke it. - (@samp{-g} is the default for @samp{CFLAGS}.) - - This causes a minimal version of @code{strtoul()} provided - as part of the @code{g77} distribution to be compiled and - linked into whatever @code{g77} programs need it, since - some systems (like SunOS4 with only the bundled compiler and its - runtime) do not provide this function in their system libraries. - - Similarly, a minimal version of @code{bsearch()} is available - and can be enabled by editing a line similar to the one - for @code{strtoul()} above in @file{gcc/f/proj.h}, if - your system libraries lack @code{bsearch()}. - The method of overriding @samp{X_CFLAGS} may also be used. - - These are not problems with @code{g77}, which requires an - ANSI C environment. - You should upgrade your system to one that provides - a full ANSI C environment, or encourage the maintainers - of @code{gcc} to provide one to all @code{gcc}-based - compilers in future @code{gcc} distributions. - - @xref{Problems Installing}, for more information on - why @code{strtoul()} comes up missing and on approaches - to dealing with this problem that have already been tried. - - @node Where to Install - @subsection Where in the World Does Fortran (and GNU CC) Go? - @cindex language f77 not recognized - @cindex gcc will not compile Fortran programs - - Before configuring, you should make sure you know - where you want the @code{g77} and @code{gcc} - binaries to be installed after they're built, - because this information is given to the configuration - tool and used during the build itself. - - A @code{g77} installation necessarily requires installation of - a @code{g77}-aware version of @code{gcc}, so that the @code{gcc} - command recognizes Fortran source files and knows how to compile - them. - - For this to work, the version of @code{gcc} that you will be building - as part of @code{g77} @strong{must} be installed as the ``active'' - version of @code{gcc} on the system. - - Sometimes people make the mistake of installing @code{gcc} as - @file{/usr/local/bin/gcc}, - leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}. - (Or, the opposite happens.)@ - This can result in @code{g77} being unable to compile Fortran - source files, because when it calls on @code{gcc} to do the - actual compilation, @code{gcc} complains that it does not - recognize the language, or the file name suffix. - - So, determine whether @code{gcc} already is installed on your system, - and, if so, @emph{where} it is installed, and prepare to configure the - new version of @code{gcc} you'll be building so that it installs - over the existing version of @code{gcc}. - - You might want to back up your existing copy of @file{bin/gcc}, and - the entire @file{lib/} directory, before - you perform the actual installation (as described in this manual). - - Existing @code{gcc} installations typically are - found in @file{/usr} or @file{/usr/local}. - If you aren't certain where the currently - installed version of @code{gcc} and its - related programs reside, look at the output - of this command: - - @example - gcc -v -o /tmp/delete-me -xc /dev/null -xnone - @end example - - All sorts of interesting information on the locations of various - @code{gcc}-related programs and data files should be visible - in the output of the above command. - (The output also is likely to include a diagnostic from - the linker, since there's no @samp{main_()} function.) - However, you do have to sift through it yourself; @code{gcc} - currently provides no easy way to ask it where it is installed - and where it looks for the various programs and data files it - calls on to do its work. - - Just @emph{building} @code{g77} should not overwrite any installed - programs---but, usually, after you build @code{g77}, you will want - to install it, so backing up anything it might overwrite is - a good idea. - (This is true for any package, not just @code{g77}, - though in this case it is intentional that @code{g77} overwrites - @code{gcc} if it is already installed---it is unusual that - the installation process for one distribution intentionally - overwrites a program or file installed by another distribution.) - - Another reason to back up the existing version first, - or make sure you can restore it easily, is that it might be - an older version on which other users have come to depend - for certain behaviors. - However, even the new version of @code{gcc} you install - will offer users the ability to specify an older version of - the actual compilation programs if desired, and these - older versions need not include any @code{g77} components. - @xref{Target Options,,Specifying Target Machine and Compiler Version, - gcc,Using and Porting GNU CC}, for information on the @samp{-V} - option of @code{gcc}. - - @node Configuring gcc - @subsection Configuring GNU CC - - @code{g77} is configured automatically when you configure - @code{gcc}. - There are two parts of @code{g77} that are configured in two - different ways---@code{g77}, which ``camps on'' to the - @code{gcc} configuration mechanism, and @code{libf2c}, which - uses a variation of the GNU @code{autoconf} configuration - system. - - Generally, you shouldn't have to be concerned with - either @code{g77} or @code{libf2c} configuration, unless - you're configuring @code{g77} as a cross-compiler. - In this case, the @code{libf2c} configuration, and possibly the - @code{g77} and @code{gcc} configurations as well, - might need special attention. - (This also might be the case if you're porting @code{gcc} to - a whole new system---even if it is just a new operating system - on an existing, supported CPU.) - - To configure the system, see - @ref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, - following the instructions for running @file{./configure}. - Pay special attention to the @samp{--prefix=} option, which - you almost certainly will need to specify. - - (Note that @code{gcc} installation information is provided - as a straight text file in @file{gcc/INSTALL}.) - - The information printed by the invocation of @file{./configure} - should show that the @file{f} directory (the Fortran language) - has been configured. - If it does not, there is a problem. - - @emph{Note:} Configuring with the @samp{--srcdir} argument is known - to work with GNU @code{make}, but it is not known to work with - other variants of @code{make}. - Irix5.2 and SunOS4.1 versions of @code{make} definitely - won't work outside the source directory at present. - @code{g77}'s - portion of the @file{configure} script issues a warning message - about this when you configure for building binaries outside - the source directory. - - @node Building gcc - @subsection Building GNU CC - @cindex building @code{gcc} - @cindex building @code{g77} - - @vindex LANGUAGES - Building @code{g77} requires building enough of @code{gcc} that - these instructions assume you're going to build all of - @code{gcc}, including @code{g++}, @code{protoize}, and so on. - You can save a little time and disk space by changes the - @samp{LANGUAGES} macro definition in @code{gcc/Makefile.in} - or @code{gcc/Makefile}, but if you do that, you're on your own. - One change is almost @emph{certainly} going to cause failures: - removing @samp{c} or @samp{f77} from the definition of the - @samp{LANGUAGES} macro. - - After configuring @code{gcc}, which configures @code{g77} and - @code{libf2c} automatically, you're ready to start the actual - build by invoking @code{make}. - - @pindex configure - @emph{Note:} You @strong{must} have run @file{./configure} - before you run @code{make}, even if you're - using an already existing @code{gcc} development directory, because - @file{./configure} does the work to recognize that you've added - @code{g77} to the configuration. - - There are two general approaches to building GNU CC from - scratch: - - @table @dfn - @item bootstrap - This method uses minimal native system facilities to - build a barebones, unoptimized @code{gcc}, that is then - used to compile (``bootstrap'') the entire system. - - @item straight - This method assumes a more complete native system - exists, and uses that just once to build the entire - system. - @end table - - On all systems without a recent version of @code{gcc} - already installed, the @i{bootstrap} method must be - used. - In particular, @code{g77} uses extensions to the C - language offered, apparently, only by @code{gcc}. - - On most systems with a recent version of @code{gcc} - already installed, the @i{straight} method can be - used. - This is an advantage, because it takes less CPU time - and disk space for the build. - However, it does require that the system have fairly - recent versions of many GNU programs and other - programs, which are not enumerated here. - - @menu - * Bootstrap Build:: For all systems. - * Straight Build:: For systems with a recent version of @code{gcc}. - @end menu - - @node Bootstrap Build - @subsubsection Bootstrap Build - @cindex bootstrap build - @cindex build, bootstrap - - A complete bootstrap build is done by issuing a command - beginning with @samp{make bootstrap @dots{}}, as - described in @ref{Installation,,Installing GNU CC, - gcc,Using and Porting GNU CC}. - This is the most reliable form of build, but it does require - the most disk space and CPU time, since the complete system - is built twice (in Stages 2 and 3), after an initial build - (during Stage 1) of a minimal @code{gcc} compiler using - the native compiler and libraries. - - You might have to, or want to, control the way a bootstrap - build is done by entering the @code{make} commands to build - each stage one at a time, as described in the @code{gcc} - manual. - For example, to save time or disk space, you might want - to not bother doing the Stage 3 build, in which case you - are assuming that the @code{gcc} compiler you have built - is basically sound (because you are giving up the opportunity - to compare a large number of object files to ensure they're - identical). - - To save some disk space during installation, after Stage 2 - is built, you can type @samp{rm -fr stage1} to remove the - binaries built during Stage 1. - - @emph{Note:} @xref{Object File Differences}, for information on - expected differences in object files produced during Stage 2 and - Stage 3 of a bootstrap build. - These differences will be encountered as a result of using - the @samp{make compare} or similar command sequence recommended - by the GNU CC installation documentation. - - Also, @xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, - for important information on building @code{gcc} that is - not described in this @code{g77} manual. - For example, explanations of diagnostic messages - and whether they're expected, or indicate trouble, - are found there. - - @node Straight Build - @subsubsection Straight Build - @cindex straight build - @cindex build, straight - - If you have a recent version of @code{gcc} - already installed on your system, and if you're - reasonably certain it produces code that is - object-compatible with the version of @code{gcc} - you want to build as part of building @code{g77}, - you can save time and disk space by doing a straight - build. - - To build just the C and Fortran compilers and the - necessary run-time libraries, issue the following - command: - - @example - make -k CC=gcc LANGUAGES=f77 all g77 - @end example - - (The @samp{g77} target is necessary because the @code{gcc} - build procedures apparently do not automatically build - command drivers for languages in subdirectories. - It's the @samp{all} target that triggers building - everything except, apparently, the @code{g77} command - itself.) - - If you run into problems using this method, you have - two options: - - @itemize @bullet - @item - Abandon this approach and do a bootstrap build. - - @item - Try to make this approach work by diagnosing the - problems you're running into and retrying. - @end itemize - - Especially if you do the latter, you might consider - submitting any solutions as bug/fix reports. - @xref{Trouble,,Known Causes of Trouble with GNU Fortran}. - - However, understand that many problems preventing a - straight build from working are not @code{g77} problems, - and, in such cases, are not likely to be addressed in - future versions of @code{g77}. - - @node Pre-installation Checks - @subsection Pre-installation Checks - @cindex pre-installation checks - @cindex installing, checking before - - Before installing the system, which includes installing - @code{gcc}, you might want to do some minimum checking - to ensure that some basic things work. - - Here are some commands you can try, and output typically - printed by them when they work: - - @example - sh# @kbd{cd /usr/src/gcc} - sh# @kbd{./g77 --driver=./xgcc -B./ -v} - g77 version @value{version-g77} - ./xgcc -B./ -v -fnull-version -o /tmp/gfa18047 @dots{} - Reading specs from ./specs - gcc version @value{version-gcc-patched} - ./cpp -lang-c -v -isystem ./include -undef @dots{} - GNU CPP version @value{version-gcc-patched} (Linux/Alpha) - #include "..." search starts here: - #include <...> search starts here: - ./include - /usr/local/include - /usr/alpha-unknown-linux/include - /usr/lib/gcc-lib/alpha-unknown-linux/@value{version-gcc-patched}/include - /usr/include - End of search list. - ./f771 /tmp/cca18048.i -fset-g77-defaults -quiet -dumpbase @dots{} - GNU F77 version @value{version-gcc-patched} (Linux/Alpha) compiled @dots{} - GNU Fortran Front End version @value{version-g77} compiled: @dots{} - as -nocpp -o /tmp/cca180481.o /tmp/cca18048.s - ld -G 8 -O1 -o /tmp/gfa18047 /usr/lib/crt0.o -L. @dots{} - __G77_LIBF77_VERSION__: @value{version-g77} - @@(#)LIBF77 VERSION 19970404 - __G77_LIBI77_VERSION__: @value{version-g77} - @@(#) LIBI77 VERSION pjw,dmg-mods 19970816 - __G77_LIBU77_VERSION__: @value{version-g77} - @@(#) LIBU77 VERSION 19970609 - sh# @kbd{./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone} - Reading specs from ./specs - gcc version @value{version-gcc-patched} - ./cpp -lang-c -v -isystem ./include -undef @dots{} - GNU CPP version @value{version-gcc-patched} (Linux/Alpha) - #include "..." search starts here: - #include <...> search starts here: - ./include - /usr/local/include - /usr/alpha-unknown-linux/include - /usr/lib/gcc-lib/alpha-unknown-linux/@value{version-gcc-patched}/include - /usr/include - End of search list. - ./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version @dots{} - GNU C version @value{version-gcc-patched} (Linux/Alpha) compiled @dots{} - as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s - ld -G 8 -O1 -o /tmp/delete-me /usr/lib/crt0.o -L. @dots{} - /usr/lib/crt0.o: In function `__start': - crt0.S:110: undefined reference to `main' - /usr/lib/crt0.o(.lita+0x28): undefined reference to `main' - sh# - @end example - - (Note that long lines have been truncated, and @samp{@dots{}} - used to indicate such truncations.) - - The above two commands test whether @code{g77} and @code{gcc}, - respectively, are able to compile empty (null) source files, - whether invocation of the C preprocessor works, whether libraries - can be linked, and so on. - - If the output you get from either of the above two commands - is noticeably different, especially if it is shorter or longer - in ways that do not look consistent with the above sample - output, you probably should not install @code{gcc} and @code{g77} - until you have investigated further. - - For example, you could try compiling actual applications and - seeing how that works. - (You might want to do that anyway, even if the above tests - work.) - - To compile using the not-yet-installed versions of @code{gcc} - and @code{g77}, use the following commands to invoke them. - - To invoke @code{g77}, type: - - @example - /usr/src/gcc/g77 --driver=/usr/src/gcc/xgcc -B/usr/src/gcc/ @dots{} - @end example - - To invoke @code{gcc}, type: - - @example - /usr/src/gcc/xgcc -B/usr/src/gcc/ @dots{} - @end example - - @node Installation of Binaries - @subsection Installation of Binaries - @cindex installation of binaries - @cindex @code{g77}, installation of - @cindex @code{gcc}, installation of - - After configuring, building, and testing @code{g77} and @code{gcc}, - when you are ready to install them on your system, type: - - @example - make -k CC=gcc LANGUAGES=f77 install - @end example - - As described in @ref{Installation,,Installing GNU CC, - gcc,Using and Porting GNU CC}, the values for - the @samp{CC} and @samp{LANGUAGES} macros should - be the same as those you supplied for the build - itself. - - So, the details of the above command might vary - if you used a bootstrap build (where you might be - able to omit both definitions, or might have to - supply the same definitions you used when building - the final stage) or if you deviated from the - instructions for a straight build. - - If the above command does not install @file{libf2c.a} - as expected, try this: - - @example - make -k @dots{} install install-libf77 install-f2c-all - @end example - - We don't know why some non-GNU versions of @code{make} sometimes - require this alternate command, but they do. - (Remember to supply the appropriate definitions for @samp{CC} and - @samp{LANGUAGES} where you see @samp{@dots{}} in the above command.) - - Note that using the @samp{-k} option tells @code{make} to - continue after some installation problems, like not having - @code{makeinfo} installed on your system. - It might not be necessary for your system. - - @node Updating Documentation - @subsection Updating Your Info Directory - @cindex updating info directory - @cindex info, updating directory - @cindex directory, updating info - @pindex /usr/info/dir - @pindex g77.info - @cindex texinfo - @cindex documentation - - As part of installing @code{g77}, you should make sure users - of @code{info} can easily access this manual on-line. - Do this by making sure a line such as the following exists - in @file{/usr/info/dir}, or in whatever file is the top-level - file in the @code{info} directory on your system (perhaps - @file{/usr/local/info/dir}: - - @example - * g77: (g77). The GNU Fortran programming language. - @end example - - If the menu in @file{dir} is organized into sections, @code{g77} - probably belongs in a section with a name such as one of - the following: - - @itemize @bullet - @item - Fortran Programming - - @item - Writing Programs - - @item - Programming Languages - - @item - Languages Other Than C - - @item - Scientific/Engineering Tools - - @item - GNU Compilers - @end itemize - - @node Missing bison? - @subsection Missing @code{bison}? - @cindex @code{bison} - @cindex missing @code{bison} - - If you cannot install @code{bison}, make sure you have started - with a @emph{fresh} distribution of @code{gcc}, do @emph{not} - do @samp{make maintainer-clean} (in other versions of @code{gcc}, - this was called @samp{make realclean}), and, to ensure that - @code{bison} is not invoked by @code{make} during the build, - type these commands: - - @example - sh# @kbd{cd gcc} - sh# @kbd{touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c} - sh# @kbd{touch cp/parse.c cp/parse.h objc-parse.c} - sh# - @end example - - These commands update the date-time-modified information for - all the files produced by the various invocations of @code{bison} - in the current versions of @code{gcc}, so that @code{make} no - longer believes it needs to update them. - All of these files should already exist in a @code{gcc} - distribution, but the application of patches to upgrade - to a newer version can leave the modification information - set such that the @code{bison} input files look more ``recent'' - than the corresponding output files. - - @emph{Note:} New versions of @code{gcc} might change the set of - files it generates by invoking @code{bison}---if you cannot figure - out for yourself how to handle such a situation, try an - older version of @code{gcc} until you find someone who can - (or until you obtain and install @code{bison}). - - @node Missing makeinfo? - @subsection Missing @code{makeinfo}? - @cindex @code{makeinfo} - @cindex missing @code{makeinfo} - - If you cannot install @code{makeinfo}, either use the @code{-k} option when - invoking make to specify any of the @samp{install} or related targets, - or specify @samp{MAKEINFO=echo} on the @code{make} command line. - - If you fail to do one of these things, some files, like @file{libf2c.a}, - might not be installed, because the failed attempt by @code{make} to - invoke @code{makeinfo} causes it to cancel any further processing. - - @node Distributing Binaries - @section Distributing Binaries - @cindex binaries, distributing - @cindex code, distributing - - If you are building @code{g77} for distribution to others in binary form, - first make sure you are aware of your legal responsibilities (read - the file @file{gcc/COPYING} thoroughly). - - Then, consider your target audience and decide where @code{g77} should - be installed. - - For systems like GNU/Linux that have no native Fortran compiler (or - where @code{g77} could be considered the native compiler for Fortran and - @code{gcc} for C, etc.), you should definitely configure - @code{g77} for installation - in @file{/usr/bin} instead of @file{/usr/local/bin}. - Specify the - @samp{--prefix=/usr} option when running @file{./configure}. - You might - also want to set up the distribution so the @code{f77} command is a - link to @code{g77}---just make an empty file named @file{f77-install-ok} in - the source or build directory (the one in which the @file{f} directory - resides, not the @file{f} directory itself) when you specify one of the - @file{install} or @file{uninstall} targets in a @code{make} command. - - For a system that might already have @code{f2c} installed, you definitely - will want to make another empty file (in the same directory) named - either @file{f2c-exists-ok} or @file{f2c-install-ok}. - Use the former if you - don't want your distribution to overwrite @code{f2c}-related files in existing - systems; use the latter if you want to improve the likelihood that - users will be able to use both @code{f2c} and @code{g77} to compile code for a - single program without encountering link-time or run-time - incompatibilities. - - (Make sure you clearly document, in the ``advertising'' for - your distribution, how installation of your distribution will - affect existing installations of @code{gcc}, @code{f2c}, - @code{f77}, @file{libf2c.a}, and so on. - Similarly, you should clearly document any requirements - you assume are met by users of your distribution.) - - For other systems with native @code{f77} (and @code{cc}) compilers, - configure @code{g77} as you (or most of your audience) would - configure @code{gcc} for their installations. - Typically this is for installation in - @file{/usr/local}, and would not include a copy of - @code{g77} named @code{f77}, so - users could still use the native @code{f77}. - - In any case, for @code{g77} to work properly, you @strong{must} ensure - that the binaries you distribute include: - - @table @file - @item bin/g77 - This is the command most users use to compile Fortran. - - @item bin/gcc - This is the command all users use to compile Fortran, either - directly or indirectly via the @code{g77} command. - The @file{bin/gcc} executable file must have been built - from a @code{gcc} source tree into which a @code{g77} source - tree was merged and configured, or it will not know how - to compile Fortran programs. - - @item bin/f77 - In installations with no non-GNU native Fortran - compiler, this is the same as @file{bin/g77}. - Otherwise, it should be omitted from the distribution, - so the one on already on a particular system does - not get overwritten. - - @item info/g77.info* - This is the documentation for @code{g77}. - If it is not included, users will have trouble understanding - diagnostics messages and other such things, and will send - you a lot of email asking questions. - - Please edit this documentation (by editing @file{gcc/f/*.texi} - and doing @samp{make doc} from the @file{/usr/src/gcc} directory) - to reflect any changes you've made to @code{g77}, or at - least to encourage users of your binary distribution to - report bugs to you first. - - Also, whether you distribute binaries or install @code{g77} - on your own system, it might be helpful for everyone to - add a line listing this manual by name and topic to the - top-level @code{info} node in @file{/usr/info/dir}. - That way, users can find @code{g77} documentation more - easily. - @xref{Updating Documentation,,Updating Your Info Directory}. - - @item man/man1/g77.1 - This is the short man page for @code{g77}. - It is out of date, but you might as well include it - for people who really like man pages. - - @item man/man1/f77.1 - In installations where @code{f77} is the same as @code{g77}, - this is the same as @file{man/man1/g77.1}. - Otherwise, it should be omitted from the distribution, - so the one already on a particular system does not - get overwritten. - - @item lib/gcc-lib/@dots{}/f771 - This is the actual Fortran compiler. - - @item lib/gcc-lib/@dots{}/libf2c.a - This is the run-time library for @code{g77}-compiled programs. - @end table - - Whether you want to include the slightly updated (and possibly - improved) versions of @code{cc1}, @code{cc1plus}, and whatever other - binaries get rebuilt with the changes the GNU Fortran distribution - makes to the GNU back end, is up to you. - These changes are - highly unlikely to break any compilers, and it is possible - they'll fix back-end bugs that can be demonstrated using front - ends other than GNU Fortran's. - - Please assure users that unless - they have a specific need for their existing, - older versions of @code{gcc} command, - they are unlikely to experience any problems by overwriting - it with your version---though they could certainly protect - themselves by making backup copies first! - Otherwise, users might try and install your binaries - in a ``safe'' place, find they cannot compile Fortran - programs with your distribution (because, perhaps, they're - picking up their old version of the @code{gcc} command, - which does not recognize Fortran programs), and assume - that your binaries (or, more generally, GNU Fortran - distributions in general) are broken, at least for their - system. - - Finally, @strong{please} ask for bug reports to go to you first, at least - until you're sure your distribution is widely used and has been - well tested. - This especially goes for those of you making any - changes to the @code{g77} sources to port @code{g77}, e.g. to OS/2. - @email{fortran@@gnu.org} has received a fair number of bug - reports that turned out to be problems with other peoples' ports - and distributions, about which nothing could be done for the - user. - Once you are quite certain a bug report does not involve - your efforts, you can forward it to us. --- 0 ---- diff -rcp2N g77-0.5.22/f/install0.texi g77-0.5.23/f/install0.texi *** g77-0.5.22/f/install0.texi Mon Mar 4 21:37:40 1996 --- g77-0.5.23/f/install0.texi Fri Apr 17 21:09:52 1998 *************** this copyright notice and permission not *** 11,14 **** @node Top,,, (dir) @chapter Installing GNU Fortran ! @include install.texi @bye --- 11,14 ---- @node Top,,, (dir) @chapter Installing GNU Fortran ! @include g77install.texi @bye diff -rcp2N g77-0.5.22/f/intdoc.c g77-0.5.23/f/intdoc.c *** g77-0.5.22/f/intdoc.c Wed Dec 24 01:18:01 1997 --- g77-0.5.23/f/intdoc.c Fri May 15 17:27:19 1998 *************** *** 1,5 **** /* intdoc.c Copyright (C) 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* intdoc.c Copyright (C) 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** static void print_type_string (char *c); *** 68,72 **** int ! main (int argc, char **argv __attribute__ ((unused))) { if (argc != 1) --- 68,72 ---- int ! main (int argc, char **argv) { if (argc != 1) *************** types of all the arguments.\n\n"); *** 845,849 **** default: ! assert ("E1" == NULL); break; } --- 845,849 ---- default: ! assert ("N1" == NULL); break; } diff -rcp2N g77-0.5.22/f/intrin.c g77-0.5.23/f/intrin.c *** g77-0.5.22/f/intrin.c Sun Mar 8 21:36:59 1998 --- g77-0.5.23/f/intrin.c Fri May 15 17:27:19 1998 *************** *** 1,5 **** /* intrin.c -- Recognize references to intrinsics Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* intrin.c -- Recognize references to intrinsics Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffeintrin_init_0 () *** 1644,1665 **** || (c[1] == 'p')) ++c; ! if (((c[1] != '-') ! && (c[1] != 'A') ! && (c[1] != 'C') ! && (c[1] != 'I') ! && (c[1] != 'L') ! && (c[1] != 'R') ! && (c[1] != 'B') ! && (c[1] != 'F') ! && (c[1] != 'N') ! && (c[1] != 'S') ! && (c[1] != 'g') ! && (c[1] != 's')) ! || ((c[2] != '*') ! && ((c[2] < '1') ! || (c[2] > '9')) ! && (c[2] != 'A'))) { ! fprintf (stderr, "%s: bad arg-type\n", ffeintrin_imps_[i].name); break; --- 1644,1670 ---- || (c[1] == 'p')) ++c; ! if ((c[1] != '-') ! && (c[1] != 'A') ! && (c[1] != 'C') ! && (c[1] != 'I') ! && (c[1] != 'L') ! && (c[1] != 'R') ! && (c[1] != 'B') ! && (c[1] != 'F') ! && (c[1] != 'N') ! && (c[1] != 'S') ! && (c[1] != 'g') ! && (c[1] != 's')) { ! fprintf (stderr, "%s: bad arg-base-type\n", ! ffeintrin_imps_[i].name); ! break; ! } ! if ((c[2] != '*') ! && ((c[2] < '1') ! || (c[2] > '9')) ! && (c[2] != 'A')) ! { ! fprintf (stderr, "%s: bad arg-kind-type\n", ffeintrin_imps_[i].name); break; diff -rcp2N g77-0.5.22/f/intrin.h g77-0.5.23/f/intrin.h *** g77-0.5.22/f/intrin.h Tue Sep 9 06:11:37 1997 --- g77-0.5.23/f/intrin.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* intrin.h -- Public interface for intrin.c Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* intrin.h -- Public interface for intrin.c Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/lab.c g77-0.5.23/f/lab.c *** g77-0.5.22/f/lab.c Wed Aug 30 19:53:36 1995 --- g77-0.5.23/f/lab.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* lab.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* lab.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/lab.h g77-0.5.23/f/lab.h *** g77-0.5.22/f/lab.h Wed Aug 30 19:53:35 1995 --- g77-0.5.23/f/lab.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* lab.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* lab.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/lang-options.h g77-0.5.23/f/lang-options.h *** g77-0.5.22/f/lang-options.h Tue Oct 28 08:48:20 1997 --- g77-0.5.23/f/lang-options.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* lang-options.h file for Fortran ! Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* lang-options.h file for Fortran ! Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 105,139 **** "-fcase-preserve", "-fbadu77-intrinsics-delete", - "-fbadu77-intrinsics-hide", "-fbadu77-intrinsics-disable", "-fbadu77-intrinsics-enable", "-fdcp-intrinsics-delete", - "-fdcp-intrinsics-hide", "-fdcp-intrinsics-disable", "-fdcp-intrinsics-enable", "-ff2c-intrinsics-delete", - "-ff2c-intrinsics-hide", "-ff2c-intrinsics-disable", "-ff2c-intrinsics-enable", "-ff90-intrinsics-delete", - "-ff90-intrinsics-hide", "-ff90-intrinsics-disable", "-ff90-intrinsics-enable", "-fgnu-intrinsics-delete", - "-fgnu-intrinsics-hide", "-fgnu-intrinsics-disable", "-fgnu-intrinsics-enable", "-fmil-intrinsics-delete", - "-fmil-intrinsics-hide", "-fmil-intrinsics-disable", "-fmil-intrinsics-enable", "-funix-intrinsics-delete", - "-funix-intrinsics-hide", "-funix-intrinsics-disable", "-funix-intrinsics-enable", "-fvxt-intrinsics-delete", - "-fvxt-intrinsics-hide", "-fvxt-intrinsics-disable", "-fvxt-intrinsics-enable", "-fzeros", "-fno-zeros", --- 105,139 ---- "-fcase-preserve", "-fbadu77-intrinsics-delete", "-fbadu77-intrinsics-disable", "-fbadu77-intrinsics-enable", + "-fbadu77-intrinsics-hide", "-fdcp-intrinsics-delete", "-fdcp-intrinsics-disable", "-fdcp-intrinsics-enable", + "-fdcp-intrinsics-hide", "-ff2c-intrinsics-delete", "-ff2c-intrinsics-disable", "-ff2c-intrinsics-enable", + "-ff2c-intrinsics-hide", "-ff90-intrinsics-delete", "-ff90-intrinsics-disable", "-ff90-intrinsics-enable", + "-ff90-intrinsics-hide", "-fgnu-intrinsics-delete", "-fgnu-intrinsics-disable", "-fgnu-intrinsics-enable", + "-fgnu-intrinsics-hide", "-fmil-intrinsics-delete", "-fmil-intrinsics-disable", "-fmil-intrinsics-enable", + "-fmil-intrinsics-hide", "-funix-intrinsics-delete", "-funix-intrinsics-disable", "-funix-intrinsics-enable", + "-funix-intrinsics-hide", "-fvxt-intrinsics-delete", "-fvxt-intrinsics-disable", "-fvxt-intrinsics-enable", + "-fvxt-intrinsics-hide", "-fzeros", "-fno-zeros", diff -rcp2N g77-0.5.22/f/lang-specs.h g77-0.5.23/f/lang-specs.h *** g77-0.5.22/f/lang-specs.h Tue Sep 9 06:11:37 1997 --- g77-0.5.23/f/lang-specs.h Tue May 12 00:19:21 1998 *************** *** 1,5 **** /* lang-specs.h file for Fortran Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* lang-specs.h file for Fortran Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 28,37 **** K&R case we're not building the f77 language. */ - #ifdef OBJECT_SUFFIX /* Not defined compiling gcc.c prior to 2.7.0. */ - #define OO "%O" - #else - #define OO ".o" - #endif - {".F", "@f77-cpp-input"}, {".fpp", "@f77-cpp-input"}, --- 28,31 ---- *************** the Free Software Foundation, 59 Temple *** 61,65 **** %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\ %{!pipe:%g.s} %A\n }}}}"}, {".r", "@ratfor"}, --- 55,59 ---- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}, {".r", "@ratfor"}, *************** the Free Software Foundation, 59 Temple *** 76,80 **** %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\ %{!pipe:%g.s} %A\n }}"}, {".f", "@f77"}, --- 70,74 ---- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}"}, {".f", "@f77"}, *************** the Free Software Foundation, 59 Temple *** 89,94 **** %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\ %{!pipe:%g.s} %A\n }}}}"}, #undef OO --- 83,111 ---- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:as %a %Y\ ! %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}, + {"@f77-version", + "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I \ + %{C:%{!E:%eGNU C does not support -C without using -E}} \ + %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} \ + -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 \ + %{ansi:-trigraphs -$ -D__STRICT_ANSI__} \ + %{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \ + %c %{O*:%{!O0:-D__OPTIMIZE__}} -traditional \ + %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z \ + /dev/null /dev/null \n\ + f771 -fnull-version %(f771) \ + %{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a} \ + %{g*} %{O*} %{W*} %{w} %{pedantic*} \ + -version -fversion %{f*} %{I*} -o %g.s /dev/null \n\ + as %a %Y -o %g%O %g.s %A \n\ + ld %l %X -o %g %g%O %{A} %{d} %{e*} %{m} %{N} %{n} \ + %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} \ + %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ + %{static:} %{L*} %D -lg2c -lm \ + %{!nostdlib:%{!nodefaultlibs:%G %L %G}} \ + %{!A:%{!nostdlib:%{!nostartfiles:%E}}} \ + %{T*} \n\ + %g \n"}, #undef OO diff -rcp2N g77-0.5.22/f/lex.c g77-0.5.23/f/lex.c *** g77-0.5.22/f/lex.c Thu Mar 12 23:43:49 1998 --- g77-0.5.23/f/lex.c Tue May 12 00:14:12 1998 *************** *** 1,5 **** /* Implementation of Fortran lexer Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Implementation of Fortran lexer Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 33,36 **** --- 33,37 ---- #include "input.j" #include "tree.j" + #include "output.j" /* Must follow tree.j so TREE_CODE is defined! */ #endif *************** ffelex_file_fixed (ffewhereFile wf, FILE *** 1849,1852 **** --- 1850,1870 ---- ffelex_current_wc_ = ffewhere_column_unknown (); latest_char_in_file = '\n'; + + if (ffe_is_null_version ()) + { + /* Just substitute a "program" directly here. */ + + char line[] = " call g77__fvers;call g77__ivers;call g77__uvers;end"; + char *p; + + column = 0; + for (p = &line[0]; *p != '\0'; ++p) + column = ffelex_image_char_ (*p, column); + + c = EOF; + + goto have_line; /* :::::::::::::::::::: */ + } + goto first_line; /* :::::::::::::::::::: */ *************** ffelex_file_fixed (ffewhereFile wf, FILE *** 1996,1999 **** --- 2014,2020 ---- column = ffelex_final_nontab_column_; } + + have_line: /* :::::::::::::::::::: */ + ffelex_card_image_[column] = '\0'; ffelex_card_length_ = column; diff -rcp2N g77-0.5.22/f/lex.h g77-0.5.23/f/lex.h *** g77-0.5.22/f/lex.h Mon Dec 4 06:18:43 1995 --- g77-0.5.23/f/lex.h Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* lex.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* lex.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/malloc.c g77-0.5.23/f/malloc.c *** g77-0.5.22/f/malloc.c Sat Oct 25 22:47:03 1997 --- g77-0.5.23/f/malloc.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* malloc.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* malloc.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/malloc.h g77-0.5.23/f/malloc.h *** g77-0.5.22/f/malloc.h Sat Oct 25 22:48:51 1997 --- g77-0.5.23/f/malloc.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* malloc.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* malloc.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/name.c g77-0.5.23/f/name.c *** g77-0.5.22/f/name.c Wed Aug 30 19:53:35 1995 --- g77-0.5.23/f/name.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* name.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* name.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/name.h g77-0.5.23/f/name.h *** g77-0.5.22/f/name.h Fri Jan 10 11:13:15 1997 --- g77-0.5.23/f/name.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* name.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* name.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/news.texi g77-0.5.23/f/news.texi *** g77-0.5.22/f/news.texi Mon Mar 16 19:48:53 1998 --- g77-0.5.23/f/news.texi Wed May 20 16:17:55 1998 *************** *** 6,10 **** @c in the G77 distribution, as well as in the G77 manual. ! @c 1998-03-16 @ifclear NEWSONLY --- 6,10 ---- @c in the G77 distribution, as well as in the G77 manual. ! @c 1998-05-20 @ifclear NEWSONLY *************** The changes are generally listed in orde *** 22,29 **** @enumerate @item ! Code-generation and run-time-library bugs @item Compiler and run-time-library crashes involving valid code @item --- 22,30 ---- @enumerate @item ! Code-generation and run-time-library bug-fixes @item Compiler and run-time-library crashes involving valid code + that have been fixed @item *************** Miscellany *** 45,48 **** --- 46,231 ---- This order is not strict---for example, some items involve a combination of these elements. + + @heading In 0.5.23: + @itemize @bullet + @item + This release contains several regressions against + version 0.5.22 of @code{g77}, due to using the + ``vanilla'' @code{gcc} back end instead of patching + it to fix a few bugs and improve performance in a + few cases. + + @xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet}, + available in plain-text format in @code{gcc/f/BUGS}, + for information on the known bugs in this version, + including the regressions. + + Features that have been dropped from this version + of @code{g77} due to their being implemented + via @code{g77}-specific patches to the @code{gcc} + back end in previous releases include: + + @itemize -- + @item + Support for @code{__restrict__} keyword, + the options @samp{-fargument-alias}, @samp{-fargument-noalias}, + and @samp{-fargument-noalias-global}, + and the corresponding alias-analysis code. + + (Version 1.0.1 of @code{egcs} has the alias-analysis + code, but not the @code{__restrict__} keyword. + @code{egcs} @code{g77} users benefit from the alias-analysis + code despite the lack of the @code{__restrict__} keyword, + which is a C-language construct.) + + @item + Support for the GNU compiler options + @samp{-fmove-all-movables}, + @samp{-freduce-all-givs}, + and @samp{-frerun-loop-opt}. + + (Version 1.0.1 of @code{egcs} supports these options. + @code{g77} users of @code{egcs} benefit from them even if + they are not explicitly specified, + because the defaults are optimized for @code{g77} users.) + + @item + Support for the @samp{-W} option warning about + integer division by zero. + + @item + The Intel x86-specific option @samp{-malign-double} + applying to stack-allocated data + as well as statically-allocate data. + @end itemize + + Note that the @file{gcc/f/gbe/} subdirectory has been removed + from this distribution as a result of @code{g77} no longer + including patches for the @code{gcc} back end. + + @item + Fix bugs in the @code{libU77} intrinsic @samp{HostNm} + that wrote one byte beyond the end of its @samp{CHARACTER} + argument, + and in the @code{libU77} intrinsics + @samp{GMTime} and @samp{LTime} + that overwrote their arguments. + + @item + Support @code{gcc} version 2.8, + and remove support for prior versions of @code{gcc}. + + @cindex -@w{}-driver option + @cindex g77 options, -@w{}-driver + @cindex options, -@w{}-driver + @item + Remove support for the @samp{--driver} option, + as @code{g77} now does all the driving, + just like @code{gcc}. + + @item + @code{CASE DEFAULT} no longer crashes @code{g77}. + + @item + Valid combinations of @code{EXTERNAL}, + passing that external as a dummy argument + without explicitly giving it a type, + and, in a subsequent program unit, + referencing that external as + an external function with a different type + no longer crash @code{g77}. + + @item + @code{g77} no longer installs the @file{f77} command + and @file{f77.1} man page + in the @file{/usr} or @file{/usr/local} heirarchy, + even if the @file{f77-install-ok} file exists + in the source or build directory. + See the installation documentation for more information. + + @item + @code{g77} no longer installs the @file{libf2c.a} library + and @file{f2c.h} include file + in the @file{/usr} or @file{/usr/local} heirarchy, + even if the @file{f2c-install-ok} or @file{f2c-exists-ok} files exist + in the source or build directory. + See the installation documentation for more information. + + @item + The @file{libf2c.a} library produced by @code{g77} has been + renamed to @file{libg2c.a}. + It is installed only in the @code{gcc} ``private'' + directory heirarchy, @file{gcc-lib}. + This allows system administrators and users to choose which + version of the @code{libf2c} library from @code{netlib} they + wish to use on a case-by-case basis. + See the installation documentation for more information. + + @item + The @file{f2c.h} include (header) file produced by @code{g77} + has been renamed to @file{g2c.h}. + It is installed only in the @code{gcc} ``private'' + directory heirarchy, @file{gcc-lib}. + This allows system administrators and users to choose which + version of the include file from @code{netlib} they + wish to use on a case-by-case basis. + See the installation documentation for more information. + + @item + The @code{g77} command now expects the run-time library + to be named @code{libg2c.a} instead of @code{libf2c.a}, + to ensure that a version other than the one built and + installed as part of the same @code{g77} version is picked up. + + @item + The @samp{-Wunused} option no longer issues a spurious + warning about the ``master'' procedure generated by + @code{g77} for procedures containing @code{ENTRY} statements. + + @item + @code{g77}'s version of @code{libf2c} separates out + the setting of global state + (such as command-line arguments and signal handling) + from @file{main.o} into distinct, new library + archive members. + + This should make it easier to write portable applications + that have their own (non-Fortran) @code{main()} routine + properly set up the @code{libf2c} environment, even + when @code{libf2c} (now @code{libg2c}) is a shared library. + + @item + During the configuration and build process, + @code{g77} creates subdirectories it needs only as it + needs them, thus avoiding unnecessary creation of, for example, + @file{stage1/f/runtime} when doing a non-bootstrap build. + Other cleaning up of the configuration and build process + has been performed as well. + + @item + @code{install-info} now used to update the directory of + Info documentation to contain an entry for @code{g77} + (during installation). + + @item + Some diagnostics have been changed from warnings to errors, + to prevent inadvertent use of the resulting, probably buggy, + programs. + These mostly include diagnostics about use of unsupported features + in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and + @code{WRITE} statements, + and about truncations of various sorts of constants. + + @item + Improve documentation and indexing. + + @item + Upgrade to @code{libf2c} as of 1998-04-20. + + This should fix a variety of problems, including + those involving some uses of the @samp{T} format + specifier, and perhaps some build (porting) problems + as well. + @end itemize @heading In 0.5.22: diff -rcp2N g77-0.5.22/f/output.j g77-0.5.23/f/output.j *** g77-0.5.22/f/output.j Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/output.j Tue Apr 21 01:23:27 1998 *************** *** 0 **** --- 1,28 ---- + /* output.j -- Wrapper for GCC's output.h + Copyright (C) 1998 Free Software Foundation, Inc. + Contributed by James Craig Burley (burley@gnu.org). + + This file is part of GNU Fortran. + + GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + + #ifndef MAKING_DEPENDENCIES + #ifndef _J_f_output + #define _J_f_output + #include "gansidecl.h" + #include "output.h" + #endif + #endif diff -rcp2N g77-0.5.22/f/parse.c g77-0.5.23/f/parse.c *** g77-0.5.22/f/parse.c Thu Oct 26 21:19:47 1995 --- g77-0.5.23/f/parse.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* GNU Fortran Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* GNU Fortran Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 26,30 **** #include "com.h" #include "where.h" ! #include "zzz.h" #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "flags.j" --- 26,30 ---- #include "com.h" #include "where.h" ! #include "version.h" #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "flags.j" *************** yyparse () *** 48,55 **** if (ffe_is_version ()) ! fprintf (stderr, "GNU Fortran Front End version %s compiled: %s %s\n", ! ffezzz_version_string, ! ffezzz_date, ! ffezzz_time); #if FFECOM_targetCURRENT == FFECOM_targetFFE --- 48,52 ---- if (ffe_is_version ()) ! fprintf (stderr, "GNU Fortran Front End version %s\n", ffe_version_string); #if FFECOM_targetCURRENT == FFECOM_targetFFE diff -rcp2N g77-0.5.22/f/proj.c g77-0.5.23/f/proj.c *** g77-0.5.22/f/proj.c Wed Aug 30 19:53:35 1995 --- g77-0.5.23/f/proj.c Mon Apr 27 15:09:36 1998 *************** *** 1,5 **** /* proj.c file for GNU Fortran Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* proj.c file for GNU Fortran Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 24,28 **** #include "glimits.j" ! #if !FFEPROJ_STRTOUL unsigned long int strtoul (const char *nptr, char **endptr, int base) --- 24,30 ---- #include "glimits.j" ! /* Insert #define statements here. */ ! ! #ifdef NEED_STRTOUL unsigned long int strtoul (const char *nptr, char **endptr, int base) *************** strtoul (const char *nptr, char **endptr *** 30,33 **** --- 32,36 ---- unsigned long int number = 0; unsigned long int old_number = 0; + int issue_gratuitous_warning; /* So people know when they've pulled this in. */ assert (base == 10); *************** strtoul (const char *nptr, char **endptr *** 44,51 **** return number; } - #endif ! #if !FFEPROJ_BSEARCH void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, --- 47,53 ---- return number; } #endif ! #ifdef NEED_BSEARCH void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, *************** bsearch (const void *key, const void *ba *** 54,57 **** --- 56,60 ---- size_t i; int cmp; + int issue_gratuitous_warning; /* So people know when they've pulled this in. */ /* We do a dumb incremental search, not a binary search, for now. */ *************** bsearch (const void *key, const void *ba *** 68,71 **** return NULL; } - #endif --- 71,73 ---- diff -rcp2N g77-0.5.22/f/proj.h g77-0.5.23/f/proj.h *** g77-0.5.22/f/proj.h Thu Mar 12 23:52:38 1998 --- g77-0.5.23/f/proj.h Wed Apr 29 19:33:44 1998 *************** *** 1,5 **** /* proj.h file for Gnu Fortran Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* proj.h file for Gnu Fortran Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 37,74 **** #endif /* !defined (BUILT_WITH_270) */ - /* This file used to attempt to allow for all sorts of broken systems. - Because the auto-configuration scripts in conf-proj(.in) didn't work - on all systems, and I received far too many bug reports about them, - I decided to stop trying to cater to broken systems at all, and - simply remove all but the simplest and most useful code (which is - still in proj.c). - - So, if you find your system can't link because bsearch() or strtoul() - aren't found, please just fix your system, or hand-edit the code - below as appropriate. I DO NOT WANT ANY "BUG REPORTS" ABOUT THIS. - g77 requires a working ANSI C environment, and if bsearch() and strtoul() - do not exist, or if isn't found, etc., then you don't have - one, and it is not g77's fault. If it turns out g77 is simply - referring to the wrong system header file -- something I can verify - myself using my copy of the ANSI C standard -- I would like to know - about that. Otherwise, g77 is not the place to fix problems with your - ANSI C implementation, though perhaps gcc might be. - -- burley@gnu.ai.mit.edu 1995-03-24 */ - - #ifndef FFEPROJ_BSEARCH - #define FFEPROJ_BSEARCH 1 /* 0=>use slow code in proj.c. */ - #endif - #ifndef FFEPROJ_STRTOUL - #define FFEPROJ_STRTOUL 1 /* 0=>use untested code in proj.c. */ - #endif - /* Include files everyone gets. */ #include "config.j" /* Must come before any other #includes in gcc. */ #include "assert.j" /* Use gcc's assert.h. */ #include #include #include #include /* Generally useful definitions. */ --- 37,84 ---- #endif /* !defined (BUILT_WITH_270) */ /* Include files everyone gets. */ #include "config.j" /* Must come before any other #includes in gcc. */ #include "assert.j" /* Use gcc's assert.h. */ + #include #include + + #if HAVE_STDDEF_H #include + #endif + #include + + #if HAVE_STRING_H #include + #else + #if HAVE_STRINGS_H + #include + #endif + #endif + + #if NEED_DECLARATION_MALLOC + extern void *malloc (size_t); + #endif + + #if NEED_DECLARATION_REALLOC + extern void *realloc (void *, size_t); + #endif + + #if NEED_DECLARATION_CALLOC + extern void *calloc (size_t, size_t); + #endif + + #if NEED_DECLARATION_INDEX + extern char *index (char *, int); + #endif + + #if NEED_DECLARATION_RINDEX + extern char *rindex (char *, int); + #endif + + #if NEED_DECLARATION_GETENV + extern char *getenv (char *); + #endif /* Generally useful definitions. */ diff -rcp2N g77-0.5.22/f/rtl.j g77-0.5.23/f/rtl.j *** g77-0.5.22/f/rtl.j Wed Aug 30 19:53:35 1995 --- g77-0.5.23/f/rtl.j Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* rtl.j -- Wrapper for GCC's rtl.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* rtl.j -- Wrapper for GCC's rtl.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/runtime/ChangeLog g77-0.5.23/f/runtime/ChangeLog *** g77-0.5.22/f/runtime/ChangeLog Sat Feb 28 20:32:29 1998 --- g77-0.5.23/f/runtime/ChangeLog Wed May 20 15:18:04 1998 *************** *** 1,2 **** --- 1,118 ---- + 1998-05-20 Dave Love + + * Makefile.in (all .PHONY): Remove obsolete lib[ifu]77 targets. + ($(LIBG2C)): Use shell loop instead of unportable make variable + substitution. + + Tue May 19 12:50:27 1998 Craig Burley + + Break up main() into separate .o's so making and + linking against shared libraries with non-Fortran + main() routines is easier: + * Makefile.in (MISC): Add setarg.o and setsig.o. + * libF77/Makefile.in (MISC): Ditto. + * libF77/setarg.c: New file, contains f_setarg(). + * libF77/setsig.c: New file, contains f_setsig(). + * libF77/getarg_.c: Rename xarg* to f__xarg*. + * libF77/iargc_.c: Ditto + + Sun May 3 00:21:21 1998 Craig Burley + + * libI77/Makefile.in (.c.o): Remove -DUIOLEN_int, + as it turns out compatibility is best provided + without it; besides, users of 64-bit systems expect + to be able to write really large records. + + * libU77/dbes.c: Comment out #include's as well. + + Sat May 2 16:44:46 1998 Craig Burley + + * libF77/signal_.c, libI77/dfe.c, libI77/due.c, + libI77/wsfe.c: Tweaks to eliminate unnecessary + differences vs. netlib libf2c. + + Sat May 2 08:31:45 1998 Craig Burley + + * libI77/open.c (f_open): Remove errant line left + over from merging latest netlib libf2c. + + Fri May 1 11:57:45 1998 Craig Burley + + * libI77/Makefile.in (.c.o): Add -DUIOLEN_int, + so unformatted files on 64-bit systems still have + 32-bit record-size fields (for compatibility). + + Update to Netlib version of 1998-04-20: + * libF77/dtime_.c, libF77/etime_.c, libF77/h_dnnt.c, + libF77/h_nint.c, libF77/i_dnnt.c, libF77/i_nint.c, + libF77/main.c, libF77/s_paus.c, libF77/signal1.h0, + libI77/backspace.c, libI77/close.c, libI77/dfe.c, + libI77/endfile.c, libI77/err.c, libI77/fio.h, + libI77/iio.c, libI77/ilnw.c, libI77/lread.c, + libI77/lwrite.c, libI77/open.c, libI77/rawio.h, + libI77/sfe.c, libI77/util.c, libI77/wrtfmt.c, + libI77/wsfe.c, libI77/wsle.c, libI77/wsne.c: + See changes.netlib for info. + + Mon Apr 27 22:52:31 1998 Richard Henderson + + * libU77/ltime_.c: Bounce the ftnint argument through a local time_t. + * libU77/gmtime_.c: Likewise. + + Sun Apr 26 09:13:41 1998 Craig Burley + + * Makefile.in, libF77/Makefile.in, libI77/Makefile.in, + libU77/Makefile.in: Rewrite config and var assignment + sections to be even more minimal than before, and to + more clearly documented what macros are expected to be + set and to what sorts of values. Eliminate CROSS and + related stuff, since there's no such things as CROSS + in gcc 2.8. Rename GCC_FOR_TARGET to CC throughout. + * Makefile.in (stamp-libi77, stamp-libf77, stamp-libu77): + Eliminate CROSS. + * configure.in: Eliminate CROSS. + (none): New target to trap possibility of overly long + command line being truncated. + + * libU77/hostnm_.c (G77_hostnm_0): Fix off-by-one error + that was trashing the byte just beyond the CHARACTER*(*) + argument. + + Mon Apr 20 16:21:37 1998 Craig Burley + + Rename libf2c.a and f2c.h to libg2c.a and g2c.h, + normalize and simplify g77/libg2c build process: + * Makefile.in: Remove all stuff pertaining to + installation, cleaning, and so on. Parent Makefile + does all that now. Accept and pass F2C_H_DIR, + G2C_H_DIR, and GCC_H_DIR, the pathnames for the + directories containing f2c.h, g2c.h, and other + #include files, to subdirectory Makefiles. + (stamp-libf77, stamp-libi77, stamp-libu77): + Don't specify `-f Makefile' anymore, it's not needed + now that subdirectory makefile's from netlib are + renamed to makefile.netlib in g77 source (and to + makefile.ori by configuration process, in case they're + still around somehow). + (stamp-libe77): Don't make libE77 dir unless it doesn't + exist, if it does just delete all objects in it. + Compile using $(GCC_FOR_TARGET), not $(CC). + (rebuilt): Remove this and all subordinate targets, + as parent Makefile now handles all that. + (*clean): Remove. + * configure.in (Pad_UDread, ALWAYS_FLUSH, WANT_LEAD_0): + Remove these and commentary to new f2c.h file. + AC_OUTPUT g2c.h instead of f2c.h. Remove old commentary + regarding concatenation. + * g2c.h.in: Rename from f2c.h.in, add appropriate + commentary. + * f2c.h: New file, a wrapper for g2c.h that does + libg2c-specific stuff. + * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: + Change $(ALL_CFLAGS) to use F2C_H_DIR, G2C_H_DIR, and GCC_H_DIR + macros. Remove F2C_H macro, replace use with explicit + dependencies on f2c.h and g2c.h. + (*clean): Remove. + Sat Feb 28 15:32:15 1998 Craig Burley *************** Sat Feb 28 15:32:15 1998 Craig Burley *** 4,7 **** --- 120,176 ---- 256, for the usual reasons. + 1998-02-17 Dave Love + + * libU77/u77-test.f: Tweak some o/p. + + * libU77/Makefile.in (check): Use -L for new directory structure. + + * Makefile.in (check): Run the u77 check. + (config.status, Makefile): New targets. + + Wed Feb 11 01:46:20 1998 Manfred Hollstein + + * Makefile.in ($(lib)): Call $(AR) repeatedly to avoid overflowing + argument size limit on ancious System V. + + Sun Feb 1 01:42:47 1998 Mumit Khan + + * libU77/configure.in (getlogin,getgid,getuid, kill,link,ttyname): + Check. + * libU77/config.h.in (HAVE_GETLOGIN, HAVE_GETGID, HAVE_GETUID, + HAVE_KILL, HAVE_LINK, HAVE_TTYNAME): New defs. + * libU77/getlog_.c: Conditionalize for target platform. Set errno + to ENOSYS if target libc doesn't have the function. + * libU77/getgid_.c: Likewise. + * libU77/getuid_.c: Likewise. + * libU77/kill_.c: Likewise. + * libU77/link_.c: Likewise. + * libU77/ttynam_.c: Likewise. + + Sun Jan 18 20:01:37 1998 Toon Moene + + * libI77/backspace.c: (f_back): Use type `uiolen' to determine size + of record length specifier. + + Sat Jan 17 22:40:31 1998 Mumit Khan + + * libU77/configure.in (sys/param.h,sys/times.h): Check. + (times,alarm): Likewise. + * libU77/config.h.in (HAVE_SYS_PARAM_H, HAVE_SYS_TIMES_H, + HAVE_ALARM, HAVE_TIMES): New defs. + * libU77/alarm_.c: Conditionalize for target platform. Set errno + to ENOSYS if target libc doesn't have the function. + * libU77/dtime_.c: Likewise. + * libU77/etime_.c: Likewise. + * libU77/sys_clock_.c: Likewise. + + * configure.in (NON_UNIX_STDIO): Define if MINGW32. + (NON_ANSI_RW_MODE): Do not define for CYGWIN32 or MINGW32. + + * libI77/rawio.h: Don't providing conflicting declarations for + read() and write(). MINGW32 header files use "const" quals. + + * libF77/s_paus.c: _WIN32 does not have pause(). + Tue Dec 23 22:56:01 1997 Craig Burley *************** Wed Oct 15 10:06:29 1997 Richard Hender *** 26,29 **** --- 195,220 ---- * libU77/chmod_.c: Likewise. + Tue Oct 7 18:22:10 1997 Richard Henderson + + * Makefile.in (CGFLAGS): Don't force -g0. + * libF77/Makefile.in, libI77/Makefile.in, libU77/Makefile.in: Likewise. + + Wed Oct 1 01:46:16 1997 Philippe De Muyter + + * libU77/sys_clock_.c: File renamed from system_clock_.c. + * libU77/Makefile.in, Makefile.in : Reference sys_clock_.*, not + system_clock_.*. + * libU77/dtime_.c (clk_tck): Try also HZ macro. + * libU77/access.c (G77_access_0): Check malloc return value against 0, + not NULL. + * libU77/getlog_.c, libU77/ttynam_.c, libU77/chdir_.c: Ditto. + * libU77/chmod_.c, libU77/rename_.c: Ditto. + + 1997-10-03 Dave Love + + * configure.in: Check for tempnam (best because it obeys TMPDIR). + * libI77/open.c: Use it. + * libI77/err.c: New message # 132. + Tue Sep 30 00:41:39 1997 Craig Burley *************** Mon Sep 8 19:39:01 1997 Craig Burley *** 67,70 **** --- 258,270 ---- open units again. + Fri Sep 5 00:18:17 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (clean): Don't remove config.cache. + (distclean): Do it here instead. + + Tue Aug 26 20:14:08 1997 Robert Lipe (robertl@dgii.com) + + * libU77/hostnm_.c: Include errno.h + Tue Aug 26 01:42:21 1997 Craig Burley *************** Tue Aug 26 01:25:58 1997 Craig Burley *** 83,86 **** --- 283,294 ---- Still remove the objects (and libE77 directory) afterward. + Mon Aug 25 23:26:05 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * Makefile.in (mostlyclean, clean): Check if Makefile exists + before using it. Remove stamp-*. + (stamp-libi77, stamp-libf77, stamp-libu77): New. + (stamp-lib): Only depend on stamp-libi77 stamp-libf77 + stamp-libu77 + Sun Aug 24 05:04:35 1997 Craig Burley *************** Wed Feb 5 00:21:23 1997 Craig Burley *** 470,474 **** compiler-level stuff handle all that. ! * err.c [MISSING_FILE_ELEMS]: Declare malloc in this case too, so it doesn't end up as an integer. --- 678,682 ---- compiler-level stuff handle all that. ! * libI77/err.c [MISSING_FILE_ELEMS]: Declare malloc in this case too, so it doesn't end up as an integer. *************** Thu Oct 31 22:27:45 1996 Craig Burley *** 548,557 **** * libI77/Version.c: Use , not "stdio.h". * libF77/Version.c: Likewise. - - 1997-10-03 Dave Love - - * configure.in: Check for tempnam (best because it obeys TMPDIR). - * libI77/open.c: Use it. - * libI77/err.c: New message # 132. Wed Aug 28 13:25:29 1996 Dave Love --- 756,759 ---- diff -rcp2N g77-0.5.22/f/runtime/Makefile.in g77-0.5.23/f/runtime/Makefile.in *** g77-0.5.22/f/runtime/Makefile.in Tue Sep 2 21:25:48 1997 --- g77-0.5.23/f/runtime/Makefile.in Wed May 20 15:17:55 1998 *************** *** 21,24 **** --- 21,28 ---- #### Start of system configuration section. #### + # Note that this configuration takes place not when gcc/g77 are + # configured; rather, when g77 is built, it configures this + # runtime stuff. That means configuration happens for each + # stage of a bootstrap build, for example. # $(srcdir) must be set to the g77 runtime source directory *************** srcdir = @srcdir@ *** 28,74 **** VPATH = @srcdir@ ! top_srcdir = @top_srcdir@ ! ! INSTALL = @INSTALL@ # installs aren't actually done from here ! INSTALL_PROGRAM = @INSTALL_PROGRAM@ ! INSTALL_DATA = @INSTALL_DATA@ ! RANLIB = @RANLIB@ ! RANLIB_TEST = @RANLIB_TEST@ ! ! CFLAGS = @CFLAGS@ ! CPPFLAGS = @CPPFLAGS@ @DEFS@ ! LDFLAGS = @LDFLAGS@ ! LIBS = @LIBS@ ! CGFLAGS = -g0 ! ! GCC_FOR_TARGET = @CC@ ! CC = $(GCC_FOR_TARGET) ! ! CROSS = @CROSS@ ! ! objext = .o ! ! transform=@program_transform_name@ ! ! prefix = @prefix@ ! exec_prefix = @exec_prefix@ ! ! AR = ar ! AR_FLAGS = rc ! ! # Directory in which to install scripts. ! bindir = $(exec_prefix)/bin ! ! # Directory in which to install library files. ! libdir = $(prefix)/lib ! ! # Directory in which to install documentation info files. ! infodir = $(prefix)/info #### End of system configuration section. #### ! SHELL = /bin/sh ! ! lib = ../../libf2c.a SUBDIRS = libI77 libF77 libU77 --- 32,54 ---- VPATH = @srcdir@ ! # gcc/f/runtime/configure sets this to all the -D options appropriate ! # for the configuration. ! DEFS = @DEFS@ #### End of system configuration section. #### ! # Must be passed in explicitly. Sample values are shown below. ! #AR = ar ! #AR_FLAGS = rc ! #CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ ! #CFLAGS = -O -g ! #CPPFLAGS = # NOTE! `-I./include' in here doesn't work, hence GCC_H_DIR. ! #F2C_H_DIR = /gcc-source-dir/f/runtime ! #G2C_H_DIR = /gcc-build-dir/f/runtime ! #GCC_H_DIR = /gcc-build-dir/include ! #LIBG2C = /gcc-build-dir/libg2c.a ! #RANLIB = /usr/bin/ranlib ! #RANLIB_TEST = true ! #SHELL = /bin/sh SUBDIRS = libI77 libF77 libU77 *************** MISC = libF77/F77_aloc.o libF77/VersionF *** 78,82 **** libF77/signal_.o libF77/s_stop.o libF77/s_paus.o libF77/system_.o \ libF77/cabs.o libF77/derf_.o libF77/derfc_.o libF77/erf_.o \ ! libF77/erfc_.o libF77/sig_die.o libF77/exit_.o POW = libF77/pow_ci.o libF77/pow_dd.o libF77/pow_di.o libF77/pow_hh.o \ libF77/pow_ii.o libF77/pow_ri.o libF77/pow_zi.o libF77/pow_zz.o \ --- 58,63 ---- libF77/signal_.o libF77/s_stop.o libF77/s_paus.o libF77/system_.o \ libF77/cabs.o libF77/derf_.o libF77/derfc_.o libF77/erf_.o \ ! libF77/erfc_.o libF77/sig_die.o libF77/exit_.o \ ! libF77/setarg.o libF77/setsig.o POW = libF77/pow_ci.o libF77/pow_dd.o libF77/pow_di.o libF77/pow_hh.o \ libF77/pow_ii.o libF77/pow_ri.o libF77/pow_zi.o libF77/pow_zz.o \ *************** UOBJ = libU77/VersionU.o libU77/gerror_ *** 132,136 **** libU77/bes.o libU77/dbes.o libU77/chdir_.o libU77/chmod_.o \ libU77/lnblnk_.o libU77/hostnm_.o libU77/rename_.o libU77/fgetc_.o \ ! libU77/fputc_.o libU77/umask_.o libU77/system_clock_.o libU77/date_.o \ libU77/second_.o libU77/flush1_.o libU77/alarm_.o libU77/mclock_.o \ libU77/symlnk_.o --- 113,117 ---- libU77/bes.o libU77/dbes.o libU77/chdir_.o libU77/chmod_.o \ libU77/lnblnk_.o libU77/hostnm_.o libU77/rename_.o libU77/fgetc_.o \ ! libU77/fputc_.o libU77/umask_.o libU77/sys_clock_.o libU77/date_.o \ libU77/second_.o libU77/flush1_.o libU77/alarm_.o libU77/mclock_.o \ libU77/symlnk_.o *************** F2CEXT = abort derf derfc ef1asc ef1cmc *** 145,253 **** vxtidt vxttim alarm ! # flags_to_pass to recursive makes & configure (hence the quoting style) FLAGS_TO_PASS = \ ! CROSS="$(CROSS)" \ ! AR_FLAGS="$(AR_FLAGS)" \ ! AR="$(AR)" \ ! GCCFLAGS="$(GCCFLAGS)" \ ! GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ ! CC="$(GCC_FOR_TARGET)" \ ! LDFLAGS="$(LDFLAGS)" \ ! RANLIB="$(RANLIB)" \ ! RANLIB_TEST="$(RANLIB_TEST)" \ ! SHELL="$(SHELL)" ! ! CROSS_FLAGS_TO_PASS = \ ! CROSS="$(CROSS)" \ ! AR_FLAGS="$(AR_FLAGS)" \ ! AR="$(AR)" \ ! GCCFLAGS="$(GCCFLAGS)" \ ! GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ ! CC="$(GCC_FOR_TARGET)" \ ! LDFLAGS="$(LDFLAGS)" \ ! RANLIB="$(RANLIB)" \ ! RANLIB_TEST="$(RANLIB_TEST)" \ ! SHELL="$(SHELL)" ! ! all: ../../include/f2c.h libi77 libf77 libu77 $(lib) ! ! $(lib): stamp-lib ; @true ! stamp-lib: $(FOBJ) $(IOBJ) $(UOBJ) ! rm -f stamp-lib ! $(AR) $(AR_FLAGS) $(lib) $? ! rm -fr libE77 ! mkdir libE77 for name in $(F2CEXT); \ do \ echo $${name}; \ ! $(GCC_FOR_TARGET) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(CFLAGS) $(CGFLAGS) \ ! -DL$${name} $(srcdir)/f2cext.c -o libE77/L$${name}$(objext); \ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ done ! $(AR) $(AR_FLAGS) $(lib) libE77/*$(object) ! rm -fr libE77 ! if $(RANLIB_TEST); then $(RANLIB) $(lib); \ ! else true; fi ! touch stamp-lib ! ! libi77: libI77/Makefile ! if test "$(CROSS)"; then \ ! cd libI77; $(MAKE) -f Makefile $(CROSS_FLAGS_TO_PASS) all ; \ ! else \ ! cd libI77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all ; \ ! fi ! ! libf77: libF77/Makefile ! if test "$(CROSS)"; then \ ! cd libF77; $(MAKE) -f Makefile $(CROSS_FLAGS_TO_PASS) all ; \ ! else \ ! cd libF77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all ; \ ! fi ! ! libu77: libU77/Makefile ! if test "$(CROSS)"; then \ ! cd libU77; $(MAKE) -f Makefile $(CROSS_FLAGS_TO_PASS) all ; \ ! else \ ! cd libU77; $(MAKE) -f Makefile $(FLAGS_TO_PASS) all ; \ ! fi ! ! ${srcdir}/configure: ${srcdir}/configure.in ! rm -f config.cache && cd ${srcdir} && autoconf && rm -f config.cache ! ${srcdir}/libU77/configure: ${srcdir}/libU77/configure.in ! rm -f libU77/config.cache && cd ${srcdir}/libU77 && autoconf && rm -f config.cache ! #../include/f2c.h libI77/Makefile libF77/Makefile libU77/Makefile Makefile: ${srcdir}/Makefile.in \ ! # config.status libU77/config.status ! # $(FLAGS_TO_PASS) CONFIG_SITE=/dev/null $(SHELL) config.status ! # cd libU77; $(FLAGS_TO_PASS) CONFIG_SITE=/dev/null $(SHELL) config.status ! ! # Extra dependencies for the targets above: ! libI77/Makefile: $(srcdir)/libI77/Makefile.in ! libF77/Makefile: $(srcdir)/libF77/Makefile.in ! libU77/Makefile: $(srcdir)/libU77/Makefile.in ! ../../include/f2c.h: $(srcdir)/f2c.h.in ! ! #config.status: ${srcdir}/configure ! # $(FLAGS_TO_PASS) CONFIG_SITE=/dev/null $(SHELL) config.status --recheck ! #libU77/config.status: ${srcdir}/libU77/configure ! # cd libU77; $(FLAGS_TO_PASS) CONFIG_SITE=/dev/null $(SHELL) config.status --recheck ! ! mostlyclean: ! for i in libI77 libF77 libU77; do cd $$i; $(MAKE) -f Makefile mostlyclean; cd ..; done ! ! clean: ! -rm -f config.log config.cache ! for i in libI77 libF77 libU77; do cd $$i; $(MAKE) -f Makefile clean; cd ..; done ! ! distclean: clean ! -rm -f Makefile lib?77/Makefile config.status libU77/config.status ../../include/f2c.h ! ! maintainer-clean: distclean ! -rm -f $(srcdir)/configure $(srcdir)/libU77/configure ! uninstall: ! rm ../../include/f2c.h ! rebuilt: ${srcdir}/configure ${srcdir}/libU77/configure ! .PHONY: libf77 libi77 libu77 rebuilt mostlyclean clean distclean maintainer-clean \ ! uninstall all --- 126,196 ---- vxtidt vxttim alarm ! # Flags to pass to sub-directory recursive makes. FLAGS_TO_PASS = \ ! CC="$(CC)" \ ! CFLAGS="$(CFLAGS)" \ ! CPPFLAGS="$(CPPFLAGS)" \ ! F2C_H_DIR="$(F2C_H_DIR)" \ ! G2C_H_DIR="$(G2C_H_DIR)" \ ! GCC_H_DIR="$(GCC_H_DIR)" ! ! # In case the invoking command line is too long, default to `none' rule ! # (since `all' is the last item), to diagnose problems with overly long ! # command lines. (I'm not sure this ever happened, but it could have ! # explained one of the reported bugs in g77-0.5.23-19980420.) ! none: ! @echo "" ! @echo "This system doesn't properly support long command lines." ! @echo "(That's assuming you're doing a normal g77 build now.)" ! @echo "Submit appropriate bug report according to g77 docs." ! @echo "" ! exit 1 ! ! all: g2c.h $(LIBG2C) ! ! $(LIBG2C): stamp-libf77 stamp-libi77 stamp-libu77 stamp-libe77 ! rm -f $(LIBG2C) ! $(AR) $(AR_FLAGS) $(LIBG2C) $(FOBJ) ! $(AR) $(AR_FLAGS) $(LIBG2C) $(IOBJ) ! $(AR) $(AR_FLAGS) $(LIBG2C) $(UOBJ) ! objs=""; for i in $(F2CEXT); do objs="$$objs libE77/L$$i.o"; done; \ ! $(AR) $(AR_FLAGS) $(LIBG2C) $$objs ! if $(RANLIB_TEST); then $(RANLIB) $(LIBG2C); \ ! else true; fi ! ! stamp-libi77: libI77/Makefile ! rm -f stamp-libi77 ! cd libI77; $(MAKE) $(FLAGS_TO_PASS) all ! touch stamp-libi77 ! ! stamp-libf77: libF77/Makefile ! rm -f stamp-libf77 ! cd libF77; $(MAKE) $(FLAGS_TO_PASS) all ! touch stamp-libf77 ! ! stamp-libu77: libU77/Makefile ! rm -f stamp-libu77 ! cd libU77; $(MAKE) $(FLAGS_TO_PASS) all ! touch stamp-libu77 ! ! stamp-libe77: $(srcdir)/f2cext.c ! if [ -d libE77 ]; then rm -f libE77/*.o; else mkdir libE77; fi for name in $(F2CEXT); \ do \ echo $${name}; \ ! $(CC) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) \ ! -DL$${name} $(srcdir)/f2cext.c \ ! -o libE77/L$${name}.o; \ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ done ! touch stamp-libe77 ! g2c.h Makefile: $(srcdir)/g2c.h.in $(srcdir)/Makefile.in config.status ! $(SHELL) config.status ! config.status: $(srcdir)/configure ! $(SHELL) config.status --recheck ! check: ! cd libU77; $(MAKE) check ! .PHONY: all check diff -rcp2N g77-0.5.22/f/runtime/README g77-0.5.23/f/runtime/README *** g77-0.5.22/f/runtime/README Tue Aug 12 02:08:47 1997 --- g77-0.5.23/f/runtime/README Tue Apr 21 01:15:43 1998 *************** *** 1,7 **** ! 970811 This directory contains the f2c library packaged for use with g77 to configure and build automatically (in principle!) as part of the top-level configure and make steps. This depends on the makefile and configure fragments in ../f. Some small changes have been made to the f2c distributions of lib[FI]77 which --- 1,9 ---- ! 1998-04-20 This directory contains the f2c library packaged for use with g77 to configure and build automatically (in principle!) as part of the top-level configure and make steps. This depends on the makefile and configure fragments in ../f. + g77 names this library `libg2c' to avoid conflict with existing copies + of `libf2c' on a system. Some small changes have been made to the f2c distributions of lib[FI]77 which *************** configure and build libf2c in g77's dist *** 27,31 **** The packaging for auto-configuration was done by Dave Love . ! Minor changes have been made by James Craig Burley , who probably broke things Dave had working. :-) --- 29,33 ---- The packaging for auto-configuration was done by Dave Love . ! Minor changes have been made by James Craig Burley , who probably broke things Dave had working. :-) diff -rcp2N g77-0.5.22/f/runtime/changes.netlib g77-0.5.23/f/runtime/changes.netlib *** g77-0.5.22/f/runtime/changes.netlib Mon Sep 29 20:23:51 1997 --- g77-0.5.23/f/runtime/changes.netlib Fri May 1 14:48:42 1998 *************** invisible on other machines. *** 2849,2850 **** --- 2849,2904 ---- Sun Sep 21 22:05:19 EDT 1997 libf77: [de]time_.c (Unix systems only): change return type to double. + + Thu Dec 4 22:10:09 EST 1997 + Fix bug with handling large blocks of comments (over 4k); parts of the + second and subsequent blocks were likely to be lost (not copied into + comments in the resulting C). Allow comment lines to be longer before + breaking them. + + Mon Jan 19 17:19:27 EST 1998 + makefile: change the rule for making gram.c to one for making gram1.c; + henceforth, asking netlib to "send all from f2c/src" will bring you a + working gram.c. Nowadays there are simply too many broken versions of + yacc floating around. + libi77: backspace.c: for b->ufmt==0, change sizeof(int) to + sizeof(uiolen). On machines where this would make a difference, it is + best for portability to compile libI77 with -DUIOLEN_int, which will + render the change invisible. + + Tue Feb 24 08:35:33 EST 1998 + makefile: remove gram.c from the "make clean" rule. + + Wed Feb 25 08:29:39 EST 1998 + makefile: change CFLAGS assignment to -O; add "veryclean" rule. + + Wed Mar 4 13:13:21 EST 1998 + libi77: open.c: fix glitch in comparing file names under + -DNON_UNIX_STDIO. + + Mon Mar 9 23:56:56 EST 1998 + putpcc.c: omit an unnecessary temporary variable in computing + (expr)**3. + libf77, libi77: minor tweaks to make some C++ compilers happy; + Version.c not changed. + + Wed Mar 18 18:08:47 EST 1998 + libf77: minor tweaks to [ed]time_.c; Version.c not changed. + libi77: endfile.c, open.c: acquire temporary files from tmpfile(), + unless compiled with -DNON_ANSI_STDIO, which uses mktemp(). + New buffering scheme independent of NON_UNIX_STDIO for handling T + format items. Now -DNON_UNIX_STDIO is no longer be necessary for + Linux, and libf2c no longer causes stderr to be buffered -- the former + setbuf or setvbuf call for stderr was to make T format items work. + open.c: use the Posix access() function to check existence or + nonexistence of files, except under -DNON_POSIX_STDIO, where trial + fopen calls are used. In open.c, fix botch in changes of 19980304. + libf2c.zip: the PC makefiles are now set for NT/W95, with comments + about changes for DOS. + + Fri Apr 3 17:22:12 EST 1998 + Adjust fix of 19960913 to again permit substring notation on + character variables in data statements. + + Sun Apr 5 19:26:50 EDT 1998 + libi77: wsfe.c: make $ format item work: this was lost in the changes + of 17 March 1998. diff -rcp2N g77-0.5.22/f/runtime/configure.in g77-0.5.23/f/runtime/configure.in *** g77-0.5.22/f/runtime/configure.in Sat Feb 28 20:27:30 1998 --- g77-0.5.23/f/runtime/configure.in Sat Apr 25 16:22:19 1998 *************** AC_INIT(libF77/Version.c) *** 24,43 **** AC_REVISION(1.10) ! dnl AC_C_CROSS ! dnl Gives misleading `(cached)' message from the check. ! if test "$CROSS";then ! if test "$CC_FOR_TARGET"; then ! CC="$CC_FOR_TARGET" ! else ! CC="../../xgcc -B../../xgcc/" ! fi ! ac_cv_c_cross=yes ! else ! dnl Checks for programs. ! # For g77 we'll set CC to point at the built gcc, but this will get it into ! # the makefiles ! AC_PROG_CC ! ac_cv_c_cross=no ! fi dnl These should be inherited in the recursive make, but ensure they are --- 24,31 ---- AC_REVISION(1.10) ! dnl Checks for programs. ! # For g77 we'll set CC to point at the built gcc, but this will get it into ! # the makefiles ! AC_PROG_CC dnl These should be inherited in the recursive make, but ensure they are *************** AC_CACHE_VAL(g77_cv_sys_cygwin32, *** 124,127 **** --- 112,128 ---- AC_MSG_RESULT($g77_cv_sys_cygwin32) + # ditto for mingw32. + AC_MSG_CHECKING([for mingw32]) + AC_CACHE_VAL(g77_cv_sys_mingw32, + AC_EGREP_CPP(yes, + [#ifdef __MINGW32__ + yes + #endif + ], + g77_cv_sys_mingw32=yes, + g77_cv_sys_mingw32=no)) + AC_MSG_RESULT($g77_cv_sys_mingw32) + + AC_CHECK_HEADER(fcntl.h, test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE), *************** fi *** 147,154 **** # This should always succeed on unix. # Apparently positive result on cygwin loses re. NON_UNIX_STDIO ! # (as of cygwin b18). AC_CHECK_FUNC(fstat) AC_MSG_CHECKING([need for NON_UNIX_STDIO]) ! if test $g77_cv_sys_cygwin32 = yes || test $ac_cv_func_fstat = no; then AC_MSG_RESULT(yes) AC_DEFINE(NON_UNIX_STDIO) --- 148,157 ---- # This should always succeed on unix. # Apparently positive result on cygwin loses re. NON_UNIX_STDIO ! # (as of cygwin b18). Likewise on mingw. AC_CHECK_FUNC(fstat) AC_MSG_CHECKING([need for NON_UNIX_STDIO]) ! if test $g77_cv_sys_cygwin32 = yes \ ! || test $g77_cv_sys_mingw32 = yes \ ! || test $ac_cv_func_fstat = no; then AC_MSG_RESULT(yes) AC_DEFINE(NON_UNIX_STDIO) *************** AC_CACHE_VAL(g77_cv_sys_sprintf_ansi, *** 199,207 **** g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi) dnl We get a misleading `(cached)' message... ! if test $ac_cv_c_cross = no; then ! AC_MSG_RESULT($g77_cv_sys_sprintf_ansi) ! else ! AC_MSG_RESULT([can't tell -- assuming no]) ! fi # The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't # understand why. --- 202,207 ---- g77_cv_sys_sprintf_ansi=$g77_cv_sys_sprintf_ansi) dnl We get a misleading `(cached)' message... ! AC_MSG_RESULT($g77_cv_sys_sprintf_ansi) ! # The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't # understand why. *************** AC_EGREP_CPP(yes, *** 223,227 **** #endif ], is_unix=yes, is_unix=no) ! if test $g77_cv_sys_cygwin32 = yes; then AC_MSG_RESULT(no) else --- 223,227 ---- #endif ], is_unix=yes, is_unix=no) ! if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then AC_MSG_RESULT(no) else *************** AC_SUBST(F2C_LONGINT) *** 323,329 **** dnl maybe check for drem/remainder - AC_SUBST(CROSS) - - # This EOF_CHAR is a misfeature on unix. AC_DEFINE(NO_EOF_CHAR_CHECK) --- 323,326 ---- *************** AC_DEFINE(NO_EOF_CHAR_CHECK) *** 331,364 **** AC_DEFINE(Skip_f2c_Undefs) - dnl Craig had these in f2c.h, but they're only relevant for building libf2c - dnl anyway. - - dnl For GNU Fortran (g77), we always enable the following behaviors for - dnl libf2c, to make things easy on the programmer. The alternate - dnl behaviors have their uses, and g77 might provide them as compiler, - dnl rather than library, options, so only a single copy of a shared libf2c - dnl need be built for a system. - - dnl This makes unformatted I/O more consistent in relation to other - dnl systems. It is not required by the F77 standard. - - AC_DEFINE(Pad_UDread) - - dnl This makes ERR= and IOSTAT= returns work properly in disk-full - dnl situations, making things work more as expected. It slows things - dnl down, so g77 will probably someday choose the original implementation - dnl on a case-by-case basis when it can be shown to not be necessary - dnl (e.g. no ERR= or IOSTAT=) or when it is given the appropriate - dnl compile-time option or, perhaps, source-code directive. - - dnl AC_DEFINE(ALWAYS_FLUSH) - - dnl Most Fortran implementations do this, so to make it easier - dnl to compare the output of g77-compiled programs to those compiled - dnl by most other compilers, tell libf2c to put leading zeros in - dnl appropriate places on output - - AC_DEFINE(WANT_LEAD_0) - # avoid confusion in case the `makefile's from the f2c distribution have # got put here --- 328,331 ---- *************** test -f libI77/makefile && mv libI77/mak *** 367,375 **** test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori ! AC_OUTPUT(Makefile ../../include/f2c.h:f2c.h.in libI77/Makefile libF77/Makefile libU77/Makefile) dnl We might have configuration options to: - dnl * allow non-standard string concatenation (use libF77 s_catow.o, - dnl not s_cat.o) dnl * change unit preconnexion in libI77/err.c (f_init.c) dnl * -DALWAYS_FLUSH in libI77 --- 334,341 ---- test -f libU77/makefile && mv libU77/makefile libU77/makefile.ori ! AC_CONFIG_SUBDIRS(libU77) ! AC_OUTPUT(Makefile g2c.h libI77/Makefile libF77/Makefile) dnl We might have configuration options to: dnl * change unit preconnexion in libI77/err.c (f_init.c) dnl * -DALWAYS_FLUSH in libI77 diff -rcp2N g77-0.5.22/f/runtime/f2c.h g77-0.5.23/f/runtime/f2c.h *** g77-0.5.22/f/runtime/f2c.h Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/runtime/f2c.h Sun Apr 19 21:43:32 1998 *************** *** 0 **** --- 1,64 ---- + /* f2c.h file for GNU Fortran run-time library + Copyright (C) 1998 Free Software Foundation, Inc. + Contributed by James Craig Burley (burley@gnu.org). + + This file is part of GNU Fortran. + + GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + /* This file currently is just a stub through which g77's copy + of netlib's libf2c, which g77 builds and installs as libg2c.a + (to avoid conflict), #include's g77's version of f2c.h, named + g2c.h. That file is, in turn, produced via g77's library + configuration process from g2c.h.in. + + By going through this extra "hoop", it is easy to provide for + libg2c-specific configuration and typedefs that aren't appropriate + in g2c.h itself (since that is intended to be installed so it can + be shared with f2c users), without changing the libf2c (libg2c) + routines themselves. (They continue to #include "f2c.h", just + like they do in netlib's version.) */ + + #include "g2c.h" + + /* For GNU Fortran (g77), we always enable the following behaviors for + libf2c, to make things easy on the programmer. The alternate + behaviors have their uses, and g77 might provide them as compiler, + rather than library, options, so only a single copy of a shared libf2c + need be built for a system. */ + + /* This makes unformatted I/O more consistent in relation to other + systems. It is not required by the F77 standard. */ + + #define Pad_UDread + + /* This makes ERR= and IOSTAT= returns work properly in disk-full + situations, making things work more as expected. It slows things + down, so g77 will probably someday choose the original implementation + on a case-by-case basis when it can be shown to not be necessary + (e.g. no ERR= or IOSTAT=) or when it is given the appropriate + compile-time option or, perhaps, source-code directive. + + (No longer defined, since it really slows down NFS access too much.) */ + + /* #define ALWAYS_FLUSH */ + + /* Most Fortran implementations do this, so to make it easier + to compare the output of g77-compiled programs to those compiled + by most other compilers, tell libf2c to put leading zeros in + appropriate places on output. */ + + #define WANT_LEAD_0 diff -rcp2N g77-0.5.22/f/runtime/f2c.h.in g77-0.5.23/f/runtime/f2c.h.in *** g77-0.5.22/f/runtime/f2c.h.in Sat Feb 8 07:31:02 1997 --- g77-0.5.23/f/runtime/f2c.h.in Thu Jan 1 00:00:00 1970 *************** *** 1,227 **** - /* f2c.h -- Standard Fortran to C header file */ - - /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - - - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ - - #ifndef F2C_INCLUDE - #define F2C_INCLUDE - - /* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ - /* we assume short, float are OK */ - typedef @F2C_INTEGER@ /* long int */ integer; - typedef unsigned @F2C_INTEGER@ /* long */ uinteger; - typedef char *address; - typedef short int shortint; - typedef float real; - typedef double doublereal; - typedef struct { real r, i; } complex; - typedef struct { doublereal r, i; } doublecomplex; - typedef @F2C_INTEGER@ /* long int */ logical; - typedef short int shortlogical; - typedef char logical1; - typedef char integer1; - typedef @F2C_LONGINT@ /* long long */ longint; /* system-dependent */ - typedef unsigned @F2C_LONGINT@ /* long long */ ulongint; /* system-dependent */ - #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) - #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) - - #define TRUE_ (1) - #define FALSE_ (0) - - /* Extern is for use with -E */ - #ifndef Extern - #define Extern extern - #endif - - /* I/O stuff */ - - #ifdef f2c_i2 - #error "f2c_i2 will not work with g77!!!!" - /* for -i2 */ - typedef short flag; - typedef short ftnlen; - typedef short ftnint; - #else - typedef @F2C_INTEGER@ /* long int */ flag; - typedef @F2C_INTEGER@ /* long int */ ftnlen; - typedef @F2C_INTEGER@ /* long int */ ftnint; - #endif - - /*external read, write*/ - typedef struct - { flag cierr; - ftnint ciunit; - flag ciend; - char *cifmt; - ftnint cirec; - } cilist; - - /*internal read, write*/ - typedef struct - { flag icierr; - char *iciunit; - flag iciend; - char *icifmt; - ftnint icirlen; - ftnint icirnum; - } icilist; - - /*open*/ - typedef struct - { flag oerr; - ftnint ounit; - char *ofnm; - ftnlen ofnmlen; - char *osta; - char *oacc; - char *ofm; - ftnint orl; - char *oblnk; - } olist; - - /*close*/ - typedef struct - { flag cerr; - ftnint cunit; - char *csta; - } cllist; - - /*rewind, backspace, endfile*/ - typedef struct - { flag aerr; - ftnint aunit; - } alist; - - /* inquire */ - typedef struct - { flag inerr; - ftnint inunit; - char *infile; - ftnlen infilen; - ftnint *inex; /*parameters in standard's order*/ - ftnint *inopen; - ftnint *innum; - ftnint *innamed; - char *inname; - ftnlen innamlen; - char *inacc; - ftnlen inacclen; - char *inseq; - ftnlen inseqlen; - char *indir; - ftnlen indirlen; - char *infmt; - ftnlen infmtlen; - char *inform; - ftnint informlen; - char *inunf; - ftnlen inunflen; - ftnint *inrecl; - ftnint *innrec; - char *inblank; - ftnlen inblanklen; - } inlist; - - #define VOID void - - union Multitype { /* for multiple entry points */ - integer1 g; - shortint h; - integer i; - /* longint j; */ - real r; - doublereal d; - complex c; - doublecomplex z; - }; - - typedef union Multitype Multitype; - - /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ - - struct Vardesc { /* for Namelist */ - char *name; - char *addr; - ftnlen *dims; - int type; - }; - typedef struct Vardesc Vardesc; - - struct Namelist { - char *name; - Vardesc **vars; - int nvars; - }; - typedef struct Namelist Namelist; - - #define abs(x) ((x) >= 0 ? (x) : -(x)) - #define dabs(x) (doublereal)abs(x) - #define min(a,b) ((a) <= (b) ? (a) : (b)) - #define max(a,b) ((a) >= (b) ? (a) : (b)) - #define dmin(a,b) (doublereal)min(a,b) - #define dmax(a,b) (doublereal)max(a,b) - #define bit_test(a,b) ((a) >> (b) & 1) - #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) - #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) - - /* procedure parameter types for -A and -C++ */ - - #define F2C_proc_par_types 1 - #ifdef __cplusplus - typedef int /* Unknown procedure type */ (*U_fp)(...); - typedef shortint (*J_fp)(...); - typedef integer (*I_fp)(...); - typedef real (*R_fp)(...); - typedef doublereal (*D_fp)(...), (*E_fp)(...); - typedef /* Complex */ VOID (*C_fp)(...); - typedef /* Double Complex */ VOID (*Z_fp)(...); - typedef logical (*L_fp)(...); - typedef shortlogical (*K_fp)(...); - typedef /* Character */ VOID (*H_fp)(...); - typedef /* Subroutine */ int (*S_fp)(...); - #else - typedef int /* Unknown procedure type */ (*U_fp)(); - typedef shortint (*J_fp)(); - typedef integer (*I_fp)(); - typedef real (*R_fp)(); - typedef doublereal (*D_fp)(), (*E_fp)(); - typedef /* Complex */ VOID (*C_fp)(); - typedef /* Double Complex */ VOID (*Z_fp)(); - typedef logical (*L_fp)(); - typedef shortlogical (*K_fp)(); - typedef /* Character */ VOID (*H_fp)(); - typedef /* Subroutine */ int (*S_fp)(); - #endif - /* E_fp is for real functions when -R is not specified */ - typedef VOID C_f; /* complex function */ - typedef VOID H_f; /* character function */ - typedef VOID Z_f; /* double complex function */ - typedef doublereal E_f; /* real function with -R not specified */ - - /* undef any lower-case symbols that your C compiler predefines, e.g.: */ - - #ifndef Skip_f2c_Undefs - /* (No such symbols should be defined in a strict ANSI C compiler. - We can avoid trouble with f2c-translated code by using - gcc -ansi [-traditional].) */ - #undef cray - #undef gcos - #undef mc68010 - #undef mc68020 - #undef mips - #undef pdp11 - #undef sgi - #undef sparc - #undef sun - #undef sun2 - #undef sun3 - #undef sun4 - #undef u370 - #undef u3b - #undef u3b2 - #undef u3b5 - #undef unix - #undef vax - #endif - #endif --- 0 ---- diff -rcp2N g77-0.5.22/f/runtime/g2c.h.in g77-0.5.23/f/runtime/g2c.h.in *** g77-0.5.22/f/runtime/g2c.h.in Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/runtime/g2c.h.in Sun Apr 19 21:02:57 1998 *************** *** 0 **** --- 1,236 ---- + /* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */ + + /* This file is generated by the g77 libg2c configuration process from a + file named g2c.h.in. This process sets up the appropriate types, + defines the appropriate macros, and so on. The resulting g2c.h file + is used to build g77's copy of libf2c, named libg2c, and also can + be used when compiling C code produced by f2c to link the resulting + object file(s) with those produced by the same version of g77 that + produced this file, allowing inter-operability of f2c-compiled and + g77-compiled code. */ + + /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + + #ifndef F2C_INCLUDE + #define F2C_INCLUDE + + /* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ + /* we assume short, float are OK */ + typedef @F2C_INTEGER@ /* long int */ integer; + typedef unsigned @F2C_INTEGER@ /* long */ uinteger; + typedef char *address; + typedef short int shortint; + typedef float real; + typedef double doublereal; + typedef struct { real r, i; } complex; + typedef struct { doublereal r, i; } doublecomplex; + typedef @F2C_INTEGER@ /* long int */ logical; + typedef short int shortlogical; + typedef char logical1; + typedef char integer1; + typedef @F2C_LONGINT@ /* long long */ longint; /* system-dependent */ + typedef unsigned @F2C_LONGINT@ /* long long */ ulongint; /* system-dependent */ + #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) + #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) + + #define TRUE_ (1) + #define FALSE_ (0) + + /* Extern is for use with -E */ + #ifndef Extern + #define Extern extern + #endif + + /* I/O stuff */ + + #ifdef f2c_i2 + #error "f2c_i2 will not work with g77!!!!" + /* for -i2 */ + typedef short flag; + typedef short ftnlen; + typedef short ftnint; + #else + typedef @F2C_INTEGER@ /* long int */ flag; + typedef @F2C_INTEGER@ /* long int */ ftnlen; + typedef @F2C_INTEGER@ /* long int */ ftnint; + #endif + + /*external read, write*/ + typedef struct + { flag cierr; + ftnint ciunit; + flag ciend; + char *cifmt; + ftnint cirec; + } cilist; + + /*internal read, write*/ + typedef struct + { flag icierr; + char *iciunit; + flag iciend; + char *icifmt; + ftnint icirlen; + ftnint icirnum; + } icilist; + + /*open*/ + typedef struct + { flag oerr; + ftnint ounit; + char *ofnm; + ftnlen ofnmlen; + char *osta; + char *oacc; + char *ofm; + ftnint orl; + char *oblnk; + } olist; + + /*close*/ + typedef struct + { flag cerr; + ftnint cunit; + char *csta; + } cllist; + + /*rewind, backspace, endfile*/ + typedef struct + { flag aerr; + ftnint aunit; + } alist; + + /* inquire */ + typedef struct + { flag inerr; + ftnint inunit; + char *infile; + ftnlen infilen; + ftnint *inex; /*parameters in standard's order*/ + ftnint *inopen; + ftnint *innum; + ftnint *innamed; + char *inname; + ftnlen innamlen; + char *inacc; + ftnlen inacclen; + char *inseq; + ftnlen inseqlen; + char *indir; + ftnlen indirlen; + char *infmt; + ftnlen infmtlen; + char *inform; + ftnint informlen; + char *inunf; + ftnlen inunflen; + ftnint *inrecl; + ftnint *innrec; + char *inblank; + ftnlen inblanklen; + } inlist; + + #define VOID void + + union Multitype { /* for multiple entry points */ + integer1 g; + shortint h; + integer i; + /* longint j; */ + real r; + doublereal d; + complex c; + doublecomplex z; + }; + + typedef union Multitype Multitype; + + /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ + + struct Vardesc { /* for Namelist */ + char *name; + char *addr; + ftnlen *dims; + int type; + }; + typedef struct Vardesc Vardesc; + + struct Namelist { + char *name; + Vardesc **vars; + int nvars; + }; + typedef struct Namelist Namelist; + + #define abs(x) ((x) >= 0 ? (x) : -(x)) + #define dabs(x) (doublereal)abs(x) + #define min(a,b) ((a) <= (b) ? (a) : (b)) + #define max(a,b) ((a) >= (b) ? (a) : (b)) + #define dmin(a,b) (doublereal)min(a,b) + #define dmax(a,b) (doublereal)max(a,b) + #define bit_test(a,b) ((a) >> (b) & 1) + #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) + #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) + + /* procedure parameter types for -A and -C++ */ + + #define F2C_proc_par_types 1 + #ifdef __cplusplus + typedef int /* Unknown procedure type */ (*U_fp)(...); + typedef shortint (*J_fp)(...); + typedef integer (*I_fp)(...); + typedef real (*R_fp)(...); + typedef doublereal (*D_fp)(...), (*E_fp)(...); + typedef /* Complex */ VOID (*C_fp)(...); + typedef /* Double Complex */ VOID (*Z_fp)(...); + typedef logical (*L_fp)(...); + typedef shortlogical (*K_fp)(...); + typedef /* Character */ VOID (*H_fp)(...); + typedef /* Subroutine */ int (*S_fp)(...); + #else + typedef int /* Unknown procedure type */ (*U_fp)(); + typedef shortint (*J_fp)(); + typedef integer (*I_fp)(); + typedef real (*R_fp)(); + typedef doublereal (*D_fp)(), (*E_fp)(); + typedef /* Complex */ VOID (*C_fp)(); + typedef /* Double Complex */ VOID (*Z_fp)(); + typedef logical (*L_fp)(); + typedef shortlogical (*K_fp)(); + typedef /* Character */ VOID (*H_fp)(); + typedef /* Subroutine */ int (*S_fp)(); + #endif + /* E_fp is for real functions when -R is not specified */ + typedef VOID C_f; /* complex function */ + typedef VOID H_f; /* character function */ + typedef VOID Z_f; /* double complex function */ + typedef doublereal E_f; /* real function with -R not specified */ + + /* undef any lower-case symbols that your C compiler predefines, e.g.: */ + + #ifndef Skip_f2c_Undefs + /* (No such symbols should be defined in a strict ANSI C compiler. + We can avoid trouble with f2c-translated code by using + gcc -ansi [-traditional].) */ + #undef cray + #undef gcos + #undef mc68010 + #undef mc68020 + #undef mips + #undef pdp11 + #undef sgi + #undef sparc + #undef sun + #undef sun2 + #undef sun3 + #undef sun4 + #undef u370 + #undef u3b + #undef u3b2 + #undef u3b5 + #undef unix + #undef vax + #endif + #endif diff -rcp2N g77-0.5.22/f/runtime/libF77/Makefile.in g77-0.5.23/f/runtime/libF77/Makefile.in *** g77-0.5.22/f/runtime/libF77/Makefile.in Fri Jul 11 00:08:10 1997 --- g77-0.5.23/f/runtime/libF77/Makefile.in Tue May 19 16:50:22 1998 *************** *** 2,6 **** # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # --- 2,6 ---- # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995-1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # *************** *** 22,48 **** #02111-1307, USA. ! SHELL = /bin/sh srcdir = @srcdir@ VPATH = @srcdir@ ! #### Start of system configuration section. #### ! ! # The _FOR_TARGET things are appropriate for a cross-make, passed by the ! # superior makefile ! GCC_FOR_TARGET = @CC@ ! CC = $(GCC_FOR_TARGET) ! CFLAGS = @CFLAGS@ $(GCC_FLAGS) ! CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ ! CGFLAGS = -g0 ! # f2c.h should already be installed in xgcc's include directory but add that ! # to -I anyhow in case not using xgcc. ! ALL_CFLAGS = -I. -I$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) ! AR = @AR@ ! AR_FLAGS = rc ! RANLIB = @RANLIB@ ! RANLIB_TEST = @RANLIB_TEST@ ! CROSS = @CROSS@ .SUFFIXES: --- 22,52 ---- #02111-1307, USA. ! #### Start of system configuration section. #### ! # Note that this configuration takes place not when gcc/g77 are ! # configured; rather, when g77 is built, it configures this ! # runtime stuff. That means configuration happens for each ! # stage of a bootstrap build, for example. ! ! # $(srcdir) must be set to the g77 runtime libF77 source directory ! # (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ ! # gcc/f/runtime/configure sets this to all the -D options appropriate ! # for the configuration. DEFS = @DEFS@ ! ! #### End of system configuration section. #### ! ! # Must be passed in explicitly. Sample values are shown below. ! #CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ ! #CFLAGS = -O -g ! #CPPFLAGS = ! #F2C_H_DIR = /gcc-source-dir/f/runtime ! #G2C_H_DIR = /gcc-build-dir/f/runtime ! #GCC_H_DIR = /gcc-build-dir/include ! ! ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) .SUFFIXES: *************** CROSS = @CROSS@ *** 50,58 **** .c.o: ! $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $(CGFLAGS) $< MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ ! derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \ pow_qq.o --- 54,62 ---- .c.o: ! $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ ! derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o setarg.o setsig.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \ pow_qq.o *************** CHAR = s_cat.o s_cmp.o s_copy.o *** 75,95 **** F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o - F2C_H = ../../../include/f2c.h - all: $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) VersionF.o: Version.c ! $(CC) -c $(CGFLAGS) -o $@ $(srcdir)/Version.c ! ! mostlyclean clean: ! -rm -f *.o ! ! distclean maintainer-clean: clean ! -rm -f stage? include Makefile # Not quite all these actually do depend on f2c.h... ! $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ ! $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT): $(F2C_H) ! .PHONY: mostlyclean clean distclean maintainer-clean all --- 79,91 ---- F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o all: $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) VersionF.o: Version.c ! $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c # Not quite all these actually do depend on f2c.h... ! $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \ ! $(CHAR) $(F90BIT): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h ! .PHONY: all diff -rcp2N g77-0.5.22/f/runtime/libF77/Version.c g77-0.5.23/f/runtime/libF77/Version.c *** g77-0.5.22/f/runtime/libF77/Version.c Mon Mar 16 20:42:46 1998 --- g77-0.5.23/f/runtime/libF77/Version.c Wed May 20 16:12:29 1998 *************** static char junk[] = "\n@(#)LIBF77 VERSI *** 4,8 **** */ ! char __G77_LIBF77_VERSION__[] = "0.5.22"; /* --- 4,8 ---- */ ! char __G77_LIBF77_VERSION__[] = "0.5.23"; /* diff -rcp2N g77-0.5.22/f/runtime/libF77/dtime_.c g77-0.5.23/f/runtime/libF77/dtime_.c *** g77-0.5.22/f/runtime/libF77/dtime_.c Mon Sep 29 20:23:51 1997 --- g77-0.5.23/f/runtime/libF77/dtime_.c Fri May 1 14:48:42 1998 *************** *** 1,4 **** --- 1,6 ---- #include "time.h" #ifndef USE_CLOCK + #define _INCLUDE_POSIX_SOURCE /* for HP-UX */ + #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */ #include "sys/types.h" #include "sys/times.h" diff -rcp2N g77-0.5.22/f/runtime/libF77/etime_.c g77-0.5.23/f/runtime/libF77/etime_.c *** g77-0.5.22/f/runtime/libF77/etime_.c Mon Sep 29 20:23:51 1997 --- g77-0.5.23/f/runtime/libF77/etime_.c Fri May 1 14:48:42 1998 *************** *** 1,4 **** --- 1,6 ---- #include "time.h" #ifndef USE_CLOCK + #define _INCLUDE_POSIX_SOURCE /* for HP-UX */ + #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */ #include "sys/types.h" #include "sys/times.h" diff -rcp2N g77-0.5.22/f/runtime/libF77/getarg_.c g77-0.5.23/f/runtime/libF77/getarg_.c *** g77-0.5.22/f/runtime/libF77/getarg_.c Fri Jul 11 00:08:12 1997 --- g77-0.5.23/f/runtime/libF77/getarg_.c Tue May 19 16:54:56 1998 *************** void G77_getarg_0 (ftnint *n, register c *** 13,23 **** #endif { ! extern int xargc; ! extern char **xargv; register char *t; register int i; ! if(*n>=0 && *n=0 && *n=0 ? ! floor(*x + .5) : -floor(.5 - *x) ); } --- 10,13 ---- #endif { ! return (shortint)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x)); } diff -rcp2N g77-0.5.22/f/runtime/libF77/h_nint.c g77-0.5.23/f/runtime/libF77/h_nint.c *** g77-0.5.22/f/runtime/libF77/h_nint.c Thu Oct 31 10:35:20 1996 --- g77-0.5.23/f/runtime/libF77/h_nint.c Fri May 1 14:48:42 1998 *************** shortint h_nint(real *x) *** 10,14 **** #endif { ! return( (*x)>=0 ? ! floor(*x + .5) : -floor(.5 - *x) ); } --- 10,13 ---- #endif { ! return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); } diff -rcp2N g77-0.5.22/f/runtime/libF77/i_dnnt.c g77-0.5.23/f/runtime/libF77/i_dnnt.c *** g77-0.5.22/f/runtime/libF77/i_dnnt.c Thu Oct 31 10:35:20 1996 --- g77-0.5.23/f/runtime/libF77/i_dnnt.c Fri May 1 14:48:42 1998 *************** integer i_dnnt(doublereal *x) *** 10,14 **** #endif { ! return( (*x)>=0 ? ! floor(*x + .5) : -floor(.5 - *x) ); } --- 10,13 ---- #endif { ! return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x)); } diff -rcp2N g77-0.5.22/f/runtime/libF77/i_nint.c g77-0.5.23/f/runtime/libF77/i_nint.c *** g77-0.5.22/f/runtime/libF77/i_nint.c Thu Oct 31 10:35:20 1996 --- g77-0.5.23/f/runtime/libF77/i_nint.c Fri May 1 14:48:42 1998 *************** integer i_nint(real *x) *** 10,14 **** #endif { ! return( (*x)>=0 ? ! floor(*x + .5) : -floor(.5 - *x) ); } --- 10,13 ---- #endif { ! return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); } diff -rcp2N g77-0.5.22/f/runtime/libF77/iargc_.c g77-0.5.23/f/runtime/libF77/iargc_.c *** g77-0.5.22/f/runtime/libF77/iargc_.c Fri Jul 11 00:08:13 1997 --- g77-0.5.23/f/runtime/libF77/iargc_.c Tue May 19 16:56:24 1998 *************** ftnint G77_iargc_0 (void) *** 7,11 **** #endif { ! extern int xargc; ! return ( xargc - 1 ); } --- 7,11 ---- #endif { ! extern int f__xargc; ! return ( f__xargc - 1 ); } diff -rcp2N g77-0.5.22/f/runtime/libF77/main.c g77-0.5.23/f/runtime/libF77/main.c *** g77-0.5.22/f/runtime/libF77/main.c Fri Jul 11 00:08:13 1997 --- g77-0.5.23/f/runtime/libF77/main.c Tue May 19 17:05:17 1998 *************** *** 4,13 **** #include "signal1.h" - #ifndef SIGIOT - #ifdef SIGABRT - #define SIGIOT SIGABRT - #endif - #endif - #ifndef KR_headers #undef VOID --- 4,7 ---- *************** extern VOID f_exit(); *** 42,94 **** #ifdef KR_headers ! extern VOID f_init(), sig_die(); extern int MAIN__(); - #define Int /* int */ #else ! extern void f_init(void), sig_die(char*, int); extern int MAIN__(void); - #define Int int - #endif - - static VOID sigfdie(Int n) - { - sig_die("Floating Exception", 1); - } - - - static VOID sigidie(Int n) - { - sig_die("IOT Trap", 1); - } - - #ifdef SIGQUIT - static VOID sigqdie(Int n) - { - sig_die("Quit signal", 1); - } - #endif - - - static VOID sigindie(Int n) - { - sig_die("Interrupt", 0); - } - - static VOID sigtdie(Int n) - { - sig_die("Killed", 0); - } - - #ifdef SIGTRAP - static VOID sigtrdie(Int n) - { - sig_die("Trace trap", 1); - } #endif - - int xargc; - char **xargv; - #ifdef __cplusplus } --- 36,46 ---- #ifdef KR_headers ! extern VOID f_init(); extern int MAIN__(); #else ! extern void f_init(void); extern int MAIN__(void); #endif #ifdef __cplusplus } *************** main(int argc, char **argv) *** 101,125 **** #endif { ! xargc = argc; ! xargv = argv; ! signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */ ! #ifdef SIGIOT ! signal1(SIGIOT, sigidie); ! #endif ! #ifdef SIGTRAP ! signal1(SIGTRAP, sigtrdie); ! #endif ! #ifdef SIGQUIT ! if(signal1(SIGQUIT,sigqdie) == SIG_IGN) ! signal1(SIGQUIT, SIG_IGN); ! #endif ! if(signal1(SIGINT, sigindie) == SIG_IGN) ! signal1(SIGINT, SIG_IGN); ! signal1(SIGTERM,sigtdie); ! ! #ifdef pdp11 ! ldfps(01200); /* detect overflow as an exception */ ! #endif ! f_init(); #ifndef NO_ONEXIT --- 53,58 ---- #endif { ! f_setarg(argc, argv); ! f_setsig(); f_init(); #ifndef NO_ONEXIT diff -rcp2N g77-0.5.22/f/runtime/libF77/s_paus.c g77-0.5.23/f/runtime/libF77/s_paus.c *** g77-0.5.22/f/runtime/libF77/s_paus.c Fri Jul 11 00:08:13 1997 --- g77-0.5.23/f/runtime/libF77/s_paus.c Fri May 1 14:48:42 1998 *************** *** 3,6 **** --- 3,7 ---- #define PAUSESIG 15 + #include "signal1.h" #ifdef KR_headers #define Void /* void */ *************** *** 13,17 **** #undef max #include - #include "signal1.h" #ifdef __cplusplus extern "C" { --- 14,17 ---- *************** extern VOID f_exit(Void); *** 23,28 **** static VOID ! waitpause(Int n) ! { n = n; /* shut up compiler warning */ return; } --- 23,28 ---- static VOID ! waitpause(Sigarg) ! { Use_Sigarg; return; } *************** s_paus(char *s, ftnlen n) *** 61,65 **** s_1paus(stdin); else { ! #if (defined (MSDOS) && !defined (GO32)) || defined(__CYGWIN32__) FILE *fin; fin = fopen("con", "r"); --- 61,65 ---- s_1paus(stdin); else { ! #if (defined (MSDOS) && !defined (GO32)) || defined (_WIN32) FILE *fin; fin = fopen("con", "r"); diff -rcp2N g77-0.5.22/f/runtime/libF77/setarg.c g77-0.5.23/f/runtime/libF77/setarg.c *** g77-0.5.22/f/runtime/libF77/setarg.c Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/runtime/libF77/setarg.c Tue May 19 17:10:45 1998 *************** *** 0 **** --- 1,29 ---- + /* Set up the global argc/argv info for use by getarg_, iargc_, and + g77's inlined intrinsic equivalents. */ + + #ifndef KR_headers + #undef VOID + #include + #endif + + #ifndef VOID + #define VOID void + #endif + + int f__xargc; + char **f__xargv; + + #ifdef __cplusplus + } + #endif + + void + #ifdef KR_headers + f_setarg(argc, argv) int argc; char **argv; + #else + f_setarg(int argc, char **argv) + #endif + { + f__xargc = argc; + f__xargv = argv; + } diff -rcp2N g77-0.5.22/f/runtime/libF77/setsig.c g77-0.5.23/f/runtime/libF77/setsig.c *** g77-0.5.22/f/runtime/libF77/setsig.c Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/runtime/libF77/setsig.c Tue May 19 17:10:35 1998 *************** *** 0 **** --- 1,101 ---- + /* Set up the signal behavior. */ + + #include + #include "signal1.h" + + #ifndef SIGIOT + #ifdef SIGABRT + #define SIGIOT SIGABRT + #endif + #endif + + #ifndef KR_headers + #undef VOID + #include + #endif + + #ifndef VOID + #define VOID void + #endif + + #ifdef __cplusplus + extern "C" { + #endif + + #ifdef KR_headers + extern VOID sig_die(); + #define Int /* int */ + #else + extern void sig_die(char*, int); + #define Int int + #endif + + static VOID sigfdie(Sigarg) + { + Use_Sigarg; + sig_die("Floating Exception", 1); + } + + + static VOID sigidie(Sigarg) + { + Use_Sigarg; + sig_die("IOT Trap", 1); + } + + #ifdef SIGQUIT + static VOID sigqdie(Sigarg) + { + Use_Sigarg; + sig_die("Quit signal", 1); + } + #endif + + + static VOID sigindie(Sigarg) + { + Use_Sigarg; + sig_die("Interrupt", 0); + } + + static VOID sigtdie(Sigarg) + { + Use_Sigarg; + sig_die("Killed", 0); + } + + #ifdef SIGTRAP + static VOID sigtrdie(Sigarg) + { + Use_Sigarg; + sig_die("Trace trap", 1); + } + #endif + + + #ifdef __cplusplus + } + #endif + + void + f_setsig() + { + signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */ + #ifdef SIGIOT + signal1(SIGIOT, sigidie); + #endif + #ifdef SIGTRAP + signal1(SIGTRAP, sigtrdie); + #endif + #ifdef SIGQUIT + if(signal1(SIGQUIT,sigqdie) == SIG_IGN) + signal1(SIGQUIT, SIG_IGN); + #endif + if(signal1(SIGINT, sigindie) == SIG_IGN) + signal1(SIGINT, SIG_IGN); + signal1(SIGTERM,sigtdie); + + #ifdef pdp11 + ldfps(01200); /* detect overflow as an exception */ + #endif + } diff -rcp2N g77-0.5.22/f/runtime/libF77/signal1.h0 g77-0.5.23/f/runtime/libF77/signal1.h0 *** g77-0.5.22/f/runtime/libF77/signal1.h0 Mon Aug 11 23:54:43 1997 --- g77-0.5.23/f/runtime/libF77/signal1.h0 Fri May 1 14:48:42 1998 *************** *** 13,18 **** --- 13,22 ---- #define Sigarg_t #else + #ifdef __cplusplus + #define Sigarg_t ... + #else #define Sigarg_t int #endif + #endif #endif /*Sigarg_t*/ *************** typedef Sigret_t (*sig_pf)(Sigarg_t); *** 24,25 **** --- 28,37 ---- #define signal1(a,b) signal(a,(sig_pf)b) + + #ifdef __cplusplus + #define Sigarg ... + #define Use_Sigarg + #else + #define Sigarg Int n + #define Use_Sigarg n = n /* shut up compiler warning */ + #endif diff -rcp2N g77-0.5.22/f/runtime/libF77/signal_.c g77-0.5.23/f/runtime/libF77/signal_.c *** g77-0.5.22/f/runtime/libF77/signal_.c Wed Dec 24 03:55:38 1997 --- g77-0.5.23/f/runtime/libF77/signal_.c Sat May 2 16:05:30 1998 *************** G77_signal_0 (integer *sigp, sig_pf proc *** 15,17 **** return (void *) signal(sig, proc); } - --- 15,16 ---- diff -rcp2N g77-0.5.22/f/runtime/libI77/Makefile.in g77-0.5.23/f/runtime/libI77/Makefile.in *** g77-0.5.22/f/runtime/libI77/Makefile.in Tue Feb 11 18:28:10 1997 --- g77-0.5.23/f/runtime/libI77/Makefile.in Sun May 3 15:53:30 1998 *************** *** 2,6 **** # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # --- 2,6 ---- # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # *************** *** 22,48 **** #02111-1307, USA. ! SHELL = /bin/sh srcdir = @srcdir@ VPATH = @srcdir@ ! #### Start of system configuration section. #### ! ! # The _FOR_TARGET things are appropriate for a cross-make, passed by the ! # superior makefile ! GCC_FOR_TARGET = @CC@ ! CC = $(GCC_FOR_TARGET) ! CFLAGS = @CFLAGS@ $(GCC_FLAGS) ! CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ ! CGFLAGS = -g0 ! # f2c.h should already be installed in xgcc's include directory but add that ! # to -I anyhow in case not using xgcc. ! ALL_CFLAGS = -I. -I$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) ! AR = @AR@ ! AR_FLAGS = rc ! RANLIB = @RANLIB@ ! RANLIB_TEST = @RANLIB_TEST@ ! CROSS = @CROSS@ .SUFFIXES: --- 22,52 ---- #02111-1307, USA. ! #### Start of system configuration section. #### ! # Note that this configuration takes place not when gcc/g77 are ! # configured; rather, when g77 is built, it configures this ! # runtime stuff. That means configuration happens for each ! # stage of a bootstrap build, for example. ! ! # $(srcdir) must be set to the g77 runtime libF77 source directory ! # (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ ! # gcc/f/runtime/configure sets this to all the -D options appropriate ! # for the configuration. DEFS = @DEFS@ ! ! #### End of system configuration section. #### ! ! # Must be passed in explicitly. Sample values are shown below. ! #CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ ! #CFLAGS = -O -g ! #CPPFLAGS = ! #F2C_H_DIR = /gcc-source-dir/f/runtime ! #G2C_H_DIR = /gcc-build-dir/f/runtime ! #GCC_H_DIR = /gcc-build-dir/include ! ! ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) .SUFFIXES: *************** CROSS = @CROSS@ *** 50,54 **** .c.o: ! $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $(CGFLAGS) $< OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ --- 54,58 ---- .c.o: ! $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $< OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ *************** OBJ = VersionI.o backspace.o close.o dfe *** 58,73 **** ftell_.o - F2C_H = ../../../include/f2c.h - all: $(OBJ) VersionI.o: Version.c ! $(CC) -c $(CGFLAGS) -o $@ $(srcdir)/Version.c ! ! mostlyclean clean: ! -rm -f $(OBJ) ! ! distclean maintainer-clean: mostlyclean ! -rm -f stage? include Makefile backspace.o: fio.h --- 62,69 ---- ftell_.o all: $(OBJ) VersionI.o: Version.c ! $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c backspace.o: fio.h *************** xwsne.o: fmt.h *** 125,129 **** # May be pessimistic: ! $(OBJ): $(F2C_H) ! .PHONY: mostlyclean clean distclean maintainer-clean all --- 121,125 ---- # May be pessimistic: ! $(OBJ): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h ! .PHONY: all diff -rcp2N g77-0.5.22/f/runtime/libI77/Version.c g77-0.5.23/f/runtime/libI77/Version.c *** g77-0.5.22/f/runtime/libI77/Version.c Mon Mar 16 20:42:46 1998 --- g77-0.5.23/f/runtime/libI77/Version.c Wed May 20 16:12:34 1998 *************** *** 1,8 **** ! static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19970916\n"; /* */ ! char __G77_LIBI77_VERSION__[] = "0.5.22"; /* --- 1,8 ---- ! static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19980405\n"; /* */ ! char __G77_LIBI77_VERSION__[] = "0.5.23"; /* *************** wrtfmt.c: *** 268,271 **** --- 268,289 ---- with 64-bit pointers and 32-bit ints that did not 64-bit align struct syl (e.g., Linux on the DEC Alpha). */ + /* 19 Jan. 1998: backspace.c: for b->ufmt==0, change sizeof(int) to + sizeof(uiolen). On machines where this would make a + difference, it is best for portability to compile libI77 with + -DUIOLEN_int (which will render the change invisible). */ + /* 4 March 1998: open.c: fix glitch in comparing file names under + -DNON_UNIX_STDIO */ + /* 17 March 1998: endfile.c, open.c: acquire temporary files from tmpfile(), + unless compiled with -DNON_ANSI_STDIO, which uses mktemp(). + New buffering scheme independent of NON_UNIX_STDIO for + handling T format items. Now -DNON_UNIX_STDIO is no + longer be necessary for Linux, and libf2c no longer + causes stderr to be buffered -- the former setbuf or + setvbuf call for stderr was to make T format items work. + open.c: use the Posix access() function to check existence + or nonexistence of files, except under -DNON_POSIX_STDIO, + where trial fopen calls are used. */ + /* 5 April 1998: wsfe.c: make $ format item work: this was lost in the + changes of 17 March 1998. */ diff -rcp2N g77-0.5.22/f/runtime/libI77/backspace.c g77-0.5.23/f/runtime/libI77/backspace.c *** g77-0.5.22/f/runtime/libI77/backspace.c Fri Jul 11 00:08:14 1997 --- g77-0.5.23/f/runtime/libI77/backspace.c Fri May 1 19:19:42 1998 *************** integer f_back(alist *a) *** 8,25 **** #endif { unit *b; ! int i, n, ndec; ! #if defined (MSDOS) && !defined (GO32) ! int j, k; ! long w, z; ! #endif ! long x, y; ! char buf[32]; if (f__init & 2) f__fatal (131, "I/O recursion"); if(a->aunit >= MXUNIT || a->aunit < 0) err(a->aerr,101,"backspace"); ! b= &f__units[a->aunit]; if(b->useek==0) err(a->aerr,106,"backspace"); ! if(b->ufd==NULL) { fk_open(1, 1, a->aunit); return(0); --- 8,22 ---- #endif { unit *b; ! long v, w, x, y, z; ! uiolen n; ! FILE *f; ! if (f__init & 2) f__fatal (131, "I/O recursion"); if(a->aunit >= MXUNIT || a->aunit < 0) err(a->aerr,101,"backspace"); ! f__curunit = b = &f__units[a->aunit]; /* curunit for error messages */ if(b->useek==0) err(a->aerr,106,"backspace"); ! if((f = b->ufd) == NULL) { fk_open(1, 1, a->aunit); return(0); *************** integer f_back(alist *a) *** 36,101 **** if(b->url>0) { ! x=ftell(b->ufd); y = x % b->url; if(y == 0) x--; x /= b->url; x *= b->url; ! (void) fseek(b->ufd,x,SEEK_SET); return(0); } if(b->ufmt==0) ! { (void) fseek(b->ufd,-(long)sizeof(int),SEEK_CUR); ! (void) fread((char *)&n,sizeof(int),1,b->ufd); ! (void) fseek(b->ufd,-(long)n-2*sizeof(int),SEEK_CUR); return(0); } ! #if defined (MSDOS) && !defined (GO32) ! w = -1; ! #endif ! for(ndec = 1;; ndec = 0) ! { ! y = x = ftell(b->ufd); ! if(x < sizeof(buf)) ! x = 0; ! else ! x -= sizeof(buf); ! (void) fseek(b->ufd,x,SEEK_SET); ! n=fread(buf,1,(size_t)(y-x), b->ufd); ! for(i = n - ndec; --i >= 0; ) ! { ! if(buf[i]!='\n') continue; ! #if defined (MSDOS) && !defined (GO32) ! for(j = k = 0; j <= i; j++) ! if (buf[j] == '\n') ! k++; ! fseek(b->ufd,x,SEEK_SET); ! for(;;) ! if (getc(b->ufd) == '\n') { ! if ((z = ftell(b->ufd)) >= y && ndec) { ! if (w == -1) ! goto break2; ! break; ! } ! if (--k <= 0) ! return 0; ! w = z; ! } ! fseek(b->ufd, w, SEEK_SET); ! #else ! fseek(b->ufd,(long)(i+1-n),SEEK_CUR); ! #endif ! return(0); } - #if defined (MSDOS) && !defined (GO32) break2: ! #endif ! if(x==0) ! { ! (void) fseek(b->ufd, 0L, SEEK_SET); ! return(0); ! } ! else if(n<=0) err(a->aerr,(EOF),"backspace"); ! (void) fseek(b->ufd, x, SEEK_SET); ! } } --- 33,72 ---- if(b->url>0) { ! x=ftell(f); y = x % b->url; if(y == 0) x--; x /= b->url; x *= b->url; ! (void) fseek(f,x,SEEK_SET); return(0); } if(b->ufmt==0) ! { fseek(f,-(long)sizeof(uiolen),SEEK_CUR); ! fread((char *)&n,sizeof(uiolen),1,f); ! fseek(f,-(long)n-2*sizeof(uiolen),SEEK_CUR); return(0); } ! w = x = ftell(f); ! z = 0; ! loop: ! while(x) { ! x -= x < 64 ? x : 64; ! fseek(f,x,SEEK_SET); ! for(y = x; y < w; y++) { ! if (getc(f) != '\n') ! continue; ! v = ftell(f); ! if (v == w) { ! if (z) ! goto break2; ! goto loop; ! } ! z = v; ! } ! err(a->aerr,(EOF),"backspace"); } break2: ! fseek(f, z, SEEK_SET); ! return 0; } diff -rcp2N g77-0.5.22/f/runtime/libI77/close.c g77-0.5.23/f/runtime/libI77/close.c *** g77-0.5.22/f/runtime/libI77/close.c Mon Dec 22 18:32:51 1997 --- g77-0.5.23/f/runtime/libI77/close.c Fri May 1 14:48:42 1998 *************** integer f_clos(cllist *a) *** 34,42 **** if(b->ufd==NULL) goto done; if (!a->csta) ! if (b->uscrtch == 1) ! goto Delete; ! else ! goto Keep; switch(*a->csta) { default: --- 34,41 ---- if(b->ufd==NULL) goto done; + if (b->uscrtch == 1) + goto Delete; if (!a->csta) ! goto Keep; switch(*a->csta) { default: *************** integer f_clos(cllist *a) *** 54,59 **** case 'D': Delete: if(b->ufnm) { - fclose(b->ufd); unlink(b->ufnm); /*SYSDEP*/ free(b->ufnm); --- 53,58 ---- case 'D': Delete: + fclose(b->ufd); if(b->ufnm) { unlink(b->ufnm); /*SYSDEP*/ free(b->ufnm); diff -rcp2N g77-0.5.22/f/runtime/libI77/dfe.c g77-0.5.23/f/runtime/libI77/dfe.c *** g77-0.5.22/f/runtime/libI77/dfe.c Fri Jul 11 00:08:15 1997 --- g77-0.5.23/f/runtime/libI77/dfe.c Sat May 2 16:35:13 1998 *************** y_getc(Void) *** 32,57 **** err(f__elist->cierr,errno,"readingd"); } ! #ifdef KR_headers ! y_putc(c) ! #else ! y_putc(int c) ! #endif ! { ! f__recpos++; ! if(f__recpos <= f__curunit->url || f__curunit->url==1) ! putc(c,f__cf); ! else ! err(f__elist->cierr,110,"dout"); ! return(0); ! } y_rev(Void) ! { /*what about work done?*/ ! if(f__curunit->url==1 || f__recpos==f__curunit->url) ! return(0); ! while(f__recposurl) ! (*f__putn)(' '); ! f__recpos=0; return(0); } y_err(Void) { --- 32,51 ---- err(f__elist->cierr,errno,"readingd"); } ! ! static int y_rev(Void) ! { ! if (f__recpos < f__hiwater) ! f__recpos = f__hiwater; ! if (f__curunit->url > 1) ! while(f__recpos < f__curunit->url) ! (*f__putn)(' '); ! if (f__recpos) ! f__putbuf(0); ! f__recpos = 0; return(0); } + + static int y_err(Void) { *************** y_err(Void) *** 59,70 **** } y_newrec(Void) { - if(f__curunit->url == 1 || f__recpos == f__curunit->url) { - f__hiwater = f__recpos = f__cursor = 0; - return(1); - } - if(f__hiwater > f__recpos) - f__recpos = f__hiwater; y_rev(); f__hiwater = f__cursor = 0; --- 53,59 ---- } + static int y_newrec(Void) { y_rev(); f__hiwater = f__cursor = 0; *************** c_dfe(cilist *a) *** 93,97 **** if(a->cirec <= 0) err(a->cierr,130,"dfe"); ! (void) fseek(f__cf,(long)f__curunit->url * (a->cirec-1),SEEK_SET); f__curunit->uend = 0; return(0); --- 82,86 ---- if(a->cirec <= 0) err(a->cierr,130,"dfe"); ! fseek(f__cf,(long)f__curunit->url * (a->cirec-1),SEEK_SET); f__curunit->uend = 0; return(0); *************** integer s_wdfe(cilist *a) *** 133,137 **** if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"startwrt"); ! f__putn = y_putc; f__doed = w_ed; f__doned= w_ned; --- 122,126 ---- if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"startwrt"); ! f__putn = x_putc; f__doed = w_ed; f__doned= w_ned; *************** integer e_rdfe(Void) *** 147,156 **** { f__init = 1; ! (void) en_fio(); return(0); - } - integer e_wdfe(Void) - { - f__init = 1; - return en_fio(); } --- 136,140 ---- { f__init = 1; ! en_fio(); return(0); } diff -rcp2N g77-0.5.22/f/runtime/libI77/due.c g77-0.5.23/f/runtime/libI77/due.c *** g77-0.5.22/f/runtime/libI77/due.c Fri Jul 11 00:08:15 1997 --- g77-0.5.23/f/runtime/libI77/due.c Sat May 2 16:09:03 1998 *************** c_due(cilist *a) *** 23,27 **** if(a->cirec <= 0) err(a->cierr,130,"due"); ! (void) fseek(f__cf,(long)(a->cirec-1)*f__curunit->url,SEEK_SET); f__curunit->uend = 0; return(0); --- 23,27 ---- if(a->cirec <= 0) err(a->cierr,130,"due"); ! fseek(f__cf,(long)(a->cirec-1)*f__curunit->url,SEEK_SET); f__curunit->uend = 0; return(0); *************** integer e_rdue(Void) *** 58,62 **** if(f__curunit->url==1 || f__recpos==f__curunit->url) return(0); ! (void) fseek(f__cf,(long)(f__curunit->url-f__recpos),SEEK_CUR); if(ftell(f__cf)%f__curunit->url) err(f__elist->cierr,200,"syserr"); --- 58,62 ---- if(f__curunit->url==1 || f__recpos==f__curunit->url) return(0); ! fseek(f__cf,(long)(f__curunit->url-f__recpos),SEEK_CUR); if(ftell(f__cf)%f__curunit->url) err(f__elist->cierr,200,"syserr"); diff -rcp2N g77-0.5.22/f/runtime/libI77/endfile.c g77-0.5.23/f/runtime/libI77/endfile.c *** g77-0.5.22/f/runtime/libI77/endfile.c Fri Jul 11 00:08:15 1997 --- g77-0.5.23/f/runtime/libI77/endfile.c Fri May 1 19:20:31 1998 *************** *** 1,9 **** #include "f2c.h" #include "fio.h" - #include - #include "rawio.h" #ifdef KR_headers extern char *strcpy(); #else #undef abs --- 1,8 ---- #include "f2c.h" #include "fio.h" #ifdef KR_headers extern char *strcpy(); + extern FILE *tmpfile(); #else #undef abs *************** extern char *strcpy(); *** 14,30 **** #endif - #ifdef NON_UNIX_STDIO - #ifndef unlink - #define unlink remove - #endif - #else - #if defined (MSDOS) && !defined (GO32) - #include "io.h" - #endif - #endif - - #ifdef NON_UNIX_STDIO extern char *f__r_mode[], *f__w_mode[]; - #endif #ifdef KR_headers --- 13,17 ---- *************** integer f_end(alist *a) *** 35,38 **** --- 22,27 ---- { unit *b; + FILE *tf; + if (f__init & 2) f__fatal (131, "I/O recursion"); *************** integer f_end(alist *a) *** 41,53 **** if(b->ufd==NULL) { char nbuf[10]; ! (void) sprintf(nbuf,"fort.%ld",a->aunit); ! #ifdef NON_UNIX_STDIO ! { FILE *tf; ! if (tf = fopen(nbuf, f__w_mode[0])) ! fclose(tf); ! } ! #else ! close(creat(nbuf, 0666)); ! #endif return(0); } --- 30,36 ---- if(b->ufd==NULL) { char nbuf[10]; ! sprintf(nbuf,"fort.%ld",a->aunit); ! if (tf = fopen(nbuf, f__w_mode[0])) ! fclose(tf); return(0); } *************** integer f_end(alist *a) *** 57,68 **** static int - #ifdef NON_UNIX_STDIO #ifdef KR_headers ! copy(from, len, to) char *from, *to; register long len; #else copy(FILE *from, register long len, FILE *to) #endif { ! int k, len1; char buf[BUFSIZ]; --- 40,50 ---- static int #ifdef KR_headers ! copy(from, len, to) FILE *from, *to; register long len; #else copy(FILE *from, register long len, FILE *to) #endif { ! int len1; char buf[BUFSIZ]; *************** copy(FILE *from, register long len, FILE *** 75,108 **** return 0; } - #else - #ifdef KR_headers - copy(from, len, to) char *from, *to; register long len; - #else - copy(char *from, register long len, char *to) - #endif - { - register size_t n; - int k, rc = 0, tmp; - char buf[BUFSIZ]; - - if ((k = open(from, O_RDONLY)) < 0) - return 1; - if ((tmp = creat(to,0666)) < 0) - return 1; - while((n = read(k, buf, (size_t) (len > BUFSIZ ? BUFSIZ : (int)len))) > 0) { - if (write(tmp, buf, n) != n) - { rc = 1; break; } - if ((len -= n) <= 0) - break; - } - close(k); - close(tmp); - return n < 0 ? 1 : rc; - } - #endif - - #ifndef L_tmpnam - #define L_tmpnam 16 - #endif int --- 57,60 ---- *************** t_runc(alist *a) *** 113,124 **** #endif { - char nm[L_tmpnam+12]; /* extra space in case L_tmpnam is tiny */ long loc, len; unit *b; - #ifdef NON_UNIX_STDIO FILE *bf, *tf; - #else - FILE *bf; - #endif int rc = 0; --- 65,71 ---- *************** t_runc(alist *a) *** 131,145 **** if (loc >= len || b->useek == 0 || b->ufnm == NULL) return(0); - #ifdef NON_UNIX_STDIO fclose(b->ufd); - #else - rewind(b->ufd); /* empty buffer */ - #endif if (!loc) { - #ifdef NON_UNIX_STDIO if (!(bf = fopen(b->ufnm, f__w_mode[b->ufmt]))) - #else - if (close(creat(b->ufnm,0666))) - #endif rc = 1; if (b->uwrt) --- 78,84 ---- *************** t_runc(alist *a) *** 147,164 **** goto done; } ! #ifdef _POSIX_SOURCE ! tmpnam(nm); ! #else ! strcpy(nm,"tmp.FXXXXXX"); ! mktemp(nm); ! #endif ! #ifdef NON_UNIX_STDIO ! if (!(bf = fopen(b->ufnm, f__r_mode[0]))) { bad: rc = 1; goto done; } - if (!(tf = fopen(nm, f__w_mode[0]))) - goto bad; if (copy(bf, loc, tf)) { bad1: --- 86,95 ---- goto done; } ! if (!(bf = fopen(b->ufnm, f__r_mode[0])) ! || !(tf = tmpfile())) { bad: rc = 1; goto done; } if (copy(bf, loc, tf)) { bad1: *************** t_runc(alist *a) *** 168,193 **** if (!(bf = freopen(b->ufnm, f__w_mode[0], bf))) goto bad1; ! if (!(tf = freopen(nm, f__r_mode[0], tf))) ! goto bad1; if (copy(tf, loc, bf)) goto bad1; ! if (f__w_mode[0] != f__w_mode[b->ufmt]) { ! if (!(bf = freopen(b->ufnm, f__w_mode[b->ufmt|2], bf))) ! goto bad1; ! fseek(bf, loc, SEEK_SET); } done1: fclose(tf); - unlink(nm); done: f__cf = b->ufd = bf; - #else - if (copy(b->ufnm, loc, nm) - || copy(nm, loc, b->ufnm)) - rc = 1; - unlink(nm); - fseek(b->ufd, loc, SEEK_SET); - done: - #endif if (rc) err(a->aerr,111,"endfile"); --- 99,119 ---- if (!(bf = freopen(b->ufnm, f__w_mode[0], bf))) goto bad1; ! rewind(tf); if (copy(tf, loc, bf)) goto bad1; ! b->urw = 2; ! #ifdef NON_UNIX_STDIO ! if (b->ufmt) { ! fclose(bf); ! if (!(bf = fopen(b->ufnm, f__w_mode[3]))) ! goto bad; ! fseek(bf,0L,SEEK_END); ! b->urw = 3; } + #endif done1: fclose(tf); done: f__cf = b->ufd = bf; if (rc) err(a->aerr,111,"endfile"); diff -rcp2N g77-0.5.22/f/runtime/libI77/err.c g77-0.5.23/f/runtime/libI77/err.c *** g77-0.5.22/f/runtime/libI77/err.c Sat Feb 28 20:28:11 1998 --- g77-0.5.23/f/runtime/libI77/err.c Fri May 1 15:08:37 1998 *************** *** 1,8 **** #ifndef NON_UNIX_STDIO #include #include #endif #include "f2c.h" - #if defined (NON_UNIX_STDIO) || defined (MISSING_FILE_ELEMS) #ifdef KR_headers extern char *malloc(); --- 1,9 ---- #ifndef NON_UNIX_STDIO + #define _INCLUDE_POSIX_SOURCE /* for HP-UX */ + #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */ #include #include #endif #include "f2c.h" #ifdef KR_headers extern char *malloc(); *************** extern char *malloc(); *** 13,20 **** #include #endif - #endif #include "fio.h" #include "fmt.h" /* for struct syl */ - #include "rawio.h" /* for fcntl.h, fdopen */ /*global definitions*/ --- 14,19 ---- *************** flag f__external; /*1 if external io, 0 *** 33,39 **** int (*f__doed)(),(*f__doned)(); int (*f__doend)(),(*f__donewrec)(),(*f__dorevert)(); ! int (*f__getn)(),(*f__putn)(); /*for formatted io*/ #else ! int (*f__getn)(void),(*f__putn)(int); /*for formatted io*/ int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*); int (*f__dorevert)(void),(*f__donewrec)(void),(*f__doend)(void); --- 32,40 ---- int (*f__doed)(),(*f__doned)(); int (*f__doend)(),(*f__donewrec)(),(*f__dorevert)(); ! int (*f__getn)(); /* for formatted input */ ! void (*f__putn)(); /* for formatted output */ #else ! int (*f__getn)(void); /* for formatted input */ ! void (*f__putn)(int); /* for formatted output */ int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*); int (*f__dorevert)(void),(*f__donewrec)(void),(*f__doend)(void); *************** f_init(Void) *** 189,201 **** p->ufd=stderr; p->useek=f__canseek(stderr); - #ifdef _IOLBF - setvbuf(stderr, (char*)malloc(BUFSIZ+8), _IOLBF, BUFSIZ+8); - #else - #if defined (NON_UNIX_STDIO) || defined (MISSING_FILE_ELEMS) - setbuf(stderr, (char *)malloc(BUFSIZ+8)); - #else - stderr->_flag &= ~_IONBF; - #endif - #endif p->ufmt=1; p->uwrt=1; --- 190,193 ---- *************** f__nowreading(unit *x) *** 218,236 **** { long loc; ! int ufmt; ! extern char *f__r_mode[]; if (!x->ufnm) goto cantread; ! ufmt = x->ufmt; ! loc=ftell(x->ufd); ! if(freopen(x->ufnm,f__r_mode[ufmt],x->ufd) == NULL) { cantread: ! errno = 126; ! return(1); } ! x->uwrt=0; ! (void) fseek(x->ufd,loc,SEEK_SET); ! return(0); } #ifdef KR_headers --- 210,236 ---- { long loc; ! int ufmt, urw; ! extern char *f__r_mode[], *f__w_mode[]; + if (x->urw & 1) + goto done; if (!x->ufnm) goto cantread; ! ufmt = x->url ? 0 : x->ufmt; ! loc = ftell(x->ufd); ! urw = 3; ! if (!freopen(x->ufnm, f__w_mode[ufmt|2], x->ufd)) { ! urw = 1; ! if(!freopen(x->ufnm, f__r_mode[ufmt], x->ufd)) { cantread: ! errno = 126; ! return 1; ! } } ! fseek(x->ufd,loc,SEEK_SET); ! x->urw = urw; ! done: ! x->uwrt = 0; ! return 0; } #ifdef KR_headers *************** f__nowwriting(unit *x) *** 243,276 **** int ufmt; extern char *f__w_mode[]; - #ifndef NON_UNIX_STDIO - int k; - #endif if (!x->ufnm) goto cantwrite; ! ufmt = x->ufmt; ! #ifdef NON_UNIX_STDIO ! ufmt |= 2; ! #endif if (x->uwrt == 3) { /* just did write, rewind */ - #ifdef NON_UNIX_STDIO if (!(f__cf = x->ufd = freopen(x->ufnm,f__w_mode[ufmt],x->ufd))) - #else - if (close(creat(x->ufnm,0666))) - #endif goto cantwrite; } else { loc=ftell(x->ufd); - #ifdef NON_UNIX_STDIO if (!(f__cf = x->ufd = ! freopen(x->ufnm, f__w_mode[ufmt], x->ufd))) ! #else ! if (fclose(x->ufd) < 0 ! || (k = x->uwrt == 2 ? creat(x->ufnm,0666) ! : open(x->ufnm,O_WRONLY)) < 0 ! || (f__cf = x->ufd = fdopen(k,f__w_mode[ufmt])) == NULL) ! #endif { x->ufd = NULL; --- 243,262 ---- int ufmt; extern char *f__w_mode[]; + if (x->urw & 2) + goto done; if (!x->ufnm) goto cantwrite; ! ufmt = x->url ? 0 : x->ufmt; if (x->uwrt == 3) { /* just did write, rewind */ if (!(f__cf = x->ufd = freopen(x->ufnm,f__w_mode[ufmt],x->ufd))) goto cantwrite; + x->urw = 2; } else { loc=ftell(x->ufd); if (!(f__cf = x->ufd = ! freopen(x->ufnm, f__w_mode[ufmt |= 2], x->ufd))) { x->ufd = NULL; *************** f__nowwriting(unit *x) *** 279,286 **** return(1); } ! (void) fseek(x->ufd,loc,SEEK_SET); } x->uwrt = 1; ! return(0); } --- 265,274 ---- return(1); } ! x->urw = 3; ! fseek(x->ufd,loc,SEEK_SET); } + done: x->uwrt = 1; ! return 0; } diff -rcp2N g77-0.5.22/f/runtime/libI77/fio.h g77-0.5.23/f/runtime/libI77/fio.h *** g77-0.5.22/f/runtime/libI77/fio.h Thu Feb 26 21:23:31 1998 --- g77-0.5.23/f/runtime/libI77/fio.h Fri May 1 14:48:42 1998 *************** typedef struct *** 38,42 **** flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; ! flag uprnt; flag ublnk; flag uend; --- 38,42 ---- flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; ! flag urw; /* (1 for can read) | (2 for can write) */ flag ublnk; flag uend; *************** extern flag f__reading,f__external,f__se *** 51,59 **** #ifdef KR_headers #define Void /*void*/ ! extern int (*f__getn)(),(*f__putn)(); /*for formatted io*/ extern long f__inode(); extern VOID sig_die(); extern int (*f__donewrec)(), t_putc(), x_wSL(); ! extern int c_sfe(), err__fl(), xrd_SL(); #else #define Void void --- 51,61 ---- #ifdef KR_headers #define Void /*void*/ ! extern int (*f__getn)(); /* for formatted input */ ! extern void (*f__putn)(); /* for formatted output */ ! extern void x_putc(); extern long f__inode(); extern VOID sig_die(); extern int (*f__donewrec)(), t_putc(), x_wSL(); ! extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf(); #else #define Void void *************** extern int c_sfe(), err__fl(), xrd_SL(); *** 61,65 **** extern "C" { #endif ! extern int (*f__getn)(void),(*f__putn)(int); /*for formatted io*/ extern long f__inode(char*,int*); extern void sig_die(char*,int); --- 63,69 ---- extern "C" { #endif ! extern int (*f__getn)(void); /* for formatted input */ ! extern void (*f__putn)(int); /* for formatted output */ ! extern void x_putc(int); extern long f__inode(char*,int*); extern void sig_die(char*,int); *************** extern int isatty(int); *** 76,79 **** --- 80,84 ---- extern int err__fl(int,int,char*); extern int xrd_SL(void); + extern int f__putbuf(int); #ifdef __cplusplus } diff -rcp2N g77-0.5.22/f/runtime/libI77/iio.c g77-0.5.23/f/runtime/libI77/iio.c *** g77-0.5.22/f/runtime/libI77/iio.c Tue Sep 2 21:25:50 1997 --- g77-0.5.23/f/runtime/libI77/iio.c Fri May 1 14:48:42 1998 *************** z_getc(Void) *** 15,18 **** --- 15,20 ---- return '\n'; } + + void #ifdef KR_headers z_putc(c) *************** z_putc(int c) *** 21,29 **** #endif { ! if(f__icptr >= f__icend) err(f__svic->icierr,110,"inwrite"); ! if(f__recpos++ < f__svic->icirlen) *f__icptr++ = c; - else err(f__svic->icierr,110,"recend"); - return 0; } z_rnew(Void) --- 23,28 ---- #endif { ! if (f__icptr < f__icend && f__recpos++ < f__svic->icirlen) *f__icptr++ = c; } z_rnew(Void) *************** integer e_wsfi(Void) *** 140,148 **** n = en_fio(); f__fmtbuf = NULL; ! if(f__icnum >= f__svic->icirnum ! || !f__recpos && f__icnum) ! return(n); while(f__recpos++ < f__svic->icirlen) *f__icptr++ = ' '; ! return(n); } --- 139,154 ---- n = en_fio(); f__fmtbuf = NULL; ! if(f__svic->icirnum != 1 ! && (f__icnum > f__svic->icirnum ! || (f__icnum == f__svic->icirnum && (f__recpos | f__hiwater)))) ! err(f__svic->icierr,110,"inwrite"); ! if (f__recpos < f__hiwater) ! f__recpos = f__hiwater; ! if (f__recpos >= f__svic->icirlen) ! err(f__svic->icierr,110,"recend"); ! if (!f__recpos && f__icnum) ! return n; while(f__recpos++ < f__svic->icirlen) *f__icptr++ = ' '; ! return n; } diff -rcp2N g77-0.5.22/f/runtime/libI77/ilnw.c g77-0.5.23/f/runtime/libI77/ilnw.c *** g77-0.5.22/f/runtime/libI77/ilnw.c Fri Jul 11 00:12:43 1997 --- g77-0.5.23/f/runtime/libI77/ilnw.c Fri May 1 14:48:42 1998 *************** extern icilist *f__svic; *** 7,13 **** extern int f__icnum; #ifdef KR_headers ! extern int z_putc(); #else ! extern int z_putc(int); #endif --- 7,13 ---- extern int f__icnum; #ifdef KR_headers ! extern void z_putc(); #else ! extern void z_putc(int); #endif *************** z_wSL(Void) *** 20,24 **** } ! VOID #ifdef KR_headers c_liw(a) icilist *a; --- 20,24 ---- } ! static void #ifdef KR_headers c_liw(a) icilist *a; diff -rcp2N g77-0.5.22/f/runtime/libI77/lread.c g77-0.5.23/f/runtime/libI77/lread.c *** g77-0.5.22/f/runtime/libI77/lread.c Mon Sep 29 20:46:39 1997 --- g77-0.5.23/f/runtime/libI77/lread.c Fri May 1 14:48:42 1998 *************** l_read(ftnint *number, char *ptr, ftnlen *** 623,627 **** case TYLOGICAL: case TYLONG: ! Ptr->flint=f__lx; break; #ifdef Allow_TYQUAD --- 623,627 ---- case TYLOGICAL: case TYLONG: ! Ptr->flint = (ftnint)f__lx; break; #ifdef Allow_TYQUAD diff -rcp2N g77-0.5.22/f/runtime/libI77/lwrite.c g77-0.5.23/f/runtime/libI77/lwrite.c *** g77-0.5.22/f/runtime/libI77/lwrite.c Thu Nov 16 09:57:26 1995 --- g77-0.5.23/f/runtime/libI77/lwrite.c Fri May 1 14:48:42 1998 *************** donewrec(Void) *** 14,27 **** } - #ifdef KR_headers - t_putc(c) - #else - t_putc(int c) - #endif - { - f__recpos++; - putc(c,f__cf); - return(0); - } static VOID #ifdef KR_headers --- 14,17 ---- *************** l_put(register char *s) *** 185,192 **** { #ifdef KR_headers ! register int c, (*pn)() = f__putn; #else ! register int c, (*pn)(int) = f__putn; #endif while(c = *s++) (*pn)(c); --- 175,184 ---- { #ifdef KR_headers ! register void (*pn)() = f__putn; #else ! register void (*pn)(int) = f__putn; #endif + register int c; + while(c = *s++) (*pn)(c); diff -rcp2N g77-0.5.22/f/runtime/libI77/open.c g77-0.5.23/f/runtime/libI77/open.c *** g77-0.5.22/f/runtime/libI77/open.c Sat Feb 28 20:30:09 1998 --- g77-0.5.23/f/runtime/libI77/open.c Sat May 2 12:31:19 1998 *************** *** 1,13 **** - #ifndef NON_UNIX_STDIO - #include - #include - #endif #include "f2c.h" #include "fio.h" #include ! #include "rawio.h" #ifdef KR_headers ! extern char *malloc(), *mktemp(); extern integer f_clos(); #else --- 1,18 ---- #include "f2c.h" #include "fio.h" #include ! #ifndef NON_POSIX_STDIO ! #ifdef MSDOS ! #include "io.h" ! #else ! #include "unistd.h" /* for access */ ! #endif ! #endif #ifdef KR_headers ! extern char *malloc(); ! #ifdef NON_ANSI_STDIO ! extern char *mktemp(); ! #endif extern integer f_clos(); #else *************** char *f__w_mode[4] = {"wb", "w", "r+b", *** 28,69 **** #endif #ifdef KR_headers ! f__isdev(s) char *s; #else ! f__isdev(char *s) #endif { ! #ifdef NON_UNIX_STDIO ! int i, j; ! i = open(s,O_RDONLY); ! if (i == -1) ! return 0; ! j = isatty(i); ! close(i); ! return j; ! #else ! struct stat x; ! ! if(stat(s, &x) == -1) return(0); ! #ifdef S_IFMT ! switch(x.st_mode&S_IFMT) { ! case S_IFREG: ! case S_IFDIR: ! return(0); ! } ! #else ! #ifdef S_ISREG ! /* POSIX version */ ! if(S_ISREG(x.st_mode) || S_ISDIR(x.st_mode)) ! return(0); ! else #else ! Help! How does stat work on this system? #endif #endif ! return(1); #endif ! } #ifdef KR_headers integer f_open(a) olist *a; --- 33,127 ---- #endif + static char f__buf0[400], *f__buf = f__buf0; + int f__buflen = (int)sizeof(f__buf0); + + static void #ifdef KR_headers ! f__bufadj(n, c) int n, c; #else ! f__bufadj(int n, int c) #endif { ! unsigned int len; ! char *nbuf, *s, *t, *te; ! if (f__buf == f__buf0) ! f__buflen = 1024; ! while(f__buflen <= n) ! f__buflen <<= 1; ! len = (unsigned int)f__buflen; ! if (len != f__buflen || !(nbuf = (char*)malloc(len))) ! f__fatal(113, "malloc failure"); ! s = nbuf; ! t = f__buf; ! te = t + c; ! while(t < te) ! *s++ = *t++; ! if (f__buf != f__buf0) ! free(f__buf); ! f__buf = nbuf; ! } ! ! int ! #ifdef KR_headers ! f__putbuf(c) int c; #else ! f__putbuf(int c) #endif + { + char *s, *se; + int n; + + if (f__hiwater > f__recpos) + f__recpos = f__hiwater; + n = f__recpos + 1; + if (n >= f__buflen) + f__bufadj(n, f__recpos); + s = f__buf; + se = s + f__recpos; + if (c) + *se++ = c; + *se = 0; + for(;;) { + fputs(s, f__cf); + s += strlen(s); + if (s >= se) + break; /* normally happens the first time */ + putc(*s++, f__cf); + } + return 0; + } + + void + #ifdef KR_headers + x_putc(c) + #else + x_putc(int c) #endif ! { ! if (f__recpos >= f__buflen) ! f__bufadj(f__recpos, f__buflen); ! f__buf[f__recpos++] = c; ! } ! ! #define opnerr(f,m,s) \ ! do {if(f) {f__init &= ~2; errno= m;} else opn_err(m,s,a); return(m);} while(0) ! ! static void ! #ifdef KR_headers ! opn_err(m, s, a) int m; char *s; olist *a; ! #else ! opn_err(int m, char *s, olist *a) #endif ! { ! if (a->ofnm) { ! /* supply file name to error message */ ! if (a->ofnmlen >= f__buflen) ! f__bufadj((int)a->ofnmlen, 0); ! g_char(a->ofnm, a->ofnmlen, f__curunit->ufnm = f__buf); ! } ! f__fatal(m, s); ! } ! #ifdef KR_headers integer f_open(a) olist *a; *************** integer f_open(olist *a) *** 76,84 **** cllist x; int ufmt; - #ifdef NON_UNIX_STDIO FILE *tf; ! #else int n; - struct stat stb; #endif if(f__init != 1) f_init(); --- 134,140 ---- cllist x; int ufmt; FILE *tf; ! #ifndef NON_UNIX_STDIO int n; #endif if(f__init != 1) f_init(); *************** integer f_open(olist *a) *** 96,100 **** if (b->ufnm && strlen(b->ufnm) == a->ofnmlen ! && !strncmp(b->ufnm, b->ufnm, (unsigned)a->ofnmlen)) goto same; #else --- 152,156 ---- if (b->ufnm && strlen(b->ufnm) == a->ofnmlen ! && !strncmp(b->ufnm, a->ofnm, (unsigned)a->ofnmlen)) goto same; #else *************** integer f_open(olist *a) *** 125,147 **** g_char(a->ofnm,a->ofnmlen,buf); if (!buf[0]) ! err(a->oerr,107,"open"); } else sprintf(buf, "fort.%ld", a->ounit); b->uscrtch = 0; switch(a->osta ? *a->osta : 'u') { case 'o': case 'O': ! #ifdef NON_UNIX_STDIO ! if(access(buf,0)) #else ! if(stat(buf,&stb)) #endif - err(a->oerr,errno,"open"); break; case 's': case 'S': b->uscrtch=1; #ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */ s = tempnam (0, buf); --- 181,210 ---- g_char(a->ofnm,a->ofnmlen,buf); if (!buf[0]) ! opnerr(a->oerr,107,"open"); } else sprintf(buf, "fort.%ld", a->ounit); b->uscrtch = 0; + b->uend=0; + b->uwrt = 0; + b->ufd = 0; + b->urw = 3; switch(a->osta ? *a->osta : 'u') { case 'o': case 'O': ! #ifdef NON_POSIX_STDIO ! if (!(tf = fopen(buf,"r"))) ! opnerr(a->oerr,errno,"open"); ! fclose(tf); #else ! if (access(buf,0)) ! opnerr(a->oerr,errno,"open"); #endif break; case 's': case 'S': b->uscrtch=1; + #ifdef NON_ANSI_STDIO #ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */ s = tempnam (0, buf); *************** integer f_open(olist *a) *** 159,220 **** #endif /* ! defined (HAVE_TEMPNAM) */ goto replace; case 'n': case 'N': ! #ifdef NON_UNIX_STDIO ! if(!access(buf,0)) #else ! if(!stat(buf,&stb)) #endif - err(a->oerr,128,"open"); /* no break */ case 'r': /* Fortran 90 replace option */ case 'R': replace: ! #ifdef NON_UNIX_STDIO if (tf = fopen(buf,f__w_mode[0])) fclose(tf); - #else - (void) close(creat(buf, 0666)); - #endif } b->ufnm=(char *) malloc((unsigned int)(strlen(buf)+1)); ! if(b->ufnm==NULL) err(a->oerr,113,"no space"); (void) strcpy(b->ufnm,buf); ! b->uend=0; ! b->uwrt = 0; ! #ifdef NON_UNIX_STDIO ! if ((s = a->oacc) && (*s == 'd' || *s == 'D')) ufmt = 0; ! #endif ! if(f__isdev(buf)) ! { b->ufd = fopen(buf,f__r_mode[ufmt]); ! if(b->ufd==NULL) err(a->oerr,errno,buf); ! } ! else { ! if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) { ! #ifdef NON_UNIX_STDIO ! if (b->ufd = fopen(buf, f__w_mode[ufmt|2])) ! b->uwrt = 2; ! else if (b->ufd = fopen(buf, f__w_mode[ufmt])) ! b->uwrt = 1; ! else ! #else ! if ((n = open(buf,O_WRONLY)) >= 0) ! b->uwrt = 2; ! else { ! n = creat(buf, 0666); ! b->uwrt = 1; ! } ! if (n < 0 ! || (b->ufd = fdopen(n, f__w_mode[ufmt])) == NULL) ! #endif ! err(a->oerr, errno, "open"); } ! } ! b->useek=f__canseek(b->ufd); #ifndef NON_UNIX_STDIO ! if((b->uinode=f__inode(buf,&b->udev))==-1) ! err(a->oerr,108,"open"); #endif if(b->useek) --- 222,276 ---- #endif /* ! defined (HAVE_TEMPNAM) */ goto replace; + #else + if (!(b->ufd = tmpfile())) + opnerr(a->oerr,errno,"open"); + b->ufnm = 0; + #ifndef NON_UNIX_STDIO + b->uinode = b->udev = -1; + #endif + b->useek = 1; + return 0; + #endif + case 'n': case 'N': ! #ifdef NON_POSIX_STDIO ! if ((tf = fopen(buf,"r")) || (tf = fopen(buf,"a"))) { ! fclose(tf); ! opnerr(a->oerr,128,"open"); ! } #else ! if (!access(buf,0)) ! opnerr(a->oerr,128,"open"); #endif /* no break */ case 'r': /* Fortran 90 replace option */ case 'R': + #ifdef NON_ANSI_STDIO replace: ! #endif if (tf = fopen(buf,f__w_mode[0])) fclose(tf); } b->ufnm=(char *) malloc((unsigned int)(strlen(buf)+1)); ! if(b->ufnm==NULL) opnerr(a->oerr,113,"no space"); (void) strcpy(b->ufnm,buf); ! if ((s = a->oacc) && b->url) ufmt = 0; ! if(!(tf = fopen(buf, f__w_mode[ufmt|2]))) { ! if (tf = fopen(buf, f__r_mode[ufmt])) ! b->urw = 1; ! else if (tf = fopen(buf, f__w_mode[ufmt])) { ! b->uwrt = 1; ! b->urw = 2; } ! else ! err(a->oerr, errno, "open"); ! } ! b->useek = f__canseek(b->ufd = tf); #ifndef NON_UNIX_STDIO ! if((b->uinode = f__inode(buf,&b->udev)) == -1) ! opnerr(a->oerr,108,"open"); #endif if(b->useek) *************** integer f_open(olist *a) *** 223,227 **** else if ((s = a->oacc) && (*s == 'a' || *s == 'A') && fseek(b->ufd, 0L, SEEK_END)) ! err(a->oerr,129,"open"); return(0); } --- 279,283 ---- else if ((s = a->oacc) && (*s == 'a' || *s == 'A') && fseek(b->ufd, 0L, SEEK_END)) ! opnerr(a->oerr,129,"open"); return(0); } diff -rcp2N g77-0.5.22/f/runtime/libI77/rawio.h g77-0.5.23/f/runtime/libI77/rawio.h *** g77-0.5.22/f/runtime/libI77/rawio.h Fri Jul 11 00:08:17 1997 --- g77-0.5.23/f/runtime/libI77/rawio.h Fri May 1 14:48:42 1998 *************** *** 1,5 **** ! #ifdef KR_headers ! extern FILE *fdopen(); ! #else #if defined (MSDOS) && !defined (GO32) #include "io.h" --- 1,3 ---- ! #ifndef KR_headers #if defined (MSDOS) && !defined (GO32) #include "io.h" *************** extern int creat(const char*,int), open( *** 20,24 **** --- 18,24 ---- #endif extern int close(int); + #if !(defined(_WIN32) && !defined(__CYGWIN32__)) extern int read(int,void*,size_t), write(int,void*,size_t); + #endif extern int unlink(const char*); #ifndef _POSIX_SOURCE diff -rcp2N g77-0.5.22/f/runtime/libI77/sfe.c g77-0.5.23/f/runtime/libI77/sfe.c *** g77-0.5.22/f/runtime/libI77/sfe.c Tue Sep 30 04:48:58 1997 --- g77-0.5.23/f/runtime/libI77/sfe.c Fri May 1 15:25:58 1998 *************** integer e_rsfe(Void) *** 9,16 **** f__init = 1; n=en_fio(); - if (f__cf == stdout) - fflush(stdout); - else if (f__cf == stderr) - fflush(stderr); f__fmtbuf=NULL; return(n); --- 9,12 ---- *************** c_sfe(cilist *a) /* check */ *** 31,44 **** integer e_wsfe(Void) { - #ifdef ALWAYS_FLUSH int n; f__init = 1; n = en_fio(); f__fmtbuf=NULL; - if (!n && fflush(f__cf)) - err(f__elist->cierr, errno, "write end"); return n; ! #else ! return(e_rsfe()); ! #endif } --- 27,39 ---- integer e_wsfe(Void) { int n; f__init = 1; n = en_fio(); f__fmtbuf=NULL; return n; ! } ! ! integer e_wdfe(Void) ! { ! return en_fio(); } diff -rcp2N g77-0.5.22/f/runtime/libI77/util.c g77-0.5.23/f/runtime/libI77/util.c *** g77-0.5.22/f/runtime/libI77/util.c Thu Oct 31 10:37:53 1996 --- g77-0.5.23/f/runtime/libI77/util.c Fri May 1 14:48:42 1998 *************** *** 1,3 **** --- 1,5 ---- #ifndef NON_UNIX_STDIO + #define _INCLUDE_POSIX_SOURCE /* for HP-UX */ + #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */ #include #include diff -rcp2N g77-0.5.22/f/runtime/libI77/wrtfmt.c g77-0.5.23/f/runtime/libI77/wrtfmt.c *** g77-0.5.22/f/runtime/libI77/wrtfmt.c Mon Sep 29 20:23:52 1997 --- g77-0.5.23/f/runtime/libI77/wrtfmt.c Fri May 1 15:34:51 1998 *************** mv_cur(Void) /* shouldn't use fseek beca *** 41,54 **** return(0); } ! if(cursor > 0) { if(f__hiwater <= f__recpos) for(;cursor>0;cursor--) (*f__putn)(' '); else if(f__hiwater <= f__recpos + cursor) { - #if ! defined (NON_UNIX_STDIO) && ! defined (MISSING_FILE_ELEMS) - if(f__cf->_ptr + f__hiwater - f__recpos < buf_end(f__cf)) - f__cf->_ptr += f__hiwater - f__recpos; - else - #endif - (void) fseek(f__cf, (long) (f__hiwater - f__recpos), SEEK_CUR); cursor -= f__hiwater - f__recpos; f__recpos = f__hiwater; --- 41,48 ---- return(0); } ! if (cursor > 0) { if(f__hiwater <= f__recpos) for(;cursor>0;cursor--) (*f__putn)(' '); else if(f__hiwater <= f__recpos + cursor) { cursor -= f__hiwater - f__recpos; f__recpos = f__hiwater; *************** mv_cur(Void) /* shouldn't use fseek beca *** 57,81 **** } else { - #if ! defined (NON_UNIX_STDIO) && ! defined (MISSING_FILE_ELEMS) - if(f__cf->_ptr + cursor < buf_end(f__cf)) - f__cf->_ptr += cursor; - else - #endif - (void) fseek(f__cf, (long)cursor, SEEK_CUR); f__recpos += cursor; } } ! if(cursor<0) { ! if(cursor+f__recpos<0) err(f__elist->cierr,110,"left off"); ! #if ! defined (NON_UNIX_STDIO) && ! defined (MISSING_FILE_ELEMS) ! if(f__cf->_ptr + cursor >= f__cf->_base) ! f__cf->_ptr += cursor; ! else ! #endif ! if(f__curunit && f__curunit->useek) ! (void) fseek(f__cf,(long)cursor,SEEK_CUR); ! else ! err(f__elist->cierr,106,"fmt"); if(f__hiwater < f__recpos) f__hiwater = f__recpos; --- 51,61 ---- } else { f__recpos += cursor; } } ! else if (cursor < 0) { ! if(cursor + f__recpos < 0) ! err(f__elist->cierr,110,"left off"); if(f__hiwater < f__recpos) f__hiwater = f__recpos; diff -rcp2N g77-0.5.22/f/runtime/libI77/wsfe.c g77-0.5.23/f/runtime/libI77/wsfe.c *** g77-0.5.22/f/runtime/libI77/wsfe.c Fri Jul 11 00:08:19 1997 --- g77-0.5.23/f/runtime/libI77/wsfe.c Sat May 2 16:17:11 1998 *************** *** 5,51 **** extern int f__hiwater; ! #ifdef KR_headers ! x_putc(c) ! #else ! x_putc(int c) ! #endif ! { ! /* this uses \n as an indicator of record-end */ ! if(c == '\n' && f__recpos < f__hiwater) { /* fseek calls fflush, a loss */ ! #if ! defined (NON_UNIX_STDIO) && ! defined (MISSING_FILE_ELEMS) ! if(f__cf->_ptr + f__hiwater - f__recpos < buf_end(f__cf)) ! f__cf->_ptr += f__hiwater - f__recpos; ! else ! #endif ! (void) fseek(f__cf, (long)(f__hiwater - f__recpos), SEEK_CUR); ! } ! #ifdef OMIT_BLANK_CC ! if (!f__recpos++ && c == ' ') ! return c; ! #else ! f__recpos++; ! #endif ! return putc(c,f__cf); ! } x_wSL(Void) { ! (*f__putn)('\n'); ! f__recpos=0; ! f__cursor = 0; ! f__hiwater = 0; ! return(1); } xw_end(Void) { ! if(f__nonl == 0) ! (*f__putn)('\n'); f__hiwater = f__recpos = f__cursor = 0; ! return(0); } xw_rev(Void) { ! if(f__workdone) (*f__putn)('\n'); f__hiwater = f__recpos = f__cursor = 0; ! return(f__workdone=0); } --- 5,41 ---- extern int f__hiwater; ! int x_wSL(Void) { ! int n = f__putbuf('\n'); ! f__hiwater = f__recpos = f__cursor = 0; ! return(n == 0); } + + static int xw_end(Void) { ! int n; ! ! if(f__nonl) { ! f__putbuf(n = 0); ! fflush(f__cf); ! } ! else ! n = f__putbuf('\n'); f__hiwater = f__recpos = f__cursor = 0; ! return n; } + + static int xw_rev(Void) { ! int n = 0; ! if(f__workdone) { ! n = f__putbuf('\n'); ! f__workdone = 0; ! } f__hiwater = f__recpos = f__cursor = 0; ! return n; } diff -rcp2N g77-0.5.22/f/runtime/libI77/wsle.c g77-0.5.23/f/runtime/libI77/wsle.c *** g77-0.5.22/f/runtime/libI77/wsle.c Fri Jul 11 00:08:19 1997 --- g77-0.5.23/f/runtime/libI77/wsle.c Fri May 1 15:39:23 1998 *************** *** 3,6 **** --- 3,7 ---- #include "fmt.h" #include "lio.h" + #include "string.h" #ifdef KR_headers *************** integer s_wsle(cilist *a) *** 15,19 **** f__external=1; f__formatted=1; ! f__putn = t_putc; f__lioproc = l_write; L_len = LINE; --- 16,20 ---- f__external=1; f__formatted=1; ! f__putn = x_putc; f__lioproc = l_write; L_len = LINE; *************** integer s_wsle(cilist *a) *** 26,41 **** integer e_wsle(Void) { f__init = 1; ! t_putc('\n'); f__recpos=0; #ifdef ALWAYS_FLUSH ! if (fflush(f__cf)) err(f__elist->cierr, errno, "write end"); - #else - if (f__cf == stdout) - fflush(stdout); - else if (f__cf == stderr) - fflush(stderr); #endif ! return(0); } --- 27,38 ---- integer e_wsle(Void) { + int n; f__init = 1; ! n = f__putbuf('\n'); f__recpos=0; #ifdef ALWAYS_FLUSH ! if (!n && fflush(f__cf)) err(f__elist->cierr, errno, "write end"); #endif ! return(n); } diff -rcp2N g77-0.5.22/f/runtime/libI77/wsne.c g77-0.5.23/f/runtime/libI77/wsne.c *** g77-0.5.22/f/runtime/libI77/wsne.c Thu Nov 16 09:57:24 1995 --- g77-0.5.23/f/runtime/libI77/wsne.c Fri May 1 14:48:42 1998 *************** s_wsne(cilist *a) *** 17,21 **** f__external=1; f__formatted=1; ! f__putn = t_putc; L_len = LINE; f__donewrec = x_wSL; --- 17,21 ---- f__external=1; f__formatted=1; ! f__putn = x_putc; L_len = LINE; f__donewrec = x_wSL; diff -rcp2N g77-0.5.22/f/runtime/libU77/COPYING.LIB g77-0.5.23/f/runtime/libU77/COPYING.LIB *** g77-0.5.22/f/runtime/libU77/COPYING.LIB Mon Feb 3 04:27:28 1997 --- g77-0.5.23/f/runtime/libU77/COPYING.LIB Mon Feb 23 21:57:23 1998 *************** *** 3,7 **** Copyright (C) 1991 Free Software Foundation, Inc. ! 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. --- 3,7 ---- Copyright (C) 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. *************** convey the exclusion of warranty; and ea *** 465,469 **** You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free ! Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. --- 465,470 ---- You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free ! Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ! MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff -rcp2N g77-0.5.22/f/runtime/libU77/Makefile.in g77-0.5.23/f/runtime/libU77/Makefile.in *** g77-0.5.22/f/runtime/libU77/Makefile.in Mon Aug 11 05:45:23 1997 --- g77-0.5.23/f/runtime/libU77/Makefile.in Sat Apr 25 16:53:59 1998 *************** *** 1,46 **** # Makefile for GNU F77 compiler runtime, libc interface. ! # Copyright (C) 1995-1997 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # ! #This file is part of GNU Fortran libU77 library. # ! #This library is free software; you can redistribute it and/or modify ! #it under the terms of the GNU Library General Public License as ! #published by the Free Software Foundation; either version 2, or (at ! #your option) any later version. # ! #GNU Fortran 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 ! #Library General Public License for more details. # #You should have received a copy of the GNU General Public License #along with GNU Fortran; see the file COPYING. If not, write to ! #Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! SHELL = /bin/sh srcdir = @srcdir@ VPATH = @srcdir@ ! #### Start of system configuration section. #### ! ! # The _FOR_TARGET things are appropriate for a cross-make, passed by the ! # superior makefile ! GCC_FOR_TARGET = @CC@ ! CC = $(GCC_FOR_TARGET) ! CFLAGS = @CFLAGS@ $(GCC_FLAGS) ! CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ ! CGFLAGS = -g0 ! # f2c.h should already be installed in xgcc's include directory but add that ! # to -I anyhow in case not using xgcc. fio.h is in libI77. We need config.h ! # from `.'. ! ALL_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/../libI77 -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) ! AR = @AR@ ! AR_FLAGS = rc ! RANLIB = @RANLIB@ ! RANLIB_TEST = @RANLIB_TEST@ ! CROSS = @CROSS@ G77DIR = ../../../ --- 1,54 ---- # Makefile for GNU F77 compiler runtime, libc interface. ! # Copyright (C) 1995-1998 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # ! #This file is part of the GNU Fortran libU77 library. # ! #The GNU Fortran libU77 library is free software; you can redistribute ! #it and/or modify it under the terms of the GNU Library General Public ! #License as published by the Free Software Foundation; either version 2, ! #or (at your option) any later version. # ! #GNU Fortran 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 Library General Public License for more details. # #You should have received a copy of the GNU General Public License #along with GNU Fortran; see the file COPYING. If not, write to ! #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA ! #02111-1307, USA. ! #### Start of system configuration section. #### ! # Note that this configuration takes place not when gcc/g77 are ! # configured; rather, when g77 is built, it configures this ! # runtime stuff. That means configuration happens for each ! # stage of a bootstrap build, for example. ! ! # $(srcdir) must be set to the g77 runtime libF77 source directory ! # (g77/f/runtime/libF77). srcdir = @srcdir@ VPATH = @srcdir@ ! # gcc/f/runtime/configure sets this to all the -D options appropriate ! # for the configuration. DEFS = @DEFS@ ! ! #### End of system configuration section. #### ! ! # Must be passed in explicitly. Sample values are shown below. ! #CC = /gcc-build-dir/xgcc -B/gcc-build-dir/ ! #CFLAGS = -O -g ! #CPPFLAGS = ! #F2C_H_DIR = /gcc-source-dir/f/runtime ! #G2C_H_DIR = /gcc-build-dir/f/runtime ! #GCC_H_DIR = /gcc-build-dir/include ! ! # fio.h is in libI77. config.h is in `.'. ! ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR)/libI77 -I$(F2C_H_DIR)/libI77 -I$(G2C_H_DIR) -I$(F2C_H_DIR) -I$(GCC_H_DIR) $(CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) ! ! # This could probably be done more elegantly, but it's currently ! # just for running the u77-test test. G77DIR = ../../../ *************** G77DIR = ../../../ *** 49,53 **** .c.o: ! $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $(CGFLAGS) $< OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \ --- 57,61 ---- .c.o: ! $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \ *************** OBJS = VersionU.o gerror_.o perror_.o i *** 59,63 **** bes.o dbes.o \ chdir_.o chmod_.o lnblnk_.o hostnm_.o rename_.o fgetc_.o fputc_.o \ ! umask_.o system_clock_.o date_.o second_.o flush1_.o mclock_.o \ alarm_.o SRCS = Version.c gerror_.c perror_.c ierrno_.c itime_.c time_.c \ --- 67,71 ---- bes.o dbes.o \ chdir_.o chmod_.o lnblnk_.o hostnm_.o rename_.o fgetc_.o fputc_.o \ ! umask_.o sys_clock_.o date_.o second_.o flush1_.o mclock_.o \ alarm_.o SRCS = Version.c gerror_.c perror_.c ierrno_.c itime_.c time_.c \ *************** SRCS = Version.c gerror_.c perror_.c ie *** 69,105 **** bes.c dbes.c \ chdir_.c chmod_.c lnblnk_.c hostnm_.c rename_.c fgetc_.c fputc_.c \ ! umask_.c system_clock_.c date_.c second_.c flush1_.c mclock_.c \ alarm_.c - F2C_H = ../../../include/f2c.h - all: $(OBJS) VersionU.o: Version.c ! $(CC) -c $(CGFLAGS) -o $@ $(srcdir)/Version.c ! ! lint: ! lint $(CFLAGS) $(SRCS) ! ! mostlyclean: ! -rm -f $(OBJS) ! ! clean: mostlyclean ! -rm -f config.log a.out ! ! distclean realclean maintainer-clean: clean ! -rm -f config.h Makefile config.status config.cache stage? include ! ! $(OBJS): $(F2C_H) config.h ! ! check: ! -$(G77DIR)g77 --driver=$(G77DIR)/xgcc -B$(G77DIR) -g $(srcdir)/u77-test.f $(lib) && ./a.out ! rm -f a.out access_.o: access_.c ctime_.o: ctime_.c dtime_.o: dtime_.c etime_.o: etime_.c ! fnum_.o: fnum_.c $(srcdir)/../libI77/fio.h fstat_.o: fstat_.c gerror_.o: gerror_.c --- 77,94 ---- bes.c dbes.c \ chdir_.c chmod_.c lnblnk_.c hostnm_.c rename_.c fgetc_.c fputc_.c \ ! umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \ alarm_.c all: $(OBJS) VersionU.o: Version.c ! $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c + $(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h access_.o: access_.c ctime_.o: ctime_.c dtime_.o: dtime_.c etime_.o: etime_.c ! fnum_.o: fnum_.c $(F2C_H_DIR)/libI77/fio.h fstat_.o: fstat_.c gerror_.o: gerror_.c *************** idate_.o: idate_.c *** 112,116 **** ierrno_.o: ierrno_.c irand_.o: irand_.c ! isatty_.o: isatty_.c $(srcdir)/../libI77/fio.h itime_.o: itime_.c kill_.o: kill_.c --- 101,105 ---- ierrno_.o: ierrno_.c irand_.o: irand_.c ! isatty_.o: isatty_.c $(F2C_H_DIR)/libI77/fio.h itime_.o: itime_.c kill_.o: kill_.c *************** rename_.o: rename_.c *** 147,151 **** fputc_.o: fputc_.c fgetc_.o: fgetc_.c ! system_clock_.o: system_clock_.c umask_.o: umask_.c flush1_.o: flush1_.c --- 136,140 ---- fputc_.o: fputc_.c fgetc_.o: fgetc_.c ! sys_clock_.o: sys_clock_.c umask_.o: umask_.c flush1_.o: flush1_.c *************** mclock_.o: mclock_.c *** 153,155 **** alarm_.o: alarm_.c ! .PHONY: mostlyclean clean distclean maintainer-clean lint check all --- 142,151 ---- alarm_.o: alarm_.c ! lint: ! lint $(ALL_CFLAGS) $(SRCS) ! ! check: ! -$(G77DIR)g77 -B$(G77DIR) -L.. -g $(srcdir)/u77-test.f $(lib) && ./a.out ! rm -f a.out ! ! .PHONY: lint check all diff -rcp2N g77-0.5.22/f/runtime/libU77/README g77-0.5.23/f/runtime/libU77/README *** g77-0.5.22/f/runtime/libU77/README Tue Aug 12 01:45:24 1997 --- g77-0.5.23/f/runtime/libU77/README Tue Apr 21 01:23:27 1998 *************** how they should be amalgamated. *** 38,40 **** Dave Love Aug '95 ! (minor changes by Craig Burley Aug '97) --- 38,40 ---- Dave Love Aug '95 ! (minor changes by Craig Burley Aug '97) diff -rcp2N g77-0.5.22/f/runtime/libU77/Version.c g77-0.5.23/f/runtime/libU77/Version.c *** g77-0.5.22/f/runtime/libU77/Version.c Mon Mar 16 20:42:46 1998 --- g77-0.5.23/f/runtime/libU77/Version.c Wed May 20 16:12:40 1998 *************** *** 1,5 **** static char junk[] = "\n@(#) LIBU77 VERSION 19970919\n"; ! char __G77_LIBU77_VERSION__[] = "0.5.22"; #include --- 1,5 ---- static char junk[] = "\n@(#) LIBU77 VERSION 19970919\n"; ! char __G77_LIBU77_VERSION__[] = "0.5.23"; #include diff -rcp2N g77-0.5.22/f/runtime/libU77/access_.c g77-0.5.23/f/runtime/libU77/access_.c *** g77-0.5.22/f/runtime/libU77/access_.c Fri Jul 11 00:08:20 1997 --- g77-0.5.23/f/runtime/libU77/access_.c Sun Feb 1 01:37:07 1998 *************** Boston, MA 02111-1307, USA. */ *** 26,30 **** # include #else ! # include /* for NULL */ #endif --- 26,30 ---- # include #else ! # include #endif *************** integer G77_access_0 (const char *name, *** 63,67 **** buff = malloc (Lname+1); ! if (buff == NULL) return -1; g_char (name, Lname, buff); amode = 0; --- 63,67 ---- buff = malloc (Lname+1); ! if (!buff) return -1; g_char (name, Lname, buff); amode = 0; diff -rcp2N g77-0.5.22/f/runtime/libU77/alarm_.c g77-0.5.23/f/runtime/libU77/alarm_.c *** g77-0.5.22/f/runtime/libU77/alarm_.c Tue Sep 2 21:25:50 1997 --- g77-0.5.23/f/runtime/libU77/alarm_.c Sun Feb 1 01:37:07 1998 *************** Boston, MA 02111-1307, USA. */ *** 25,28 **** --- 25,29 ---- #endif + #include /* for ENOSYS */ #include "f2c.h" *************** integer G77_alarm_0 (integer *seconds, s *** 51,59 **** { int status; ! if (signal(SIGALRM, (sig_type)proc) == SIG_ERR) status = -1; else status = alarm (*seconds); return status; } --- 52,64 ---- { int status; ! #if defined (HAVE_ALARM) && defined (SIGALRM) if (signal(SIGALRM, (sig_type)proc) == SIG_ERR) status = -1; else status = alarm (*seconds); + #else /* ! HAVE_ALARM || ! SIGALRM */ + errno = ENOSYS; + status = -1; + #endif return status; } diff -rcp2N g77-0.5.22/f/runtime/libU77/chdir_.c g77-0.5.23/f/runtime/libU77/chdir_.c *** g77-0.5.22/f/runtime/libU77/chdir_.c Fri Jul 11 00:08:20 1997 --- g77-0.5.23/f/runtime/libU77/chdir_.c Sun Feb 1 01:37:08 1998 *************** integer G77_chdir_0 (const char *name, c *** 50,54 **** buff = malloc (Lname+1); ! if (buff == NULL) return -1; g_char (name, Lname, buff); i = chdir (buff); --- 50,54 ---- buff = malloc (Lname+1); ! if (!buff) return -1; g_char (name, Lname, buff); i = chdir (buff); diff -rcp2N g77-0.5.22/f/runtime/libU77/config.h.in g77-0.5.23/f/runtime/libU77/config.h.in *** g77-0.5.22/f/runtime/libU77/config.h.in Sat Feb 8 08:44:56 1997 --- g77-0.5.23/f/runtime/libU77/config.h.in Tue Feb 10 23:51:51 1998 *************** *** 34,37 **** --- 34,40 ---- #undef CHMOD_PATH + /* Define if you have the alarm function. */ + #undef HAVE_ALARM + /* Define if you have the clock function. */ #undef HAVE_CLOCK *************** *** 40,52 **** --- 43,70 ---- #undef HAVE_GETCWD + /* Define if you have the getgid function. */ + #undef HAVE_GETGID + /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME + /* Define if you have the getlogin function. */ + #undef HAVE_GETLOGIN + /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE + /* Define if you have the getuid function. */ + #undef HAVE_GETUID + /* Define if you have the getwd function. */ #undef HAVE_GETWD + /* Define if you have the kill function. */ + #undef HAVE_KILL + + /* Define if you have the link function. */ + #undef HAVE_LINK + /* Define if you have the lstat function. */ #undef HAVE_LSTAT *************** *** 58,61 **** --- 76,85 ---- #undef HAVE_SYMLINK + /* Define if you have the times function. */ + #undef HAVE_TIMES + + /* Define if you have the ttyname function. */ + #undef HAVE_TTYNAME + /* Define if you have the header file. */ #undef HAVE_LIMITS_H *************** *** 67,72 **** --- 91,102 ---- #undef HAVE_STRING_H + /* Define if you have the header file. */ + #undef HAVE_SYS_PARAM_H + /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H + + /* Define if you have the header file. */ + #undef HAVE_SYS_TIMES_H /* Define if you have the header file. */ diff -rcp2N g77-0.5.22/f/runtime/libU77/configure.in g77-0.5.23/f/runtime/libU77/configure.in *** g77-0.5.22/f/runtime/libU77/configure.in Tue Sep 2 21:28:20 1997 --- g77-0.5.23/f/runtime/libU77/configure.in Sun Feb 1 01:37:08 1998 *************** dnl AC_MSG_RESULT($ac_cv_sys_proto) *** 80,84 **** AC_HEADER_TIME ! AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h) dnl Checks for typedefs, structures, and compiler characteristics. --- 80,85 ---- AC_HEADER_TIME ! AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \ ! sys/param.h sys/times.h) dnl Checks for typedefs, structures, and compiler characteristics. *************** AC_STRUCT_TM *** 97,101 **** dnl Checks for library functions. ! AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock getrusage) test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" --- 98,103 ---- dnl Checks for library functions. ! AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \ ! getrusage times alarm getlogin getgid getuid kill link ttyname) test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" diff -rcp2N g77-0.5.22/f/runtime/libU77/dbes.c g77-0.5.23/f/runtime/libU77/dbes.c *** g77-0.5.22/f/runtime/libU77/dbes.c Tue Sep 2 21:25:50 1997 --- g77-0.5.23/f/runtime/libU77/dbes.c Sun May 3 04:20:50 1998 *************** not, write to the Free Software Foundati *** 17,24 **** Boston, MA 02111-1307, USA. */ #include "f2c.h" #include - #if 0 /* Don't include these unless necessary -- dnp. */ double G77_dbesj0_0 (const double *x) { return j0 (*x); --- 17,24 ---- Boston, MA 02111-1307, USA. */ + #if 0 /* Don't include these unless necessary -- dnp. */ #include "f2c.h" #include double G77_dbesj0_0 (const double *x) { return j0 (*x); diff -rcp2N g77-0.5.22/f/runtime/libU77/dtime_.c g77-0.5.23/f/runtime/libU77/dtime_.c *** g77-0.5.22/f/runtime/libU77/dtime_.c Tue Sep 30 04:52:44 1997 --- g77-0.5.23/f/runtime/libU77/dtime_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 23,31 **** # include #endif ! #include #if HAVE_GETRUSAGE # include # include #endif #include "f2c.h" --- 23,38 ---- # include #endif ! #include ! #if HAVE_SYS_TIMES_H ! # include ! #endif ! #if HAVE_SYS_PARAM_H ! # include ! #endif #if HAVE_GETRUSAGE # include # include #endif + #include /* for ENOSYS */ #include "f2c.h" *************** double G77_dtime_0 (real tarray[2]) *** 44,47 **** --- 51,55 ---- #endif { + #if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES) /* The getrusage version is only the default for convenience. */ #ifdef HAVE_GETRUSAGE *************** double G77_dtime_0 (real tarray[2]) *** 71,74 **** --- 79,84 ---- # elif defined CLK_TCK if (! clk_tck) clk_tck = CLK_TCK; + # elif defined HZ + if (! clk_tck) clk_tck = HZ; # elif defined HAVE_GETRUSAGE # else *************** double G77_dtime_0 (real tarray[2]) *** 82,84 **** --- 92,98 ---- old_utime = utime; old_stime = stime; return (tarray[0]+tarray[1]); + #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ + errno = ENOSYS; + return 0.0; + #endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ } diff -rcp2N g77-0.5.22/f/runtime/libU77/etime_.c g77-0.5.23/f/runtime/libU77/etime_.c *** g77-0.5.22/f/runtime/libU77/etime_.c Tue Sep 2 21:25:50 1997 --- g77-0.5.23/f/runtime/libU77/etime_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 24,33 **** #endif #include ! #include ! #include #if HAVE_GETRUSAGE # include # include #endif #include "f2c.h" --- 24,38 ---- #endif #include ! #if HAVE_SYS_TIMES_H ! # include ! #endif ! #if HAVE_SYS_PARAM_H ! # include ! #endif #if HAVE_GETRUSAGE # include # include #endif + #include /* for ENOSYS */ #include "f2c.h" *************** double G77_etime_0 (real tarray[2]) *** 46,49 **** --- 51,55 ---- #endif { + #if defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES) /* The getrusage version is only the default for convenience. */ #ifdef HAVE_GETRUSAGE *************** double G77_etime_0 (real tarray[2]) *** 67,70 **** --- 73,78 ---- # elif defined CLK_TCK if (! clk_tck) clk_tck = CLK_TCK; + # elif defined HZ + if (! clk_tck) clk_tck = HZ; # elif defined HAVE_GETRUSAGE # else *************** double G77_etime_0 (real tarray[2]) *** 76,78 **** --- 84,90 ---- #endif /* HAVE_GETRUSAGE */ return (tarray[0]+tarray[1]); + #else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ + errno = ENOSYS; + return 0.0; + #endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ } diff -rcp2N g77-0.5.22/f/runtime/libU77/getgid_.c g77-0.5.23/f/runtime/libU77/getgid_.c *** g77-0.5.22/f/runtime/libU77/getgid_.c Fri Jul 11 00:08:23 1997 --- g77-0.5.23/f/runtime/libU77/getgid_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 24,27 **** --- 24,28 ---- #endif #include + #include /* for ENOSYS */ #include "f2c.h" *************** integer G77_getgid_0 (void) *** 32,35 **** --- 33,41 ---- #endif { + #if defined (HAVE_GETGID) return getgid (); + #else + errno = ENOSYS; + return -1; + #endif } diff -rcp2N g77-0.5.22/f/runtime/libU77/getlog_.c g77-0.5.23/f/runtime/libU77/getlog_.c *** g77-0.5.22/f/runtime/libU77/getlog_.c Fri Jul 11 00:08:23 1997 --- g77-0.5.23/f/runtime/libU77/getlog_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 20,23 **** --- 20,24 ---- #include "config.h" #endif + #include #if HAVE_STDLIB_H # include *************** Boston, MA 02111-1307, USA. */ *** 34,37 **** --- 35,39 ---- # include #endif + #include /* for ENOSYS */ #include "f2c.h" *************** extern void s_copy(register char *a, reg *** 51,55 **** --- 53,59 ---- size_t i; char *p; + int status; + #if defined (HAVE_GETLOGIN) p = getlogin (); if (p != NULL) { *************** extern void s_copy(register char *a, reg *** 59,62 **** s_copy (str, " ", Lstr, 1); } ! return 0; } --- 63,71 ---- s_copy (str, " ", Lstr, 1); } ! status = 0; ! #else ! errno = ENOSYS; ! status = -1; ! #endif ! return status; } diff -rcp2N g77-0.5.22/f/runtime/libU77/getuid_.c g77-0.5.23/f/runtime/libU77/getuid_.c *** g77-0.5.22/f/runtime/libU77/getuid_.c Fri Jul 11 00:08:24 1997 --- g77-0.5.23/f/runtime/libU77/getuid_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 24,27 **** --- 24,28 ---- #endif #include + #include /* for ENOSYS */ #include "f2c.h" *************** integer G77_getuid_0 (void) *** 32,35 **** --- 33,41 ---- #endif { + #if defined (HAVE_GETUID) return getuid (); + #else + errno = ENOSYS; + return -1; + #endif } diff -rcp2N g77-0.5.22/f/runtime/libU77/gmtime_.c g77-0.5.23/f/runtime/libU77/gmtime_.c *** g77-0.5.22/f/runtime/libU77/gmtime_.c Fri Jul 11 00:08:24 1997 --- g77-0.5.23/f/runtime/libU77/gmtime_.c Fri May 1 15:56:45 1998 *************** Boston, MA 02111-1307, USA. */ *** 34,45 **** #ifdef KR_headers ! /* Subroutine */ int G77_gmtime_0 (stime, tarray) ! integer *stime, tarray[9]; #else ! /* Subroutine */ int G77_gmtime_0 (const integer * stime, integer tarray[9]) #endif { struct tm *lt; ! lt = gmtime ((time_t *) stime); tarray[0] = lt->tm_sec; tarray[1] = lt->tm_min; --- 34,46 ---- #ifdef KR_headers ! /* Subroutine */ int G77_gmtime_0 (xstime, tarray) ! integer *xstime, tarray[9]; #else ! /* Subroutine */ int G77_gmtime_0 (const integer * xstime, integer tarray[9]) #endif { struct tm *lt; ! time_t stime = *xstime; ! lt = gmtime (&stime); tarray[0] = lt->tm_sec; tarray[1] = lt->tm_min; diff -rcp2N g77-0.5.22/f/runtime/libU77/hostnm_.c g77-0.5.23/f/runtime/libU77/hostnm_.c *** g77-0.5.22/f/runtime/libU77/hostnm_.c Tue Sep 2 21:25:51 1997 --- g77-0.5.23/f/runtime/libU77/hostnm_.c Sun Apr 26 07:23:08 1998 *************** integer G77_hostnm_0 (char *name, ftnlen *** 40,44 **** /* Pad with blanks (assuming gethostname will make an error return if it can't fit in the null). */ ! for (i=strlen(name); i<=Lname; i++) name[i] = ' '; } --- 40,44 ---- /* Pad with blanks (assuming gethostname will make an error return if it can't fit in the null). */ ! for (i=strlen(name); i ! #include #include "f2c.h" --- 29,36 ---- #endif #include ! #if HAVE_SYS_PARAM_H ! # include ! #endif ! #include /* for ENOSYS */ #include "f2c.h" *************** integer G77_link_0 (const char *path1, c *** 43,46 **** --- 46,50 ---- #endif { + #if defined (HAVE_LINK) char *buff1, *buff2; char *bp, *blast; *************** integer G77_link_0 (const char *path1, c *** 56,58 **** --- 60,66 ---- free (buff1); free (buff2); return i ? errno : 0; + #else /* ! HAVE_LINK */ + errno = ENOSYS; + return -1; + #endif } diff -rcp2N g77-0.5.22/f/runtime/libU77/ltime_.c g77-0.5.23/f/runtime/libU77/ltime_.c *** g77-0.5.22/f/runtime/libU77/ltime_.c Fri Jul 11 00:08:26 1997 --- g77-0.5.23/f/runtime/libU77/ltime_.c Fri May 1 15:56:45 1998 *************** Boston, MA 02111-1307, USA. */ *** 34,45 **** #ifdef KR_headers ! /* Subroutine */ int G77_ltime_0 (stime, tarray) ! integer *stime, tarray[9]; #else ! /* Subroutine */ int G77_ltime_0 (const integer * stime, integer tarray[9]) #endif { struct tm *lt; ! lt = localtime ((time_t *) stime); tarray[0] = lt->tm_sec; tarray[1] = lt->tm_min; --- 34,46 ---- #ifdef KR_headers ! /* Subroutine */ int G77_ltime_0 (xstime, tarray) ! integer *xstime, tarray[9]; #else ! /* Subroutine */ int G77_ltime_0 (const integer * xstime, integer tarray[9]) #endif { struct tm *lt; ! time_t stime = *xstime; ! lt = localtime (&stime); tarray[0] = lt->tm_sec; tarray[1] = lt->tm_min; diff -rcp2N g77-0.5.22/f/runtime/libU77/rename_.c g77-0.5.23/f/runtime/libU77/rename_.c *** g77-0.5.22/f/runtime/libU77/rename_.c Fri Jul 11 00:08:28 1997 --- g77-0.5.23/f/runtime/libU77/rename_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 20,23 **** --- 20,26 ---- #include "config.h" #endif + #if HAVE_UNISTD_H + # include + #endif #if HAVE_STDLIB_H # include diff -rcp2N g77-0.5.22/f/runtime/libU77/symlnk_.c g77-0.5.23/f/runtime/libU77/symlnk_.c *** g77-0.5.22/f/runtime/libU77/symlnk_.c Tue Aug 12 00:33:20 1997 --- g77-0.5.23/f/runtime/libU77/symlnk_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 29,33 **** #endif #include ! #include #include "f2c.h" --- 29,35 ---- #endif #include ! #if HAVE_SYS_PARAM_H ! # include ! #endif #include "f2c.h" diff -rcp2N g77-0.5.22/f/runtime/libU77/sys_clock_.c g77-0.5.23/f/runtime/libU77/sys_clock_.c *** g77-0.5.22/f/runtime/libU77/sys_clock_.c Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/runtime/libU77/sys_clock_.c Sun Feb 1 01:37:08 1998 *************** *** 0 **** --- 1,74 ---- + /* Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of GNU Fortran libU77 library. + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + GNU Fortran 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with GNU Fortran; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + #if HAVE_SYS_TIMES_H + # include + #endif + #include + #if HAVE_UNISTD_H + # include + #endif + #include /* for ENOSYS */ + #include "f2c.h" + + #ifdef KR_headers + int G77_system_clock_0 (count, count_rate, count_max) + integer *count, *count_rate, *count_max; + #else + int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max) + #endif + { + #if defined (HAVE_TIMES) + struct tms buffer; + unsigned long cnt; + #ifdef _SC_CLK_TCK + *count_rate = sysconf(_SC_CLK_TCK); + #elif defined CLOCKS_PER_SECOND + *count_rate = CLOCKS_PER_SECOND; + #elif defined CLK_TCK + *count_rate = CLK_TCK; + #elif defined HZ + *count_rate = HZ; + #else + #error Dont know clock tick length + #endif + *count_max = INT_MAX; /* dubious */ + cnt = times (&buffer); + if (cnt > (unsigned long) (*count_max)) + *count = *count_max; /* also dubious */ + else + *count = cnt; + return 0; + #else /* ! HAVE_TIMES */ + errno = ENOSYS; + return -1; + #endif /* ! HAVE_TIMES */ + } diff -rcp2N g77-0.5.22/f/runtime/libU77/system_clock_.c g77-0.5.23/f/runtime/libU77/system_clock_.c *** g77-0.5.22/f/runtime/libU77/system_clock_.c Fri Jul 11 00:08:28 1997 --- g77-0.5.23/f/runtime/libU77/system_clock_.c Thu Jan 1 00:00:00 1970 *************** *** 1,64 **** - /* Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of GNU Fortran libU77 library. - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GNU Fortran 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with GNU Fortran; see the file COPYING.LIB. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - - #ifdef HAVE_CONFIG_H - #include "config.h" - #endif - #if TIME_WITH_SYS_TIME - # include - # include - #else - # if HAVE_SYS_TIME_H - # include - # else - # include - # endif - #endif - #include - #include - #if HAVE_UNISTD_H - # include - #endif - #include "f2c.h" - - #ifdef KR_headers - int G77_system_clock_0 (count, count_rate, count_max) - integer *count, *count_rate, *count_max; - #else - int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max) - #endif - { - struct tms buffer; - unsigned long cnt; - #ifdef _SC_CLK_TCK - *count_rate = sysconf(_SC_CLK_TCK); - #elif defined CLOCKS_PER_SECOND - *count_rate = CLOCKS_PER_SECOND; - #elif defined CLK_TCK - *count_rate = CLK_TCK; - #else - #error Dont know clock tick length - #endif - *count_max = INT_MAX; /* dubious */ - cnt = times (&buffer); - if (cnt > (unsigned long) (*count_max)) - *count = *count_max; /* also dubious */ - else - *count = cnt; - return 0; - } --- 0 ---- diff -rcp2N g77-0.5.22/f/runtime/libU77/ttynam_.c g77-0.5.23/f/runtime/libU77/ttynam_.c *** g77-0.5.22/f/runtime/libU77/ttynam_.c Fri Jul 11 00:08:28 1997 --- g77-0.5.23/f/runtime/libU77/ttynam_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 20,23 **** --- 20,24 ---- #include "config.h" #endif + #include #if STDC_HEADERS # include *************** Boston, MA 02111-1307, USA. */ *** 32,35 **** --- 33,37 ---- # include #endif + #include /* for ENOSYS */ #include "f2c.h" *************** extern void s_copy(register char *a, reg *** 45,48 **** --- 47,51 ---- #endif { + #if defined (HAVE_TTYNAME) size_t i; char *p; *************** extern void s_copy(register char *a, reg *** 55,57 **** --- 58,64 ---- s_copy (ret_val, " ", ret_val_len, 1); } + #else + errno = ENOSYS; + return -1; + #endif } diff -rcp2N g77-0.5.22/f/runtime/libU77/u77-test.f g77-0.5.23/f/runtime/libU77/u77-test.f *** g77-0.5.22/f/runtime/libU77/u77-test.f Fri Jul 11 00:08:30 1997 --- g77-0.5.23/f/runtime/libU77/u77-test.f Tue Feb 17 23:52:39 1998 *************** *** 67,71 **** if (r1.ne.tarray1(1)+tarray1(2)) + write (6,*) '*** ETIME didn''t return sum of the array: ', ! + r1, ' /= ', tarray1 r2= dtime (tarray2) if (abs (r1-r2).gt.1.0) write (6,*) --- 67,71 ---- if (r1.ne.tarray1(1)+tarray1(2)) + write (6,*) '*** ETIME didn''t return sum of the array: ', ! + r1, ' /= ', tarray1(1), '+', tarray1(2) r2= dtime (tarray2) if (abs (r1-r2).gt.1.0) write (6,*) *************** *** 80,84 **** print *, '... and the VXT version: ', i,j,k call time(line(:8)) ! print *, line(:8) write (6,*) 'SECNDS(0.0) returns: ',secnds(0.0) write (6,*) 'SECOND returns: ', second() --- 80,84 ---- print *, '... and the VXT version: ', i,j,k call time(line(:8)) ! print *, 'TIME: ', line(:8) write (6,*) 'SECNDS(0.0) returns: ',secnds(0.0) write (6,*) 'SECOND returns: ', second() diff -rcp2N g77-0.5.22/f/runtime/libU77/unlink_.c g77-0.5.23/f/runtime/libU77/unlink_.c *** g77-0.5.22/f/runtime/libU77/unlink_.c Fri Jul 11 00:08:30 1997 --- g77-0.5.23/f/runtime/libU77/unlink_.c Sun Feb 1 01:37:08 1998 *************** Boston, MA 02111-1307, USA. */ *** 29,33 **** #endif #include ! #include #include "f2c.h" --- 29,35 ---- #endif #include ! #if HAVE_SYS_PARAM_H ! # include ! #endif #include "f2c.h" diff -rcp2N g77-0.5.22/f/runtime/readme.netlib g77-0.5.23/f/runtime/readme.netlib *** g77-0.5.22/f/runtime/readme.netlib Mon Sep 29 20:23:52 1997 --- g77-0.5.23/f/runtime/readme.netlib Fri May 1 14:48:42 1998 *************** f2c/src Source for the converter itself, *** 78,93 **** send exec.c expr.c format.c format_data.c from f2c/src ! If you have trouble generating gram.c, you can ask netlib to ! send gram.c from f2c/src ! Then `xsum gram.c` should report ! gram.c 5529f4f 58745 ! Alternatively, if you have bison, you might get a working ! gram.c by saying ! make gram.c YACC=bison YFLAGS=-y ! (but please do not complain if this gives a bad gram.c). ! ! NOTE: For now, you may exercise f2c by sending netlib a message whose ! first line is "execute f2c" and whose remaining lines are ! the Fortran 77 source that you wish to have converted. Return mail brings you the resulting C, with f2c's error messages between #ifdef uNdEfInEd and #endif at the end. --- 78,92 ---- send exec.c expr.c format.c format_data.c from f2c/src ! The makefile used to generate gram.c; now we distribute a ! working gram.c, and you must say ! make gram1.c ! mv gram1.c gram.c ! if you want to generate your own gram.c -- there are just too ! many broken variants of yacc floating around nowadays for ! generation of gram.c to be the default. ! ! NOTE: You may exercise f2c by sending netlib@netlib.bell-labs.com ! a message whose first line is "execute f2c" and whose remaining ! lines are the Fortran 77 source that you wish to have converted. Return mail brings you the resulting C, with f2c's error messages between #ifdef uNdEfInEd and #endif at the end. *************** FTP: All the material described above is *** 169,181 **** binary prompt ! mget *.Z ! to get all the .Z files in src. You must uncompress the .Z files once you have a copy of them, e.g., by ! uncompress *.Z Subdirectory msdos contains two PC versions of f2c, ! f2c.exe.Z and f2cx.exe.Z; the latter uses extended memory. The README in that directory provides more details. --- 168,187 ---- binary prompt ! mget *.gz ! to get all the .gz files in src. You must uncompress the .gz files once you have a copy of them, e.g., by ! gzip -dN *.gz ! ! You can also get the entire f2c tree as a tar file: ! ! ftp://netlib.bell-labs.com/netlib/f2c.tar ! ! (which is a synthetic file -- created on the fly and not visible ! to ftp's "ls" or "dir" commands). Subdirectory msdos contains two PC versions of f2c, ! f2c.exe.gz and f2cx.exe.gz; the latter uses extended memory. The README in that directory provides more details. *************** Sun Sep 21 22:05:19 EDT 1997 *** 535,538 **** --- 541,598 ---- libf77: [de]time_.c (Unix systems only): change return type to double. + Thu Dec 4 22:10:09 EST 1997 + Fix bug with handling large blocks of comments (over 4k); parts of the + second and subsequent blocks were likely to be lost (not copied into + comments in the resulting C). Allow comment lines to be longer before + breaking them. + + Mon Jan 19 17:19:27 EST 1998 + makefile: change the rule for making gram.c to one for making gram1.c; + henceforth, asking netlib to "send all from f2c/src" will bring you a + working gram.c. Nowadays there are simply too many broken versions of + yacc floating around. + libi77: backspace.c: for b->ufmt==0, change sizeof(int) to + sizeof(uiolen). On machines where this would make a difference, it is + best for portability to compile libI77 with -DUIOLEN_int, which will + render the change invisible. + + Tue Feb 24 08:35:33 EST 1998 + makefile: remove gram.c from the "make clean" rule. + + Wed Feb 25 08:29:39 EST 1998 + makefile: change CFLAGS assignment to -O; add "veryclean" rule. + + Wed Mar 4 13:13:21 EST 1998 + libi77: open.c: fix glitch in comparing file names under + -DNON_UNIX_STDIO. + + Mon Mar 9 23:56:56 EST 1998 + putpcc.c: omit an unnecessary temporary variable in computing + (expr)**3. + libf77, libi77: minor tweaks to make some C++ compilers happy; + Version.c not changed. + + Wed Mar 18 18:08:47 EST 1998 + libf77: minor tweaks to [ed]time_.c; Version.c not changed. + libi77: endfile.c, open.c: acquire temporary files from tmpfile(), + unless compiled with -DNON_ANSI_STDIO, which uses mktemp(). + New buffering scheme independent of NON_UNIX_STDIO for handling T + format items. Now -DNON_UNIX_STDIO is no longer be necessary for + Linux, and libf2c no longer causes stderr to be buffered -- the former + setbuf or setvbuf call for stderr was to make T format items work. + open.c: use the Posix access() function to check existence or + nonexistence of files, except under -DNON_POSIX_STDIO, where trial + fopen calls are used. In open.c, fix botch in changes of 19980304. + libf2c.zip: the PC makefiles are now set for NT/W95, with comments + about changes for DOS. + + Fri Apr 3 17:22:12 EST 1998 + Adjust fix of 19960913 to again permit substring notation on + character variables in data statements. + + Sun Apr 5 19:26:50 EDT 1998 + libi77: wsfe.c: make $ format item work: this was lost in the changes + of 17 March 1998. + Current timestamps of files in "all from f2c/src", sorted by time, appear below (mm/dd/year hh:mm:ss). To bring your source up to date, *************** version.c. Note that the time shown in *** 541,559 **** timestamp of the source module that immediately follows version.c below: ! 8/05/1997 14:51:56 xsum0.out ! 8/05/1997 14:42:48 version.c 8/05/1997 10:31:26 malloc.c 7/24/1997 17:10:55 README - 7/24/1997 17:00:57 makefile 7/24/1997 16:06:19 Notice 7/21/1997 12:58:44 proc.c - 2/19/1997 13:34:09 lex.c 2/11/1997 23:39:14 vax.c 12/22/1996 11:51:22 output.c 12/04/1996 13:07:53 gram.exec - 10/17/1996 13:10:40 putpcc.c - 10/01/1996 14:36:18 gram.dcl - 10/01/1996 14:36:18 init.c 10/01/1996 14:36:18 defs.h 10/01/1996 14:36:17 data.c 9/17/1996 17:29:44 expr.c --- 601,622 ---- timestamp of the source module that immediately follows version.c below: ! 4/03/1998 17:20:55 xsum0.out ! 4/03/1998 17:15:05 gram.c ! 4/03/1998 17:15:05 version.c ! 4/03/1998 17:14:59 gram.dcl ! 3/09/1998 0:30:23 putpcc.c ! 2/25/1998 8:18:04 makefile ! 12/04/1997 17:44:11 format.c ! 12/04/1997 17:44:11 niceprintf.c ! 12/04/1997 17:14:05 lex.c 8/05/1997 10:31:26 malloc.c 7/24/1997 17:10:55 README 7/24/1997 16:06:19 Notice 7/21/1997 12:58:44 proc.c 2/11/1997 23:39:14 vax.c 12/22/1996 11:51:22 output.c 12/04/1996 13:07:53 gram.exec 10/01/1996 14:36:18 defs.h + 10/01/1996 14:36:18 init.c 10/01/1996 14:36:17 data.c 9/17/1996 17:29:44 expr.c *************** timestamp of the source module that imme *** 561,565 **** 8/27/1996 8:30:32 intr.c 8/26/1996 9:41:13 sysdep.c - 7/09/1996 10:41:13 format.c 7/09/1996 10:40:45 names.c 7/04/1996 9:58:31 formatdata.c --- 624,627 ---- *************** timestamp of the source module that imme *** 567,573 **** 7/04/1996 9:55:43 put.c 7/04/1996 9:55:41 pread.c - 7/04/1996 9:55:40 parse_args.c 7/04/1996 9:55:40 p1output.c ! 7/04/1996 9:55:38 niceprintf.c 7/04/1996 9:55:37 misc.c 7/04/1996 9:55:36 memset.c --- 629,634 ---- 7/04/1996 9:55:43 put.c 7/04/1996 9:55:41 pread.c 7/04/1996 9:55:40 p1output.c ! 7/04/1996 9:55:40 parse_args.c 7/04/1996 9:55:37 misc.c 7/04/1996 9:55:36 memset.c diff -rcp2N g77-0.5.22/f/src.c g77-0.5.23/f/src.c *** g77-0.5.22/f/src.c Wed Aug 30 19:53:35 1995 --- g77-0.5.23/f/src.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* src.c -- Implementation File Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* src.c -- Implementation File Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffesrc_strcmp_1ns2i (ffeCase mcase, cons *** 235,242 **** d = ffesrc_toupper (*str_ic); /* Upcase InitialCaps char. */ if (c != d) ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; } break; --- 235,244 ---- d = ffesrc_toupper (*str_ic); /* Upcase InitialCaps char. */ if (c != d) ! { ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; ! } } break; *************** ffesrc_strcmp_1ns2i (ffeCase mcase, cons *** 248,255 **** d = ffesrc_toupper (*str_ic); /* Transform InitialCaps char. */ if (c != d) ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; } break; --- 250,259 ---- d = ffesrc_toupper (*str_ic); /* Transform InitialCaps char. */ if (c != d) ! { ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; ! } } break; *************** ffesrc_strcmp_1ns2i (ffeCase mcase, cons *** 261,268 **** d = ffesrc_tolower (*str_ic); /* Transform InitialCaps char. */ if (c != d) ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; } break; --- 265,274 ---- d = ffesrc_tolower (*str_ic); /* Transform InitialCaps char. */ if (c != d) ! { ! if ((d != '\0') && (c < d)) ! return -1; ! else ! return 1; ! } } break; *************** ffesrc_strcmp_2c (ffeCase mcase, const c *** 321,328 **** c = ffesrc_toupper (*var); /* Upcase source. */ if (c != *str_uc) ! if ((*str_uc != '\0') && (c < *str_uc)) ! return -1; ! else ! return 1; } if (*str_uc == '\0') --- 327,336 ---- c = ffesrc_toupper (*var); /* Upcase source. */ if (c != *str_uc) ! { ! if ((*str_uc != '\0') && (c < *str_uc)) ! return -1; ! else ! return 1; ! } } if (*str_uc == '\0') *************** ffesrc_strncmp_2c (ffeCase mcase, const *** 389,396 **** c = ffesrc_toupper (*var); /* Upcase source. */ if (c != *str_uc) ! if (c < *str_uc) ! return -1; ! else ! return 1; } return 0; --- 397,406 ---- c = ffesrc_toupper (*var); /* Upcase source. */ if (c != *str_uc) ! { ! if (c < *str_uc) ! return -1; ! else ! return 1; ! } } return 0; diff -rcp2N g77-0.5.22/f/src.h g77-0.5.23/f/src.h *** g77-0.5.22/f/src.h Fri Jan 31 06:08:38 1997 --- g77-0.5.23/f/src.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* src.h -- Public #include File Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* src.h -- Public #include File Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/st.c g77-0.5.23/f/st.c *** g77-0.5.22/f/st.c Sun Jul 13 20:42:39 1997 --- g77-0.5.23/f/st.c Tue Apr 21 01:23:29 1998 *************** *** 1,5 **** /* st.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* st.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/st.h g77-0.5.23/f/st.h *** g77-0.5.22/f/st.h Sun Jul 13 20:42:40 1997 --- g77-0.5.23/f/st.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* st.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* st.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/sta.c g77-0.5.23/f/sta.c *** g77-0.5.22/f/sta.c Sun Oct 26 02:35:54 1997 --- g77-0.5.23/f/sta.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* sta.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* sta.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffesta_second_ (ffelexToken t) *** 645,648 **** --- 645,649 ---- case FFESTR_firstCASE: + case FFESTR_firstCASEDEFAULT: ffesta_add_possible_exec_ ((ffelexHandler) ffestb_R810); break; diff -rcp2N g77-0.5.22/f/sta.h g77-0.5.23/f/sta.h *** g77-0.5.22/f/sta.h Sun Oct 26 02:35:11 1997 --- g77-0.5.23/f/sta.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* sta.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* sta.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stb.c g77-0.5.23/f/stb.c *** g77-0.5.22/f/stb.c Sun Jan 11 20:07:29 1998 --- g77-0.5.23/f/stb.c Fri May 15 17:27:20 1998 *************** *** 1,5 **** /* stb.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stb.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffestb_halt1_ (ffelexToken ft, ffebld ex *** 3774,3781 **** ffesta_confirmed (); if (!ffesta_is_inhibited ()) ! if (ffesta_first_kw == FFESTR_firstSTOP) ! ffestc_R842 (expr, ft); ! else ! ffestc_R843 (expr, ft); return (ffelexHandler) ffesta_zero (t); --- 3774,3783 ---- ffesta_confirmed (); if (!ffesta_is_inhibited ()) ! { ! if (ffesta_first_kw == FFESTR_firstSTOP) ! ffestc_R842 (expr, ft); ! else ! ffestc_R843 (expr, ft); ! } return (ffelexHandler) ffesta_zero (t); *************** ffestb_R100110_ (ffelexToken t) *** 10588,10592 **** default: ! assert (FALSE); err = FFEBAD_FORMAT_BAD_H_SPEC; pre = disallowed; --- 10590,10594 ---- default: ! assert ("bad format item" == NULL); err = FFEBAD_FORMAT_BAD_H_SPEC; pre = disallowed; *************** ffestb_R90910_ (ffelexToken ft, ffebld e *** 15554,15562 **** case FFELEX_typeCLOSE_PAREN: if (expr == NULL) ! if (ffestb_local_.read.context == FFEEXPR_contextFILEFORMAT) ! ffestp_file.read.read_spec[ffestb_local_.read.ix] ! .value_is_label = TRUE; ! else ! break; ffestp_file.read.read_spec[ffestb_local_.read.ix].value_present = TRUE; --- 15556,15566 ---- case FFELEX_typeCLOSE_PAREN: if (expr == NULL) ! { ! if (ffestb_local_.read.context == FFEEXPR_contextFILEFORMAT) ! ffestp_file.read.read_spec[ffestb_local_.read.ix] ! .value_is_label = TRUE; ! else ! break; ! } ffestp_file.read.read_spec[ffestb_local_.read.ix].value_present = TRUE; *************** ffestb_R9109_ (ffelexToken ft, ffebld ex *** 16170,16178 **** case FFELEX_typeCLOSE_PAREN: if (expr == NULL) ! if (ffestb_local_.write.context == FFEEXPR_contextFILEFORMAT) ! ffestp_file.write.write_spec[ffestb_local_.write.ix] ! .value_is_label = TRUE; ! else ! break; ffestp_file.write.write_spec[ffestb_local_.write.ix].value_present = TRUE; --- 16174,16184 ---- case FFELEX_typeCLOSE_PAREN: if (expr == NULL) ! { ! if (ffestb_local_.write.context == FFEEXPR_contextFILEFORMAT) ! ffestp_file.write.write_spec[ffestb_local_.write.ix] ! .value_is_label = TRUE; ! else ! break; ! } ffestp_file.write.write_spec[ffestb_local_.write.ix].value_present = TRUE; diff -rcp2N g77-0.5.22/f/stb.h g77-0.5.23/f/stb.h *** g77-0.5.22/f/stb.h Sat Mar 1 04:28:23 1997 --- g77-0.5.23/f/stb.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stb.h -- Private #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stb.h -- Private #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stc.c g77-0.5.23/f/stc.c *** g77-0.5.22/f/stc.c Fri Jul 11 00:08:37 1997 --- g77-0.5.23/f/stc.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stc.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stc.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffestc_R544_equiv_ (ffebld expr, ffelexT *** 8239,8252 **** if (ffesymbol_equiv (s) != NULL) ! if (ffestc_local_.equiv.eq == NULL) ! ffestc_local_.equiv.eq = ffesymbol_equiv (s); /* New equiv obj. */ ! else if (ffestc_local_.equiv.eq != ffesymbol_equiv (s)) ! { ! ffestc_local_.equiv.eq = ffeequiv_merge (ffesymbol_equiv (s), ! ffestc_local_.equiv.eq, ! t); ! if (ffestc_local_.equiv.eq == NULL) ! ffestc_local_.equiv.ok = FALSE; /* Couldn't merge. */ ! } if (ffesymbol_is_save (s)) --- 8239,8254 ---- if (ffesymbol_equiv (s) != NULL) ! { ! if (ffestc_local_.equiv.eq == NULL) ! ffestc_local_.equiv.eq = ffesymbol_equiv (s); /* New equiv obj. */ ! else if (ffestc_local_.equiv.eq != ffesymbol_equiv (s)) ! { ! ffestc_local_.equiv.eq = ffeequiv_merge (ffesymbol_equiv (s), ! ffestc_local_.equiv.eq, ! t); ! if (ffestc_local_.equiv.eq == NULL) ! ffestc_local_.equiv.ok = FALSE; /* Couldn't merge. */ ! } ! } if (ffesymbol_is_save (s)) diff -rcp2N g77-0.5.22/f/stc.h g77-0.5.23/f/stc.h *** g77-0.5.22/f/stc.h Wed Aug 30 19:53:34 1995 --- g77-0.5.23/f/stc.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stc.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stc.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/std.c g77-0.5.23/f/std.c *** g77-0.5.22/f/std.c Sun Mar 8 21:37:44 1998 --- g77-0.5.23/f/std.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* std.c -- Implementation File (module.c template V1.0) ! Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* std.c -- Implementation File (module.c template V1.0) ! Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffestd_subr_copy_easy_ (ffestpInquireIx *** 1195,1205 **** && (stmt->inquire_spec[ix].value_present = ffestp_file.inquire.inquire_spec[ix].value_present)) ! if ((stmt->inquire_spec[ix].value_is_label ! = ffestp_file.inquire.inquire_spec[ix].value_is_label)) ! stmt->inquire_spec[ix].u.label ! = ffestp_file.inquire.inquire_spec[ix].u.label; ! else ! stmt->inquire_spec[ix].u.expr ! = ffestp_file.inquire.inquire_spec[ix].u.expr; } --- 1195,1207 ---- && (stmt->inquire_spec[ix].value_present = ffestp_file.inquire.inquire_spec[ix].value_present)) ! { ! if ((stmt->inquire_spec[ix].value_is_label ! = ffestp_file.inquire.inquire_spec[ix].value_is_label)) ! stmt->inquire_spec[ix].u.label ! = ffestp_file.inquire.inquire_spec[ix].u.label; ! else ! stmt->inquire_spec[ix].u.expr ! = ffestp_file.inquire.inquire_spec[ix].u.expr; ! } } *************** ffestd_R1001dump_ (ffests s, ffesttForma *** 4459,4467 **** case FFESTP_formattypeFORMAT: if (next->u.R1003D.R1004.present) ! if (next->u.R1003D.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, next, next->u.R1003D.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", ! next->u.R1003D.R1004.u.unsigned_val); ffests_putc (s, '('); --- 4461,4471 ---- case FFESTP_formattypeFORMAT: if (next->u.R1003D.R1004.present) ! { ! if (next->u.R1003D.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, next, next->u.R1003D.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", ! next->u.R1003D.R1004.u.unsigned_val); ! } ffests_putc (s, '('); *************** ffestd_R1001dump_1005_1_ (ffests s, ffes *** 4490,4505 **** if (f->u.R1005.R1004.present) ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ffests_puts (s, string); if (f->u.R1005.R1006.present) ! if (f->u.R1005.R1006.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1006.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1006.u.unsigned_val); } --- 4494,4513 ---- if (f->u.R1005.R1004.present) ! { ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ! } ffests_puts (s, string); if (f->u.R1005.R1006.present) ! { ! if (f->u.R1005.R1006.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1006.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1006.u.unsigned_val); ! } } *************** ffestd_R1001dump_1005_2_ (ffests s, ffes *** 4519,4526 **** if (f->u.R1005.R1004.present) ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ffests_puts (s, string); --- 4527,4536 ---- if (f->u.R1005.R1004.present) ! { ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ! } ffests_puts (s, string); *************** ffestd_R1001dump_1005_3_ (ffests s, ffes *** 4546,4553 **** if (f->u.R1005.R1004.present) ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ffests_puts (s, string); --- 4556,4565 ---- if (f->u.R1005.R1004.present) ! { ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ! } ffests_puts (s, string); *************** ffestd_R1001dump_1005_4_ (ffests s, ffes *** 4584,4591 **** if (f->u.R1005.R1004.present) ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ffests_puts (s, string); --- 4596,4605 ---- if (f->u.R1005.R1004.present) ! { ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ! } ffests_puts (s, string); *************** ffestd_R1001dump_1005_5_ (ffests s, ffes *** 4617,4624 **** if (f->u.R1005.R1004.present) ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ffests_puts (s, string); --- 4631,4640 ---- if (f->u.R1005.R1004.present) ! { ! if (f->u.R1005.R1004.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1005.R1004.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val); ! } ffests_puts (s, string); *************** ffestd_R1001dump_1010_2_ (ffests s, ffes *** 4671,4678 **** { if (f->u.R1010.val.present) ! if (f->u.R1010.val.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1010.val.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1010.val.u.unsigned_val); ffests_puts (s, string); --- 4687,4696 ---- { if (f->u.R1010.val.present) ! { ! if (f->u.R1010.val.rtexpr) ! ffestd_R1001rtexpr_ (s, f, f->u.R1010.val.u.expr); ! else ! ffests_printf_1U (s, "%lu", f->u.R1010.val.u.unsigned_val); ! } ffests_puts (s, string); diff -rcp2N g77-0.5.22/f/std.h g77-0.5.23/f/std.h *** g77-0.5.22/f/std.h Wed Aug 30 19:53:34 1995 --- g77-0.5.23/f/std.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* std.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* std.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/ste.c g77-0.5.23/f/ste.c *** g77-0.5.22/f/ste.c Sun Mar 8 21:37:06 1998 --- g77-0.5.23/f/ste.c Fri May 15 17:27:20 1998 *************** *** 1,5 **** /* ste.c -- Implementation File (module.c template V1.0) ! Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* ste.c -- Implementation File (module.c template V1.0) ! Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 46,55 **** /* Include files. */ #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "config.j" #include "rtl.j" #endif - #include "proj.h" #include "ste.h" #include "bld.h" --- 46,58 ---- /* Include files. */ + #include "proj.h" + #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "config.j" #include "rtl.j" + #include "tree.j" + #include "output.j" /* Must follow tree.j so TREE_CODE is defined! */ #endif #include "ste.h" #include "bld.h" *************** ffeste_io_dofio_ (ffebld expr) *** 637,641 **** num_elements = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size); ! num_elements = size_binop (CEIL_DIV_EXPR, num_elements, size_int (TYPE_PRECISION (char_type_node))); --- 640,645 ---- num_elements = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size); ! num_elements = size_binop (CEIL_DIV_EXPR, ! num_elements, size_int (TYPE_PRECISION (char_type_node))); *************** ffeste_io_dolio_ (ffebld expr) *** 737,742 **** TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size); num_elements = size_binop (CEIL_DIV_EXPR, ! num_elements, size_int (TYPE_PRECISION ! (char_type_node))); num_elements = convert (ffecom_f2c_ftnlen_type_node, num_elements); --- 741,747 ---- TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size); num_elements = size_binop (CEIL_DIV_EXPR, ! num_elements, ! size_int (TYPE_PRECISION ! (char_type_node))); num_elements = convert (ffecom_f2c_ftnlen_type_node, num_elements); *************** ffeste_R840 (ffebld expr, ffelab neg, ff *** 2904,2923 **** if (neg == zero) ! if (neg == pos) ! expand_goto (gzero); ! else ! { /* IF (expr.LE.0) THEN GOTO neg/zero ELSE ! GOTO pos. */ ! texpr = ffecom_expr (expr); ! texpr = ffecom_2 (LE_EXPR, integer_type_node, ! texpr, ! convert (TREE_TYPE (texpr), ! integer_zero_node)); ! expand_start_cond (ffecom_truth_value (texpr), 0); expand_goto (gzero); ! expand_start_else (); ! expand_goto (gpos); ! expand_end_cond (); ! } else if (neg == pos) { /* IF (expr.NE.0) THEN GOTO neg/pos ELSE GOTO --- 2909,2930 ---- if (neg == zero) ! { ! if (neg == pos) expand_goto (gzero); ! else ! { /* IF (expr.LE.0) THEN GOTO neg/zero ELSE ! GOTO pos. */ ! texpr = ffecom_expr (expr); ! texpr = ffecom_2 (LE_EXPR, integer_type_node, ! texpr, ! convert (TREE_TYPE (texpr), ! integer_zero_node)); ! expand_start_cond (ffecom_truth_value (texpr), 0); ! expand_goto (gzero); ! expand_start_else (); ! expand_goto (gpos); ! expand_end_cond (); ! } ! } else if (neg == pos) { /* IF (expr.NE.0) THEN GOTO neg/pos ELSE GOTO diff -rcp2N g77-0.5.22/f/ste.h g77-0.5.23/f/ste.h *** g77-0.5.22/f/ste.h Wed Aug 30 19:53:34 1995 --- g77-0.5.23/f/ste.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* ste.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* ste.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/storag.c g77-0.5.23/f/storag.c *** g77-0.5.22/f/storag.c Fri Jul 11 00:08:37 1997 --- g77-0.5.23/f/storag.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* storag.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* storag.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/storag.h g77-0.5.23/f/storag.h *** g77-0.5.22/f/storag.h Sat Mar 1 04:28:59 1997 --- g77-0.5.23/f/storag.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* storag.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* storag.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stp.c g77-0.5.23/f/stp.c *** g77-0.5.22/f/stp.c Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/stp.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stp.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stp.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stp.h g77-0.5.23/f/stp.h *** g77-0.5.22/f/stp.h Sat Mar 9 18:53:41 1996 --- g77-0.5.23/f/stp.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stp.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stp.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-1t.fin g77-0.5.23/f/str-1t.fin *** g77-0.5.22/f/str-1t.fin Sat Mar 9 18:53:41 1996 --- g77-0.5.23/f/str-1t.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-2t.fin g77-0.5.23/f/str-2t.fin *** g77-0.5.22/f/str-2t.fin Sat Mar 9 18:53:41 1996 --- g77-0.5.23/f/str-2t.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-fo.fin g77-0.5.23/f/str-fo.fin *** g77-0.5.22/f/str-fo.fin Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str-fo.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-io.fin g77-0.5.23/f/str-io.fin *** g77-0.5.22/f/str-io.fin Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str-io.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-nq.fin g77-0.5.23/f/str-nq.fin *** g77-0.5.22/f/str-nq.fin Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str-nq.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-op.fin g77-0.5.23/f/str-op.fin *** g77-0.5.22/f/str-op.fin Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str-op.fin Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str-ot.fin g77-0.5.23/f/str-ot.fin *** g77-0.5.22/f/str-ot.fin Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str-ot.fin Fri May 15 17:27:20 1998 *************** *** 1,5 **** { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- { Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** the Free Software Foundation, 59 Temple *** 23,43 **** FFESTR_other // // ffestrOther ffestr_other 1 1 ! ;And AND ;Dimension DIMENSION ! ;Eq EQ ! ;Eqv EQV ! ;Ge GE ! ;Gt GT In IN InOut INOUT Kind KIND ! ;Le LE Len LEN ! ;Lt LT ! ;Ne NE ! ;Neqv NEQV ! ;Not NOT ;Only ONLY ! ;Or OR Out OUT ;Pointer POINTER --- 23,44 ---- FFESTR_other // // ffestrOther ffestr_other 1 1 ! And AND ;Dimension DIMENSION ! Eq EQ ! Eqv EQV ! False FALSE ! GE GE ! GT GT In IN InOut INOUT Kind KIND ! LE LE Len LEN ! LT LT ! NE NE ! NEqv NEQV ! Not NOT ;Only ONLY ! Or OR Out OUT ;Pointer POINTER *************** Out OUT *** 46,47 **** --- 47,50 ---- Result RESULT ;Stat STAT + True TRUE + XOr XOR diff -rcp2N g77-0.5.22/f/str.c g77-0.5.23/f/str.c *** g77-0.5.22/f/str.c Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* str.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* str.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/str.h g77-0.5.23/f/str.h *** g77-0.5.22/f/str.h Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/str.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* str.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* str.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/sts.c g77-0.5.23/f/sts.c *** g77-0.5.22/f/sts.c Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/sts.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* sts.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* sts.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffests_puttext (ffests s, char *text, ff *** 253,269 **** newlen = s->len_ + length; if (newlen > s->max_) ! if (s->text_ == NULL) ! { ! s->max_ = 40; ! s->text_ = malloc_new_ksr (s->pool_, "ffests", s->max_); ! } ! else ! { ! newmax = s->max_ << 1; ! while (newmax < newlen) ! newmax <<= 1; ! s->text_ = malloc_resize_ksr (s->pool_, s->text_, newmax, s->max_); ! s->max_ = newmax; ! } memcpy (s->text_ + s->len_, text, length); --- 253,271 ---- newlen = s->len_ + length; if (newlen > s->max_) ! { ! if (s->text_ == NULL) ! { ! s->max_ = 40; ! s->text_ = malloc_new_ksr (s->pool_, "ffests", s->max_); ! } ! else ! { ! newmax = s->max_ << 1; ! while (newmax < newlen) ! newmax <<= 1; ! s->text_ = malloc_resize_ksr (s->pool_, s->text_, newmax, s->max_); ! s->max_ = newmax; ! } ! } memcpy (s->text_ + s->len_, text, length); diff -rcp2N g77-0.5.22/f/sts.h g77-0.5.23/f/sts.h *** g77-0.5.22/f/sts.h Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/sts.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* sts.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* sts.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stt.c g77-0.5.23/f/stt.c *** g77-0.5.22/f/stt.c Sun Feb 23 20:43:39 1997 --- g77-0.5.23/f/stt.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stt.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stt.c -- Implementation File (module.c template V1.0) Copyright (C) 1995, 1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stt.h g77-0.5.23/f/stt.h *** g77-0.5.22/f/stt.h Sat Mar 1 04:29:19 1997 --- g77-0.5.23/f/stt.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stt.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stt.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stu.c g77-0.5.23/f/stu.c *** g77-0.5.22/f/stu.c Mon Sep 29 20:42:56 1997 --- g77-0.5.23/f/stu.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stu.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stu.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stu.h g77-0.5.23/f/stu.h *** g77-0.5.22/f/stu.h Wed Aug 30 19:53:33 1995 --- g77-0.5.23/f/stu.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stu.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stu.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stv.c g77-0.5.23/f/stv.c *** g77-0.5.22/f/stv.c Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/stv.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stv.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stv.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stv.h g77-0.5.23/f/stv.h *** g77-0.5.22/f/stv.h Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/stv.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stv.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stv.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stw.c g77-0.5.23/f/stw.c *** g77-0.5.22/f/stw.c Mon Dec 4 06:10:30 1995 --- g77-0.5.23/f/stw.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stw.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stw.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/stw.h g77-0.5.23/f/stw.h *** g77-0.5.22/f/stw.h Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/stw.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* stw.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* stw.h -- Private #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/symbol.c g77-0.5.23/f/symbol.c *** g77-0.5.22/f/symbol.c Tue Sep 9 06:11:37 1997 --- g77-0.5.23/f/symbol.c Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* Implementation of Fortran symbol manager Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Implementation of Fortran symbol manager Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffesymbol_check_token_ (ffelexToken t, c *** 171,178 **** if (bad != FFEBAD) ! if (i >= len) ! *c = *(ffelex_token_text (t)); ! else ! *c = *p; return bad; --- 171,180 ---- if (bad != FFEBAD) ! { ! if (i >= len) ! *c = *(ffelex_token_text (t)); ! else ! *c = *p; ! } return bad; diff -rcp2N g77-0.5.22/f/symbol.def g77-0.5.23/f/symbol.def *** g77-0.5.22/f/symbol.def Wed Feb 5 06:01:20 1997 --- g77-0.5.23/f/symbol.def Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* Definitions and documentations for attributes used in GNU F77 compiler Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Definitions and documentations for attributes used in GNU F77 compiler Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/symbol.h g77-0.5.23/f/symbol.h *** g77-0.5.22/f/symbol.h Fri Jul 11 00:08:38 1997 --- g77-0.5.23/f/symbol.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* Interface definitions for Fortran symbol manager Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Interface definitions for Fortran symbol manager Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/target.c g77-0.5.23/f/target.c *** g77-0.5.22/f/target.c Sun Mar 8 21:36:15 1998 --- g77-0.5.23/f/target.c Tue Apr 21 01:23:30 1998 *************** *** 1,5 **** /* target.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* target.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1998 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** ffetarget_real1 (ffetargetReal1 *value, *** 2257,2267 **** if (exponent_sign != NULL) ! if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS) ! *p++ = '+'; ! else ! { ! assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS); ! *p++ = '-'; ! } dotoktxt (exponent_digits); --- 2257,2269 ---- if (exponent_sign != NULL) ! { ! if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS) ! *p++ = '+'; ! else ! { ! assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS); ! *p++ = '-'; ! } ! } dotoktxt (exponent_digits); *************** ffetarget_real2 (ffetargetReal2 *value, *** 2341,2351 **** if (exponent_sign != NULL) ! if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS) ! *p++ = '+'; ! else ! { ! assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS); ! *p++ = '-'; ! } dotoktxt (exponent_digits); --- 2343,2355 ---- if (exponent_sign != NULL) ! { ! if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS) ! *p++ = '+'; ! else ! { ! assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS); ! *p++ = '-'; ! } ! } dotoktxt (exponent_digits); *************** ffetarget_num_digits_ (ffelexToken token *** 2551,2552 **** --- 2555,4753 ---- } } + + /* Begin the cruft g77 used to patch into gcc-2.7/real.c. */ + + #include + #include "config.j" + #include "tree.j" + + #ifdef REAL_ARITHMETIC + #define NEED_E53TOE /* Compile e53toe, else avoid compiler warning. */ + + void warning (char *s, ...); /* From toplev.c (no .h file). */ + + #ifndef errno + extern int errno; + #endif + + /* To enable support of XFmode extended real floating point, define + LONG_DOUBLE_TYPE_SIZE 96 in the tm.h file (m68k.h or i386.h). + + To support cross compilation between IEEE, VAX and IBM floating + point formats, define REAL_ARITHMETIC in the tm.h file. + + In either case the machine files (tm.h) must not contain any code + that tries to use host floating point arithmetic to convert + REAL_VALUE_TYPEs from `double' to `float', pass them to fprintf, + etc. In cross-compile situations a REAL_VALUE_TYPE may not + be intelligible to the host computer's native arithmetic. + + The emulator defaults to the host's floating point format so that + its decimal conversion functions can be used if desired (see + real.h). + + The first part of this file interfaces gcc to a floating point + arithmetic suite that was not written with gcc in mind. Avoid + changing the low-level arithmetic routines unless you have suitable + test programs available. A special version of the PARANOIA floating + point arithmetic tester, modified for this purpose, can be found on + usc.edu: /pub/C-numanal/ieeetest.zoo. Other tests, and libraries of + XFmode and TFmode transcendental functions, can be obtained by ftp from + netlib.att.com: netlib/cephes. */ + + /* Type of computer arithmetic. + Only one of DEC, IBM, IEEE, or UNK should get defined. + + `IEEE', when REAL_WORDS_BIG_ENDIAN is non-zero, refers generically + to big-endian IEEE floating-point data structure. This definition + should work in SFmode `float' type and DFmode `double' type on + virtually all big-endian IEEE machines. If LONG_DOUBLE_TYPE_SIZE + has been defined to be 96, then IEEE also invokes the particular + XFmode (`long double' type) data structure used by the Motorola + 680x0 series processors. + + `IEEE', when REAL_WORDS_BIG_ENDIAN is zero, refers generally to + little-endian IEEE machines. In this case, if LONG_DOUBLE_TYPE_SIZE + has been defined to be 96, then IEEE also invokes the particular + XFmode `long double' data structure used by the Intel 80x86 series + processors. + + `DEC' refers specifically to the Digital Equipment Corp PDP-11 + and VAX floating point data structure. This model currently + supports no type wider than DFmode. + + `IBM' refers specifically to the IBM System/370 and compatible + floating point data structure. This model currently supports + no type wider than DFmode. The IBM conversions were contributed by + frank@atom.ansto.gov.au (Frank Crawford). + + If LONG_DOUBLE_TYPE_SIZE = 64 (the default, unless tm.h defines it) + then `long double' and `double' are both implemented, but they + both mean DFmode. In this case, the software floating-point + support available here is activated by writing + #define REAL_ARITHMETIC + in tm.h. + + The case LONG_DOUBLE_TYPE_SIZE = 128 activates TFmode support + and may deactivate XFmode since `long double' is used to refer + to both modes. + + The macros FLOAT_WORDS_BIG_ENDIAN, HOST_FLOAT_WORDS_BIG_ENDIAN, + contributed by Richard Earnshaw , + separate the floating point unit's endian-ness from that of + the integer addressing. This permits one to define a big-endian + FPU on a little-endian machine (e.g., ARM). An extension to + BYTES_BIG_ENDIAN may be required for some machines in the future. + These optional macros may be defined in tm.h. In real.h, they + default to WORDS_BIG_ENDIAN, etc., so there is no need to define + them for any normal host or target machine on which the floats + and the integers have the same endian-ness. */ + + + /* The following converts gcc macros into the ones used by this file. */ + + /* REAL_ARITHMETIC defined means that macros in real.h are + defined to call emulator functions. */ + #ifdef REAL_ARITHMETIC + + #if TARGET_FLOAT_FORMAT == VAX_FLOAT_FORMAT + /* PDP-11, Pro350, VAX: */ + #define DEC 1 + #else /* it's not VAX */ + #if TARGET_FLOAT_FORMAT == IBM_FLOAT_FORMAT + /* IBM System/370 style */ + #define IBM 1 + #else /* it's also not an IBM */ + #if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT + #define IEEE + #else /* it's not IEEE either */ + /* UNKnown arithmetic. We don't support this and can't go on. */ + unknown arithmetic type + #define UNK 1 + #endif /* not IEEE */ + #endif /* not IBM */ + #endif /* not VAX */ + + #define REAL_WORDS_BIG_ENDIAN FLOAT_WORDS_BIG_ENDIAN + + #else + /* REAL_ARITHMETIC not defined means that the *host's* data + structure will be used. It may differ by endian-ness from the + target machine's structure and will get its ends swapped + accordingly (but not here). Probably only the decimal <-> binary + functions in this file will actually be used in this case. */ + + #if HOST_FLOAT_FORMAT == VAX_FLOAT_FORMAT + #define DEC 1 + #else /* it's not VAX */ + #if HOST_FLOAT_FORMAT == IBM_FLOAT_FORMAT + /* IBM System/370 style */ + #define IBM 1 + #else /* it's also not an IBM */ + #if HOST_FLOAT_FORMAT == IEEE_FLOAT_FORMAT + #define IEEE + #else /* it's not IEEE either */ + unknown arithmetic type + #define UNK 1 + #endif /* not IEEE */ + #endif /* not IBM */ + #endif /* not VAX */ + + #define REAL_WORDS_BIG_ENDIAN HOST_FLOAT_WORDS_BIG_ENDIAN + + #endif /* REAL_ARITHMETIC not defined */ + + /* Define INFINITY for support of infinity. + Define NANS for support of Not-a-Number's (NaN's). */ + #if !defined(DEC) && !defined(IBM) + #define INFINITY + #define NANS + #endif + + /* Support of NaNs requires support of infinity. */ + #ifdef NANS + #ifndef INFINITY + #define INFINITY + #endif + #endif + + /* Find a host integer type that is at least 16 bits wide, + and another type at least twice whatever that size is. */ + + #if HOST_BITS_PER_CHAR >= 16 + #define EMUSHORT char + #define EMUSHORT_SIZE HOST_BITS_PER_CHAR + #define EMULONG_SIZE (2 * HOST_BITS_PER_CHAR) + #else + #if HOST_BITS_PER_SHORT >= 16 + #define EMUSHORT short + #define EMUSHORT_SIZE HOST_BITS_PER_SHORT + #define EMULONG_SIZE (2 * HOST_BITS_PER_SHORT) + #else + #if HOST_BITS_PER_INT >= 16 + #define EMUSHORT int + #define EMUSHORT_SIZE HOST_BITS_PER_INT + #define EMULONG_SIZE (2 * HOST_BITS_PER_INT) + #else + #if HOST_BITS_PER_LONG >= 16 + #define EMUSHORT long + #define EMUSHORT_SIZE HOST_BITS_PER_LONG + #define EMULONG_SIZE (2 * HOST_BITS_PER_LONG) + #else + /* You will have to modify this program to have a smaller unit size. */ + #define EMU_NON_COMPILE + #endif + #endif + #endif + #endif + + #if HOST_BITS_PER_SHORT >= EMULONG_SIZE + #define EMULONG short + #else + #if HOST_BITS_PER_INT >= EMULONG_SIZE + #define EMULONG int + #else + #if HOST_BITS_PER_LONG >= EMULONG_SIZE + #define EMULONG long + #else + #if HOST_BITS_PER_LONG_LONG >= EMULONG_SIZE + #define EMULONG long long int + #else + /* You will have to modify this program to have a smaller unit size. */ + #define EMU_NON_COMPILE + #endif + #endif + #endif + #endif + + + /* The host interface doesn't work if no 16-bit size exists. */ + #if EMUSHORT_SIZE != 16 + #define EMU_NON_COMPILE + #endif + + /* OK to continue compilation. */ + #ifndef EMU_NON_COMPILE + + /* Construct macros to translate between REAL_VALUE_TYPE and e type. + In GET_REAL and PUT_REAL, r and e are pointers. + A REAL_VALUE_TYPE is guaranteed to occupy contiguous locations + in memory, with no holes. */ + + #if LONG_DOUBLE_TYPE_SIZE == 96 + /* Number of 16 bit words in external e type format */ + #define NE 6 + #define MAXDECEXP 4932 + #define MINDECEXP -4956 + #define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE) + #define PUT_REAL(e,r) bcopy ((char *) e, (char *) r, 2*NE) + #else /* no XFmode */ + #if LONG_DOUBLE_TYPE_SIZE == 128 + #define NE 10 + #define MAXDECEXP 4932 + #define MINDECEXP -4977 + #define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE) + #define PUT_REAL(e,r) bcopy ((char *) e, (char *) r, 2*NE) + #else + #define NE 6 + #define MAXDECEXP 4932 + #define MINDECEXP -4956 + + #define NEED_ETOE53 /* Compile etoe53, else avoid compiler warning. */ + + #ifdef REAL_ARITHMETIC + /* Emulator uses target format internally + but host stores it in host endian-ness. */ + + #define GET_REAL(r,e) \ + do { \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ + e53toe ((unsigned EMUSHORT*) (r), (e)); \ + else \ + { \ + unsigned EMUSHORT w[4]; \ + w[3] = ((EMUSHORT *) r)[0]; \ + w[2] = ((EMUSHORT *) r)[1]; \ + w[1] = ((EMUSHORT *) r)[2]; \ + w[0] = ((EMUSHORT *) r)[3]; \ + e53toe (w, (e)); \ + } \ + } while (0) + + #define PUT_REAL(e,r) \ + do { \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ + etoe53 ((e), (unsigned EMUSHORT *) (r)); \ + else \ + { \ + unsigned EMUSHORT w[4]; \ + etoe53 ((e), w); \ + *((EMUSHORT *) r) = w[3]; \ + *((EMUSHORT *) r + 1) = w[2]; \ + *((EMUSHORT *) r + 2) = w[1]; \ + *((EMUSHORT *) r + 3) = w[0]; \ + } \ + } while (0) + + #else /* not REAL_ARITHMETIC */ + + /* emulator uses host format */ + #define GET_REAL(r,e) e53toe ((unsigned EMUSHORT *) (r), (e)) + #define PUT_REAL(e,r) etoe53 ((e), (unsigned EMUSHORT *) (r)) + + #endif /* not REAL_ARITHMETIC */ + #endif /* not TFmode */ + #endif /* no XFmode */ + + + /* Number of 16 bit words in internal format */ + #define NI (NE+3) + + /* Array offset to exponent */ + #define E 1 + + /* Array offset to high guard word */ + #define M 2 + + /* Number of bits of precision */ + #define NBITS ((NI-4)*16) + + /* Maximum number of decimal digits in ASCII conversion + * = NBITS*log10(2) + */ + #define NDEC (NBITS*8/27) + + /* The exponent of 1.0 */ + #define EXONE (0x3fff) + + extern int extra_warnings; + extern unsigned EMUSHORT ezero[], ehalf[], eone[], etwo[]; + extern unsigned EMUSHORT elog2[], esqrt2[]; + + static void eclear PROTO((unsigned EMUSHORT *)); + static void eneg PROTO((unsigned EMUSHORT *)); + static int eisneg PROTO((unsigned EMUSHORT *)); + static int eisinf PROTO((unsigned EMUSHORT *)); + static int eisnan PROTO((unsigned EMUSHORT *)); + static void einfin PROTO((unsigned EMUSHORT *)); + static void enan PROTO((unsigned EMUSHORT *, int)); + static void emovi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void emovo PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void ecleaz PROTO((unsigned EMUSHORT *)); + static void ecleazs PROTO((unsigned EMUSHORT *)); + static int eiisnan PROTO((unsigned EMUSHORT *)); + static int eiisneg PROTO((unsigned EMUSHORT *)); + static void eshdn1 PROTO((unsigned EMUSHORT *)); + static void eshup1 PROTO((unsigned EMUSHORT *)); + static void eshdn8 PROTO((unsigned EMUSHORT *)); + static void eshup8 PROTO((unsigned EMUSHORT *)); + static void eshup6 PROTO((unsigned EMUSHORT *)); + static void eshdn6 PROTO((unsigned EMUSHORT *)); + static void eaddm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void emdnorm PROTO((unsigned EMUSHORT *, int, int, EMULONG, int)); + static void e53toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void e24toe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void etoe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void toe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static int eshift PROTO((unsigned EMUSHORT *, int)); + static int enormlz PROTO((unsigned EMUSHORT *)); + static void mtherr PROTO((char *, int)); + #ifdef DEC + static void dectoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void etodec PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + static void todec PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); + #endif + #if IBM + static void ibmtoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *, + enum machine_mode)); + static void etoibm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *, + enum machine_mode)); + static void toibm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *, + enum machine_mode)); + #endif + static void make_nan PROTO((unsigned EMUSHORT *, int, enum machine_mode)); + + /* + Extended precision IEEE binary floating point arithmetic routines + + Numbers are stored in C language as arrays of 16-bit unsigned + short integers. The arguments of the routines are pointers to + the arrays. + + External e type data structure, similar to Intel 8087 chip + temporary real format but possibly with a larger significand: + + NE-1 significand words (least significant word first, + most significant bit is normally set) + exponent (value = EXONE for 1.0, + top bit is the sign) + + + Internal exploded e-type data structure of a number (a "word" is 16 bits): + + ei[0] sign word (0 for positive, 0xffff for negative) + ei[1] biased exponent (value = EXONE for the number 1.0) + ei[2] high guard word (always zero after normalization) + ei[3] + to ei[NI-2] significand (NI-4 significand words, + most significant word first, + most significant bit is set) + ei[NI-1] low guard word (0x8000 bit is rounding place) + + + + Routines for external format e-type numbers + + asctoe (string, e) ASCII string to extended double e type + asctoe64 (string, &d) ASCII string to long double + asctoe53 (string, &d) ASCII string to double + asctoe24 (string, &f) ASCII string to single + asctoeg (string, e, prec) ASCII string to specified precision + e24toe (&f, e) IEEE single precision to e type + e53toe (&d, e) IEEE double precision to e type + e64toe (&d, e) IEEE long double precision to e type + e113toe (&d, e) 128-bit long double precision to e type + eabs (e) absolute value + eadd (a, b, c) c = b + a + eclear (e) e = 0 + ecmp (a, b) Returns 1 if a > b, 0 if a == b, + -1 if a < b, -2 if either a or b is a NaN. + ediv (a, b, c) c = b / a + efloor (a, b) truncate to integer, toward -infinity + efrexp (a, exp, s) extract exponent and significand + eifrac (e, &l, frac) e to HOST_WIDE_INT and e type fraction + euifrac (e, &l, frac) e to unsigned HOST_WIDE_INT and e type fraction + einfin (e) set e to infinity, leaving its sign alone + eldexp (a, n, b) multiply by 2**n + emov (a, b) b = a + emul (a, b, c) c = b * a + eneg (e) e = -e + eround (a, b) b = nearest integer value to a + esub (a, b, c) c = b - a + e24toasc (&f, str, n) single to ASCII string, n digits after decimal + e53toasc (&d, str, n) double to ASCII string, n digits after decimal + e64toasc (&d, str, n) 80-bit long double to ASCII string + e113toasc (&d, str, n) 128-bit long double to ASCII string + etoasc (e, str, n) e to ASCII string, n digits after decimal + etoe24 (e, &f) convert e type to IEEE single precision + etoe53 (e, &d) convert e type to IEEE double precision + etoe64 (e, &d) convert e type to IEEE long double precision + ltoe (&l, e) HOST_WIDE_INT to e type + ultoe (&l, e) unsigned HOST_WIDE_INT to e type + eisneg (e) 1 if sign bit of e != 0, else 0 + eisinf (e) 1 if e has maximum exponent (non-IEEE) + or is infinite (IEEE) + eisnan (e) 1 if e is a NaN + + + Routines for internal format exploded e-type numbers + + eaddm (ai, bi) add significands, bi = bi + ai + ecleaz (ei) ei = 0 + ecleazs (ei) set ei = 0 but leave its sign alone + ecmpm (ai, bi) compare significands, return 1, 0, or -1 + edivm (ai, bi) divide significands, bi = bi / ai + emdnorm (ai,l,s,exp) normalize and round off + emovi (a, ai) convert external a to internal ai + emovo (ai, a) convert internal ai to external a + emovz (ai, bi) bi = ai, low guard word of bi = 0 + emulm (ai, bi) multiply significands, bi = bi * ai + enormlz (ei) left-justify the significand + eshdn1 (ai) shift significand and guards down 1 bit + eshdn8 (ai) shift down 8 bits + eshdn6 (ai) shift down 16 bits + eshift (ai, n) shift ai n bits up (or down if n < 0) + eshup1 (ai) shift significand and guards up 1 bit + eshup8 (ai) shift up 8 bits + eshup6 (ai) shift up 16 bits + esubm (ai, bi) subtract significands, bi = bi - ai + eiisinf (ai) 1 if infinite + eiisnan (ai) 1 if a NaN + eiisneg (ai) 1 if sign bit of ai != 0, else 0 + einan (ai) set ai = NaN + eiinfin (ai) set ai = infinity + + The result is always normalized and rounded to NI-4 word precision + after each arithmetic operation. + + Exception flags are NOT fully supported. + + Signaling NaN's are NOT supported; they are treated the same + as quiet NaN's. + + Define INFINITY for support of infinity; otherwise a + saturation arithmetic is implemented. + + Define NANS for support of Not-a-Number items; otherwise the + arithmetic will never produce a NaN output, and might be confused + by a NaN input. + If NaN's are supported, the output of `ecmp (a,b)' is -2 if + either a or b is a NaN. This means asking `if (ecmp (a,b) < 0)' + may not be legitimate. Use `if (ecmp (a,b) == -1)' for `less than' + if in doubt. + + Denormals are always supported here where appropriate (e.g., not + for conversion to DEC numbers). */ + + /* Definitions for error codes that are passed to the common error handling + routine mtherr. + + For Digital Equipment PDP-11 and VAX computers, certain + IBM systems, and others that use numbers with a 56-bit + significand, the symbol DEC should be defined. In this + mode, most floating point constants are given as arrays + of octal integers to eliminate decimal to binary conversion + errors that might be introduced by the compiler. + + For computers, such as IBM PC, that follow the IEEE + Standard for Binary Floating Point Arithmetic (ANSI/IEEE + Std 754-1985), the symbol IEEE should be defined. + These numbers have 53-bit significands. In this mode, constants + are provided as arrays of hexadecimal 16 bit integers. + The endian-ness of generated values is controlled by + REAL_WORDS_BIG_ENDIAN. + + To accommodate other types of computer arithmetic, all + constants are also provided in a normal decimal radix + which one can hope are correctly converted to a suitable + format by the available C language compiler. To invoke + this mode, the symbol UNK is defined. + + An important difference among these modes is a predefined + set of machine arithmetic constants for each. The numbers + MACHEP (the machine roundoff error), MAXNUM (largest number + represented), and several other parameters are preset by + the configuration symbol. Check the file const.c to + ensure that these values are correct for your computer. + + For ANSI C compatibility, define ANSIC equal to 1. Currently + this affects only the atan2 function and others that use it. */ + + /* Constant definitions for math error conditions. */ + + #define DOMAIN 1 /* argument domain error */ + #define SING 2 /* argument singularity */ + #define OVERFLOW 3 /* overflow range error */ + #define UNDERFLOW 4 /* underflow range error */ + #define TLOSS 5 /* total loss of precision */ + #define PLOSS 6 /* partial loss of precision */ + #define INVALID 7 /* NaN-producing operation */ + + #if 0 + extern unsigned EMUSHORT ezero[]; + extern unsigned EMUSHORT ehalf[]; + extern unsigned EMUSHORT eone[]; + extern unsigned EMUSHORT etwo[]; + extern unsigned EMUSHORT e32[]; + extern unsigned EMUSHORT elog2[]; + extern unsigned EMUSHORT esqrt2[]; + extern unsigned EMUSHORT epi[]; + #endif + + /* Control register for rounding precision. + This can be set to 113 (if NE=10), 80 (if NE=6), 64, 56, 53, or 24 bits. */ + + extern int rndprc; + + /* Clear out entire e-type number X. */ + + /* KEEP */ + static void + eclear (x) + register unsigned EMUSHORT *x; + { + register int i; + + for (i = 0; i < NE; i++) + *x++ = 0; + } + + /* Negate the e-type number X. */ + + /* KEEP */ + static void + eneg (x) + unsigned EMUSHORT x[]; + { + + x[NE - 1] ^= 0x8000; /* Toggle the sign bit */ + } + + /* Return 1 if sign bit of e-type number X is nonzero, else zero. */ + + /* KEEP */ + static int + eisneg (x) + unsigned EMUSHORT x[]; + { + + if (x[NE - 1] & 0x8000) + return (1); + else + return (0); + } + + /* Return 1 if e-type number X is infinity, else return zero. */ + + /* KEEP */ + static int + eisinf (x) + unsigned EMUSHORT x[]; + { + + #ifdef NANS + if (eisnan (x)) + return (0); + #endif + if ((x[NE - 1] & 0x7fff) == 0x7fff) + return (1); + else + return (0); + } + + /* Check if e-type number is not a number. The bit pattern is one that we + defined, so we know for sure how to detect it. */ + + /* KEEP */ + static int + eisnan (x) + unsigned EMUSHORT x[]; + { + #ifdef NANS + int i; + + /* NaN has maximum exponent */ + if ((x[NE - 1] & 0x7fff) != 0x7fff) + return (0); + /* ... and non-zero significand field. */ + for (i = 0; i < NE - 1; i++) + { + if (*x++ != 0) + return (1); + } + #endif + + return (0); + } + + /* Fill e-type number X with infinity pattern (IEEE) + or largest possible number (non-IEEE). */ + + /* KEEP */ + static void + einfin (x) + register unsigned EMUSHORT *x; + { + register int i; + + #ifdef INFINITY + for (i = 0; i < NE - 1; i++) + *x++ = 0; + *x |= 32767; + #else + for (i = 0; i < NE - 1; i++) + *x++ = 0xffff; + *x |= 32766; + if (rndprc < NBITS) + { + if (rndprc == 113) + { + *(x - 9) = 0; + *(x - 8) = 0; + } + if (rndprc == 64) + { + *(x - 5) = 0; + } + if (rndprc == 53) + { + *(x - 4) = 0xf800; + } + else + { + *(x - 4) = 0; + *(x - 3) = 0; + *(x - 2) = 0xff00; + } + } + #endif + } + + /* Output an e-type NaN. + This generates Intel's quiet NaN pattern for extended real. + The exponent is 7fff, the leading mantissa word is c000. */ + + /* KEEP */ + static void + enan (x, sign) + register unsigned EMUSHORT *x; + int sign; + { + register int i; + + for (i = 0; i < NE - 2; i++) + *x++ = 0; + *x++ = 0xc000; + *x = (sign << 15) | 0x7fff; + } + + /* Move in an e-type number A, converting it to exploded e-type B. */ + + /* KEEP */ + static void + emovi (a, b) + unsigned EMUSHORT *a, *b; + { + register unsigned EMUSHORT *p, *q; + int i; + + q = b; + p = a + (NE - 1); /* point to last word of external number */ + /* get the sign bit */ + if (*p & 0x8000) + *q++ = 0xffff; + else + *q++ = 0; + /* get the exponent */ + *q = *p--; + *q++ &= 0x7fff; /* delete the sign bit */ + #ifdef INFINITY + if ((*(q - 1) & 0x7fff) == 0x7fff) + { + #ifdef NANS + if (eisnan (a)) + { + *q++ = 0; + for (i = 3; i < NI; i++) + *q++ = *p--; + return; + } + #endif + + for (i = 2; i < NI; i++) + *q++ = 0; + return; + } + #endif + + /* clear high guard word */ + *q++ = 0; + /* move in the significand */ + for (i = 0; i < NE - 1; i++) + *q++ = *p--; + /* clear low guard word */ + *q = 0; + } + + /* Move out exploded e-type number A, converting it to e type B. */ + + /* KEEP */ + static void + emovo (a, b) + unsigned EMUSHORT *a, *b; + { + register unsigned EMUSHORT *p, *q; + unsigned EMUSHORT i; + int j; + + p = a; + q = b + (NE - 1); /* point to output exponent */ + /* combine sign and exponent */ + i = *p++; + if (i) + *q-- = *p++ | 0x8000; + else + *q-- = *p++; + #ifdef INFINITY + if (*(p - 1) == 0x7fff) + { + #ifdef NANS + if (eiisnan (a)) + { + enan (b, eiisneg (a)); + return; + } + #endif + einfin (b); + return; + } + #endif + /* skip over guard word */ + ++p; + /* move the significand */ + for (j = 0; j < NE - 1; j++) + *q-- = *p++; + } + + /* Clear out exploded e-type number XI. */ + + /* KEEP */ + static void + ecleaz (xi) + register unsigned EMUSHORT *xi; + { + register int i; + + for (i = 0; i < NI; i++) + *xi++ = 0; + } + + /* Clear out exploded e-type XI, but don't touch the sign. */ + + /* KEEP */ + static void + ecleazs (xi) + register unsigned EMUSHORT *xi; + { + register int i; + + ++xi; + for (i = 0; i < NI - 1; i++) + *xi++ = 0; + } + + /* Return nonzero if exploded e-type X is a NaN. */ + + /* KEEP */ + static int + eiisnan (x) + unsigned EMUSHORT x[]; + { + int i; + + if ((x[E] & 0x7fff) == 0x7fff) + { + for (i = M + 1; i < NI; i++) + { + if (x[i] != 0) + return (1); + } + } + return (0); + } + + /* Return nonzero if sign of exploded e-type X is nonzero. */ + + /* KEEP */ + static int + eiisneg (x) + unsigned EMUSHORT x[]; + { + + return x[0] != 0; + } + + /* Shift significand of exploded e-type X down by 1 bit. */ + + /* KEEP */ + static void + eshdn1 (x) + register unsigned EMUSHORT *x; + { + register unsigned EMUSHORT bits; + int i; + + x += M; /* point to significand area */ + + bits = 0; + for (i = M; i < NI; i++) + { + if (*x & 1) + bits |= 1; + *x >>= 1; + if (bits & 2) + *x |= 0x8000; + bits <<= 1; + ++x; + } + } + + /* Shift significand of exploded e-type X up by 1 bit. */ + + /* KEEP */ + static void + eshup1 (x) + register unsigned EMUSHORT *x; + { + register unsigned EMUSHORT bits; + int i; + + x += NI - 1; + bits = 0; + + for (i = M; i < NI; i++) + { + if (*x & 0x8000) + bits |= 1; + *x <<= 1; + if (bits & 2) + *x |= 1; + bits <<= 1; + --x; + } + } + + + /* Shift significand of exploded e-type X down by 8 bits. */ + + /* KEEP */ + static void + eshdn8 (x) + register unsigned EMUSHORT *x; + { + register unsigned EMUSHORT newbyt, oldbyt; + int i; + + x += M; + oldbyt = 0; + for (i = M; i < NI; i++) + { + newbyt = *x << 8; + *x >>= 8; + *x |= oldbyt; + oldbyt = newbyt; + ++x; + } + } + + /* Shift significand of exploded e-type X up by 8 bits. */ + + /* KEEP */ + static void + eshup8 (x) + register unsigned EMUSHORT *x; + { + int i; + register unsigned EMUSHORT newbyt, oldbyt; + + x += NI - 1; + oldbyt = 0; + + for (i = M; i < NI; i++) + { + newbyt = *x >> 8; + *x <<= 8; + *x |= oldbyt; + oldbyt = newbyt; + --x; + } + } + + /* Shift significand of exploded e-type X up by 16 bits. */ + + /* KEEP */ + static void + eshup6 (x) + register unsigned EMUSHORT *x; + { + int i; + register unsigned EMUSHORT *p; + + p = x + M; + x += M + 1; + + for (i = M; i < NI - 1; i++) + *p++ = *x++; + + *p = 0; + } + + /* Shift significand of exploded e-type X down by 16 bits. */ + + /* KEEP */ + static void + eshdn6 (x) + register unsigned EMUSHORT *x; + { + int i; + register unsigned EMUSHORT *p; + + x += NI - 1; + p = x + 1; + + for (i = M; i < NI - 1; i++) + *(--p) = *(--x); + + *(--p) = 0; + } + + /* Add significands of exploded e-type X and Y. X + Y replaces Y. */ + + /* KEEP */ + static void + eaddm (x, y) + unsigned EMUSHORT *x, *y; + { + register unsigned EMULONG a; + int i; + unsigned int carry; + + x += NI - 1; + y += NI - 1; + carry = 0; + for (i = M; i < NI; i++) + { + a = (unsigned EMULONG) (*x) + (unsigned EMULONG) (*y) + carry; + if (a & 0x10000) + carry = 1; + else + carry = 0; + *y = (unsigned EMUSHORT) a; + --x; + --y; + } + } + + /* Normalize and round off. + + The internal format number to be rounded is S. + Input LOST is 0 if the value is exact. This is the so-called sticky bit. + + Input SUBFLG indicates whether the number was obtained + by a subtraction operation. In that case if LOST is nonzero + then the number is slightly smaller than indicated. + + Input EXP is the biased exponent, which may be negative. + the exponent field of S is ignored but is replaced by + EXP as adjusted by normalization and rounding. + + Input RCNTRL is the rounding control. If it is nonzero, the + returned value will be rounded to RNDPRC bits. + + For future reference: In order for emdnorm to round off denormal + significands at the right point, the input exponent must be + adjusted to be the actual value it would have after conversion to + the final floating point type. This adjustment has been + implemented for all type conversions (etoe53, etc.) and decimal + conversions, but not for the arithmetic functions (eadd, etc.). + Data types having standard 15-bit exponents are not affected by + this, but SFmode and DFmode are affected. For example, ediv with + rndprc = 24 will not round correctly to 24-bit precision if the + result is denormal. */ + + static int rlast = -1; + static int rw = 0; + static unsigned EMUSHORT rmsk = 0; + static unsigned EMUSHORT rmbit = 0; + static unsigned EMUSHORT rebit = 0; + static int re = 0; + static unsigned EMUSHORT rbit[NI]; + + /* KEEP */ + static void + emdnorm (s, lost, subflg, exp, rcntrl) + unsigned EMUSHORT s[]; + int lost; + int subflg; + EMULONG exp; + int rcntrl; + { + int i, j; + unsigned EMUSHORT r; + + /* Normalize */ + j = enormlz (s); + + /* a blank significand could mean either zero or infinity. */ + #ifndef INFINITY + if (j > NBITS) + { + ecleazs (s); + return; + } + #endif + exp -= j; + #ifndef INFINITY + if (exp >= 32767L) + goto overf; + #else + if ((j > NBITS) && (exp < 32767)) + { + ecleazs (s); + return; + } + #endif + if (exp < 0L) + { + if (exp > (EMULONG) (-NBITS - 1)) + { + j = (int) exp; + i = eshift (s, j); + if (i) + lost = 1; + } + else + { + ecleazs (s); + return; + } + } + /* Round off, unless told not to by rcntrl. */ + if (rcntrl == 0) + goto mdfin; + /* Set up rounding parameters if the control register changed. */ + if (rndprc != rlast) + { + ecleaz (rbit); + switch (rndprc) + { + default: + case NBITS: + rw = NI - 1; /* low guard word */ + rmsk = 0xffff; + rmbit = 0x8000; + re = rw - 1; + rebit = 1; + break; + case 113: + rw = 10; + rmsk = 0x7fff; + rmbit = 0x4000; + rebit = 0x8000; + re = rw; + break; + case 64: + rw = 7; + rmsk = 0xffff; + rmbit = 0x8000; + re = rw - 1; + rebit = 1; + break; + /* For DEC or IBM arithmetic */ + case 56: + rw = 6; + rmsk = 0xff; + rmbit = 0x80; + rebit = 0x100; + re = rw; + break; + case 53: + rw = 6; + rmsk = 0x7ff; + rmbit = 0x0400; + rebit = 0x800; + re = rw; + break; + case 24: + rw = 4; + rmsk = 0xff; + rmbit = 0x80; + rebit = 0x100; + re = rw; + break; + } + rbit[re] = rebit; + rlast = rndprc; + } + + /* Shift down 1 temporarily if the data structure has an implied + most significant bit and the number is denormal. + Intel long double denormals also lose one bit of precision. */ + if ((exp <= 0) && (rndprc != NBITS) + && ((rndprc != 64) || ((rndprc == 64) && ! REAL_WORDS_BIG_ENDIAN))) + { + lost |= s[NI - 1] & 1; + eshdn1 (s); + } + /* Clear out all bits below the rounding bit, + remembering in r if any were nonzero. */ + r = s[rw] & rmsk; + if (rndprc < NBITS) + { + i = rw + 1; + while (i < NI) + { + if (s[i]) + r |= 1; + s[i] = 0; + ++i; + } + } + s[rw] &= ~rmsk; + if ((r & rmbit) != 0) + { + if (r == rmbit) + { + if (lost == 0) + { /* round to even */ + if ((s[re] & rebit) == 0) + goto mddone; + } + else + { + if (subflg != 0) + goto mddone; + } + } + eaddm (rbit, s); + } + mddone: + /* Undo the temporary shift for denormal values. */ + if ((exp <= 0) && (rndprc != NBITS) + && ((rndprc != 64) || ((rndprc == 64) && ! REAL_WORDS_BIG_ENDIAN))) + { + eshup1 (s); + } + if (s[2] != 0) + { /* overflow on roundoff */ + eshdn1 (s); + exp += 1; + } + mdfin: + s[NI - 1] = 0; + if (exp >= 32767L) + { + #ifndef INFINITY + overf: + #endif + #ifdef INFINITY + s[1] = 32767; + for (i = 2; i < NI - 1; i++) + s[i] = 0; + if (extra_warnings) + warning ("floating point overflow"); + #else + s[1] = 32766; + s[2] = 0; + for (i = M + 1; i < NI - 1; i++) + s[i] = 0xffff; + s[NI - 1] = 0; + if ((rndprc < 64) || (rndprc == 113)) + { + s[rw] &= ~rmsk; + if (rndprc == 24) + { + s[5] = 0; + s[6] = 0; + } + } + #endif + return; + } + if (exp < 0) + s[1] = 0; + else + s[1] = (unsigned EMUSHORT) exp; + } + + /* Convert double precision PE to e-type Y. */ + + #if 1 || defined (NEED_E53TOE) /* Can't get all this stuff right at the moment. */ + + /* KEEP */ + static void + e53toe (pe, y) + unsigned EMUSHORT *pe, *y; + { + #ifdef DEC + + dectoe (pe, y); + + #else + #ifdef IBM + + ibmtoe (pe, y, DFmode); + + #else + register unsigned EMUSHORT r; + register unsigned EMUSHORT *e, *p; + unsigned EMUSHORT yy[NI]; + int denorm, k; + + e = pe; + denorm = 0; /* flag if denormalized number */ + ecleaz (yy); + if (! REAL_WORDS_BIG_ENDIAN) + e += 3; + r = *e; + yy[0] = 0; + if (r & 0x8000) + yy[0] = 0xffff; + yy[M] = (r & 0x0f) | 0x10; + r &= ~0x800f; /* strip sign and 4 significand bits */ + #ifdef INFINITY + if (r == 0x7ff0) + { + #ifdef NANS + if (! REAL_WORDS_BIG_ENDIAN) + { + if (((pe[3] & 0xf) != 0) || (pe[2] != 0) + || (pe[1] != 0) || (pe[0] != 0)) + { + enan (y, yy[0] != 0); + return; + } + } + else + { + if (((pe[0] & 0xf) != 0) || (pe[1] != 0) + || (pe[2] != 0) || (pe[3] != 0)) + { + enan (y, yy[0] != 0); + return; + } + } + #endif /* NANS */ + eclear (y); + einfin (y); + if (yy[0]) + eneg (y); + return; + } + #endif /* INFINITY */ + r >>= 4; + /* If zero exponent, then the significand is denormalized. + So take back the understood high significand bit. */ + + if (r == 0) + { + denorm = 1; + yy[M] &= ~0x10; + } + r += EXONE - 01777; + yy[E] = r; + p = &yy[M + 1]; + #ifdef IEEE + if (! REAL_WORDS_BIG_ENDIAN) + { + *p++ = *(--e); + *p++ = *(--e); + *p++ = *(--e); + } + else + { + ++e; + *p++ = *e++; + *p++ = *e++; + *p++ = *e++; + } + #endif + eshift (yy, -5); + if (denorm) + { /* if zero exponent, then normalize the significand */ + if ((k = enormlz (yy)) > NBITS) + ecleazs (yy); + else + yy[E] -= (unsigned EMUSHORT) (k - 1); + } + emovo (yy, y); + #endif /* not IBM */ + #endif /* not DEC */ + } + + #endif /* defined (NEED_E53TOE) */ + + /* Convert single precision float PE to e type Y. */ + + /* KEEP */ + static void + e24toe (pe, y) + unsigned EMUSHORT *pe, *y; + { + #ifdef IBM + + ibmtoe (pe, y, SFmode); + + #else + register unsigned EMUSHORT r; + register unsigned EMUSHORT *e, *p; + unsigned EMUSHORT yy[NI]; + int denorm, k; + + e = pe; + denorm = 0; /* flag if denormalized number */ + ecleaz (yy); + #ifdef IEEE + if (! REAL_WORDS_BIG_ENDIAN) + e += 1; + #endif + #ifdef DEC + e += 1; + #endif + r = *e; + yy[0] = 0; + if (r & 0x8000) + yy[0] = 0xffff; + yy[M] = (r & 0x7f) | 0200; + r &= ~0x807f; /* strip sign and 7 significand bits */ + #ifdef INFINITY + if (r == 0x7f80) + { + #ifdef NANS + if (REAL_WORDS_BIG_ENDIAN) + { + if (((pe[0] & 0x7f) != 0) || (pe[1] != 0)) + { + enan (y, yy[0] != 0); + return; + } + } + else + { + if (((pe[1] & 0x7f) != 0) || (pe[0] != 0)) + { + enan (y, yy[0] != 0); + return; + } + } + #endif /* NANS */ + eclear (y); + einfin (y); + if (yy[0]) + eneg (y); + return; + } + #endif /* INFINITY */ + r >>= 7; + /* If zero exponent, then the significand is denormalized. + So take back the understood high significand bit. */ + if (r == 0) + { + denorm = 1; + yy[M] &= ~0200; + } + r += EXONE - 0177; + yy[E] = r; + p = &yy[M + 1]; + #ifdef DEC + *p++ = *(--e); + #endif + #ifdef IEEE + if (! REAL_WORDS_BIG_ENDIAN) + *p++ = *(--e); + else + { + ++e; + *p++ = *e++; + } + #endif + eshift (yy, -8); + if (denorm) + { /* if zero exponent, then normalize the significand */ + if ((k = enormlz (yy)) > NBITS) + ecleazs (yy); + else + yy[E] -= (unsigned EMUSHORT) (k - 1); + } + emovo (yy, y); + #endif /* not IBM */ + } + + /* e type to double precision. */ + + #ifdef DEC + /* Convert e-type X to DEC-format double E. */ + + #if 1 || defined (NEED_ETOE53) + + /* KEEP */ + static void + etoe53 (x, e) + unsigned EMUSHORT *x, *e; + { + etodec (x, e); /* see etodec.c */ + } + + #endif /* defined (NEED_ETOE53) */ + + /* Convert exploded e-type X, that has already been rounded to + 56-bit double precision, to DEC double Y. */ + + /* KEEP */ + static void + toe53 (x, y) + unsigned EMUSHORT *x, *y; + { + todec (x, y); + } + + #else + #ifdef IBM + /* Convert e-type X to IBM 370-format double E. */ + + #if 1 || defined (NEED_ETOE53) + + /* KEEP */ + static void + etoe53 (x, e) + unsigned EMUSHORT *x, *e; + { + etoibm (x, e, DFmode); + } + + #endif /* defined (NEED_ETOE53) */ + + /* Convert exploded e-type X, that has already been rounded to + 56-bit precision, to IBM 370 double Y. */ + + /* KEEP */ + static void + toe53 (x, y) + unsigned EMUSHORT *x, *y; + { + toibm (x, y, DFmode); + } + + #else /* it's neither DEC nor IBM */ + + /* Convert e-type X to IEEE double E. */ + + #if 1 || defined (NEED_ETOE53) + + /* KEEP */ + static void + etoe53 (x, e) + unsigned EMUSHORT *x, *e; + { + unsigned EMUSHORT xi[NI]; + EMULONG exp; + int rndsav; + + #ifdef NANS + if (eisnan (x)) + { + make_nan (e, eisneg (x), DFmode); + return; + } + #endif + emovi (x, xi); + /* adjust exponent for offsets */ + exp = (EMULONG) xi[E] - (EXONE - 0x3ff); + #ifdef INFINITY + if (eisinf (x)) + goto nonorm; + #endif + /* round off to nearest or even */ + rndsav = rndprc; + rndprc = 53; + emdnorm (xi, 0, 0, exp, 64); + rndprc = rndsav; + nonorm: + toe53 (xi, e); + } + + #endif /* defined (NEED_ETOE53) */ + + /* Convert exploded e-type X, that has already been rounded to + 53-bit precision, to IEEE double Y. */ + + /* KEEP */ + static void + toe53 (x, y) + unsigned EMUSHORT *x, *y; + { + unsigned EMUSHORT i; + unsigned EMUSHORT *p; + + #ifdef NANS + if (eiisnan (x)) + { + make_nan (y, eiisneg (x), DFmode); + return; + } + #endif + p = &x[0]; + #ifdef IEEE + if (! REAL_WORDS_BIG_ENDIAN) + y += 3; + #endif + *y = 0; /* output high order */ + if (*p++) + *y = 0x8000; /* output sign bit */ + + i = *p++; + if (i >= (unsigned int) 2047) + { /* Saturate at largest number less than infinity. */ + #ifdef INFINITY + *y |= 0x7ff0; + if (! REAL_WORDS_BIG_ENDIAN) + { + *(--y) = 0; + *(--y) = 0; + *(--y) = 0; + } + else + { + ++y; + *y++ = 0; + *y++ = 0; + *y++ = 0; + } + #else + *y |= (unsigned EMUSHORT) 0x7fef; + if (! REAL_WORDS_BIG_ENDIAN) + { + *(--y) = 0xffff; + *(--y) = 0xffff; + *(--y) = 0xffff; + } + else + { + ++y; + *y++ = 0xffff; + *y++ = 0xffff; + *y++ = 0xffff; + } + #endif + return; + } + if (i == 0) + { + eshift (x, 4); + } + else + { + i <<= 4; + eshift (x, 5); + } + i |= *p++ & (unsigned EMUSHORT) 0x0f; /* *p = xi[M] */ + *y |= (unsigned EMUSHORT) i; /* high order output already has sign bit set */ + if (! REAL_WORDS_BIG_ENDIAN) + { + *(--y) = *p++; + *(--y) = *p++; + *(--y) = *p; + } + else + { + ++y; + *y++ = *p++; + *y++ = *p++; + *y++ = *p++; + } + } + + #endif /* not IBM */ + #endif /* not DEC */ + + /* Shift the significand of exploded e-type X up or down by SC bits. */ + + /* KEEP */ + static int + eshift (x, sc) + unsigned EMUSHORT *x; + int sc; + { + unsigned EMUSHORT lost; + unsigned EMUSHORT *p; + + if (sc == 0) + return (0); + + lost = 0; + p = x + NI - 1; + + if (sc < 0) + { + sc = -sc; + while (sc >= 16) + { + lost |= *p; /* remember lost bits */ + eshdn6 (x); + sc -= 16; + } + + while (sc >= 8) + { + lost |= *p & 0xff; + eshdn8 (x); + sc -= 8; + } + + while (sc > 0) + { + lost |= *p & 1; + eshdn1 (x); + sc -= 1; + } + } + else + { + while (sc >= 16) + { + eshup6 (x); + sc -= 16; + } + + while (sc >= 8) + { + eshup8 (x); + sc -= 8; + } + + while (sc > 0) + { + eshup1 (x); + sc -= 1; + } + } + if (lost) + lost = 1; + return ((int) lost); + } + + /* Shift normalize the significand area of exploded e-type X. + Return the shift count (up = positive). */ + + /* KEEP */ + static int + enormlz (x) + unsigned EMUSHORT x[]; + { + register unsigned EMUSHORT *p; + int sc; + + sc = 0; + p = &x[M]; + if (*p != 0) + goto normdn; + ++p; + if (*p & 0x8000) + return (0); /* already normalized */ + while (*p == 0) + { + eshup6 (x); + sc += 16; + + /* With guard word, there are NBITS+16 bits available. + Return true if all are zero. */ + if (sc > NBITS) + return (sc); + } + /* see if high byte is zero */ + while ((*p & 0xff00) == 0) + { + eshup8 (x); + sc += 8; + } + /* now shift 1 bit at a time */ + while ((*p & 0x8000) == 0) + { + eshup1 (x); + sc += 1; + if (sc > NBITS) + { + mtherr ("enormlz", UNDERFLOW); + return (sc); + } + } + return (sc); + + /* Normalize by shifting down out of the high guard word + of the significand */ + normdn: + + if (*p & 0xff00) + { + eshdn8 (x); + sc -= 8; + } + while (*p != 0) + { + eshdn1 (x); + sc -= 1; + + if (sc < -NBITS) + { + mtherr ("enormlz", OVERFLOW); + return (sc); + } + } + return (sc); + } + + /* Report an error condition CODE encountered in function NAME. + CODE is one of the following: + + Mnemonic Value Significance + + DOMAIN 1 argument domain error + SING 2 function singularity + OVERFLOW 3 overflow range error + UNDERFLOW 4 underflow range error + TLOSS 5 total loss of precision + PLOSS 6 partial loss of precision + INVALID 7 NaN - producing operation + EDOM 33 Unix domain error code + ERANGE 34 Unix range error code + + The order of appearance of the following messages is bound to the + error codes defined above. */ + + #define NMSGS 8 + static char *ermsg[NMSGS] = + { + "unknown", /* error code 0 */ + "domain", /* error code 1 */ + "singularity", /* et seq. */ + "overflow", + "underflow", + "total loss of precision", + "partial loss of precision", + "invalid operation" + }; + + extern int merror; + + /* KEEP */ + static void + mtherr (name, code) + char *name; + int code; + { + char errstr[80]; + + /* The string passed by the calling program is supposed to be the + name of the function in which the error occurred. + The code argument selects which error message string will be printed. */ + + if ((code <= 0) || (code >= NMSGS)) + code = 0; + sprintf (errstr, " %s %s error", name, ermsg[code]); + if (extra_warnings) + warning (errstr); + /* Set global error message word */ + merror = code + 1; + } + + #ifdef DEC + /* Convert DEC double precision D to e type E. */ + + /* KEEP */ + static void + dectoe (d, e) + unsigned EMUSHORT *d; + unsigned EMUSHORT *e; + { + unsigned EMUSHORT y[NI]; + register unsigned EMUSHORT r, *p; + + ecleaz (y); /* start with a zero */ + p = y; /* point to our number */ + r = *d; /* get DEC exponent word */ + if (*d & (unsigned int) 0x8000) + *p = 0xffff; /* fill in our sign */ + ++p; /* bump pointer to our exponent word */ + r &= 0x7fff; /* strip the sign bit */ + if (r == 0) /* answer = 0 if high order DEC word = 0 */ + goto done; + + + r >>= 7; /* shift exponent word down 7 bits */ + r += EXONE - 0201; /* subtract DEC exponent offset */ + /* add our e type exponent offset */ + *p++ = r; /* to form our exponent */ + + r = *d++; /* now do the high order mantissa */ + r &= 0177; /* strip off the DEC exponent and sign bits */ + r |= 0200; /* the DEC understood high order mantissa bit */ + *p++ = r; /* put result in our high guard word */ + + *p++ = *d++; /* fill in the rest of our mantissa */ + *p++ = *d++; + *p = *d; + + eshdn8 (y); /* shift our mantissa down 8 bits */ + done: + emovo (y, e); + } + + /* Convert e type X to DEC double precision D. */ + + /* KEEP */ + static void + etodec (x, d) + unsigned EMUSHORT *x, *d; + { + unsigned EMUSHORT xi[NI]; + EMULONG exp; + int rndsav; + + emovi (x, xi); + /* Adjust exponent for offsets. */ + exp = (EMULONG) xi[E] - (EXONE - 0201); + /* Round off to nearest or even. */ + rndsav = rndprc; + rndprc = 56; + emdnorm (xi, 0, 0, exp, 64); + rndprc = rndsav; + todec (xi, d); + } + + /* Convert exploded e-type X, that has already been rounded to + 56-bit precision, to DEC format double Y. */ + + /* KEEP */ + static void + todec (x, y) + unsigned EMUSHORT *x, *y; + { + unsigned EMUSHORT i; + unsigned EMUSHORT *p; + + p = x; + *y = 0; + if (*p++) + *y = 0100000; + i = *p++; + if (i == 0) + { + *y++ = 0; + *y++ = 0; + *y++ = 0; + *y++ = 0; + return; + } + if (i > 0377) + { + *y++ |= 077777; + *y++ = 0xffff; + *y++ = 0xffff; + *y++ = 0xffff; + #ifdef ERANGE + errno = ERANGE; + #endif + return; + } + i &= 0377; + i <<= 7; + eshup8 (x); + x[M] &= 0177; + i |= x[M]; + *y++ |= i; + *y++ = x[M + 1]; + *y++ = x[M + 2]; + *y++ = x[M + 3]; + } + #endif /* DEC */ + + #ifdef IBM + /* Convert IBM single/double precision to e type. */ + + /* KEEP */ + static void + ibmtoe (d, e, mode) + unsigned EMUSHORT *d; + unsigned EMUSHORT *e; + enum machine_mode mode; + { + unsigned EMUSHORT y[NI]; + register unsigned EMUSHORT r, *p; + int rndsav; + + ecleaz (y); /* start with a zero */ + p = y; /* point to our number */ + r = *d; /* get IBM exponent word */ + if (*d & (unsigned int) 0x8000) + *p = 0xffff; /* fill in our sign */ + ++p; /* bump pointer to our exponent word */ + r &= 0x7f00; /* strip the sign bit */ + r >>= 6; /* shift exponent word down 6 bits */ + /* in fact shift by 8 right and 2 left */ + r += EXONE - (0x41 << 2); /* subtract IBM exponent offset */ + /* add our e type exponent offset */ + *p++ = r; /* to form our exponent */ + + *p++ = *d++ & 0xff; /* now do the high order mantissa */ + /* strip off the IBM exponent and sign bits */ + if (mode != SFmode) /* there are only 2 words in SFmode */ + { + *p++ = *d++; /* fill in the rest of our mantissa */ + *p++ = *d++; + } + *p = *d; + + if (y[M] == 0 && y[M+1] == 0 && y[M+2] == 0 && y[M+3] == 0) + y[0] = y[E] = 0; + else + y[E] -= 5 + enormlz (y); /* now normalise the mantissa */ + /* handle change in RADIX */ + emovo (y, e); + } + + + + /* Convert e type to IBM single/double precision. */ + + /* KEEP */ + static void + etoibm (x, d, mode) + unsigned EMUSHORT *x, *d; + enum machine_mode mode; + { + unsigned EMUSHORT xi[NI]; + EMULONG exp; + int rndsav; + + emovi (x, xi); + exp = (EMULONG) xi[E] - (EXONE - (0x41 << 2)); /* adjust exponent for offsets */ + /* round off to nearest or even */ + rndsav = rndprc; + rndprc = 56; + emdnorm (xi, 0, 0, exp, 64); + rndprc = rndsav; + toibm (xi, d, mode); + } + + /* KEEP */ + static void + toibm (x, y, mode) + unsigned EMUSHORT *x, *y; + enum machine_mode mode; + { + unsigned EMUSHORT i; + unsigned EMUSHORT *p; + int r; + + p = x; + *y = 0; + if (*p++) + *y = 0x8000; + i = *p++; + if (i == 0) + { + *y++ = 0; + *y++ = 0; + if (mode != SFmode) + { + *y++ = 0; + *y++ = 0; + } + return; + } + r = i & 0x3; + i >>= 2; + if (i > 0x7f) + { + *y++ |= 0x7fff; + *y++ = 0xffff; + if (mode != SFmode) + { + *y++ = 0xffff; + *y++ = 0xffff; + } + #ifdef ERANGE + errno = ERANGE; + #endif + return; + } + i &= 0x7f; + *y |= (i << 8); + eshift (x, r + 5); + *y++ |= x[M]; + *y++ = x[M + 1]; + if (mode != SFmode) + { + *y++ = x[M + 2]; + *y++ = x[M + 3]; + } + } + #endif /* IBM */ + + /* Output a binary NaN bit pattern in the target machine's format. */ + + /* If special NaN bit patterns are required, define them in tm.h + as arrays of unsigned 16-bit shorts. Otherwise, use the default + patterns here. */ + #ifdef TFMODE_NAN + TFMODE_NAN; + #else + #ifdef IEEE + extern unsigned EMUSHORT TFbignan[]; + extern unsigned EMUSHORT TFlittlenan[]; + #endif + #endif + + #ifdef XFMODE_NAN + XFMODE_NAN; + #else + #ifdef IEEE + extern unsigned EMUSHORT XFbignan[]; + extern unsigned EMUSHORT XFlittlenan[]; + #endif + #endif + + #ifdef DFMODE_NAN + DFMODE_NAN; + #else + #ifdef IEEE + extern unsigned EMUSHORT DFbignan[]; + extern unsigned EMUSHORT DFlittlenan[]; + #endif + #endif + + #ifdef SFMODE_NAN + SFMODE_NAN; + #else + #ifdef IEEE + extern unsigned EMUSHORT SFbignan[]; + extern unsigned EMUSHORT SFlittlenan[]; + #endif + #endif + + + /* KEEP */ + static void + make_nan (nan, sign, mode) + unsigned EMUSHORT *nan; + int sign; + enum machine_mode mode; + { + int n; + unsigned EMUSHORT *p; + + switch (mode) + { + /* Possibly the `reserved operand' patterns on a VAX can be + used like NaN's, but probably not in the same way as IEEE. */ + #if !defined(DEC) && !defined(IBM) + case TFmode: + n = 8; + if (REAL_WORDS_BIG_ENDIAN) + p = TFbignan; + else + p = TFlittlenan; + break; + case XFmode: + n = 6; + if (REAL_WORDS_BIG_ENDIAN) + p = XFbignan; + else + p = XFlittlenan; + break; + case DFmode: + n = 4; + if (REAL_WORDS_BIG_ENDIAN) + p = DFbignan; + else + p = DFlittlenan; + break; + case HFmode: + case SFmode: + n = 2; + if (REAL_WORDS_BIG_ENDIAN) + p = SFbignan; + else + p = SFlittlenan; + break; + #endif + default: + abort (); + } + if (REAL_WORDS_BIG_ENDIAN) + *nan++ = (sign << 15) | *p++; + while (--n != 0) + *nan++ = *p++; + if (! REAL_WORDS_BIG_ENDIAN) + *nan = (sign << 15) | *p; + } + + /* This is the inverse of the function `etarsingle' invoked by + REAL_VALUE_TO_TARGET_SINGLE. */ + + REAL_VALUE_TYPE + ereal_unto_float (f) + long f; + { + REAL_VALUE_TYPE r; + unsigned EMUSHORT s[2]; + unsigned EMUSHORT e[NE]; + + /* Convert 32 bit integer to array of 16 bit pieces in target machine order. + This is the inverse operation to what the function `endian' does. */ + if (REAL_WORDS_BIG_ENDIAN) + { + s[0] = (unsigned EMUSHORT) (f >> 16); + s[1] = (unsigned EMUSHORT) f; + } + else + { + s[0] = (unsigned EMUSHORT) f; + s[1] = (unsigned EMUSHORT) (f >> 16); + } + /* Convert and promote the target float to E-type. */ + e24toe (s, e); + /* Output E-type to REAL_VALUE_TYPE. */ + PUT_REAL (e, &r); + return r; + } + + + /* This is the inverse of the function `etardouble' invoked by + REAL_VALUE_TO_TARGET_DOUBLE. */ + + REAL_VALUE_TYPE + ereal_unto_double (d) + long d[]; + { + REAL_VALUE_TYPE r; + unsigned EMUSHORT s[4]; + unsigned EMUSHORT e[NE]; + + /* Convert array of HOST_WIDE_INT to equivalent array of 16-bit pieces. */ + if (REAL_WORDS_BIG_ENDIAN) + { + s[0] = (unsigned EMUSHORT) (d[0] >> 16); + s[1] = (unsigned EMUSHORT) d[0]; + s[2] = (unsigned EMUSHORT) (d[1] >> 16); + s[3] = (unsigned EMUSHORT) d[1]; + } + else + { + /* Target float words are little-endian. */ + s[0] = (unsigned EMUSHORT) d[0]; + s[1] = (unsigned EMUSHORT) (d[0] >> 16); + s[2] = (unsigned EMUSHORT) d[1]; + s[3] = (unsigned EMUSHORT) (d[1] >> 16); + } + /* Convert target double to E-type. */ + e53toe (s, e); + /* Output E-type to REAL_VALUE_TYPE. */ + PUT_REAL (e, &r); + return r; + } + #endif /* EMU_NON_COMPILE not defined */ + + #endif /* defined (REAL_ARITHMETIC) */ + + /* End the cruft g77 used to patch into gcc-2.7/real.h. */ diff -rcp2N g77-0.5.22/f/target.h g77-0.5.23/f/target.h *** g77-0.5.22/f/target.h Sat Mar 1 04:30:32 1997 --- g77-0.5.23/f/target.h Tue Apr 21 01:23:28 1998 *************** *** 1,5 **** /* target.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* target.h -- Public #include File (module.h template V1.0) Copyright (C) 1995, 1996 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** void *ffetarget_memcpy_ (void *dst, void *** 1860,1863 **** --- 1860,1876 ---- #define ffetarget_xor_logical3(res,l,r) (*(res) = (l) != (r), FFEBAD) #define ffetarget_xor_logical4(res,l,r) (*(res) = (l) != (r), FFEBAD) + + /* Begin the cruft g77 used to patch into gcc-2.7/real.h. */ + + extern REAL_VALUE_TYPE ereal_unto_float PROTO((long)); + extern REAL_VALUE_TYPE ereal_unto_double PROTO((long *)); + + /* Inverse of REAL_VALUE_TO_TARGET_DOUBLE. */ + #define REAL_VALUE_UNTO_TARGET_DOUBLE(d) (ereal_unto_double (d)) + + /* Inverse of REAL_VALUE_TO_TARGET_SINGLE. */ + #define REAL_VALUE_UNTO_TARGET_SINGLE(f) (ereal_unto_float (f)) + + /* End the cruft g77 used to patch into gcc-2.7/real.h. */ /* End of #include file. */ diff -rcp2N g77-0.5.22/f/tconfig.j g77-0.5.23/f/tconfig.j *** g77-0.5.22/f/tconfig.j Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/tconfig.j Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* tconfig.j -- Wrapper for GCC's tconfig.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* tconfig.j -- Wrapper for GCC's tconfig.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/tm.j g77-0.5.23/f/tm.j *** g77-0.5.22/f/tm.j Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/tm.j Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* tm.j -- Wrapper for GCC's tm.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* tm.j -- Wrapper for GCC's tm.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/top.c g77-0.5.23/f/top.c *** g77-0.5.22/f/top.c Fri Jul 11 00:11:15 1997 --- g77-0.5.23/f/top.c Tue May 12 00:05:49 1998 *************** *** 1,5 **** /* top.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* top.c -- Implementation File (module.c template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** bool ffe_is_init_local_zero_ = FFETARGET *** 81,84 **** --- 81,85 ---- bool ffe_is_mainprog_; /* TRUE if current prog unit known to be main. */ + bool ffe_is_null_version_ = FALSE; bool ffe_is_onetrip_ = FALSE; bool ffe_is_silent_ = TRUE; *************** ffe_decode_option (char *opt) *** 170,179 **** ffe_set_is_version (TRUE); else if (strcmp (&opt[2], "null-version") == 0) ! ; /* Someday generate program to print version ! info. */ else if (strcmp (&opt[2], "set-g77-defaults") == 0) { ffe_is_do_internal_checks_ = 0; ! #if BUILT_FOR_270 /* User must have applied patch (circa 2.7.2 and beyond). */ flag_move_all_movables = 1; flag_reduce_all_givs = 1; --- 171,179 ---- ffe_set_is_version (TRUE); else if (strcmp (&opt[2], "null-version") == 0) ! ffe_set_is_null_version (TRUE); else if (strcmp (&opt[2], "set-g77-defaults") == 0) { ffe_is_do_internal_checks_ = 0; ! #if BUILT_FOR_270 && !BUILT_FOR_280 flag_move_all_movables = 1; flag_reduce_all_givs = 1; diff -rcp2N g77-0.5.22/f/top.h g77-0.5.23/f/top.h *** g77-0.5.22/f/top.h Fri Jul 11 00:11:15 1997 --- g77-0.5.23/f/top.h Tue May 12 00:06:32 1998 *************** *** 1,5 **** /* top.h -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* top.h -- Public #include File (module.h template V1.0) Copyright (C) 1995-1997 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. *************** extern bool ffe_is_ident_; *** 96,99 **** --- 96,100 ---- extern bool ffe_is_init_local_zero_; extern bool ffe_is_mainprog_; + extern bool ffe_is_null_version_; extern bool ffe_is_onetrip_; extern bool ffe_is_silent_; *************** void ffe_terminate_4 (void); *** 183,186 **** --- 184,188 ---- #define ffe_is_init_local_zero() ffe_is_init_local_zero_ #define ffe_is_mainprog() ffe_is_mainprog_ + #define ffe_is_null_version() ffe_is_null_version_ #define ffe_is_onetrip() ffe_is_onetrip_ #define ffe_is_pedantic() ffe_is_pedantic_ *************** void ffe_terminate_4 (void); *** 234,237 **** --- 236,240 ---- #define ffe_set_is_init_local_zero(f) (ffe_is_init_local_zero_ = (f)) #define ffe_set_is_mainprog(f) (ffe_is_mainprog_ = (f)) + #define ffe_set_is_null_version(f) (ffe_is_null_version_ = (f)) #define ffe_set_is_onetrip(f) (ffe_is_onetrip_ = (f)) #define ffe_set_is_pedantic(f) (ffe_is_pedantic_ = (f)) diff -rcp2N g77-0.5.22/f/tree.j g77-0.5.23/f/tree.j *** g77-0.5.22/f/tree.j Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/tree.j Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* tree.j -- Wrapper for GCC's tree.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* tree.j -- Wrapper for GCC's tree.h Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/type.c g77-0.5.23/f/type.c *** g77-0.5.22/f/type.c Fri Jul 11 00:08:39 1997 --- g77-0.5.23/f/type.c Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* Implementation of Fortran type abstraction Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Implementation of Fortran type abstraction Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/type.h g77-0.5.23/f/type.h *** g77-0.5.22/f/type.h Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/type.h Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* Interface definitions for Fortran type abstraction Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* Interface definitions for Fortran type abstraction Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/version.c g77-0.5.23/f/version.c *** g77-0.5.22/f/version.c Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/version.c Wed May 20 16:12:23 1998 *************** *** 0 **** --- 1 ---- + char *ffe_version_string = "0.5.23"; diff -rcp2N g77-0.5.22/f/version.h g77-0.5.23/f/version.h *** g77-0.5.22/f/version.h Thu Jan 1 00:00:00 1970 --- g77-0.5.23/f/version.h Fri Apr 17 21:13:06 1998 *************** *** 0 **** --- 1,6 ---- + #ifndef _H_f_version + #define _H_f_version + + extern char *ffe_version_string; + + #endif diff -rcp2N g77-0.5.22/f/where.c g77-0.5.23/f/where.c *** g77-0.5.22/f/where.c Sun Jul 13 21:40:49 1997 --- g77-0.5.23/f/where.c Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* where.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* where.c -- Implementation File (module.c template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/where.h g77-0.5.23/f/where.h *** g77-0.5.22/f/where.h Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/where.h Tue Apr 21 01:23:27 1998 *************** *** 1,5 **** /* where.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.ai.mit.edu). This file is part of GNU Fortran. --- 1,5 ---- /* where.h -- Public #include File (module.h template V1.0) Copyright (C) 1995 Free Software Foundation, Inc. ! Contributed by James Craig Burley (burley@gnu.org). This file is part of GNU Fortran. diff -rcp2N g77-0.5.22/f/zzz.c g77-0.5.23/f/zzz.c *** g77-0.5.22/f/zzz.c Mon Mar 16 20:42:46 1998 --- g77-0.5.23/f/zzz.c Thu Jan 1 00:00:00 1970 *************** *** 1,56 **** - /* zzz.c -- Implementation File (module.c template V1.0) - Copyright (C) 1995 Free Software Foundation, Inc. - Contributed by James Craig Burley (burley@gnu.ai.mit.edu). - - This file is part of GNU Fortran. - - GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - - Related Modules: - None - - Description: - Has the version number for the front end. Makes it easier to - tell how consistently patches have been applied, etc. - - Modifications: - */ - - #include "zzz.h" - - /* If you want to override the version date/time info with your own - macros, e.g. for a consistent distribution when bootstrapping, - go ahead! */ - - #ifndef FFEZZZ_DATE - #ifdef __DATE__ - #define FFEZZZ_DATE __DATE__ - #else /* !defined (__DATE__) */ - #define FFEZZZ_DATE "date unknown" - #endif /* !defined (__DATE__) */ - #endif /* !defined (FFEZZZ_DATE) */ - - #ifndef FFEZZZ_TIME - #ifdef __TIME__ - #define FFEZZZ_TIME __TIME__ - #else /* !defined (__TIME__) */ - #define FFEZZZ_TIME "time unknown" - #endif /* !defined (__TIME__) */ - #endif /* !defined (FFEZZZ_TIME) */ - - char *ffezzz_version_string = "0.5.22"; - char *ffezzz_date = FFEZZZ_DATE; - char *ffezzz_time = FFEZZZ_TIME; --- 0 ---- diff -rcp2N g77-0.5.22/f/zzz.h g77-0.5.23/f/zzz.h *** g77-0.5.22/f/zzz.h Wed Aug 30 19:53:32 1995 --- g77-0.5.23/f/zzz.h Thu Jan 1 00:00:00 1970 *************** *** 1,35 **** - /* zzz.h -- Public #include File (module.h template V1.0) - Copyright (C) 1995 Free Software Foundation, Inc. - Contributed by James Craig Burley (burley@gnu.ai.mit.edu). - - This file is part of GNU Fortran. - - GNU Fortran 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 Fortran 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 Fortran; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - - Owning Modules: - zzz.c - - Modifications: - */ - - #ifndef _H_f_zzz - #define _H_f_zzz - - extern char *ffezzz_version_string; - extern char *ffezzz_date; - extern char *ffezzz_time; - - #endif --- 0 ----