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: cd g77-0.5.19; make -k srcdir=. -f f/Make-lang.in f/g77.info If that fails due to `makeinfo' not being installed, obtain texinfo-3.9.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.19.tar.gz. This distribution contains the derived Info documentation. (Note that this is the second version of g77-0.5.18-0.5.19.diff.gz generated by the g77 author, on 1996-12-15, after being warned that the first version erroneously contained patches for the non-g77 parts of a gcc-2.7.2.1 directory. These patches were not themselves in error, but should not have been included in this particular patch file -- they are in the gcc/f/gbe/2.7.2.1.diff file that results from applying this patch file and merging the g77 and gcc source trees as explained in the installation instructions, and are applied by hand by the installer per these instructions.) diff -rcp2N g77-0.5.18/f/BUGS g77-0.5.19/f/BUGS *** g77-0.5.18/f/BUGS Mon Mar 25 21:26:44 1996 --- g77-0.5.19/f/BUGS Sun Dec 1 22:59:57 1996 *************** port, build, and install `g77', *Note Pr *** 45,50 **** abbreviated forms of long options, `g77' generally doesn't. - * `g77' could use a `--help' option of some sort. - * Some confusion in diagnostics concerning failing `INCLUDE' statements from within `INCLUDE''d or `#include''d files. --- 45,48 ---- *************** port, build, and install `g77', *Note Pr *** 100,103 **** --- 98,108 ---- as well. + As of Version 0.5.19, a temporary kludge solution is provided + whereby some rudimentary information on a member is written as a + string that is the member's value as a character string. + + *Note Options for Code Generation Conventions: Code Gen Options, + for information on the `-fdebug-kludge' option. + * When debugging, after starting up the debugger but before being able to see the source code for the main program unit, the user *************** port, build, and install `g77', *Note Pr *** 133,139 **** * `g77' doesn't work on 64-bit configurations such as the Alpha. ! The problem is not yet adequately investigated, and some Alpha ! users are having quite a bit of success, so perhaps it depends on ! the OS and configuration of `gcc' they are using. * Maintainers of gcc report that the back end definitely has "broken" --- 138,144 ---- * `g77' doesn't work on 64-bit configurations such as the Alpha. ! This problem is expected to be largely resolved as of version ! 0.5.20, and version 0.6 should solve most or all related problems ! (such as 64-bit machines other than DEC Alphas). * Maintainers of gcc report that the back end definitely has "broken" *************** port, build, and install `g77', *Note Pr *** 143,151 **** imaginary parts are integers) that GNU Fortran does not use. ! But there might well be some problems with the portions of ! `__complex__' support in the back end that `g77' uses to implement ! `COMPLEX' and `DOUBLE COMPLEX'. More investigation is needed, but ! bug reports are definitely welcome, since that can help speed ! investigation of problem areas. * There seem to be some problems with passing constants, and perhaps --- 148,154 ---- imaginary parts are integers) that GNU Fortran does not use. ! Version 0.5.20 of `g77' is expected to work around this problem by ! not using the back end's support for `COMPLEX'. This work has ! already been done, and is being tested by developers. * There seem to be some problems with passing constants, and perhaps diff -rcp2N g77-0.5.18/f/ChangeLog g77-0.5.19/f/ChangeLog *** g77-0.5.18/f/ChangeLog Mon Apr 1 10:14:13 1996 --- g77-0.5.19/f/ChangeLog Fri Dec 6 12:48:42 1996 *************** *** 1,2 **** --- 1,339 ---- + Fri Dec 6 12:23:55 1996 Craig Burley + + * g77.c: Default to assuming "f77" is in $LANGUAGES, since + the LANGUAGE_F77 macro isn't defined by anyone anymore (but + might as well leave the no-f77 code in just in case). + * Make-lang.in (g77, g77-cross): Don't define LANGUAGE_F77 + anymore. + + 1996-12-06 Dave Love + + * Make-lang.in (g77, g77-cross): Revert to building `g77' or not + conditional on `f77' in LANGUAGES. + + Wed Dec 4 13:08:44 1996 Craig Burley + + * Make-lang.in (g77, g77-cross): No libs or lib dependencies + in case where "f77" is not in $LANGUAGES. + + * lex.c (ffelex_image_char_, ffelex_file_fixed, + ffelex_file_free): Fixes to properly handle lines with + null character, and too-long lines as well. + + * lex.c: Call ffebad_start_msg_lex instead of + ffebad_start_msg throughout. + + Sun Dec 1 21:19:55 1996 Craig Burley + + Fix-up for 1996-11-25 changes: + * com.c (ffecom_member_phase2_): Subtract out 0 offset for + elegance and consistency with EQUIVALENCE aggregates. + (ffecom_sym_transform_): Ditto for LOCAL/COMMON, and + ensure we get the same parent storage area. + * data.c (ffedata_gather_, ffedata_value_): Subtract out + aggregate offset. + + Wed Nov 27 13:55:57 1996 Craig Burley + + * proj.h: Quote the text of the #error message, to avoid + strange-looking diagnostics from non-gcc ANSI compilers. + + * top.c: Make -fno-debug-kludge the default. + + Mon Nov 25 20:13:45 1996 Craig Burley + + Provide more info on EQUIVALENCE mismatches: + * bad.def (FFEBAD_EQUIV_MISMATCH): More detailed message. + * equiv.c (ffeequiv_layout_local_, ffeequiv_layout_cblock): + More details for FFEBAD_EQUIV_MISMATCH. + + Fix problem with EQUIVALENCE handling: + * equiv.c (ffeequiv_layout_local_): Redesign algorithm -- + old one was broken, resulting in rejection of good code. + (ffeequiv_offset_): Add argument, change callers. + Clean up the code, fix up the (probably unused) negative-value + case for SYMTER. + * com.c (ffecom_sym_transform_): For local EQUIVALENCE + member, subtract out aggregate offset (which is <= 0). + + Thu Nov 21 12:44:56 1996 Craig Burley + + Change type of ffetargetOffset from `unsigned long' to `long long': + * bld.c (ffebld_constantarray_dump): Change printf formats. + * storag.c (ffestorag_dump): Ditto. + * symbol.c (ffesymbol_report): Ditto. + * target.h (ffetargetOffset_f): Ditto and change type itself. + + Handle situation where list of languages does not include f77: + * Make-lang.in: Define LANGUAGE_F77 to 1 only if `f77' is in + the $LANGUAGES macro for the build. + * g77.c: Compile to a (nearly) no-op program if LANGUAGE_F77 + is not defined to 1. + + Fixes to delay confirmation of READ, WRITE, and GOTO statements + so the corresponding assignments to same-named CHAR*(*) arrays + work: + * stb.c (ffestb_R90915_, ffestb_91014_): New functions. + (ffestb_goto3_, ffestb_goto5_): Move confirmation from 3 to 5 + for the OPEN_PAREN case. + (ffestb_R9091_, ffestb_R9094_, ffestb_R90913_, ffestb_R90914_, + ffestb_R91012_, ffestb_R91013_): Use new functions, and confirm + except for the OPEN_PAREN case. + + Fixes to not confirm declarations with an open paren where + an equal sign or other assignment-like token might be, so the + corresponding assignments to same-named CHAR*(*) arrays work: + (ffestb_decl_entsp_5_): Move assertion so we crash on that first, + if it turns out to be wrong, before the less-debuggable crash + on mistaken confirmation. + (ffestb_decl_entsp_6_, ffestb_decl_entsp_7_, ffestb_decl_entsp_8_): + Include OPEN_PAREN in list of assignment-only tokens. + + Fix more diagnosed-crash bugs: + * stu.c (ffestu_sym_end_transition): ANY-ize an adjustable array + with bad dimension expressions even if still stateUNCERTAIN. + (ffestu_symter_end_transition_, ffestu_symter_exec_transition_): + Return TRUE for opANY as well. + For code elegance, move opSYMTER case into first switch. + + 1996-11-17 Dave Love + + * lex.c: Fix last change. + + 1996-11-14 Dave Love + + * Make-lang.in, config-lang.in: Remove the (broken) libU77 stuff, + pending 0.5.20. + + Thu Nov 14 15:40:59 1996 Craig Burley + + * bad.def (FFEBAD_UNIMPL_STMT): Explain that invalid + intrinsic references can trigger this message, too. + + 1996-11-12 Dave Love + + * lex.c: Declare dwarfout routines. + + * config-lang.in: Sink grep o/p. + + Mon Nov 11 14:21:13 1996 Craig Burley + + * g77.c (main): Might as well print version number + for --verbose as well. + + Thu Nov 7 18:41:41 1996 Craig Burley + + * expr.c, lang-options.h, target.h, top.c, top.h: Split out + remaining -fugly stuff into -fugly-logint and -fugly-comma, + leaving -fugly as simply a `macro' that expands into other + options, and eliminate defaults for some of the ugly stuff + in target.h. + + * Make-lang.in (gcc-cross): Compile zzz.c, not version.o (!), + in to get version info for this target. + + * config-lang.in: Test for GBE patch application based + on whether 2.6.x or 2.7.x GBE is detected. + + Wed Nov 6 14:19:45 1996 Craig Burley + + * Make-lang.in (g77): Compile zzz.c in to get version info. + * g77.c: Add support for --help and --version. + + * g77.c (lookup_option): Short-circuit long-winded tests + when second char is not hyphen, just to save a spot of time. + + Sat Nov 2 13:50:31 1996 Craig Burley + + * intrin.def: Add FTELL and FSEEK intrinsics, plus new + `g' codes for alternate-return (GOTO) arguments. + * intrin.c (ffeintrin_check_): Support `g' codes. + * com-rt.def: Add ftell_() and fseek_() to database. + * com.c (ffecom_expr_intrinsic_): Ditto. Also, let each + subroutine intrinsic decide for itself what to do with + tree_type, the default being NULL_TREE once again (so + ffecom_call_ doesn't think it's supposed to cast the + function call to the type in the fall-through case). + + * ste.c (ffeste_R909_finish): Don't special-case list-directed + I/O, now that libf2c can return non-zero status codes. + (ffeste_R910_finish): Ditto. + (ffeste_io_call_): Simplify logic. + (ffeste_io_impdo_): + (ffeste_subr_beru_): + (ffeste_R904): + (ffeste_R907): + (ffeste_R909_start): + (ffeste_R909_item): + (ffeste_R909_finish): + (ffeste_R910_start): + (ffeste_R910_item): + (ffeste_R910_finish): + (ffeste_R911_start): + (ffeste_R923A): Ditto all the above. + + Thu Oct 31 20:56:28 1996 Craig Burley + + * config-lang.in, Make-lang.in: Rename flag file + build-u77 to build-libu77, for consistency with + install-libf2c and such. + + * config-lang.in: Don't complain about failure to patch + if pre-2.7.0 gcc is involved (since our patch for that + doesn't add support for tooning). + + Sat Oct 26 00:45:42 1996 Craig Burley + + * target.c (ffetarget_integerhex): Fix dumb bug. + + 1996-10-20 Dave Love + + * gbe/2.7.2.1.diff: New file. + + * Makefile.in (F771_LDFLAGS): Add -bbigtoc for AIX4.1 up, suggested by + endo@material.tohoku.ac.jp [among others!]. + + Sat Oct 19 03:11:14 1996 Craig Burley + + * bad.def, bld.c, bld.h, expr.c, lang-options.h, target.c, + target.h, top.c, top.h (ffebld_constant_new_integerbinary, + ffebld_constant_new_integerhex, ffebld_constant_new_integeroctal, + ffeexpr_token_name_apos_name_, ffetarget_integerbinary, + ffetarget_integerhex, ffetarget_integeroctal): Support + new -fno-typeless-boz option with new functions, mods to + existing octal-handling functions, new macros, new error + messages, and so on. + + * com.c, lang-options.h, top.c, top.h (ffecom_notify_primary_entry): + Print program unit name on stderr if -fno-silent (new option). + + * lang-options.h, top.c, top.h, stt.c (ffestt_dimlist_as_expr): + Treat ([...,]1) in dimlist as ([...,]*) if -fugly-assumed + (new option). + + * lang-options.h: Comment out options duplicated in gcc/toplev.c, + because, somehow, having them commented in and building on my + DEC Alpha results in a cc1 that always segfaults, and gdb that + also segfaults whenever it debugs it up to init_lex() calling + xmalloc() or so. + + Thu Oct 17 00:39:27 1996 Craig Burley + + * stb.c (ffestb_R10013_): Don't change meaning of .sign until + after previous meaning/value used to set sign of value + (960507-1.f). + + Sun Oct 13 22:15:23 1996 Craig Burley + + * top.c (ffe_decode_option): Don't set back-end flags + that are nonexistent prior to gcc 2.7.0. + + Wed Oct 2 21:57:12 1996 Craig Burley + + * com.c (ffecom_debug_kludge_): Set DECL_IN_SYSTEM_HEADER so + -Wunused doesn't complain about these manufactured decls. + (ffecom_expr_): Ditto, for original (non-ASSIGN'ed) variable. + (ffecom_transform_equiv_): Clear DECL_IGNORED_P for aggregate + area so it shows up as a debug-accessible symbol. + (pushdecl): Default for "invented" identifiers (a g77-specific + concept for now) is that they are artificial, in system header, + ignored for debugging purposes, used, and (for types) suppressed. + This ought to be overkill. + + Fri Sep 27 23:13:07 1996 Craig Burley + + * ste.c (ffeste_begin_iterdo_, ffeste_end_iterdo_): Support + one-trip DO loops (F66-style). + * lang-options.h, top.c, top.h (-fonetrip): New option. + + Thu Sep 26 00:18:40 1996 Craig Burley + + * com.c (ffecom_debug_kludge_): New function. + (ffecom_sym_transform_): Use new function for COMMON and EQUIVALENCE + members. + + * lang-options.h, top.c, top.h (-fno-debug-kludge): + New option. + + 1996-09-24 Dave Love + + * Make-lang.in (include/f2c.h): + Remove dependencies on xmake_file and tmake_file. + They expand inconsistently in 2.8 c.f. 2.7; $(GCC_PARTS) depends on + them anyhow. + + 1996-09-22 Dave Love + + * config-lang.in: Add --enable-libu77 option handling. + + * Make-lang.in: + Conditionally add --enable-libu77 when running runtime configure. + Define LIBU77STAGESTUFF and use it in relevant rules. + + 1996-08-21 Dave Love + + * Make-lang.in (f77-runtime): + `stmp-hdrs' should have been `stmp-headers'. + + 1996-08-20 Dave Love + + * Make-lang.in (f77-runtime): + Depend on stmp-hdrs, not stmp-int-hdrs, since libF77 + needs float.h. + + 1996-05-20 Dave Love + + * config-lang.in: + Test for patch being applied with flag_move_all_movables in toplev.c. + + * install.texi (Patching GNU Fortran): + Mention overriding X_CFLAGS rather than + editing proj.h on SunOS4. + + * Make-lang.in (F77_FLAGS_TO_PASS): + Add X_CFLAGS (convenient for SunOS4 kluge, in + particular). + (f77.{,mostly,dist}clean): Reorder things, in particular not to delete + Makefiles too early. + + * g77.c (DEFAULT_SWITCH_TAKES_ARG): Define a la gcc.c in the + current GCC snapshot. + + Tue Apr 16 14:08:28 1996 Craig Burley + + * top.c (ffe_decode_option): -Wall no longer implies + -Wsurprising. + + Sat Apr 13 14:50:06 1996 Craig Burley + + * com.c (ffecom_char_args_): If item is error_mark_node, + set *length that way, too. + + * com.c (ffecom_expr_power_integer_): If either operand + is error_mark_node, return that. + + * com.c (ffecom_intrinsic_len_): If item is error_mark_node, + return that for length. + + * expr.c (ffeexpr_declare_unadorned_, + ffeexpr_declare_parenthesized_): Instead of crashing + on unexpected contexts, produce a diagnostic. + + * intrin.c (ffeintrin_check_), intrin.def (impSIGNAL): + Allow procedure as second arg to SIGNAL intrinsic. + + * stu.c (ffestu_symter_end_transition_): New function. + (ffestu_symter_exec_transition_): Return bool arg. + Always transition symbol (don't inhibit when !whereNONE). + (ffestu_sym_end_transition): If DUMMY/LOCAL arg has any + opANY exprs in its dimlist, diagnose it so it doesn't + make it through to later stages that try to deal with + dimlist stuff. + (ffestu_sym_exec_transition): If sym has any opANY exprs + in its dimlist, diagnose it so it becomes opANY itself. + + * symbol.c (ffesymbol_error): If token arg is NULL, + just ANY-ize the symbol -- don't produce diagnostic. + Mon Apr 1 10:14:02 1996 Craig Burley diff -rcp2N g77-0.5.18/f/INSTALL g77-0.5.19/f/INSTALL *** g77-0.5.18/f/INSTALL Tue Mar 19 13:18:29 1996 --- g77-0.5.19/f/INSTALL Sun Dec 1 22:59:57 1996 *************** follow the `g77' installation instructio *** 52,56 **** You can obtain an FSF distribution of `gcc' from the FSF. ! `g77-0.5.18.tar.gz' You probably have already unpacked this distribution, or you are reading an advanced copy of this manual, which is contained in --- 52,56 ---- You can obtain an FSF distribution of `gcc' from the FSF. ! `g77-0.5.19.tar.gz' You probably have already unpacked this distribution, or you are reading an advanced copy of this manual, which is contained in *************** follow the `g77' installation instructio *** 62,66 **** 100MB disk space For a complete "bootstrap" build, about 100MB of disk space is ! required for `g77' by the author's current Linux system. Some juggling can reduce the amount of space needed; during the --- 62,66 ---- 100MB disk space For a complete "bootstrap" build, about 100MB of disk space is ! required for `g77' by the author's current GNU/Linux system. Some juggling can reduce the amount of space needed; during the *************** General Problems *** 178,186 **** * `g77' currently requires application of a patch file to the gcc ! compiler tree (at least up through gcc version 2.7.0). The ! necessary patches should be folded in to the mainline gcc ! distribution. ! (Some combinations of versions of `g77' and `gcc' might actually *require* no patches, but the patch files will be provided anyway as long as there are more changes expected in subsequent releases. --- 178,185 ---- * `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 `g77' and `gcc' might actually *require* no patches, but the patch files will be provided anyway as long as there are more changes expected in subsequent releases. *************** system: *** 261,265 **** /usr/FSF/gcc-2.7.2.tar.gz ! /usr/FSF/g77-0.5.18.tar.gz Users of the following systems should not blindly follow these --- 260,264 ---- /usr/FSF/gcc-2.7.2.tar.gz ! /usr/FSF/g77-0.5.19.tar.gz Users of the following systems should not blindly follow these *************** of your system. Before doing so, it is *** 284,330 **** of some of the steps. These explanations follow this list of steps. ! sh[ 1]# `cd /usr/src' ! sh[ 2]# `gunzip -c < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -' [Might say "Broken pipe"...that is normal on some systems.] ! sh[ 3]# `gunzip -c < /usr/FSF/g77-0.5.18.tar.gz | tar xf -' ["Broken pipe" again possible.] ! sh[ 4]# `ln -s gcc-2.7.2 gcc' ! sh[ 5]# `ln -s g77-0.5.18 g77' ! sh[ 6]# `mv -i g77/* gcc' [No questions should be asked by mv here; or, you made a mistake.] ! sh[ 7]# `patch -p1 -V t -d gcc-2.7.2 < gcc-2.7.2/f/gbe/2.7.2.diff' [Unless patch complains about rejected patches, this step worked.] ! sh[ 8]# `cd gcc' ! sh[ 9]# `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.] ! sh[10]# `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, `touch f2c-exists-ok'.] ! sh[11]# `./configure --prefix=/usr' [Do not do the above if gcc is not installed in /usr/bin. ! You might need a different `--prefix=...', as described below.] ! sh[12]# `make bootstrap' [This takes a long time, and is where most problems occur.] ! sh[13]# `rm -fr stage1' ! sh[14]# `make -k install' [The actual installation.] ! sh[15]# `g77 -v' [Verify that g77 is installed, obtain version info.] --- 283,329 ---- of some of the steps. These explanations follow this list of steps. ! sh[ 1]# cd /usr/src ! sh[ 2]# gunzip -c < /usr/FSF/gcc-2.7.2.tar.gz | tar xf - [Might say "Broken pipe"...that is normal on some systems.] ! sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.19.tar.gz | tar xf - ["Broken pipe" again possible.] ! sh[ 4]# ln -s gcc-2.7.2 gcc ! sh[ 5]# ln -s g77-0.5.19 g77 ! sh[ 6]# mv -i g77/* gcc [No questions should be asked by mv here; or, you made a mistake.] ! sh[ 7]# patch -p1 -V t -d gcc-2.7.2 < gcc-2.7.2/f/gbe/2.7.2.diff [Unless patch complains about rejected patches, this step worked.] ! sh[ 8]# cd gcc ! sh[ 9]# 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.] ! sh[10]# 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, touch f2c-exists-ok.] ! sh[11]# ./configure --prefix=/usr [Do not do the above if gcc is not installed in /usr/bin. ! You might need a different --prefix=..., as described below.] ! sh[12]# make bootstrap [This takes a long time, and is where most problems occur.] ! sh[13]# rm -fr stage1 ! sh[14]# make -k install [The actual installation.] ! sh[15]# g77 -v [Verify that g77 is installed, obtain version info.] *************** Step 1: `cd /usr/src' *** 345,349 **** Step 4: `ln -s gcc-2.7.2 gcc' ! Step 5: `ln -s g77-0.5.18 g77' These commands mainly help reduce typing, and help reduce visual clutter in examples in this manual showing what to type to install --- 344,348 ---- Step 4: `ln -s gcc-2.7.2 gcc' ! Step 5: `ln -s g77-0.5.19 g77' These commands mainly help reduce typing, and help reduce visual clutter in examples in this manual showing what to type to install *************** Step 5: `ln -s g77-0.5.18 g77' *** 355,359 **** Step 6: `mv -i g77/* gcc' After doing this, you can, if you like, type `rm g77' and `rmdir ! g77-0.5.18' 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 `g77' are installed on your --- 354,358 ---- Step 6: `mv -i g77/* gcc' After doing this, you can, if you like, type `rm g77' and `rmdir ! g77-0.5.19' 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 `g77' are installed on your *************** generally only the documentation is imme *** 463,472 **** A sequence of commands typically used to unpack `gcc' and `g77' is: ! sh# `cd /usr/src' ! sh# `gunzip -d < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -' ! sh# `gunzip -d < /usr/FSF/g77-0.5.18.tar.gz | tar xf -' ! sh# `ln -s gcc-2.7.2 gcc' ! sh# `ln -s g77-0.5.18 g77' ! sh# `mv -i g77/* gcc' *Notes:* The commands beginning with `gunzip...' might print `Broken --- 462,471 ---- A sequence of commands typically used to unpack `gcc' and `g77' is: ! sh# cd /usr/src ! sh# gunzip -d < /usr/FSF/gcc-2.7.2.tar.gz | tar xf - ! sh# gunzip -d < /usr/FSF/g77-0.5.19.tar.gz | tar xf - ! sh# ln -s gcc-2.7.2 gcc ! sh# ln -s g77-0.5.19 g77 ! sh# mv -i g77/* gcc *Notes:* The commands beginning with `gunzip...' might print `Broken *************** newer than the newest `gcc' version supp *** 521,524 **** --- 520,529 ---- you have. + As of version 0.5.18, `g77' modifies the version number of `gcc' via + the pertinent patches. This is done because the resulting version of + `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 *************** as well try applying the `g77' patch tha *** 548,555 **** `gcc' having the same MAJOR and MINOR fields, as this is likely to work. ! So, for example, if `g77' has support for versions 2.7.0 and 2.7.1, ! it is likely that `gcc-2.7.2' would work well with `g77' by using the ! `2.7.1.diff' patch file provided with `g77' (aside from some offsets ! reported by `patch', which usually are harmless). However, `gcc-2.8.0' would almost certainly not work with that --- 553,561 ---- `gcc' having the same MAJOR and MINOR fields, as this is likely to work. ! So, for example, if a particular version of `g77' has support for ! `gcc' versions 2.7.0 and 2.7.1, it is likely that `gcc-2.7.2' would ! work well with `g77' by using the `2.7.1.diff' patch file provided with ! `g77' (aside from some offsets reported by `patch', which usually are ! harmless). However, `gcc-2.8.0' would almost certainly not work with that *************** type `rm -i *.~*~'. *** 593,606 **** *Note:* `g77''s configuration file `gcc/f/config-lang.in' ensures that the source code for the version of `gcc' being configured has at ! least one GBE function required specifically by `g77'. This function ! was added to `gcc-2.7.1', making the patch file ! `g77-0.5.17/f/gbe/2.7.1.diff' empty of actual patches. ! ! For `gcc-2.7.0' and earlier, this configuration-time checking should ! catch failure to apply the correct patch and, if so caught, it should ! abort the configuration with an explanation. *Please* do not try to ! disable the check, otherwise `g77' might well appear to build and ! install correctly, and even appear to compile correctly, but could ! easily produce broken code. `diff -rcp2N' is used to create the patch files in `gcc/f/gbe/'. --- 599,608 ---- *Note:* `g77''s configuration file `gcc/f/config-lang.in' ensures that the source code for the version of `gcc' being configured has at ! least one indication of being patched as required specifically by `g77'. ! This configuration-time checking should catch failure to apply the ! correct patch and, if so caught, should abort the configuration with an ! explanation. *Please* do not try to disable the check, otherwise `g77' ! might well appear to build and install correctly, and even appear to ! compile correctly, but could easily produce broken code. `diff -rcp2N' is used to create the patch files in `gcc/f/gbe/'. *************** change to `gcc/f/proj.h': edit the line *** 701,705 **** #define FFEPROJ_STRTOUL 1 ... ! by replacing the `1' with `0'. This causes a minimal version of `strtoul()' provided as part of the --- 703,711 ---- #define FFEPROJ_STRTOUL 1 ... ! by replacing the `1' with `0'. Or, you can avoid editing the source by ! adding ! CFLAGS='-DFFEPROJ_STRTOUL=0 -g' ! to the command line for `make' when you invoke it. (`-g' is the ! default for `CFLAGS'.) This causes a minimal version of `strtoul()' provided as part of the *************** function in their system libraries. *** 710,714 **** Similarly, a minimal version of `bsearch()' is available and can be enabled by editing a line similar to the one for `strtoul()' above in ! `gcc/f/proj.h', if your system libraries lack `bsearch()'. These are not problems with `g77', which requires an ANSI C --- 716,721 ---- Similarly, a minimal version of `bsearch()' is available and can be enabled by editing a line similar to the one for `strtoul()' above in ! `gcc/f/proj.h', if your system libraries lack `bsearch()'. The method ! of overriding `X_CFLAGS' may also be used. These are not problems with `g77', which requires an ANSI C *************** work. *** 943,948 **** them when they work: ! sh# `cd /usr/src/gcc' ! sh# `./g77 --driver=./xgcc -B./ -v' ./xgcc -B./ -v -fnull-version -o /tmp/gfa03648 ... Reading specs from ./specs --- 950,955 ---- them when they work: ! sh# cd /usr/src/gcc ! sh# ./g77 --driver=./xgcc -B./ -v ./xgcc -B./ -v -fnull-version -o /tmp/gfa03648 ... Reading specs from ./specs *************** them when they work: *** 960,968 **** ./f771 /tmp/cca03648.i -quiet -dumpbase null.F -version ... GNU F77 version 2.7.1 (80386, BSD syntax) compiled ... ! GNU Fortran Front End version 0.5.18 compiled: ... as -o /tmp/cca036481.o /tmp/cca03648.s ld -m i386linux -o /tmp/gfa03648 /usr/lib/crt0.o -L. ... /usr/lib/crt0.o(.text+0x35): undefined reference to `main' ! sh# `./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone' Reading specs from ./specs gcc version 2.7.1 --- 967,975 ---- ./f771 /tmp/cca03648.i -quiet -dumpbase null.F -version ... GNU F77 version 2.7.1 (80386, BSD syntax) compiled ... ! GNU Fortran Front End version 0.5.19 compiled: ... as -o /tmp/cca036481.o /tmp/cca03648.s ld -m i386linux -o /tmp/gfa03648 /usr/lib/crt0.o -L. ... /usr/lib/crt0.o(.text+0x35): undefined reference to `main' ! sh# ./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone Reading specs from ./specs gcc version 2.7.1 *************** ensure that `bison' is not invoked by `m *** 1078,1084 **** these commands: ! sh# `cd gcc' ! sh# `touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c' ! sh# `touch cp/parse.c cp/parse.h objc-parse.c' sh# --- 1085,1091 ---- these commands: ! sh# cd gcc ! sh# touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c ! sh# touch cp/parse.c cp/parse.h objc-parse.c sh# *************** file `gcc/COPYING' thoroughly). *** 1117,1121 **** installed. ! For systems like Linux that have no native Fortran compiler (or where `g77' could be considered the native compiler for Fortran and `gcc' for C, etc.), you should definitely configure `g77' for --- 1124,1128 ---- installed. ! For systems like GNU/Linux that have no native Fortran compiler (or where `g77' could be considered the native compiler for Fortran and `gcc' for C, etc.), you should definitely configure `g77' for *************** run-time performance, as it presents mor *** 1248,1251 **** --- 1255,1263 ---- optimize the generated code). + *Note:* Putting more variables and arrays on the stack might cause + problems due to system-dependent limits on stack size. Also, the value + of `FFECOM_sizeMAXSTACKITEM' has no effect on automatic variables and + arrays. *Note But-bugs::, for more information. + Floating-point Bit Patterns --------------------------- *************** have to crash the build but rather gener *** 1258,1263 **** (Currently, `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 `EQUIVALENCE (I,R)' and `DATA ! R/3.1415926535/'.) Initialization of Large Aggregate Areas --- 1270,1274 ---- (Currently, `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 `EQUIVALENCE (I,R)' and `DATA R/9.43578/'.) Initialization of Large Aggregate Areas *************** target configuration that is not basical *** 1299,1311 **** Alpha, which is a 64-bit machine, especially if it has a 64-bit operating system running on it). This is because `g77' is known to not ! work properly on such configurations, although the reasons for this are ! not fully explored. This is expected to be fixed at 0.6, at which ! point the warning would be dropped. (The reason the unexplored ! problems are expected to be fixed at 0.6 is because some known internal ! design problems `g77' has, which reduce portability and the ability to ! configure it as a cross-compiler, are presumed to be at least partly ! responsible for the problems being encountered on the Alpha. The ! problems remain unexplored partly because the known problems exist and ! are scheduled to be addressed anyway. Plus, the `g77' maintainer does ! not yet possess an Alpha workstation of his own.) --- 1310,1317 ---- Alpha, which is a 64-bit machine, especially if it has a 64-bit operating system running on it). This is because `g77' is known to not ! work properly on such configurations. This is expected to be ! completely fixed at 0.6, at which point the warning would be dropped. ! ! (Version 0.5.20 is expected to solve most of these problems, though, ! as of this writing, work is still progressing in this area.) diff -rcp2N g77-0.5.18/f/Make-lang.in g77-0.5.19/f/Make-lang.in *** g77-0.5.18/f/Make-lang.in Tue Mar 19 13:45:33 1996 --- g77-0.5.19/f/Make-lang.in Fri Dec 6 12:46:48 1996 *************** *** 1,4 **** ! # Top level makefile fragment for GNU Fortran. ! # Copyright (C) 1995 Free Software Foundation, Inc. #This file is part of GNU Fortran. --- 1,4 ---- ! # Top level makefile fragment for GNU Fortran. -*-makefile-*- ! # Copyright (C) 1995, 1996 Free Software Foundation, Inc. #This file is part of GNU Fortran. *************** F77_FLAGS_TO_PASS = \ *** 49,52 **** --- 49,53 ---- CC="$(CC)" \ CFLAGS="$(CFLAGS)" \ + X_CFLAGS="$(X_CFLAGS)" \ LDFLAGS="$(LDFLAGS)" \ LEX="$(LEX)" \ *************** F77 f77: f771 f77-runtime *** 108,119 **** f77.stage4 f77.distdir f77.rebuilt ! # Create the compiler driver for g77. g77: f/g77.c $(CONFIG_H) $(LIBDEPS) ! $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ $(srcdir)/f/g77.c $(LIBS) ! # Create a version of the g77 driver which calls the cross-compiler. g77-cross: f/g77.c version.o $(LIBDEPS) ! $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ \ ! -DGCC_NAME=\"$(GCC_CROSS_NAME)\" $(srcdir)/f/g77.c version.o $(LIBS) # g77 documentation. --- 109,129 ---- f77.stage4 f77.distdir f77.rebuilt ! # Create the compiler driver for g77 (only if `f77' is in LANGUAGES). g77: f/g77.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: f/g77.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 # g77 documentation. *************** f/Makefile: $(srcdir)/f/Makefile.in $(sr *** 240,245 **** # overridden from the default "./xgcc -B./", hence the case statement. # We depend on GCC_PASSES through f/runtime/Makefile. ! stmp-int-hdrs = stmp-int-hdrs # to be overrideable in unsafe version ! f77-runtime: f/runtime/Makefile include/f2c.h $(stmp-int-headers) \ f/runtime/libF77/Makefile f/runtime/libI77/Makefile case "$(LANGUAGES)" in \ --- 250,256 ---- # overridden from the default "./xgcc -B./", hence the case statement. # 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 case "$(LANGUAGES)" in \ *************** f77-runtime: f/runtime/Makefile include *** 256,260 **** # in particular, at present... f77-runtime-unsafe: ! $(MAKE) stmp-int-hdrs= GCC_PARTS= f77-runtime # The configuration of the runtime system relies on an autoconf-type --- 267,271 ---- # in particular, at present... f77-runtime-unsafe: ! $(MAKE) stmp-headers= GCC_PARTS= f77-runtime # The configuration of the runtime system relies on an autoconf-type *************** f/runtime/libF77/Makefile f/runtime/libI *** 268,272 **** $(srcdir)/f/runtime/libF77/Makefile.in \ $(srcdir)/f/runtime/libI77/Makefile.in \ ! $(GCC_PARTS) $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) # The make "stage?" in compiler spec. is fully qualified as above top=`pwd`; \ --- 279,283 ---- $(srcdir)/f/runtime/libF77/Makefile.in \ $(srcdir)/f/runtime/libI77/Makefile.in \ ! $(GCC_PARTS) # The make "stage?" in compiler spec. is fully qualified as above top=`pwd`; \ *************** f/runtime/libF77/Makefile f/runtime/libI *** 280,284 **** #For now, omit f2c stuff. -- burley ! #f2c: stmp-int-hdrs f/f2c/Makefile # cd f/f2c; $(MAKE) all # --- 291,295 ---- #For now, omit f2c stuff. -- burley ! #f2c: stmp-headers f/f2c/Makefile # cd f/f2c; $(MAKE) all # *************** f77.mostlyclean: *** 458,466 **** -rm -f f/fini f/f771 f/stamp-str f/str-*.h f/str-*.j -cd f/runtime; $(MAKE) mostlyclean ! f77.clean: f77.mostlyclean ! -cd f/runtime; $(MAKE) clean ! f77.distclean: f77.clean ! -rm -f f/Makefile -cd f/runtime; $(MAKE) distclean # like gcc's extraclean, which does clean f/ for us, but not f/gbe, # f/runtime, f/runtime/libF77, and f/runtime/libI77, so do those. --- 469,479 ---- -rm -f f/fini f/f771 f/stamp-str f/str-*.h f/str-*.j -cd f/runtime; $(MAKE) mostlyclean ! f77.clean: ! -cd f/runtime; $(MAKE) mostlyclean ! -$(MAKE) f77.mostlyclean ! f77.distclean: -cd f/runtime; $(MAKE) distclean + -$(MAKE) f77.clean + -rm -f f/Makefile # like gcc's extraclean, which does clean f/ for us, but not f/gbe, # f/runtime, f/runtime/libF77, and f/runtime/libI77, so do those. diff -rcp2N g77-0.5.18/f/Makefile.in g77-0.5.19/f/Makefile.in *** g77-0.5.18/f/Makefile.in Mon Apr 1 10:10:49 1996 --- g77-0.5.19/f/Makefile.in Thu Oct 31 05:33:26 1996 *************** ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) *** 139,144 **** # f771 is so big, need to tell linker on m68k-next-nextstep* to make enough ! # room for it. ! F771_LDFLAGS = ` case "${target}" in m68k-next-nextstep*) echo -segaddr __DATA 6000000 ;; esac ` # Even if ALLOCA is set, don't use it if compiling with GCC. --- 139,147 ---- # 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;;\ ! *-*-aix[4-9]*) echo -Wl,-bbigtoc;; esac` # Even if ALLOCA is set, don't use it if compiling with GCC. diff -rcp2N g77-0.5.18/f/NEWS g77-0.5.19/f/NEWS *** g77-0.5.18/f/NEWS Mon Apr 1 10:20:52 1996 --- g77-0.5.19/f/NEWS Wed Dec 4 22:00:13 1996 *************** News About GNU Fortran *** 7,10 **** --- 7,97 ---- ********************** + In 0.5.19: + ========== + + * Fix `FORMAT' statement parsing so negative values for specifiers + such as `P' (e.g. `FORMAT(-1PF8.1)') are correctly processed as + negative. + + * Fix `SIGNAL' intrinsic so it once again accepts a procedure as its + second argument. + + * A temporary kludge option provides bare-bones information on + `COMMON' and `EQUIVALENCE' members at debug time. + + * New `-fonetrip' option specifies FORTRAN-66-style one-trip `DO' + loops. + + * New `-fno-silent' option causes names of program units to be + printed as they are compiled, in a fashion similar to UNIX `f77' + and `f2c'. + + * New `-fugly-assumed' option specifies that arrays dimensioned via + `DIMENSION X(1)', for example, are to be treated as assumed-size. + + * New `-fno-typeless-boz' option specifies that non-decimal-radix + constants using the prefixed-radix form (such as `Z'1234'') are to + be interpreted as `INTEGER' constants. + + * New `-ff66' option is a "shorthand" option that specifies + behaviors considered appropriate for FORTRAN 66 programs. + + * New `-ff77' option is a "shorthand" option that specifies + behaviors considered appropriate for UNIX `f77' programs. + + * New `-fugly-comma' and `-fugly-logint' options provided to perform + some of what `-fugly' used to do. `-fugly' and `-fno-ugly' are + now "shorthand" options, in that they do nothing more than enable + (or disable) other `-fugly-*' options. + + * Fix parsing of assignment statements involving targets that are + substrings of elements of `CHARACTER' arrays having names such as + `READ', `WRITE', `GOTO', and `REALFUNCTIONFOO'. + + * Fix crashes involving diagnosed code. + + * Fix handling of local `EQUIVALENCE' areas so certain cases of + valid Fortran programs are not misdiagnosed as improperly + extending the area backwards. + + * Support `gcc' version 2.7.2.1. + + * Upgrade to `libf2c' as of 1996-09-26, and fix up some of the build + procedures. + + * Change code generation for list-directed I/O so it allows for new + versions of `libf2c' that might return non-zero status codes for + some operations previously assumed to always return zero. + + This change not only affects how `IOSTAT=' variables are set by + list-directed I/O, it also affects whether `END=' and `ERR=' + labels are reached by these operations. + + * Add intrinsic support for new `FTELL' and `FSEEK' procedures in + `libf2c'. + + * Modify `fseek_()' in `libf2c' to be more portable (though, in + practice, there might be no systems where this matters) and to + catch invalid `whence' arguments. + + * Some useless warnings from the `-Wunused' option have been + eliminated. + + * Fix a problem building the `f771' executable on AIX systems by + linking with the `-bbigtoc' option. + + * Abort configuration if `gcc' has not been patched using the patch + file provided in the `gcc/f/gbe/' subdirectory. + + * Add options `--help' and `--version' to the `g77' command, to + conform to GNU coding guidelines. Also add printing of `g77' + version number when the `--verbose' (`-v') option is used. + + * Change internally generated name for local `EQUIVALENCE' areas to + one based on the alphabetically sorted first name in the list of + names for entities placed at the beginning of the areas. + + * Improvements to documentation and indexing. + In 0.5.18: ========== *************** In 0.5.18: *** 138,141 **** --- 225,230 ---- rewritten.) + * Support `gcc' version 2.7.2. + * Upgrade to `libf2c' as of 1996-03-23, and fix up some of the build procedures. *************** In 0.5.16: *** 234,238 **** * Fix a code-generation bug involving complicated `EQUIVALENCE' ! statements not involving `COMMON' * Fix code-generation bugs involving invoking "gratis" library --- 323,327 ---- * Fix a code-generation bug involving complicated `EQUIVALENCE' ! statements not involving `COMMON'. * Fix code-generation bugs involving invoking "gratis" library diff -rcp2N g77-0.5.18/f/bad.def g77-0.5.19/f/bad.def *** g77-0.5.18/f/bad.def Mon Mar 18 16:42:26 1996 --- g77-0.5.19/f/bad.def Mon Nov 25 20:12:49 1996 *************** FFEBAD_MSGS2 (FFEBAD_QUOTE_MISSES_DIGITS *** 105,108 **** --- 105,114 ---- "Double-quote at %0 not followed by a string of valid octal digits at %1", "Invalid octal constant at %0") + FFEBAD_MSGS2 (FFEBAD_INVALID_BINARY_DIGIT, FATAL, + "Invalid binary digit(s) found in string of digits at %0", + "Invalid binary constant at %0") + FFEBAD_MSGS2 (FFEBAD_INVALID_HEX_DIGIT, FATAL, + "Invalid hexadecimal digit(s) found in string of digits at %0", + "Invalid hexadecimal constant at %0") FFEBAD_MSGS2 (FFEBAD_INVALID_OCTAL_DIGIT, FATAL, "Invalid octal digit(s) found in string of digits at %0", *************** FFEBAD_MSGS2 (FFEBAD_UNREC_STMT, FATAL, *** 168,172 **** "Invalid statement at %0") FFEBAD_MSGS2 (FFEBAD_UNIMPL_STMT, FATAL, ! "Unimplemented or invalid form of statement at %0 (this is a catchall diagnostic that currently applies to a wide variety of errors, including things like invalid ordering of statements)", "Invalid statement at %0") FFEBAD_MSGS2 (FFEBAD_INVALID_STMT_FORM, FATAL, --- 174,178 ---- "Invalid statement at %0") FFEBAD_MSGS2 (FFEBAD_UNIMPL_STMT, FATAL, ! "Unimplemented or invalid form of statement at %0 (this is a catchall diagnostic that currently applies to a wide variety of errors, including things like invalid ordering of statements and invalid reference to intrinsic procedure)", "Invalid statement at %0") FFEBAD_MSGS2 (FFEBAD_INVALID_STMT_FORM, FATAL, *************** FFEBAD_MSGS1 (FFEBAD_EQUIV_ALIGN, FATAL, *** 564,568 **** "Can't place `%A' as directed by EQUIVALENCE due to alignment restrictions") FFEBAD_MSGS1 (FFEBAD_EQUIV_MISMATCH, FATAL, ! "Mismatched EQUIVALENCE requirements for placement of `%A'") FFEBAD_MSGS1 (FFEBAD_EQUIV_RANGE, FATAL, "Array or substring specification for `%A' out of range in EQUIVALENCE statement") --- 570,574 ---- "Can't place `%A' as directed by EQUIVALENCE due to alignment restrictions") FFEBAD_MSGS1 (FFEBAD_EQUIV_MISMATCH, FATAL, ! "Mismatched EQUIVALENCE requirements for placement of `%A' at both %C and %D bytes offset from `%B'") FFEBAD_MSGS1 (FFEBAD_EQUIV_RANGE, FATAL, "Array or substring specification for `%A' out of range in EQUIVALENCE statement") *************** FFEBAD_MSGS2 (FFEBAD_COMMON_PAD, WARN, *** 577,581 **** "Padding of %A %D required before `%B' in common block `%C' at %0") FFEBAD_MSGS1 (FFEBAD_COMMON_NEG, FATAL, ! "Attempt to extend COMMON/EQUIVALENCE area beyond its starting point via EQUIVALENCE of `%A'") FFEBAD_MSGS1 (FFEBAD_EQUIV_FEW, FATAL, "Too few elements in reference to array `%A' in EQUIVALENCE statement") --- 583,587 ---- "Padding of %A %D required before `%B' in common block `%C' at %0") FFEBAD_MSGS1 (FFEBAD_COMMON_NEG, FATAL, ! "Attempt to extend COMMON area beyond its starting point via EQUIVALENCE of `%A'") FFEBAD_MSGS1 (FFEBAD_EQUIV_FEW, FATAL, "Too few elements in reference to array `%A' in EQUIVALENCE statement") diff -rcp2N g77-0.5.18/f/bld.c g77-0.5.19/f/bld.c *** g77-0.5.18/f/bld.c Mon Mar 18 20:14:45 1996 --- g77-0.5.19/f/bld.c Thu Nov 21 20:49:09 1996 *************** ffebld_constant_new_integer4_val (ffetar *** 1487,1495 **** #endif /* ffebld_constant_new_integeroctal -- Return octal constant object from token See prototype. ! Parses the token as a decimal integer constant, thus it must be an FFELEX_typeNUMBER. */ --- 1487,1533 ---- #endif + /* ffebld_constant_new_integerbinary -- Return binary constant object from token + + See prototype. + + Parses the token as a binary integer constant, thus it must be an + FFELEX_typeNUMBER. */ + + ffebldConstant + ffebld_constant_new_integerbinary (ffelexToken t) + { + ffetargetIntegerDefault val; + + assert ((ffelex_token_type (t) == FFELEX_typeNAME) + || (ffelex_token_type (t) == FFELEX_typeNUMBER)); + + ffetarget_integerbinary (&val, t); + return ffebld_constant_new_integerdefault_val (val); + } + + /* ffebld_constant_new_integerhex -- Return hex constant object from token + + See prototype. + + Parses the token as a hex integer constant, thus it must be an + FFELEX_typeNUMBER. */ + + ffebldConstant + ffebld_constant_new_integerhex (ffelexToken t) + { + ffetargetIntegerDefault val; + + assert ((ffelex_token_type (t) == FFELEX_typeNAME) + || (ffelex_token_type (t) == FFELEX_typeNUMBER)); + + ffetarget_integerhex (&val, t); + return ffebld_constant_new_integerdefault_val (val); + } + /* ffebld_constant_new_integeroctal -- Return octal constant object from token See prototype. ! Parses the token as a octal integer constant, thus it must be an FFELEX_typeNUMBER. */ *************** ffebld_constant_new_integeroctal (ffelex *** 1499,1503 **** ffetargetIntegerDefault val; ! assert (ffelex_token_type (t) == FFELEX_typeNUMBER); ffetarget_integeroctal (&val, t); --- 1537,1542 ---- ffetargetIntegerDefault val; ! assert ((ffelex_token_type (t) == FFELEX_typeNAME) ! || (ffelex_token_type (t) == FFELEX_typeNUMBER)); ffetarget_integeroctal (&val, t); *************** ffebld_constantarray_dump (ffebldConstan *** 1996,2003 **** { if (length == 1) ! fprintf (dmpout, "[%" ffetargetOffset_f "u]:", offset); else fprintf (dmpout, ! "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "u]:", offset, offset + length - 1); for (i = 0; i < length; ++i, ++offset) --- 2035,2042 ---- { if (length == 1) ! fprintf (dmpout, "[%" ffetargetOffset_f "d]:", offset); else fprintf (dmpout, ! "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "d]:", offset, offset + length - 1); for (i = 0; i < length; ++i, ++offset) diff -rcp2N g77-0.5.18/f/bld.h g77-0.5.19/f/bld.h *** g77-0.5.18/f/bld.h Wed Aug 30 15:53:37 1995 --- g77-0.5.19/f/bld.h Thu Oct 31 06:21:29 1996 *************** ffebldConstant ffebld_constant_new_integ *** 587,590 **** --- 587,592 ---- ffebldConstant ffebld_constant_new_integer8_val (ffetargetInteger8 val); #endif + ffebldConstant ffebld_constant_new_integerbinary (ffelexToken t); + ffebldConstant ffebld_constant_new_integerhex (ffelexToken t); ffebldConstant ffebld_constant_new_integeroctal (ffelexToken t); #if FFETARGET_okLOGICAL1 diff -rcp2N g77-0.5.18/f/bugs.texi g77-0.5.19/f/bugs.texi *** g77-0.5.18/f/bugs.texi Mon Mar 25 20:27:20 1996 --- g77-0.5.19/f/bugs.texi Wed Nov 27 13:52:39 1996 *************** *** 6,10 **** @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-03-25 @ifclear BUGSONLY --- 6,10 ---- @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-11-27 @ifclear BUGSONLY *************** For example, @code{gcc} accepts abbrevia *** 73,79 **** @item - @code{g77} could use a @samp{--help} option of some sort. - - @item Some confusion in diagnostics concerning failing @samp{INCLUDE} statements from within @samp{INCLUDE}'d or @samp{#include}'d files. --- 73,76 ---- *************** And it turns out there's a similar bug f *** 149,157 **** local equivalence areas, so that has been disabled as well. ! @item @cindex code, displaying main source @cindex displaying main source code @cindex debugging main source code @cindex printing main source When debugging, after starting up the debugger but before being able to see the source code for the main program unit, the user must currently --- 146,161 ---- local equivalence areas, so that has been disabled as well. ! As of Version 0.5.19, a temporary kludge solution is provided whereby ! some rudimentary information on a member is written as a string that ! is the member's value as a character string. ! ! @xref{Code Gen Options,,Options for Code Generation Conventions}, ! for information on the @samp{-fdebug-kludge} option. ! @cindex code, displaying main source @cindex displaying main source code @cindex debugging main source code @cindex printing main source + @item When debugging, after starting up the debugger but before being able to see the source code for the main program unit, the user must currently *************** The known problem shows up only when com *** 205,212 **** @item @code{g77} doesn't work on 64-bit configurations such as the Alpha. ! The problem is not yet adequately investigated, and some ! Alpha users are having quite a bit of success, so perhaps ! it depends on the OS and configuration of @code{gcc} they ! are using. @cindex COMPLEX support --- 209,215 ---- @item @code{g77} doesn't work on 64-bit configurations such as the Alpha. ! This problem is expected to be largely resolved as of version 0.5.20, ! and version 0.6 should solve most or all related problems (such as ! 64-bit machines other than DEC Alphas). @cindex COMPLEX support *************** the problems affect only the more-genera *** 221,230 **** Fortran does not use. ! But there might well be some problems with the portions of @samp{__complex__} ! support in the back end that @code{g77} uses to implement @samp{COMPLEX} and ! @samp{DOUBLE COMPLEX}. ! More investigation is needed, but bug reports ! are definitely welcome, since that can help speed investigation of ! problem areas. @cindex ELF support --- 224,231 ---- Fortran does not use. ! Version 0.5.20 of @code{g77} is expected to work around this ! problem by not using the back end's support for @samp{COMPLEX}. ! This work has already been done, and is being tested by ! developers. @cindex ELF support diff -rcp2N g77-0.5.18/f/com-rt.def g77-0.5.19/f/com-rt.def *** g77-0.5.18/f/com-rt.def Tue Mar 12 14:41:42 1996 --- g77-0.5.19/f/com-rt.def Tue Nov 5 22:21:50 1996 *************** DEFGFRT (FFECOM_gfrtEXIT, "exit_", FFECO *** 157,160 **** --- 157,162 ---- DEFGFRT (FFECOM_gfrtEXP, "r_exp", FFECOM_rttypeDOUBLE_, "&r", FALSE, FALSE) DEFGFRT (FFECOM_gfrtFLUSH, "flush_", FFECOM_rttypeVOID_, 0, FALSE, FALSE) + DEFGFRT (FFECOM_gfrtFTELL, "ftell_", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE) + DEFGFRT (FFECOM_gfrtFSEEK, "fseek_", FFECOM_rttypeINTEGER_, "&i&i&i", FALSE, FALSE) DEFGFRT (FFECOM_gfrtGETARG, "getarg_", FFECOM_rttypeVOID_, "&i&a", FALSE, FALSE) DEFGFRT (FFECOM_gfrtGETENV, "getenv_", FFECOM_rttypeVOID_, "&a&a", FALSE, FALSE) diff -rcp2N g77-0.5.18/f/com.c g77-0.5.19/f/com.c *** g77-0.5.18/f/com.c Mon Mar 25 19:46:58 1996 --- g77-0.5.19/f/com.c Mon Dec 2 00:46:34 1996 *************** static void ffecom_concat_list_kill_ (ff *** 422,425 **** --- 422,427 ---- static ffecomConcatList_ ffecom_concat_list_new_ (ffebld expr, ffetargetCharacterSize max); + static void ffecom_debug_kludge_ (tree aggr, char *aggr_type, ffesymbol member, + tree member_type, ffetargetOffset offset); static void ffecom_do_entry_ (ffesymbol fn, int entrynum); static tree ffecom_expr_ (ffebld expr, tree dest_tree, *************** ffecom_char_args_ (tree *xitem, tree *le *** 1343,1346 **** --- 1345,1350 ---- } } + else if (item == error_mark_node) + *length = error_mark_node; else /* FFEINFO_kindFUNCTION: */ *length = NULL_TREE; *************** ffecom_concat_list_new_ (ffebld expr, ff *** 1810,1813 **** --- 1814,1903 ---- #endif + + /* Provide some kind of useful info on member of aggregate area, + since current g77/gcc technology does not provide debug info + on these members. */ + + #if FFECOM_targetCURRENT == FFECOM_targetGCC + static void + ffecom_debug_kludge_ (tree aggr, char *aggr_type, ffesymbol member, + tree member_type UNUSED, ffetargetOffset offset) + { + tree value; + tree decl; + int len; + char *buff; + char space[120]; + #if 0 + tree type_id; + + for (type_id = member_type; + TREE_CODE (type_id) != IDENTIFIER_NODE; + ) + { + switch (TREE_CODE (type_id)) + { + case INTEGER_TYPE: + case REAL_TYPE: + type_id = TYPE_NAME (type_id); + break; + + case ARRAY_TYPE: + case COMPLEX_TYPE: + type_id = TREE_TYPE (type_id); + break; + + default: + assert ("no IDENTIFIER_NODE for type!" == NULL); + type_id = error_mark_node; + break; + } + } + #endif + + if (ffecom_transform_only_dummies_ + || !ffe_is_debug_kludge ()) + return; /* Can't do this yet, maybe later. */ + + len = 60 + + strlen (aggr_type) + + IDENTIFIER_LENGTH (DECL_NAME (aggr)); + #if 0 + + IDENTIFIER_LENGTH (type_id); + #endif + + if (((size_t) len) >= ARRAY_SIZE (space)) + buff = malloc_new_ks (malloc_pool_image (), "debug_kludge", len + 1); + else + buff = &space[0]; + + sprintf (&buff[0], "At (%s) `%s' plus %ld bytes", + aggr_type, + IDENTIFIER_POINTER (DECL_NAME (aggr)), + (long int) offset); + + value = build_string (len, buff); + TREE_TYPE (value) + = build_type_variant (build_array_type (char_type_node, + build_range_type + (integer_type_node, + integer_one_node, + build_int_2 (strlen (buff), 0))), + 1, 0); + decl = build_decl (VAR_DECL, + ffecom_get_identifier_ (ffesymbol_text (member)), + TREE_TYPE (value)); + TREE_CONSTANT (decl) = 1; + TREE_STATIC (decl) = 1; + DECL_INITIAL (decl) = error_mark_node; + DECL_IN_SYSTEM_HEADER (decl) = 1; /* Don't let -Wunused complain. */ + decl = start_decl (decl, FALSE); + finish_decl (decl, value, FALSE); + + if (buff != &space[0]) + malloc_kill_ks (malloc_pool_image (), buff, len + 1); + } + #endif + /* ffecom_do_entry_ -- Do compilation of a particular entrypoint *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 2323,2326 **** --- 2413,2420 ---- if (assignp) { /* ASSIGN'ed-label expr. */ + t = ffesymbol_hook (s).decl_tree; + if (t != NULL_TREE) + DECL_IN_SYSTEM_HEADER (t) = 1; /* Don't let -Wunused complain. */ + t = ffesymbol_hook (s).assign_tree; if (t == NULL_TREE) *************** ffecom_expr_intrinsic_ (ffebld expr, tre *** 3005,3010 **** kt = ffeinfo_kindtype (ffebld_info (expr)); tree_type = ffecom_tree_type[bt][kt]; - if (tree_type == NULL_TREE) - tree_type = void_type_node; /* For SUBROUTINEs. */ if (list != NULL) --- 3099,3102 ---- *************** ffecom_expr_intrinsic_ (ffebld expr, tre *** 4048,4070 **** #endif expr_tree ! = ffecom_2s (MODIFY_EXPR, tree_type, arg4_tree, prep_arg1); /* Make sure SAVE_EXPRs get referenced early enough. */ expr_tree ! = ffecom_2 (COMPOUND_EXPR, tree_type, ! convert (tree_type, arg1_tree), ! ffecom_2 (COMPOUND_EXPR, tree_type, ! convert (tree_type, arg3_tree), ! ffecom_2 (COMPOUND_EXPR, tree_type, ! convert (tree_type, ! arg5_tree), ! ffecom_2 (COMPOUND_EXPR, tree_type, ! convert (tree_type, ! arg5_plus_arg3), expr_tree)))); expr_tree ! = ffecom_2 (COMPOUND_EXPR, tree_type, ! convert (tree_type, arg4_tree), expr_tree); --- 4140,4160 ---- #endif expr_tree ! = ffecom_2s (MODIFY_EXPR, void_type_node, arg4_tree, prep_arg1); /* Make sure SAVE_EXPRs get referenced early enough. */ expr_tree ! = ffecom_2 (COMPOUND_EXPR, void_type_node, ! arg1_tree, ! ffecom_2 (COMPOUND_EXPR, void_type_node, ! arg3_tree, ! ffecom_2 (COMPOUND_EXPR, void_type_node, ! arg5_tree, ! ffecom_2 (COMPOUND_EXPR, void_type_node, ! arg5_plus_arg3, expr_tree)))); expr_tree ! = ffecom_2 (COMPOUND_EXPR, void_type_node, ! arg4_tree, expr_tree); *************** ffecom_expr_intrinsic_ (ffebld expr, tre *** 4227,4230 **** --- 4317,4322 ---- case FFEINTRIN_impGETARG: case FFEINTRIN_impGETENV: + case FFEINTRIN_impFTELL: + case FFEINTRIN_impFSEEK: break; *************** ffecom_expr_power_integer_ (ffebld left, *** 5144,5147 **** --- 5236,5243 ---- tree result = NULL_TREE; + if (l == error_mark_node + || r == error_mark_node) + return error_mark_node; + if (TREE_CODE (r) == INTEGER_CST) { *************** ffecom_intrinsic_len_ (ffebld expr) *** 6182,6185 **** --- 6278,6283 ---- } } + else if (item == error_mark_node) + length = error_mark_node; else /* FFEINFO_kindFUNCTION: */ length = NULL_TREE; *************** ffecom_member_phase2_ (ffestorag mst, ff *** 6636,6640 **** plus_constant (XEXP (DECL_RTL (mt), 0), ffestorag_modulo (mst) ! + ffestorag_offset (st))); t = start_decl (t, FALSE); --- 6734,6739 ---- plus_constant (XEXP (DECL_RTL (mt), 0), ffestorag_modulo (mst) ! + ffestorag_offset (st) ! - ffestorag_offset (mst))); t = start_decl (t, FALSE); *************** ffecom_sym_transform_ (ffesymbol s) *** 7080,7086 **** offset = ffestorag_modulo (est) ! + ffestorag_offset (ffesymbol_storage (s)); ! /* (t_type *) (((void *) &et) + offset */ t = convert (string_type_node, /* (char *) */ --- 7179,7188 ---- offset = ffestorag_modulo (est) ! + ffestorag_offset (ffesymbol_storage (s)) ! - ffestorag_offset (est); ! ! ffecom_debug_kludge_ (et, "EQUIVALENCE", s, type, offset); ! /* (t_type *) (((char *) &et) + offset) */ t = convert (string_type_node, /* (char *) */ *************** ffecom_sym_transform_ (ffesymbol s) *** 7542,7546 **** cs = ffesymbol_common (s); /* The COMMON area itself. */ if (st != NULL) /* Else not laid out. */ ! ffecom_transform_common_ (cs); yes = suspend_momentary (); --- 7644,7651 ---- cs = ffesymbol_common (s); /* The COMMON area itself. */ if (st != NULL) /* Else not laid out. */ ! { ! ffecom_transform_common_ (cs); ! st = ffesymbol_storage (s); ! } yes = suspend_momentary (); *************** ffecom_sym_transform_ (ffesymbol s) *** 7561,7569 **** { ffetargetOffset offset; ! offset = ffestorag_modulo (ffesymbol_storage (cs)) ! + ffestorag_offset (st); ! /* (t_type *) (((char *) &ct) + offset */ t = convert (string_type_node, /* (char *) */ --- 7666,7681 ---- { ffetargetOffset offset; + ffestorag cst; + + cst = ffestorag_parent (st); + assert (cst == ffesymbol_storage (cs)); ! offset = ffestorag_modulo (cst) ! + ffestorag_offset (st) ! - ffestorag_offset (cst); ! ffecom_debug_kludge_ (ct, "COMMON", s, type, offset); ! ! /* (t_type *) (((char *) &ct) + offset) */ t = convert (string_type_node, /* (char *) */ *************** ffecom_transform_equiv_ (ffestorag eqst) *** 8224,8227 **** --- 8336,8344 ---- eqt = start_decl (eqt, FALSE); + /* Make sure this shows up as a debug symbol, which is not normally + the case for invented identifiers. */ + + DECL_IGNORED_P (eqt) = 0; + /* Make sure that any type can live in EQUIVALENCE and be referenced without getting a bus error. We could pick the most restrictive *************** ffecom_notify_primary_entry (ffesymbol s *** 11435,11438 **** --- 11552,11563 ---- ffecom_primary_entry_is_proc_ = FALSE; + if (!ffe_is_silent ()) + { + if (ffecom_primary_entry_kind_ == FFEINFO_kindPROGRAM) + fprintf (stderr, "%s:\n", ffesymbol_text (s)); + else + fprintf (stderr, " %s:\n", ffesymbol_text (s)); + } + #if FFECOM_targetCURRENT == FFECOM_targetGCC if (ffecom_primary_entry_kind_ == FFEINFO_kindSUBROUTINE) *************** pushdecl (x) *** 13589,13592 **** --- 13714,13729 ---- if (name) { + if (IDENTIFIER_INVENTED (name)) + { + #if BUILT_FOR_270 + DECL_ARTIFICIAL (x) = 1; + #endif + DECL_IN_SYSTEM_HEADER (x) = 1; + DECL_IGNORED_P (x) = 1; + TREE_USED (x) = 1; + if (TREE_CODE (x) == TYPE_DECL) + TYPE_DECL_SUPPRESS_DEBUG (x) = 1; + } + t = lookup_name_current_level (name); diff -rcp2N g77-0.5.18/f/config-lang.in g77-0.5.19/f/config-lang.in *** g77-0.5.18/f/config-lang.in Tue Dec 26 11:54:27 1995 --- g77-0.5.19/f/config-lang.in Thu Nov 21 13:24:54 1996 *************** *** 27,36 **** # diff_excludes - files to ignore when building diffs between two versions. ! if grep put_pending_sizes $srcdir/stor-layout.c >/dev/null; then true else ! echo "You haven't applied the patches to the GCC distribution in" ! echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README." ! echo "" ! exit 1 fi --- 27,46 ---- # 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 diff -rcp2N g77-0.5.18/f/data.c g77-0.5.19/f/data.c *** g77-0.5.18/f/data.c Tue Mar 19 16:08:03 1996 --- g77-0.5.19/f/data.c Sun Dec 1 21:18:06 1996 *************** static ffesymbol ffedata_symbol_ = NULL; *** 101,105 **** static ffeinfoBasictype ffedata_basictype_; /* Info on symbol. */ static ffeinfoKindtype ffedata_kindtype_; ! static ffestorag ffedata_storage_; /* If non-NULL, inits go here. */ static ffeinfoBasictype ffedata_storage_bt_; /* Info on storage. */ static ffeinfoKindtype ffedata_storage_kt_; --- 101,105 ---- static ffeinfoBasictype ffedata_basictype_; /* Info on symbol. */ static ffeinfoKindtype ffedata_kindtype_; ! static ffestorag ffedata_storage_; /* If non-NULL, inits go into this parent. */ static ffeinfoBasictype ffedata_storage_bt_; /* Info on storage. */ static ffeinfoKindtype ffedata_storage_kt_; *************** ffedata_gather_ (ffestorag mst, ffestora *** 1193,1197 **** assert (units % ffedata_storage_units_ == 0); units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; ! offset = ffestorag_offset (st) / ffedata_storage_units_; /* Does an accretion array exist? If not, create it. */ --- 1193,1198 ---- assert (units % ffedata_storage_units_ == 0); units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; ! offset = (ffestorag_offset (st) - ffestorag_offset (mst)) ! / ffedata_storage_units_; /* Does an accretion array exist? If not, create it. */ *************** ffedata_value_ (ffebld value, ffelexToke *** 1561,1565 **** units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; offset *= units / ffedata_storage_units_; ! offset += ffestorag_offset (ffesymbol_storage (ffedata_symbol_)) / ffedata_storage_units_; --- 1562,1567 ---- units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; offset *= units / ffedata_storage_units_; ! offset += (ffestorag_offset (ffesymbol_storage (ffedata_symbol_)) ! - ffestorag_offset (ffedata_storage_)) / ffedata_storage_units_; diff -rcp2N g77-0.5.18/f/equiv.c g77-0.5.19/f/equiv.c *** g77-0.5.18/f/equiv.c Mon Mar 18 18:46:56 1996 --- g77-0.5.19/f/equiv.c Mon Nov 25 20:12:50 1996 *************** static void ffeequiv_layout_local_ (ffee *** 73,77 **** static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s, ffebld expr, bool subtract, ! ffetargetOffset adjust); /* Internal macros. */ --- 73,77 ---- static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s, ffebld expr, bool subtract, ! ffetargetOffset adjust, bool no_precede); /* Internal macros. */ *************** static bool ffeequiv_offset_ (ffetargetO *** 85,107 **** Makes a single master ffestorag object that contains all the vars in the equivalence, and makes subordinate ffestorag objects for the ! vars with the correct offsets. */ static void ffeequiv_layout_local_ (ffeequiv eq) { - ffesymbol s; /* Symbol. */ ffestorag st; /* Equivalence storage area. */ ffebld list; /* List of list of equivalences. */ ffebld item; /* List of equivalences. */ ! ffebld eqv; /* Equivalence item. */ ! ffebld root; /* Expression for (1st) root sym (offset=0). */ ! ffestorag rst; /* Storage for root. */ ! ffetargetOffset root_offset; /* Negative offset for root. */ ! ffesymbol sr; /* Root itself. */ ! ffebld var; /* Expression for equivalence. */ ! ffestorag vst; /* Storage for var. */ ! ffetargetOffset var_offset; /* Offset for var into equiv area (from ! root). */ ! ffesymbol sv; /* Var itself. */ ffetargetAlign alignment; ffetargetAlign modulo; --- 85,107 ---- Makes a single master ffestorag object that contains all the vars in the equivalence, and makes subordinate ffestorag objects for the ! vars with the correct offsets. ! ! The resulting var offsets are relative not necessarily to 0 -- the ! are relative to the offset of the master area, which might be 0 or ! negative, but should never be positive. */ static void ffeequiv_layout_local_ (ffeequiv eq) { ffestorag st; /* Equivalence storage area. */ ffebld list; /* List of list of equivalences. */ ffebld item; /* List of equivalences. */ ! ffebld root_exp; /* Expression for root sym. */ ! ffestorag root_st; /* Storage for root. */ ! ffesymbol root_sym; /* Root itself. */ ! ffebld rooted_exp; /* Expression for rooted sym in an eqlist. */ ! ffestorag rooted_st; /* Storage for rooted. */ ! ffesymbol rooted_sym; /* Rooted symbol itself. */ ! ffetargetOffset eqlist_offset;/* Offset for eqlist from rooted sym. */ ffetargetAlign alignment; ffetargetAlign modulo; *************** ffeequiv_layout_local_ (ffeequiv eq) *** 111,115 **** bool new_storage; /* Established new storage info. */ bool need_storage; /* Have need for more storage info. */ - bool ok; bool init; --- 111,114 ---- *************** ffeequiv_layout_local_ (ffeequiv eq) *** 122,132 **** } ! /* First find the symbol which, in the list of lists, has the reference ! with the greatest offset, which means that symbol is the root symbol (it ! will end up with an offset of zero in the equivalence area). */ ! ! root_offset = 0; /* Lowest possible value, to find max value. */ ! sr = NULL; /* No sym found yet. */ ! ok = TRUE; #if FFEEQUIV_DEBUG --- 121,127 ---- } ! /* Find the symbol for the first valid item in the list of lists, use that ! as the root symbol. Doesn't matter if it won't end up at the beginning ! of the list, though. */ #if FFEEQUIV_DEBUG *************** ffeequiv_layout_local_ (ffeequiv eq) *** 134,137 **** --- 129,135 ---- #endif + root_sym = NULL; + root_exp = NULL; + for (list = ffeequiv_list (eq); list != NULL; *************** ffeequiv_layout_local_ (ffeequiv eq) *** 139,177 **** { /* For every equivalence list in the list of equivs */ - #if FFEEQUIV_DEBUG - fprintf (stderr, "("); - #endif - for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! eqv = ffebld_head (item); ! s = ffeequiv_symbol (eqv); ! if (s == NULL) continue; /* Ignore me. */ ! #if FFEEQUIV_DEBUG ! fprintf (stderr, "%s,", ffesymbol_text (s)); ! #endif ! assert (ffesymbol_storage (s) == NULL); /* No storage yet. */ ! ffesymbol_set_equiv (s, NULL); /* Equiv area slated for ! death. */ ! if (!ffeequiv_offset_ (&var_offset, s, eqv, FALSE, 0)) ! ok = FALSE; /* Can't calc shape of equivalence area. */ ! if ((var_offset > root_offset) || (sr == NULL)) { ! root_offset = var_offset; ! sr = s; } - } - #if FFEEQUIV_DEBUG - fprintf (stderr, ")\n"); - #endif } ! if (!ok || (sr == NULL)) { ffeequiv_kill (eq); --- 137,168 ---- { /* For every equivalence list in the list of equivs */ for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! ffetargetOffset ign; /* Ignored. */ ! ! root_exp = ffebld_head (item); ! root_sym = ffeequiv_symbol (root_exp); ! if (root_sym == NULL) continue; /* Ignore me. */ ! assert (ffesymbol_storage (root_sym) == NULL); /* No storage yet. */ ! if (!ffeequiv_offset_ (&ign, root_sym, root_exp, FALSE, 0, FALSE)) { ! ffesymbol_set_equiv (root_sym, NULL); /* Equiv area slated for ! death. */ ! root_sym = NULL; ! continue; /* Something's wrong with eqv expr, try another. */ } + break; /* Use first valid eqv expr for root exp/sym. */ + } + if (root_sym != NULL) + break; } ! if (root_sym == NULL) { ffeequiv_kill (eq); *************** ffeequiv_layout_local_ (ffeequiv eq) *** 179,182 **** --- 170,178 ---- } + + #if FFEEQUIV_DEBUG + fprintf (stderr, " Root: `%s'\n", ffesymbol_text (root_sym)); + #endif + /* We've got work to do, so make the LOCAL storage object that'll hold all the equivalenced vars inside it. */ *************** ffeequiv_layout_local_ (ffeequiv eq) *** 186,215 **** ffestorag_set_init (st, NULL); ffestorag_set_accretion (st, NULL); ! ffestorag_set_symbol (st, NULL); /* LOCAL equiv collection has no ! single sym. */ ! ffestorag_set_offset (st, 0); ffestorag_set_alignment (st, 1); ffestorag_set_modulo (st, 0); ffestorag_set_type (st, FFESTORAG_typeLOCAL); ! ffestorag_set_basictype (st, ffesymbol_basictype (sr)); ! ffestorag_set_kindtype (st, ffesymbol_kindtype (sr)); ! ffestorag_set_typesymbol (st, sr); ffestorag_set_is_save (st, ffeequiv_is_save (eq)); ! if (ffesymbol_is_save (sr)) ffestorag_update_save (st); ffestorag_set_is_init (st, ffeequiv_is_init (eq)); ! if (ffesymbol_is_init (sr)) ffestorag_update_init (st); /* Make the EQUIV storage object for the root symbol. */ ! if (ffesymbol_rank (sr) == 0) num_elements = 1; else num_elements = ffebld_constant_integerdefault (ffebld_conter ! (ffesymbol_arraysize (sr))); ! ffetarget_layout (ffesymbol_text (sr), &alignment, &modulo, &size, ! ffesymbol_basictype (sr), ffesymbol_kindtype (sr), ! ffesymbol_size (sr), num_elements); pad = ffetarget_align (ffestorag_ptr_to_alignment (st), ffestorag_ptr_to_modulo (st), 0, alignment, --- 182,215 ---- ffestorag_set_init (st, NULL); ffestorag_set_accretion (st, NULL); ! ffestorag_set_offset (st, 0); /* Assume equiv will be at root offset 0 for now. */ ffestorag_set_alignment (st, 1); ffestorag_set_modulo (st, 0); ffestorag_set_type (st, FFESTORAG_typeLOCAL); ! ffestorag_set_basictype (st, ffesymbol_basictype (root_sym)); ! ffestorag_set_kindtype (st, ffesymbol_kindtype (root_sym)); ! ffestorag_set_typesymbol (st, root_sym); ffestorag_set_is_save (st, ffeequiv_is_save (eq)); ! if (ffesymbol_is_save (root_sym)) ffestorag_update_save (st); ffestorag_set_is_init (st, ffeequiv_is_init (eq)); ! if (ffesymbol_is_init (root_sym)) ffestorag_update_init (st); + ffestorag_set_symbol (st, root_sym); /* Assume this will be the root until + we know better (used only to generate + the internal name for the aggregate area, + e.g. for debugging). */ /* Make the EQUIV storage object for the root symbol. */ ! if (ffesymbol_rank (root_sym) == 0) num_elements = 1; else num_elements = ffebld_constant_integerdefault (ffebld_conter ! (ffesymbol_arraysize (root_sym))); ! ffetarget_layout (ffesymbol_text (root_sym), &alignment, &modulo, &size, ! ffesymbol_basictype (root_sym), ffesymbol_kindtype (root_sym), ! ffesymbol_size (root_sym), num_elements); ! ffestorag_set_size (st, size); /* Set initial size of aggregate area. */ ! pad = ffetarget_align (ffestorag_ptr_to_alignment (st), ffestorag_ptr_to_modulo (st), 0, alignment, *************** ffeequiv_layout_local_ (ffeequiv eq) *** 217,243 **** assert (pad == 0); ! rst = ffestorag_new (ffestorag_list_equivs (st)); ! ffestorag_set_parent (rst, st); /* Initializations happen there. */ ! ffestorag_set_init (rst, NULL); ! ffestorag_set_accretion (rst, NULL); ! ffestorag_set_symbol (rst, sr); ! ffestorag_set_size (rst, size); ! ffestorag_set_offset (rst, 0); ! ffestorag_set_alignment (rst, alignment); ! ffestorag_set_modulo (rst, modulo); ! ffestorag_set_type (rst, FFESTORAG_typeEQUIV); ! ffestorag_set_basictype (rst, ffesymbol_basictype (sr)); ! ffestorag_set_kindtype (rst, ffesymbol_kindtype (sr)); ! ffestorag_set_typesymbol (rst, sr); ! ffestorag_set_is_save (rst, FALSE); /* Assume FALSE, then... */ if (ffestorag_is_save (st)) /* ...update to TRUE if needed. */ ! ffestorag_update_save (rst); ! ffestorag_set_is_init (rst, FALSE); /* Assume FALSE, then... */ if (ffestorag_is_init (st)) /* ...update to TRUE if needed. */ ! ffestorag_update_init (rst); ! ffestorag_set_size (st, size); ! ffesymbol_set_storage (sr, rst); ! ffesymbol_signal_unreported (sr); ! init = ffesymbol_is_init (sr); /* Now that we know the root (offset=0) symbol, revisit all the lists and --- 217,242 ---- assert (pad == 0); ! root_st = ffestorag_new (ffestorag_list_equivs (st)); ! ffestorag_set_parent (root_st, st); /* Initializations happen there. */ ! ffestorag_set_init (root_st, NULL); ! ffestorag_set_accretion (root_st, NULL); ! ffestorag_set_symbol (root_st, root_sym); ! ffestorag_set_size (root_st, size); ! ffestorag_set_offset (root_st, 0); /* Will not change; always 0 relative to itself! */ ! ffestorag_set_alignment (root_st, alignment); ! ffestorag_set_modulo (root_st, modulo); ! ffestorag_set_type (root_st, FFESTORAG_typeEQUIV); ! ffestorag_set_basictype (root_st, ffesymbol_basictype (root_sym)); ! ffestorag_set_kindtype (root_st, ffesymbol_kindtype (root_sym)); ! ffestorag_set_typesymbol (root_st, root_sym); ! ffestorag_set_is_save (root_st, FALSE); /* Assume FALSE, then... */ if (ffestorag_is_save (st)) /* ...update to TRUE if needed. */ ! ffestorag_update_save (root_st); ! ffestorag_set_is_init (root_st, FALSE); /* Assume FALSE, then... */ if (ffestorag_is_init (st)) /* ...update to TRUE if needed. */ ! ffestorag_update_init (root_st); ! ffesymbol_set_storage (root_sym, root_st); ! ffesymbol_signal_unreported (root_sym); ! init = ffesymbol_is_init (root_sym); /* Now that we know the root (offset=0) symbol, revisit all the lists and *************** ffeequiv_layout_local_ (ffeequiv eq) *** 245,258 **** through them all without making any new storage objects. */ - #if FFEEQUIV_DEBUG - fprintf (stderr, "Equiv2:\n"); - #endif - do { - #if FFEEQUIV_DEBUG - fprintf (stderr, " Equiv3:\n"); - #endif - new_storage = FALSE; need_storage = FALSE; --- 244,249 ---- *************** ffeequiv_layout_local_ (ffeequiv eq) *** 262,315 **** { /* For every equivalence list in the list of equivs */ ! #if FFEEQUIV_DEBUG ! fprintf (stderr, " ("); ! #endif - root_offset = 0; - sr = NULL; - root = NULL; for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! var = ffebld_head (item); ! sv = ffeequiv_symbol (var); ! if (sv == NULL) ! continue; /* Ignore me. */ ! ! #if FFEEQUIV_DEBUG ! fprintf (stderr, "%s,", ffesymbol_text (sv)); ! #endif need_storage = TRUE; /* Somebody is likely to need storage. */ ! if ((vst = ffesymbol_storage (sv)) == NULL) ! continue; /* No storage for this guy, try another. */ ! ! ffeequiv_offset_ (&var_offset, sv, var, FALSE, ! ffestorag_offset (vst)); ! if ((var_offset > root_offset) || (sr == NULL)) { ! root = var; ! root_offset = var_offset; ! sr = sv; ! rst = vst; } ! } ! if (sr == NULL) /* No storage to go on, try later. */ ! { #if FFEEQUIV_DEBUG ! fprintf (stderr, ")\n"); #endif ! continue; } #if FFEEQUIV_DEBUG ! fprintf (stderr, ") %s:\n (", ffesymbol_text (sr)); #endif ! /* We now know the root symbol/expr and the operating offset of ! that root into the equivalence area. The other expressions in ! the list all identify an initial storage unit that must have the same offset. */ --- 253,339 ---- { /* For every equivalence list in the list of equivs */ ! /* Now find a "rooted" symbol in this list. That is, find the ! first item we can that is valid and whose symbol already ! has a storage area, because that means we know where it ! belongs in the equivalence area and can then allocate the ! rest of the items in the list accordingly. */ ! ! rooted_sym = NULL; ! rooted_exp = NULL; ! eqlist_offset = 0; for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! rooted_exp = ffebld_head (item); ! rooted_sym = ffeequiv_symbol (rooted_exp); ! if ((rooted_sym == NULL) ! || (ffesymbol_equiv (rooted_sym) == NULL)) ! { ! rooted_sym = NULL; ! continue; /* Ignore me. */ ! } need_storage = TRUE; /* Somebody is likely to need storage. */ ! if ((rooted_st = ffesymbol_storage (rooted_sym)) == NULL) { ! rooted_sym = NULL; ! continue; /* No storage for this guy, try another. */ } ! ! #if FFEEQUIV_DEBUG ! fprintf (stderr, " Rooted: `%s' at %" ffetargetOffset_f "d\n", ! ffesymbol_text (rooted_sym), ! ffestorag_offset (rooted_st)); ! #endif ! ! /* The offset of this symbol from the equiv's root symbol ! is already known, and the size of this symbol is already ! incorporated in the size of the equiv's aggregate area. ! What we now determine is the offset of this equivalence ! _list_ from the equiv's root symbol. ! ! For example, if we know that A is at offset 16 from the ! root symbol, given EQUIVALENCE (B(24),A(2)), we're looking ! at A(2), meaning that the offset for this equivalence list ! is 20 (4 bytes beyond the beginning of A, assuming typical ! array types, dimensions, and type info). */ ! ! if (!ffeequiv_offset_ (&eqlist_offset, rooted_sym, rooted_exp, FALSE, ! ffestorag_offset (rooted_st), FALSE)) ! ! { /* Can't use this one. */ ! ffesymbol_set_equiv (rooted_sym, NULL);/* Equiv area slated for ! death. */ ! rooted_sym = NULL; ! continue; /* Something's wrong with eqv expr, try another. */ ! } ! #if FFEEQUIV_DEBUG ! fprintf (stderr, " Eqlist offset: %" ffetargetOffset_f "d\n", ! eqlist_offset); #endif ! ! break; } + /* If no rooted symbol, it means this list has no roots -- yet. + So, forget this list this time around, but we'll get back + to it after the outer loop iterates at least one more time, + and, ultimately, it will have a root. */ + + if (rooted_sym == NULL) + { #if FFEEQUIV_DEBUG ! fprintf (stderr, "No roots.\n"); #endif + continue; + } ! /* We now have a rooted symbol/expr and the offset of this equivalence ! list from the root symbol. The other expressions in this ! list all identify an initial storage unit that must have the same offset. */ *************** ffeequiv_layout_local_ (ffeequiv eq) *** 318,419 **** item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! var = ffebld_head (item); ! sv = ffeequiv_symbol (var); ! if (sv == NULL) ! continue; /* Except erroneous stuff (opANY). */ ! if (var == root) { ! /* The last root symbol we see must therefore ! (by static deduction) be the first-listed "rooted" item ! in the EQUIVALENCE statements pertaining to this area. */ ! ffestorag_set_symbol (st, sv); ! continue; /* Root sym already set up. */ } - if (!ffeequiv_offset_ (&var_offset, sv, var, TRUE, root_offset)) - continue; /* Attempt to start sym prior to equiv area! */ - #if FFEEQUIV_DEBUG ! fprintf (stderr, "%s:%ld,", ffesymbol_text (sv), ! (long) var_offset); #endif ! if (ffesymbol_rank (sv) == 0) num_elements = 1; else num_elements = ffebld_constant_integerdefault (ffebld_conter ! (ffesymbol_arraysize (sv))); ! ffetarget_layout (ffesymbol_text (sv), &alignment, &modulo, ! &size, ffesymbol_basictype (sv), ! ffesymbol_kindtype (sv), ffesymbol_size (sv), num_elements); pad = ffetarget_align (ffestorag_ptr_to_alignment (st), ffestorag_ptr_to_modulo (st), ! var_offset, alignment, modulo); if (pad != 0) { ffebad_start (FFEBAD_EQUIV_ALIGN); ! ffebad_string (ffesymbol_text (sv)); ffebad_finish (); continue; } ! /* The last symbol we see with a zero offset must therefore ! (by static deduction) be the first-listed "rooted" item ! in the EQUIVALENCE statements pertaining to this area. */ ! if (var_offset == 0) ! ffestorag_set_symbol (st, sv); ! if ((vst = ffesymbol_storage (sv)) == NULL) { /* Create new ffestorag object, extend equiv area. */ new_storage = TRUE; ! vst = ffestorag_new (ffestorag_list_equivs (st)); ! ffestorag_set_parent (vst, st); /* Initializations happen there. */ ! ffestorag_set_init (vst, NULL); ! ffestorag_set_accretion (vst, NULL); ! ffestorag_set_symbol (vst, sv); ! ffestorag_set_size (vst, size); ! ffestorag_set_offset (vst, var_offset); ! ffestorag_set_alignment (vst, alignment); ! ffestorag_set_modulo (vst, modulo); ! ffestorag_set_type (vst, FFESTORAG_typeEQUIV); ! ffestorag_set_basictype (vst, ffesymbol_basictype (sv)); ! ffestorag_set_kindtype (vst, ffesymbol_kindtype (sv)); ! ffestorag_set_typesymbol (vst, sv); ! ffestorag_set_is_save (vst, FALSE); /* Assume FALSE... */ if (ffestorag_is_save (st)) /* ...update TRUE */ ! ffestorag_update_save (vst); /* if needed. */ ! ffestorag_set_is_init (vst, FALSE); /* Assume FALSE... */ if (ffestorag_is_init (st)) /* ...update TRUE */ ! ffestorag_update_init (vst); /* if needed. */ ! if (!ffetarget_offset_add (&size, var_offset, size)) ! /* Find one size of equiv area, complain if overflow. */ ffetarget_offset_overflow (ffesymbol_text (s)); else if (size > ffestorag_size (st)) - /* Extend equiv area if necessary. */ ffestorag_set_size (st, size); ! ffesymbol_set_storage (sv, vst); ! ffesymbol_signal_unreported (sv); ! ffestorag_update (st, sv, ffesymbol_basictype (sv), ! ffesymbol_kindtype (sv)); ! if (ffesymbol_is_init (sv)) ! init = TRUE; } else { /* Make sure offset agrees with known offset. */ ! if (var_offset != ffestorag_offset (vst)) { ffebad_start (FFEBAD_EQUIV_MISMATCH); ! ffebad_string (ffesymbol_text (sv)); ffebad_finish (); } } } /* (For every equivalence item in the list) */ - #if FFEEQUIV_DEBUG - fprintf (stderr, ")\n"); - #endif ffebld_set_head (list, NULL); /* Don't do this list again. */ } /* (For every equivalence list in the list of --- 342,500 ---- item = ffebld_trail (item)) { /* For every equivalence item in the list */ ! ffebld item_exp; /* Expression for equivalence. */ ! ffestorag item_st; /* Storage for var. */ ! ffesymbol item_sym; /* Var itself. */ ! ffetargetOffset item_offset; /* Offset for var from root. */ ! ! item_exp = ffebld_head (item); ! item_sym = ffeequiv_symbol (item_exp); ! if ((item_sym == NULL) ! || (ffesymbol_equiv (item_sym) == NULL)) ! continue; /* Ignore me. */ ! ! if (item_sym == rooted_sym) ! continue; /* Rooted sym already set up. */ ! ! if (!ffeequiv_offset_ (&item_offset, item_sym, item_exp, TRUE, ! eqlist_offset, FALSE)) { ! ffesymbol_set_equiv (item_sym, NULL); /* Don't bother with me anymore. */ ! continue; } #if FFEEQUIV_DEBUG ! fprintf (stderr, " Item `%s' at %" ffetargetOffset_f "d", ! ffesymbol_text (item_sym), item_offset); #endif ! if (ffesymbol_rank (item_sym) == 0) num_elements = 1; else num_elements = ffebld_constant_integerdefault (ffebld_conter ! (ffesymbol_arraysize (item_sym))); ! ffetarget_layout (ffesymbol_text (item_sym), &alignment, &modulo, ! &size, ffesymbol_basictype (item_sym), ! ffesymbol_kindtype (item_sym), ffesymbol_size (item_sym), num_elements); pad = ffetarget_align (ffestorag_ptr_to_alignment (st), ffestorag_ptr_to_modulo (st), ! item_offset, alignment, modulo); if (pad != 0) { ffebad_start (FFEBAD_EQUIV_ALIGN); ! ffebad_string (ffesymbol_text (item_sym)); ffebad_finish (); continue; } ! /* If the variable's offset is less than the offset for the ! aggregate storage area, it means it has to expand backwards ! -- i.e. the new known starting point of the area precedes the ! old one. This can't happen with COMMON areas (the standard, ! and common sense, disallow it), but it is normal for local ! EQUIVALENCE areas. ! ! Also handle choosing the "documented" rooted symbol for this ! area here. It's the symbol at the bottom (lowest offset) ! of the aggregate area, with ties going to the name that would ! sort to the top of the list of ties. */ ! ! if (item_offset == ffestorag_offset (st)) ! { ! if ((item_sym != ffestorag_symbol (st)) ! && (strcmp (ffesymbol_text (item_sym), ! ffesymbol_text (ffestorag_symbol (st))) ! < 0)) ! ffestorag_set_symbol (st, item_sym); ! } ! else if (item_offset < ffestorag_offset (st)) ! { ! ffetargetOffset new_size; ! ! /* Increase size of equiv area to start for lower offset relative ! to root symbol. */ ! if (!ffetarget_offset_add (&new_size, ! ffestorag_offset (st) - item_offset, ! ffestorag_size (st))) ! ffetarget_offset_overflow (ffesymbol_text (s)); ! else ! ffestorag_set_size (st, new_size); ! ! ffestorag_set_symbol (st, item_sym); ! ffestorag_set_offset (st, item_offset); ! ! #if FFEEQUIV_DEBUG ! fprintf (stderr, " [eq offset=%" ffetargetOffset_f ! "d, size=%" ffetargetOffset_f "d]", ! item_offset, new_size); ! #endif ! } ! ! if ((item_st = ffesymbol_storage (item_sym)) == NULL) { /* Create new ffestorag object, extend equiv area. */ + #if FFEEQUIV_DEBUG + fprintf (stderr, ".\n"); + #endif new_storage = TRUE; ! item_st = ffestorag_new (ffestorag_list_equivs (st)); ! ffestorag_set_parent (item_st, st); /* Initializations happen there. */ ! ffestorag_set_init (item_st, NULL); ! ffestorag_set_accretion (item_st, NULL); ! ffestorag_set_symbol (item_st, item_sym); ! ffestorag_set_size (item_st, size); ! ffestorag_set_offset (item_st, item_offset); ! ffestorag_set_alignment (item_st, alignment); ! ffestorag_set_modulo (item_st, modulo); ! ffestorag_set_type (item_st, FFESTORAG_typeEQUIV); ! ffestorag_set_basictype (item_st, ffesymbol_basictype (item_sym)); ! ffestorag_set_kindtype (item_st, ffesymbol_kindtype (item_sym)); ! ffestorag_set_typesymbol (item_st, item_sym); ! ffestorag_set_is_save (item_st, FALSE); /* Assume FALSE... */ if (ffestorag_is_save (st)) /* ...update TRUE */ ! ffestorag_update_save (item_st); /* if needed. */ ! ffestorag_set_is_init (item_st, FALSE); /* Assume FALSE... */ if (ffestorag_is_init (st)) /* ...update TRUE */ ! ffestorag_update_init (item_st); /* if needed. */ ! ffesymbol_set_storage (item_sym, item_st); ! ffesymbol_signal_unreported (item_sym); ! if (ffesymbol_is_init (item_sym)) ! init = TRUE; ! ! /* Determine new size of equiv area, complain if overflow. */ ! ! if (!ffetarget_offset_add (&size, item_offset, size) ! || !ffetarget_offset_add (&size, -ffestorag_offset (st), size)) ffetarget_offset_overflow (ffesymbol_text (s)); else if (size > ffestorag_size (st)) ffestorag_set_size (st, size); ! ffestorag_update (st, item_sym, ffesymbol_basictype (item_sym), ! ffesymbol_kindtype (item_sym)); } else { + #if FFEEQUIV_DEBUG + fprintf (stderr, " (was %" ffetargetOffset_f "d).\n", + ffestorag_offset (item_st)); + #endif /* Make sure offset agrees with known offset. */ ! if (item_offset != ffestorag_offset (item_st)) { + char io1[40]; + char io2[40]; + + sprintf (&io1[0], "%" ffetargetOffset_f "d", item_offset); + sprintf (&io2[0], "%" ffetargetOffset_f "d", ffestorag_offset (item_st)); ffebad_start (FFEBAD_EQUIV_MISMATCH); ! ffebad_string (ffesymbol_text (item_sym)); ! ffebad_string (ffesymbol_text (root_sym)); ! ffebad_string (io1); ! ffebad_string (io2); ffebad_finish (); } } } /* (For every equivalence item in the list) */ ffebld_set_head (list, NULL); /* Don't do this list again. */ } /* (For every equivalence list in the list of *************** ffeequiv_layout_local_ (ffeequiv eq) *** 445,449 **** static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s UNUSED, ! ffebld expr, bool subtract, ffetargetOffset adjust) { ffetargetIntegerDefault value = 0; --- 526,531 ---- static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s UNUSED, ! ffebld expr, bool subtract, ffetargetOffset adjust, ! bool no_precede) { ffetargetIntegerDefault value = 0; *************** again: /* :::::::::::::::::::: */ *** 471,474 **** --- 553,560 ---- return FALSE; + ffetarget_layout (ffesymbol_text (sym), &a, &m, &size, + ffesymbol_basictype (sym), + ffesymbol_kindtype (sym), 1, 1); + if (value < 0) { /* Really invalid, as in A(-2:5), but in case *************** again: /* :::::::::::::::::::: */ *** 476,483 **** if (!ffetarget_offset (&cval, -value)) return FALSE; if (subtract) return ffetarget_offset_add (offset, cval, adjust); ! if (cval > adjust) { neg: /* :::::::::::::::::::: */ --- 562,573 ---- if (!ffetarget_offset (&cval, -value)) return FALSE; + + if (!ffetarget_offset_multiply (&cval, cval, size)) + return FALSE; + if (subtract) return ffetarget_offset_add (offset, cval, adjust); ! if (no_precede && (cval > adjust)) { neg: /* :::::::::::::::::::: */ *************** again: /* :::::::::::::::::::: */ *** 487,492 **** return FALSE; } ! *offset = adjust - cval; ! return TRUE; } --- 577,581 ---- return FALSE; } ! return ffetarget_offset_add (offset, -cval, adjust); } *************** again: /* :::::::::::::::::::: */ *** 494,512 **** return FALSE; - ffetarget_layout (ffesymbol_text (sym), &a, &m, &size, - ffesymbol_basictype (sym), - ffesymbol_kindtype (sym), 1, 1); - if (!ffetarget_offset_multiply (&cval, cval, size)) return FALSE; ! if (subtract) ! if (cval > adjust) ! goto neg; /* :::::::::::::::::::: */ ! else ! *offset = adjust - cval; ! else if (!ffetarget_offset_add (offset, cval, adjust)) ! return FALSE; ! return TRUE; } --- 583,596 ---- return FALSE; if (!ffetarget_offset_multiply (&cval, cval, size)) return FALSE; ! if (!subtract) ! return ffetarget_offset_add (offset, cval, adjust); ! ! if (no_precede && (cval > adjust)) ! goto neg; /* :::::::::::::::::::: */ ! ! return ffetarget_offset_add (offset, -cval, adjust); } *************** ffeequiv_layout_cblock (ffestorag st) *** 882,886 **** root = ffebld_head (root); /* Lose its opITEM. */ ok = ffeequiv_offset_ (&root_offset, sr, root, FALSE, ! ffestorag_offset (rst)); /* Equiv point prior to start of common area? */ } --- 966,970 ---- root = ffebld_head (root); /* Lose its opITEM. */ ok = ffeequiv_offset_ (&root_offset, sr, root, FALSE, ! ffestorag_offset (rst), TRUE); /* Equiv point prior to start of common area? */ } *************** ffeequiv_layout_cblock (ffestorag st) *** 891,895 **** ok = ffeequiv_offset_ (&root_offset, altrootsym, root, FALSE, ! ffestorag_offset (ffesymbol_storage (altrootsym))); ffesymbol_set_equiv (altrootsym, NULL); } --- 975,980 ---- ok = ffeequiv_offset_ (&root_offset, altrootsym, root, FALSE, ! ffestorag_offset (ffesymbol_storage (altrootsym)), ! TRUE); ffesymbol_set_equiv (altrootsym, NULL); } *************** ffeequiv_layout_cblock (ffestorag st) *** 921,925 **** || !ffeequiv_offset_ (&var_offset, sv, ffebld_head (var), TRUE, ! root_offset)) continue; /* Can't do negative offset wrt COMMON. */ --- 1006,1010 ---- || !ffeequiv_offset_ (&var_offset, sv, ffebld_head (var), TRUE, ! root_offset, TRUE)) continue; /* Can't do negative offset wrt COMMON. */ *************** ffeequiv_layout_cblock (ffestorag st) *** 989,994 **** --- 1074,1087 ---- if (var_offset != ffestorag_offset (vst)) { + char io1[40]; + char io2[40]; + + sprintf (&io1[0], "%" ffetargetOffset_f "d", var_offset); + sprintf (&io2[0], "%" ffetargetOffset_f "d", ffestorag_offset (vst)); ffebad_start (FFEBAD_EQUIV_MISMATCH); ffebad_string (ffesymbol_text (sv)); + ffebad_string (ffesymbol_text (s)); + ffebad_string (io1); + ffebad_string (io2); ffebad_finish (); } diff -rcp2N g77-0.5.18/f/expr.c g77-0.5.19/f/expr.c *** g77-0.5.18/f/expr.c Mon Mar 25 20:57:34 1996 --- g77-0.5.19/f/expr.c Thu Nov 7 18:50:34 1996 *************** ffeexpr_convert (ffebld source, ffelexTo *** 6965,6969 **** case FFEINFO_basictypeINTEGER: ! bad = !ffe_is_ugly (); break; --- 6965,6969 ---- case FFEINFO_basictypeINTEGER: ! bad = !ffe_is_ugly_logint (); break; *************** ffeexpr_convert (ffebld source, ffelexTo *** 6990,6994 **** case FFEINFO_basictypeLOGICAL: ! bad = !ffe_is_ugly (); break; --- 6990,6994 ---- case FFEINFO_basictypeLOGICAL: ! bad = !ffe_is_ugly_logint (); break; *************** ffeexpr_reduce_ () *** 9621,9625 **** case FFEEXPR_operatorADD_: reduced = ffebld_new_uplus (expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); --- 9621,9625 ---- case FFEEXPR_operatorADD_: reduced = ffebld_new_uplus (expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); *************** ffeexpr_reduce_ () *** 9630,9634 **** submag = TRUE; /* Ok to negate a magic number. */ reduced = ffebld_new_uminus (expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); --- 9630,9634 ---- submag = TRUE; /* Ok to negate a magic number. */ reduced = ffebld_new_uminus (expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); *************** ffeexpr_reduce_ () *** 9638,9642 **** case FFEEXPR_operatorNOT_: reduced = ffebld_new_not (expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly1log_ (reduced, operator, operand); reduced = ffeexpr_reduced_bool1_ (reduced, operator, operand); --- 9638,9642 ---- case FFEEXPR_operatorNOT_: reduced = ffebld_new_not (expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1log_ (reduced, operator, operand); reduced = ffeexpr_reduced_bool1_ (reduced, operator, operand); *************** ffeexpr_reduce_ () *** 9677,9681 **** case FFEEXPR_operatorADD_: reduced = ffebld_new_add (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9677,9681 ---- case FFEEXPR_operatorADD_: reduced = ffebld_new_add (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9689,9693 **** number. */ reduced = ffebld_new_subtract (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9689,9693 ---- number. */ reduced = ffebld_new_subtract (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9699,9703 **** case FFEEXPR_operatorMULTIPLY_: reduced = ffebld_new_multiply (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9699,9703 ---- case FFEEXPR_operatorMULTIPLY_: reduced = ffebld_new_multiply (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9709,9713 **** case FFEEXPR_operatorDIVIDE_: reduced = ffebld_new_divide (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9709,9713 ---- case FFEEXPR_operatorDIVIDE_: reduced = ffebld_new_divide (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9719,9723 **** case FFEEXPR_operatorPOWER_: reduced = ffebld_new_power (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9719,9723 ---- case FFEEXPR_operatorPOWER_: reduced = ffebld_new_power (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9736,9740 **** case FFEEXPR_operatorLT_: reduced = ffebld_new_lt (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9736,9740 ---- case FFEEXPR_operatorLT_: reduced = ffebld_new_lt (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9746,9750 **** case FFEEXPR_operatorLE_: reduced = ffebld_new_le (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9746,9750 ---- case FFEEXPR_operatorLE_: reduced = ffebld_new_le (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9756,9760 **** case FFEEXPR_operatorEQ_: reduced = ffebld_new_eq (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9756,9760 ---- case FFEEXPR_operatorEQ_: reduced = ffebld_new_eq (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9766,9770 **** case FFEEXPR_operatorNE_: reduced = ffebld_new_ne (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9766,9770 ---- case FFEEXPR_operatorNE_: reduced = ffebld_new_ne (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9776,9780 **** case FFEEXPR_operatorGT_: reduced = ffebld_new_gt (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9776,9780 ---- case FFEEXPR_operatorGT_: reduced = ffebld_new_gt (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9786,9790 **** case FFEEXPR_operatorGE_: reduced = ffebld_new_ge (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); --- 9786,9790 ---- case FFEEXPR_operatorGE_: reduced = ffebld_new_ge (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9796,9800 **** case FFEEXPR_operatorAND_: reduced = ffebld_new_and (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); --- 9796,9800 ---- case FFEEXPR_operatorAND_: reduced = ffebld_new_and (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9806,9810 **** case FFEEXPR_operatorOR_: reduced = ffebld_new_or (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); --- 9806,9810 ---- case FFEEXPR_operatorOR_: reduced = ffebld_new_or (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9816,9820 **** case FFEEXPR_operatorXOR_: reduced = ffebld_new_xor (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); --- 9816,9820 ---- case FFEEXPR_operatorXOR_: reduced = ffebld_new_xor (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9826,9830 **** case FFEEXPR_operatorEQV_: reduced = ffebld_new_eqv (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); --- 9826,9830 ---- case FFEEXPR_operatorEQV_: reduced = ffebld_new_eqv (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduce_ () *** 9836,9840 **** case FFEEXPR_operatorNEQV_: reduced = ffebld_new_neqv (left_expr, expr); ! if (ffe_is_ugly ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); --- 9836,9840 ---- case FFEEXPR_operatorNEQV_: reduced = ffebld_new_neqv (left_expr, expr); ! if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); *************** ffeexpr_reduced_bool1_ (ffebld reduced, *** 9918,9922 **** if (((rbt == FFEINFO_basictypeLOGICAL) ! || (ffe_is_ugly () && (rbt == FFEINFO_basictypeINTEGER))) && (rrk == 0)) { --- 9918,9922 ---- if (((rbt == FFEINFO_basictypeLOGICAL) ! || (ffe_is_ugly_logint () && (rbt == FFEINFO_basictypeINTEGER))) && (rrk == 0)) { *************** ffeexpr_reduced_bool1_ (ffebld reduced, *** 9943,9947 **** if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) --- 9943,9947 ---- if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) *************** ffeexpr_reduced_bool2_ (ffebld reduced, *** 10013,10017 **** if (((nbt == FFEINFO_basictypeLOGICAL) ! || (ffe_is_ugly () && (nbt == FFEINFO_basictypeINTEGER))) && (lrk == 0) && (rrk == 0)) { --- 10013,10017 ---- if (((nbt == FFEINFO_basictypeLOGICAL) ! || (ffe_is_ugly_logint () && (nbt == FFEINFO_basictypeINTEGER))) && (lrk == 0) && (rrk == 0)) { *************** ffeexpr_reduced_bool2_ (ffebld reduced, *** 10067,10074 **** if ((lbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly () || (lbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) { if ((lbt != FFEINFO_basictypeANY) && (rbt != FFEINFO_basictypeANY) --- 10067,10074 ---- if ((lbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly_logint () || (lbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((lbt != FFEINFO_basictypeANY) && (rbt != FFEINFO_basictypeANY) *************** ffeexpr_reduced_bool2_ (ffebld reduced, *** 10093,10097 **** } else if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) --- 10093,10097 ---- } else if ((rbt != FFEINFO_basictypeLOGICAL) ! && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) *************** again: /* :::::::::::::::::::: */ *** 12209,12213 **** { case FFEINFO_basictypeLOGICAL: ! error = !ffe_is_ugly (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ --- 12209,12213 ---- { case FFEINFO_basictypeLOGICAL: ! error = !ffe_is_ugly_logint (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ *************** again: /* :::::::::::::::::::: */ *** 12277,12281 **** case FFEINFO_basictypeLOGICAL: ! error = !ffe_is_ugly () || (ffeinfo_kindtype (info) != FFEINFO_kindtypeLOGICALDEFAULT); break; --- 12277,12281 ---- case FFEINFO_basictypeLOGICAL: ! error = !ffe_is_ugly_logint () || (ffeinfo_kindtype (info) != FFEINFO_kindtypeLOGICALDEFAULT); break; *************** again: /* :::::::::::::::::::: */ *** 12577,12581 **** { case FFEINFO_basictypeLOGICAL: ! error = error && !ffe_is_ugly (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ --- 12577,12581 ---- { case FFEINFO_basictypeLOGICAL: ! error = error && !ffe_is_ugly_logint (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ *************** ffeexpr_token_name_apos_name_ (ffelexTok *** 15419,15422 **** --- 15419,15463 ---- ffetargetCharacterSize size; + if (!ffe_is_typeless_boz ()) { + + switch (c) + { + case FFESRC_CASE_MATCH_INIT ('B', 'b', imatch_b, no_imatch): + e->u.operand = ffebld_new_conter (ffebld_constant_new_integerbinary + (ffeexpr_tokens_[2])); + break; + + case FFESRC_CASE_MATCH_INIT ('O', 'o', imatch_o, no_imatch): + e->u.operand = ffebld_new_conter (ffebld_constant_new_integeroctal + (ffeexpr_tokens_[2])); + break; + + case FFESRC_CASE_MATCH_INIT ('X', 'x', imatch_x, no_imatch): + e->u.operand = ffebld_new_conter (ffebld_constant_new_integerhex + (ffeexpr_tokens_[2])); + break; + + case FFESRC_CASE_MATCH_INIT ('Z', 'z', imatch_z, no_imatch): + e->u.operand = ffebld_new_conter (ffebld_constant_new_integerhex + (ffeexpr_tokens_[2])); + break; + + default: + no_imatch: /* :::::::::::::::::::: */ + assert ("not BOXZ!" == NULL); + abort (); + } + + ffebld_set_info (e->u.operand, + ffeinfo_new (FFEINFO_basictypeINTEGER, + FFEINFO_kindtypeINTEGERDEFAULT, 0, + FFEINFO_kindENTITY, FFEINFO_whereCONSTANT, + FFETARGET_charactersizeNONE)); + ffeexpr_exprstack_push_operand_ (e); + ffelex_token_kill (ffeexpr_tokens_[1]); + ffelex_token_kill (ffeexpr_tokens_[2]); + return (ffelexHandler) ffeexpr_token_binary_; + } + switch (c) { *************** ffeexpr_declare_unadorned_ (ffelexToken *** 15785,15789 **** default: ! assert ("UNCERTAIN/NONE bad context" == NULL); break; } --- 15826,15830 ---- default: ! ffesymbol_error (s, t); break; } *************** ffeexpr_declare_unadorned_ (ffelexToken *** 15923,15927 **** default: - assert ("UNDERSTOOD bad context" == NULL); bad = TRUE; break; --- 15964,15967 ---- *************** ffeexpr_declare_unadorned_ (ffelexToken *** 16002,16006 **** default: ! assert ("SEEN bad context" == NULL); break; } --- 16042,16046 ---- default: ! ffesymbol_error (s, t); break; } *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 17507,17511 **** default: ! assert ("UNCERTAIN/NONE bad context" == NULL); break; } --- 17547,17551 ---- default: ! ffesymbol_error (s, t); break; } *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 17608,17612 **** default: - assert ("UNDERSTOOD bad context" == NULL); bad = TRUE; break; --- 17648,17651 ---- *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 17735,17743 **** case FFEEXPR_contextINITVAL: case FFEEXPR_contextEQVINDEX_: - ffesymbol_error (s, t); break; case FFEEXPR_contextINCLUDE: - bad = TRUE; break; --- 17774,17780 ---- *************** ffeexpr_declare_parenthesized_ (ffelexTo *** 17757,17761 **** default: - assert ("SEEN bad context" == NULL); break; } --- 17794,17797 ---- *************** ffeexpr_token_arguments_ (ffelexToken ft *** 18134,18138 **** } } ! else if ((expr != NULL) || ffe_is_ugly () || (ffelex_token_type (t) == FFELEX_typeCOMMA)) ffebld_append_item (&ffeexpr_stack_->bottom, expr); --- 18170,18174 ---- } } ! else if ((expr != NULL) || ffe_is_ugly_comma () || (ffelex_token_type (t) == FFELEX_typeCOMMA)) ffebld_append_item (&ffeexpr_stack_->bottom, expr); diff -rcp2N g77-0.5.18/f/g77.c g77-0.5.19/f/g77.c *** g77-0.5.18/f/g77.c Thu Nov 16 03:01:50 1995 --- g77-0.5.19/f/g77.c Fri Dec 6 12:46:48 1996 *************** the Free Software Foundation, 59 Temple *** 52,56 **** --- 52,76 ---- `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 *************** typedef enum *** 205,208 **** --- 225,229 ---- OPTION_driver, /* Wrapper-specific option. */ OPTION_E, /* Aka --preprocess. */ + OPTION_help, /* --help. */ OPTION_i, /* -imacros, -include, -include-*. */ OPTION_M, /* Aka --dependencies. */ *************** typedef enum *** 213,216 **** --- 234,238 ---- OPTION_S, /* Aka --assemble. */ OPTION_v, /* Aka --verbose. */ + OPTION_version, /* --version. */ OPTION_V, /* Aka --use-version. */ OPTION_x, /* Aka --language. */ *************** typedef enum *** 218,231 **** } Option; ! /* THE FOLLOWING COMES STRAIGHT FROM gcc-2.7.0/gcc.c: */ /* This defines which switch letters take arguments. */ ! #ifndef SWITCH_TAKES_ARG ! #define 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') #endif --- 240,255 ---- } 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 *************** lookup_option (xopt, xskip, xarg, text) *** 754,757 **** --- 778,783 ---- "iwithprefix", "iwithprefixbefore", "isystem". */ ; + else if (text[1] != '-') + skip = 0; else if (strcmp (text, "--assemble") == 0) opt = OPTION_S; *************** lookup_option (xopt, xskip, xarg, text) *** 760,763 **** --- 786,791 ---- 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) *************** lookup_option (xopt, xskip, xarg, text) *** 794,797 **** --- 822,827 ---- 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; *************** main (argc, argv) *** 963,966 **** --- 993,997 ---- case OPTION_v: verbose = 1; + printf ("g77 version %s\n", ffezzz_version_string); break; *************** main (argc, argv) *** 974,977 **** --- 1005,1057 ---- break; + case OPTION_version: + printf ("\ + GNU Fortran %s\n\ + Copyright (C) 1996 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; *************** main (argc, argv) *** 1167,1168 **** --- 1247,1249 ---- return 0; } + #endif /* LANGUAGE_F77 == 1 */ diff -rcp2N g77-0.5.18/f/g77.texi g77-0.5.19/f/g77.texi *** g77-0.5.18/f/g77.texi Sat Mar 23 22:05:59 1996 --- g77-0.5.19/f/g77.texi Tue Dec 3 12:28:00 1996 *************** was contributed to Craig by David Ronis *** 103,116 **** @center James Craig Burley @sp 3 ! @center Last updated 1996-03-23 @sp 1 @c The version number appears some more times in this file. ! @center for version 0.5.18 @page @vskip 0pt plus 1filll Copyright @copyright{} 1995, 1996 Free Software Foundation, Inc. @sp 2 ! For GNU Fortran Version 0.5.18* @sp 1 Published by the Free Software Foundation @* --- 103,116 ---- @center James Craig Burley @sp 3 ! @center Last updated 1996-12-03 @sp 1 @c The version number appears some more times in this file. ! @center for version 0.5.19 @page @vskip 0pt plus 1filll Copyright @copyright{} 1995, 1996 Free Software Foundation, Inc. @sp 2 ! For GNU Fortran Version 0.5.19* @sp 1 Published by the Free Software Foundation @* *************** original English. *** 153,157 **** 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.18. @end ifset @end ifset --- 153,157 ---- 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.19. @end ifset @end ifset *************** report bugs. It corresponds to GNU Fort *** 160,169 **** 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.18. @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.18. @end ifclear --- 160,169 ---- 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.19. @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.19. @end ifclear *************** appropriately before submitting it to th *** 1224,1229 **** @cindex options, -v @cindex -@w{}-driver option ! @cindex g77 options, --driver ! @cindex options, --driver Use the @samp{-v} option with @code{g77} to see what is going on---the first line of output is the invocation --- 1224,1229 ---- @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 *************** the @code{gcc} command: *** 1252,1260 **** @cindex -@w{}-driver option @cindex g77 options, driver ! @cindex options, --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 gcc build directory after building GNU Fortran (but without having to install it), @samp{./g77 --driver=./xgcc foo.f -B./}. --- 1252,1260 ---- @cindex -@w{}-driver option @cindex g77 options, 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 @samp{gcc} build directory after building GNU Fortran (but without having to install it), @samp{./g77 --driver=./xgcc foo.f -B./}. *************** one is not the default. *** 1276,1279 **** --- 1276,1280 ---- an executable, object files, assembler files, or preprocessed source. + * Shorthand Options:: Options that are shorthand for other options. * Fortran Dialect Options:: Controlling the variant of Fortran language compiled. *************** by type. Explanations are in the follow *** 1301,1304 **** --- 1302,1314 ---- @smallexample --driver -fversion -fset-g77-defaults + -fno-silent + @end smallexample + + @item Shorthand Options + @xref{Shorthand Options}. + @smallexample + -ff66 -fno-f66 + -ff77 -fno-f77 + -fugly -fno-ugly @end smallexample *************** by type. Explanations are in the follow *** 1308,1311 **** --- 1318,1324 ---- -ffree-form -fno-fixed-form -ff90 -fvxt-not-f90 -ff90-not-vxt -fdollar-ok -fno-backslash + -fno-ugly-args -fno-ugly-assumed -fugly-comma + -fugly-init -fugly-logint + -fonetrip -fno-typeless-boz -fintrin-case-initcap -fintrin-case-upper -fintrin-case-lower -fintrin-case-any *************** by type. Explanations are in the follow *** 1336,1342 **** @smallexample -fsyntax-only -pedantic -pedantic-errors -fpedantic ! -fugly -fno-ugly-args -fno-ugly-init -w -Wimplicit ! -Wunused -Wuninitialized -Wall -Wsurprising -Werror ! -W @end smallexample --- 1349,1354 ---- @smallexample -fsyntax-only -pedantic -pedantic-errors -fpedantic ! -w -Wimplicit -Wunused -Wuninitialized -Wall -Wsurprising ! -Werror -W @end smallexample *************** by type. Explanations are in the follow *** 1372,1376 **** -fpcc-struct-return -freg-struct-return -fshort-double -fno-common -fpack-struct ! -fzeros @end smallexample @end table --- 1384,1389 ---- -fpcc-struct-return -freg-struct-return -fshort-double -fno-common -fpack-struct ! -fzeros -fno-second-underscore ! -fdebug-kludge @end smallexample @end table *************** by type. Explanations are in the follow *** 1380,1383 **** --- 1393,1397 ---- an executable, object files, assembler files, or preprocessed source. + * Shorthand Options:: Options that are shorthand for other options. * Fortran Dialect Options:: Controlling the variant of Fortran language compiled. *************** information on this option. *** 1478,1482 **** Ensure that the @code{g77}-specific version of the compiler phase is reported, if run. ! (This is supplied automatically when @samp{-v} or @samp{--version} is specified as a command-line option for @code{g77} or @code{gcc} and when the resulting commands compile Fortran source files.) --- 1492,1496 ---- Ensure that the @code{g77}-specific version of the compiler phase is reported, if run. ! (This is supplied automatically when @samp{-v} or @samp{--verbose} is specified as a command-line option for @code{g77} or @code{gcc} and when the resulting commands compile Fortran source files.) *************** and when the resulting commands compile *** 1487,1491 **** Set up whatever @code{gcc} options are to apply to Fortran compilations. ! For version 0.5.18, this is equivalent to @samp{-fmove-all-movables -freduce-all-givs -frerun-loop-opt}. (This is supplied automatically when compiling Fortran code. --- 1501,1505 ---- Set up whatever @code{gcc} options are to apply to Fortran compilations. ! As of version 0.5.18, this is equivalent to @samp{-fmove-all-movables -freduce-all-givs -frerun-loop-opt}. (This is supplied automatically when compiling Fortran code. *************** Also, developers who run @code{f771} dir *** 1496,1499 **** --- 1510,1526 ---- by hand to get the same defaults as they would running @code{f771} via @code{g77} or @code{gcc}.) + + @cindex -fno-silent option + @cindex options, -fno-silent + @cindex @code{f2c} compatibility + @cindex compatibility, @code{f2c} + @cindex status, compilation + @cindex compilation status + @cindex reporting compilation status + @cindex printing compilation status + @item -fno-silent + Print (to @code{stderr}) the names of the program units as + they are compiled, in a form similar to that used by popular + UNIX @code{f77} implementations and @code{f2c}. @end table *************** on more options that control the overall *** 1503,1506 **** --- 1530,1620 ---- (and, by extension, the @code{g77} command). + @node Shorthand Options + @section Shorthand Options + @cindex shorthand options + @cindex options, shorthand + @cindex macro options + @cindex options, macro + + The following options serve as ``shorthand'' + for other options accepted by the compiler: + + @table @code + @cindex -fugly option + @cindex options, -fugly + @item -fugly + @cindex ugly features + @cindex features, ugly + Specify that certain ``ugly'' constructs are to be quietly accepted. + Same as: + + @smallexample + -fugly-args -fugly-assumed -fugly-comma -fugly-init -fugly-logint + @end smallexample + + These constructs are considered inappropriate to use in new + or well-maintained portable Fortran code, but widely used + in old code. + @xref{Distensions}, for more information. + + @cindex -fno-ugly option + @cindex options, -fno-ugly + @item -fno-ugly + @cindex ugly features + @cindex features, ugly + Specify that all ``ugly'' constructs are to be noisily rejected. + Same as: + + @smallexample + -fno-ugly-args -fno-ugly-assumed -fno-ugly-comma -fno-ugly-init + -fno-ugly-logint + @end smallexample + + @cindex -ff66 option + @cindex options, -ff66 + @item -ff66 + @cindex FORTRAN 66 + @cindex compatibility, FORTRAN 66 + Specify that the program is written in idiomatic FORTRAN 66. + Same as @samp{-fonetrip -fugly-assumed}. + + The @samp{-fno-f66} option is the inverse of @samp{-ff66}. + As such, it is the same as @samp{-fno-onetrip -fno-ugly-assumed}. + + The meaning of this option is likely to be refined as future + versions of @code{g77} provide more compatibility with other + existing and obsolete Fortran implementations. + + @cindex -ff77 option + @cindex options, -ff77 + @item -ff77 + @cindex UNIX f77 + @cindex @code{f2c} compatibility + @cindex compatibility, @code{f2c} + @cindex @code{f77} compatibility + @cindex compatibility, @code{f77} + Specify that the program is written in idiomatic UNIX FORTRAN 77 + and/or the dialect accepted by the @code{f2c} product. + Same as @samp{-fbackslash -fno-typeless-boz}. + + The meaning of this option is likely to be refined as future + versions of @code{g77} provide more compatibility with other + existing and obsolete Fortran implementations. + + @cindex -fno-f77 option + @cindex options, -fno-f77 + @item -fno-f77 + @cindex UNIX f77 + The @samp{-fno-f77} option is @emph{not} the inverse + of @samp{-ff77}. + It specifies that the program is not written in idiomatic UNIX + FORTRAN 77 or @code{f2c}, but in a more widely portable dialect. + @samp{-fno-f77} is the same as @samp{-fno-backslash}. + + The meaning of this option is likely to be refined as future + versions of @code{g77} provide more compatibility with other + existing and obsolete Fortran implementations. + @end table + @node Fortran Dialect Options @section Options Controlling Fortran Dialect *************** the three-octal-digit form, and thus tre *** 1593,1600 **** than three characters. ! @xref{Non-bugs,,Certain Changes We Don't Want to Make}, for information on why @samp{-fbackslash} is the default instead of @samp{-fno-backslash}. @cindex -fintrin-case-initcap option @cindex options, -fintrin-case-initcap --- 1707,1841 ---- than three characters. ! @xref{Backslash in Constants}, for information on why @samp{-fbackslash} is the default instead of @samp{-fno-backslash}. + @cindex -fno-ugly-args option + @cindex options, -fno-ugly-args + @item -fno-ugly-args + Disallow passing Hollerith and typeless constants as actual + arguments (for example, @samp{CALL FOO(4HABCD)}). + + @xref{Ugly Implicit Argument Conversion}, for more information. + + @cindex -fugly-assumed option + @cindex options, -fugly-assumed + @item -fugly-assumed + Assume any array with a final dimension specified as @samp{1} + is really an assumed-size array, as if @samp{*} had been specified + instead. + + For example, @samp{DIMENSION X(1)} is treated as if it + had read @samp{DIMENSION X(*)}. + + @xref{Ugly Assumed-Size Arrays}, for more information. + + @cindex -fugly-comma option + @cindex options, -fugly-comma + @item -fugly-comma + Treat a trailing comma in an argument list as specification + of a trailing null argument, and treat an empty argument + list as specification of a single null argument. + + For example, @samp{CALL FOO(,)} is treated as + @samp{CALL FOO(%VAL(0), %VAL(0))}. + That is, @emph{two} null arguments are specified + by the procedure call when @samp{-fugly-comma} is in force. + And @samp{F = FUNC()} is treated as @samp{F = FUNC(%VAL(0))}. + + The default behavior, @samp{-fno-ugly-comma}, is to ignore + a single trailing comma in an argument list. + + @xref{Ugly Null Arguments}, for more information. + + @cindex -fno-ugly-init option + @cindex options, -fno-ugly-init + @item -fno-ugly-init + Disallow use of Hollerith and typeless constants as initial + values (in @code{PARAMETER} and @code{DATA} statements), and + use of character constants to + initialize numeric types and vice versa. + + For example, @samp{DATA I/'F'/, CHRVAR/65/, J/4HABCD/} is disallowed by + @samp{-fno-ugly-init}. + + @xref{Ugly Conversion of Initializers}, for more information. + + @cindex -fugly-logint option + @cindex options, -fugly-logint + @item -fugly-logint + Treat @samp{INTEGER} and @samp{LOGICAL} variables and + expressions as potential stand-ins for each other. + + For example, automatic conversion between @samp{INTEGER} and + @samp{LOGICAL} is enabled, for many contexts, via this option. + + @xref{Ugly Integer Conversions}, for more information. + + @cindex -fonetrip option + @cindex options, -fonetrip + @item -fonetrip + @cindex FORTRAN 66 + @cindex DO loops, one-trip + @cindex one-trip DO loops + @cindex compatibility, FORTRAN 66 + Imperative executable @samp{DO} loops are to be executed at + least once each time they are reached. + + ANSI FORTRAN 77 and more recent versions of the Fortran standard + specify that the body of an imperative @samp{DO} loop is not executed + 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}. + + Prior to ANSI FORTRAN 77, many compilers implemented @samp{DO} loops + such that the body of a loop would be executed at least once, even + if the iteration count was zero. + Fortran code written assuming this behavior is said to require + @dfn{one-trip loops}. + For example, some code written to the FORTRAN 66 standard + expects this behavior from its @samp{DO} loops, although that + standard did not specify this behavior. + + The @samp{-fonetrip} option specifies that the source file(s) being + compiled require one-trip loops. + + This option affects only those loops specified by the (imperative) @samp{DO} + statement and by implied-@samp{DO} lists in I/O statements. + Loops specified by implied-@samp{DO} lists in @samp{DATA} and + specification (non-executable) statements are not affected. + + @cindex -fno-typeless-boz option + @cindex options, -fno-typeless-boz + @cindex prefix-radix constants + @cindex constants, prefix-radix + @cindex constants, types + @cindex types, constants + @item -fno-typeless-boz + Specifies that prefix-radix non-decimal constants, such as + @samp{Z'ABCD'}, as @samp{INTEGER} instead of typeless. + + Currently plans call for this option being the default as of + version 0.5.20. + + You can test for yourself whether a particular compiler treats + the prefix form as @samp{INTEGER} or typeless by running the + following program: + + @smallexample + EQUIVALENCE (I, R) + R = Z'ABCD1234' + J = Z'ABCD1234' + IF (J .EQ. I) PRINT *, 'Prefix form is TYPELESS' + IF (J .NE. I) PRINT *, 'Prefix form is INTEGER' + END + @end smallexample + + Reports indicate that many compilers process this form as + @samp{INTEGER}, though a few as typeless, and at least one + based on a command-line option specifying some kind of + compatibility. + @cindex -fintrin-case-initcap option @cindex options, -fintrin-case-initcap *************** a library function and thus works with o *** 1793,1798 **** compilers or earlier version of @code{g77}, either add the @samp{EXTERNAL FLUSH} statement or, perhaps ! more convenient for you, compile with the -funix-intrinsics-hide or ! -funix-intrinsics-delete option. @cindex ABORT() intrinsic --- 2034,2040 ---- compilers or earlier version of @code{g77}, either add the @samp{EXTERNAL FLUSH} statement or, perhaps ! more convenient for you, compile with the ! @samp{-funix-intrinsics-hide} or ! @samp{-funix-intrinsics-delete} option. @cindex ABORT() intrinsic *************** more convenient for you, compile with th *** 1800,1803 **** --- 2042,2047 ---- @cindex EXIT() intrinsic @cindex intrinsics, EXIT() + @cindex FSEEK() intrinsic + @cindex intrinsics, FSEEK() @cindex SIGNAL() intrinsic @cindex intrinsics, SIGNAL() *************** more convenient for you, compile with th *** 1810,1817 **** @cindex side effects @cindex intrinsics, side effects of ! Note that @code{ABORT}, @code{EXIT}, @code{FLUSH}, @code{SIGNAL}, and @code{SYSTEM} are intrinsic subroutines, not functions (since they have ! side effects), so to get the return values from @code{SIGNAL} and ! @code{SYSTEM}, append a final argument specifying an @samp{INTEGER} variable or array element to receive the returned status. (For example, @samp{CALL SYSTEM('rm foo',ISTAT)}.) --- 2054,2063 ---- @cindex side effects @cindex intrinsics, side effects of ! Note that @code{ABORT}, @code{EXIT}, @code{FLUSH}, @code{FSEEK}, ! @code{SIGNAL}, and @code{SYSTEM} are intrinsic subroutines, not functions (since they have ! side effects), so to get the return values from @code{FSEEK}, ! @code{SIGNAL}, and @code{SYSTEM}, append a final argument specifying ! an @samp{INTEGER} variable or array element to receive the returned status. (For example, @samp{CALL SYSTEM('rm foo',ISTAT)}.) *************** warnings. *** 1930,1962 **** Like @samp{-pedantic}, but applies only to Fortran constructs. - @cindex -fugly option - @cindex options, -fugly - @item -fugly - @cindex ugly features - @cindex features, ugly - Specify that certain ``ugly'' constructs are to be quietly accepted. - Implies @samp{-fugly-args} and @samp{-fugly-init} as well. - - For example, with @samp{-fno-ugly}, @samp{CALL FOO(,)} means to pass - one null argument, whereas with @samp{-fugly}, it means to pass two null - arguments. - - @cindex -fno-ugly-args option - @cindex options, -fno-ugly-args - @item -fno-ugly-args - Disallow passing Hollerith and typeless constants as actual - arguments (for example, @samp{CALL FOO(4HABCD)}). - - @cindex -fno-ugly-init option - @cindex options, -fno-ugly-init - @item -fno-ugly-init - Disallow use of Hollerith and typeless constants as initial - values (in @code{PARAMETER} and @code{DATA} statements), and - use of character constants to - initialize numeric types and vice versa. - - For example, @samp{DATA I/'F'/, CHRVAR/65/, J/4HABCD/} is disallowed by - @samp{-fno-ugly-init}. - @cindex -w option @cindex options, -w --- 2176,2179 ---- *************** get these warnings. *** 2000,2009 **** These warnings occur only for variables that are candidates for ! register allocation. Therefore, they do not occur for a variable that ! is declared @code{volatile}, or whose address is taken, or whose size is other than 1, 2, 4 or 8 bytes. Also, they do not occur for arrays, even when they are in registers. ! Note that there may be no warning about a variable that is used only to compute a value that itself is never used, because such computations may be deleted by data flow analysis before the warnings --- 2217,2227 ---- These warnings occur only for variables that are candidates for ! register allocation. Therefore, they do not occur for a variable ! @c that is declared @code{VOLATILE}, or ! whose address is taken, or whose size is other than 1, 2, 4 or 8 bytes. Also, they do not occur for arrays, even when they are in registers. ! Note that there might be no warning about a variable that is used only to compute a value that itself is never used, because such computations may be deleted by data flow analysis before the warnings *************** another common case: *** 2032,2036 **** SUBROUTINE MAYBE(FLAG) LOGICAL FLAG ! IF (FLAG) VALUE = 3.14 @dots{} IF (FLAG) PRINT *, VALUE --- 2250,2254 ---- SUBROUTINE MAYBE(FLAG) LOGICAL FLAG ! IF (FLAG) VALUE = 9.4 @dots{} IF (FLAG) PRINT *, VALUE *************** the precedence is @samp{-(2**2)}, yieldi *** 2108,2111 **** --- 2326,2340 ---- @samp{(-2)**2}, which yields 4, and which might represent what a programmer expects. + + An example of an expression producing different results + in a surprising way is @samp{-I*S}, where @var{I} holds + the value @samp{-2147483648} and @var{S} holds @samp{0.5}. + On many systems, negating @var{I} results in the same + value, not a positive number, because it is already the + lower bound of what an @samp{INTEGER} variable can hold. + So, the expression evaluates to a positive number, while + the ``expected'' interpretation, @samp{(-I)*S}, would + evaluate to a negative number. + Even cases such as @samp{-I*J} produce warnings, even though, in most configurations and situations, *************** In particular, names of variables and ar *** 2236,2239 **** --- 2465,2475 ---- or that are storage-associated via @samp{EQUIVALENCE} are unavailable to the debugger. + + However, version 0.5.19 of @code{g77} does provide this information + in a rudimentary way, as controlled by the + @samp{-fdebug-kludge} option. + + @xref{Code Gen Options,,Options for Code Generation Conventions}, + for more information. @end table *************** Also note that the general behavior of @ *** 2414,2418 **** looking for @file{header.gcc} files and other such things. ! @xref{Directory Optoins,,Options for Directory Search, gcc,Using and Porting GNU CC}, for information on the @samp{-I} option. @end table --- 2650,2654 ---- looking for @file{header.gcc} files and other such things. ! @xref{Directory Options,,Options for Directory Search, gcc,Using and Porting GNU CC}, for information on the @samp{-I} option. @end table *************** With @samp{-funderscoring} in effect, @c *** 2506,2510 **** to names with underscores and one underscore to external names with no underscores. (@code{g77} also appends two underscores to internal ! names with underscores to avoid naming collisions with external names.) This is done to ensure compatibility with code produced by many --- 2742,2748 ---- to names with underscores and one underscore to external names with no underscores. (@code{g77} also appends two underscores to internal ! names with underscores to avoid naming collisions with external names. ! The @samp{-fno-second-underscore} option disables appending of the ! second underscore in all cases.) This is done to ensure compatibility with code produced by many *************** Do not append a second underscore to nam *** 2576,2580 **** in the Fortran source file. ! This option has no effect if @samp{-fno-underscoring} is not in effect. --- 2814,2818 ---- in the Fortran source file. ! This option has no effect if @samp{-fno-underscoring} is in effect. *************** differently. *** 2611,2614 **** --- 2849,2921 ---- The interpretation changes will affect only non-standard programs; standard-conforming programs should not be affected. + + @cindex -fdebug-kludge option + @cindex options, -fdebug-kludge + @item -fdebug-kludge + Emit information on @samp{COMMON} and @samp{EQUIVALENCE} members + that might help users of debuggers work around lack of proper debugging + information on such members. + + As of version 0.5.19, @code{g77} offers this option to emit + information on members of aggregate areas to help users while debugging. + This information consists of establishing the type and contents of each + such member so that, when a debugger is asked to print the contents, + the printed information provides rudimentary debugging information. + This information identifies the name of the aggregate area (either the + @samp{COMMON} block name, or the @code{g77}-assigned name for the + @samp{EQUIVALENCE} name) and the offset, in bytes, of the member from + the beginning of the area. + + Using @code{gdb}, this information is not coherently displayed in the Fortran + language mode, so temporarily switching to the C language mode to display the + information is suggested. + Use @samp{set language c} and @samp{set language fortran} to accomplish this. + + For example: + + @example + COMMON /X/A,B + EQUIVALENCE (C,D) + CHARACTER XX*50 + EQUIVALENCE (I,XX(20:20)) + END + + GDB is free software and you are welcome to distribute copies of it + under certain conditions; type "show copying" to see the conditions. + There is absolutely no warranty for GDB; type "show warranty" for details. + GDB 4.16 (lm-gnits-dwim), Copyright 1996 Free Software Foundation, Inc... + (gdb) b MAIN__ + Breakpoint 1 at 0t1200000201120112: file cd.f, line 5. + (gdb) r + Starting program: /home/user/a.out + + Breakpoint 1, MAIN__ () at cd.f:5 + Current language: auto; currently fortran + (gdb) set language c + Warning: the current language does not match this frame. + (gdb) p a + $2 = "At (COMMON) `x_' plus 0 bytes" + (gdb) p b + $3 = "At (COMMON) `x_' plus 4 bytes" + (gdb) p c + $4 = "At (EQUIVALENCE) `__g77_equiv_c' plus 0 bytes" + (gdb) p d + $5 = "At (EQUIVALENCE) `__g77_equiv_c' plus 0 bytes" + (gdb) p i + $6 = "At (EQUIVALENCE) `__g77_equiv_xx' plus 20 bytes" + (gdb) p xx + $7 = "At (EQUIVALENCE) `__g77_equiv_xx' plus 1 bytes" + (gdb) set language fortran + (gdb) + @end example + + Use @samp{-fdebug-kludge} to generate this information, + which might make some programs noticably larger. + + @emph{Caution:} Future versions of @code{g77} might disregard this option + (and its negative form). + Current plans call for this to happen when published versions of @code{g77} + and @code{gdb} exist that provide proper access to debugging information on + @samp{COMMON} and @samp{EQUIVALENCE} members. @end table *************** instead, or use @samp{gate-2}, @samp{gat *** 2679,2683 **** instead of @samp{gate-1}.) ! Alternatively, retrieve @file{gnu.ai.mit.edu:/g77.plan} via anonymous ftp, or if you cannot do that, email @samp{fortran@@gnu.ai.mit.edu} asking for a recent copy of the --- 2986,2990 ---- instead of @samp{gate-1}.) ! Alternatively, retrieve @url{ftp://gnu.ai.mit.edu/g77.plan} via anonymous ftp, or if you cannot do that, email @samp{fortran@@gnu.ai.mit.edu} asking for a recent copy of the *************** GNU Fortran @file{.plan} file. *** 2686,2689 **** --- 2993,3061 ---- copy of all these methods.) + @heading In 0.5.19: + + @itemize @bullet + @item + A temporary kludge option provides bare-bones information on + @samp{COMMON} and @samp{EQUIVALENCE} members at debug time. + @xref{Code Gen Options,,Options for Code Generation Conventions}, + for information on the @samp{-fdebug-kludge} option. + + @item + New @samp{-fonetrip} option specifies FORTRAN-66-style + one-trip @samp{DO} loops. + + @item + New @samp{-fno-silent} option causes names of program units + to be printed as they are compiled, in a fashion similar to + UNIX @samp{f77} and @samp{f2c}. + + @item + New @samp{-fugly-assumed} option specifies that arrays + dimensioned via @samp{DIMENSION X(1)}, for example, are to be + treated as assumed-size. + + @item + New @samp{-fno-typeless-boz} option specifies that non-decimal-radix + constants using the prefixed-radix form (such as @samp{Z'1234'}) + are to be interpreted as @samp{INTEGER} constants. + + @item + New @samp{-ff66} option is a ``shorthand'' option that specifies + behaviors considered appropriate for FORTRAN 66 programs. + + @item + New @samp{-ff77} option is a ``shorthand'' option that specifies + behaviors considered appropriate for UNIX @samp{f77} programs. + + @item + New @samp{-fugly-comma} and @samp{-fugly-logint} options provided + to perform some of what @samp{-fugly} used to do. + @samp{-fugly} and @samp{-fno-ugly} are now ``shorthand'' options, + in that they do nothing more than enable (or disable) other + @samp{-fugly-*} options. + + @item + Change code generation for list-directed I/O so it allows + for new versions of @samp{libf2c} that might return non-zero + status codes for some operations previously assumed to always + return zero. + + This change not only affects how @samp{IOSTAT=} variables + are set by list-directed I/O, it also affects whether + @samp{END=} and @samp{ERR=} labels are reached by these + operations. + + @item + Add intrinsic support for new @samp{FTELL} and @samp{FSEEK} + procedures in @samp{libf2c}. + + @item + Add options @samp{--help} and @samp{--version} to the + @code{g77} command, to conform to GNU coding guidelines. + Also add printing of @code{g77} version number when + the @samp{--verbose} (@samp{-v}) option is used. + @end itemize + @heading In 0.5.18: *************** Many improvements to the @code{g77} comm *** 2801,2805 **** a front-end to the @code{gcc} driver. For example, @code{g77} now ! recognizes @samp{--version} as a verbose way of specifying @samp{-v}. @item --- 3173,3177 ---- a front-end to the @code{gcc} driver. For example, @code{g77} now ! recognizes @samp{--verbose} as a verbose way of specifying @samp{-v}. @item *************** dummy arguments. *** 2888,2892 **** @item Block data program units now may contain @samp{NAMELIST}, @samp{EXTERNAL}, ! @samp{INTRINSIC}, and @samp{VOLATILE} statements. @item --- 3260,3265 ---- @item Block data program units now may contain @samp{NAMELIST}, @samp{EXTERNAL}, ! @c @samp{INTRINSIC}, and @samp{VOLATILE} statements. ! and @samp{INTRINSIC} statements. @item *************** lines allowed, now lifted. *** 2904,2910 **** @chapter The GNU Fortran Language GNU Fortran supports a variety of extensions to, and dialects of, the Fortran language. ! Its primary base is the ANSI FORTRAN 77 standard. It offers some extensions that are popular among users of UNIX @code{f77} and @code{f2c} compilers, some that --- 3277,3287 ---- @chapter The GNU Fortran Language + @cindex standard, ANSI FORTRAN 77 + @cindex ANSI FORTRAN 77 standard GNU Fortran supports a variety of extensions to, and dialects of, the Fortran language. ! Its primary base is the ANSI FORTRAN 77 standard, currently available on ! the network at @url{http://kumo.swcp.com/fortran/F77_std/f77_std.html} ! or in @url{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 *************** on them. *** 3253,3268 **** @end table - For now, @code{g77} does not support numeric types other - than the ones listed above. - So, on a typical 32-bit machine, only @samp{INTEGER*4}, @samp{REAL*4}, - @samp{LOGICAL*4}, @samp{COMPLEX*8}, and so on, will work. Other types supported by @code{g77} are derived from gcc types such as @samp{char}, @samp{short}, @samp{int}, @samp{long int}, @samp{long long int}, @samp{long double}, and so on. ! That is, whatever types @samp{gcc} already supports, @code{g77} probably ! will support in a future version. ! The rules for the @samp{@var{numeric-type}*@var{n}} notation will ! apply to the new types, and new values for @samp{@var{numeric-type}(KIND=@var{n})} will be assigned in a way that encourages clarity, consistency, and portability. --- 3630,3641 ---- @end table Other types supported by @code{g77} are derived from gcc types such as @samp{char}, @samp{short}, @samp{int}, @samp{long int}, @samp{long long int}, @samp{long double}, and so on. ! That is, whatever types @samp{gcc} already supports, @code{g77} supports ! now or probably will support in a future version. ! The rules for the @samp{@var{numeric-type}*@var{n}} notation ! apply to these types, and new values for @samp{@var{numeric-type}(KIND=@var{n})} will be assigned in a way that encourages clarity, consistency, and portability. *************** assigned in a way that encourages clarit *** 3274,3283 **** @code{g77} strictly assigns types to all constants not ! documented as ``typeless'' (the typeless constants include things like ! @samp{Z'1'}). Context is never a determining factor for the type, and hence the interpretation, of a typed constant. Examples: @samp{1} is always type @samp{INTEGER}, ! @samp{3.141592653545256234} is always type @samp{REAL} (even if the additional precision specified is lost, and even when used in a @samp{DOUBLE PRECISION} context), @samp{1E0} is always type @samp{REAL}, and @samp{1D0} --- 3647,3656 ---- @code{g77} strictly assigns types to all constants not ! documented as ``typeless'' (typeless constants including @samp{'1'Z}, ! for example). Context is never a determining factor for the type, and hence the interpretation, of a typed constant. Examples: @samp{1} is always type @samp{INTEGER}, ! @samp{9.435784839284958} is always type @samp{REAL} (even if the additional precision specified is lost, and even when used in a @samp{DOUBLE PRECISION} context), @samp{1E0} is always type @samp{REAL}, and @samp{1D0} *************** result). *** 3425,3428 **** --- 3798,3802 ---- Automatic conversion of numeric expressions to @samp{INTEGER} in contexts such as: + @itemize -- @item *************** Low-level switches are identified in thi *** 3530,3534 **** @itemize @w{} @item A ! Source Case Conversion @itemize @w{} @item 0 --- 3904,3909 ---- @itemize @w{} @item A ! Source Case Conversion: ! @itemize @w{} @item 0 *************** Convert to Lower Case *** 3542,3545 **** --- 3917,3921 ---- @item B Built-in Keyword Matching: + @itemize @w{} @item 0 *************** Match InitialCaps Only (see tables for s *** 3555,3558 **** --- 3931,3935 ---- @item C Built-in Intrinsic Matching: + @itemize @w{} @item 0 *************** Match InitialCaps Only (see tables for s *** 3567,3571 **** @item D ! User-defined Symbol Possibilities (warnings only) @itemize @w{} @item 0 --- 3944,3949 ---- @item D ! User-defined Symbol Possibilities (warnings only): ! @itemize @w{} @item 0 *************** but that seems to be overkill for a prod *** 3605,3608 **** --- 3983,3987 ---- Note 2: Rules for InitialCaps names are: + @itemize -- @item *************** either.) *** 3935,3939 **** @cindex object code @cindex code, object ! @cindex compatibility @cindex f2c compatibility @cindex compilers, compatibility --- 4314,4318 ---- @cindex object code @cindex code, object ! @cindex compatibility, @code{f2c} @cindex f2c compatibility @cindex compilers, compatibility *************** command. *** 4102,4106 **** @cindex features, ugly ! The @samp{-fugly} command-line options determine whether certain features supported by VAX FORTRAN and other such compilers, but considered too ugly to be in code that can be changed to use safer and/or more --- 4481,4485 ---- @cindex features, ugly ! The @samp{-fugly-*} command-line options determine whether certain features supported by VAX FORTRAN and other such compilers, but considered too ugly to be in code that can be changed to use safer and/or more *************** These are humorously referred to as ``di *** 4109,4153 **** extensions that just plain look ugly in the harsh light of day. ! The constructs enabled via @samp{-fugly} include: @itemize @bullet @item ! Automatic conversion between @samp{INTEGER} and @samp{LOGICAL} as ! dictated by ! context (typically implies nonportable dependencies on how a ! particular implementation encodes @samp{.TRUE.} and @samp{.FALSE.}). ! @item ! Use of typeless and Hollerith constants in non-standard places ! (the ``standard'' here being the appendix in ANSI FORTRAN 77 and ! the descriptions in MIL-STD 1753), plus in places controlled ! by @samp{-fugly-args} and @samp{-fugly-init}. ! @item ! Use of a @samp{LOGICAL} variable in @samp{ASSIGN} and assigned-@samp{GOTO} ! statements. @item ! Use of a single trailing comma to mean ``pass an extra trailing null ! argument'' in a list of actual arguments to a procedure other than a ! statement function. ! For example, @samp{CALL FOO(,)} means ``pass ! two null arguments'' when @samp{-fugly} is used, rather than ! ``pass one null argument''. @end itemize ! The construct disabled via @samp{-fno-ugly-args} is: @itemize @bullet - @cindex Hollerith constants - @cindex constants, Hollerith @item ! Passing of typeless and Hollerith constants as actual arguments ! in procedure invocations. ! For example, @samp{CALL FOO(4HABCD)}. @end itemize The constructs disabled by @samp{-fno-ugly-init} are: --- 4488,4604 ---- extensions that just plain look ugly in the harsh light of day. ! @menu ! * Ugly Implicit Argument Conversion:: Disabled via @samp{-fno-ugly-args}. ! * Ugly Assumed-Size Arrays:: Enabled via @samp{-fugly-assumed}. ! * Ugly Null Arguments:: Enabled via @samp{-fugly-comma}. ! * Ugly Conversion of Initializers:: Disabled via @samp{-fno-ugly-init}. ! * Ugly Integer Conversions:: Enabled via @samp{-fugly-logint}. ! @end menu ! ! @node Ugly Implicit Argument Conversion ! @subsection Implicit Argument Conversion ! ! The construct disabled via @samp{-fno-ugly-args} is: @itemize @bullet + @cindex Hollerith constants + @cindex constants, Hollerith @item ! Passing of typeless and Hollerith constants as actual arguments ! in procedure invocations. ! For example, @samp{CALL FOO(4HABCD)}. ! This construct can be too easily used to create non-portable ! code, but is not considered as ``ugly'' as others. ! Further, it is widely used in existing Fortran source code ! in ways that often are quite portable. ! Therefore, it is enabled by default. ! @end itemize + @cindex arrays, assumed-size + @cindex assumed-size arrays + @cindex DIMENSION X(1) + @node Ugly Assumed-Size Arrays + @subsection Ugly Assumed-Size Arrays + + The construct enabled via @samp{-fugly-assumed} is: + + @itemize @bullet @item ! Treatment of any array with a final dimension specified as @samp{1} ! as an assumed-size array, as if @samp{*} had been specified ! instead. ! For example, @samp{DIMENSION X(1)} is treated as if it ! had read @samp{DIMENSION X(*)}. ! ! Use an explicit lower bound to avoid this interpretation. ! For example, @samp{DIMENSION X(1:1)} is never treated as if ! it had read @samp{DIMENSION X(*)} or @samp{DIMENSION X(1:*)}. ! ! This option prevents a warning being issued about an apparent ! out-of-bounds reference such as @samp{X(2) = 99}. ! ! It also prevents the array from being used in contexts that ! disallow assumed-size arrays, such as @samp{PRINT *,X}. ! ! This construct is used only in very old code that pre-exists ! the widespread acceptance of adjustable and assumed-size ! arrays in the Fortran community. @end itemize ! @cindex trailing commas ! @cindex commas, trailing ! @cindex null arguments ! @cindex arguments, null ! @node Ugly Null Arguments ! @subsection Ugly Null Arguments ! ! The construct enabled via @samp{-fugly-comma} is: @itemize @bullet @item ! Use of a single trailing comma to mean ``pass an extra trailing null ! argument'' in a list of actual arguments to a procedure other than a ! statement function, and an empty list of arguments to ! mean ``pass a single null argument''. ! @cindex omitting arguments ! @cindex arguments, omitting ! (Null arguments often are used in some procedure-calling ! schemes to indicate omitted arguments.) ! ! For example, @samp{CALL FOO(,)} means ``pass ! two null arguments'', rather than ``pass one null argument''. ! Also, @samp{CALL BAR()} means ``pass one null argument''. ! ! This construct is considered ``ugly'' because it does not ! provide an elegant way to pass a single null argument ! that is syntactically distinct from passing no arguments. ! That is, this construct changes the meaning of code that ! makes no use of the construct. ! ! So, with @samp{-fugly-comma} in force, @samp{CALL FOO()} ! and @samp{I = JFUNC()} pass a single null argument, instead ! of passing no arguments as required by the Fortran 77 and ! 90 standards. ! ! @emph{Note:} Many systems gracefully allow the case ! where a procedure call passes one extra argument that the ! called procedure does not expect. ! ! So, in practice, there might be no difference in ! the behavior of a program that does @samp{CALL FOO()} ! or @samp{I = JFUNC()} and is compiled with @samp{-fugly-comma} ! in force as compared to its behavior when compiled ! with the default, @samp{-fno-ugly-comma}, in force, ! assuming @samp{FOO} and @samp{JFUNC} do not expect any ! arguments to be passed. @end itemize + @node Ugly Conversion of Initializers + @subsection Ugly Conversion of Initializers + The constructs disabled by @samp{-fno-ugly-init} are: *************** constants---that is, @samp{DATA} and @sa *** 4161,4164 **** --- 4612,4624 ---- type-declaration statements specifying initial values. + Here are some sample initializations that are disabled by the + @samp{-fno-ugly-init} option: + + @example + PARAMETER (VAL='9A304FFE'X) + REAL*8 STRING/8HOUTPUT00/ + DATA VAR/4HABCD/ + @end example + @cindex character constants @cindex constants, character *************** In the same contexts as above, use of ch *** 4167,4179 **** numeric items and vice versa (one constant per item). @item Use of Hollerith and typeless constants on the right-hand side of assignment statements to numeric types, and in other ! contexts (such as passing arguments to in invocations of intrinsic procedures and statement functions) that are treated as assignments to known types (the dummy arguments, in these cases). @end itemize @include install.texi --- 4627,4694 ---- numeric items and vice versa (one constant per item). + Here are more sample initializations that are disabled by the + @samp{-fno-ugly-init} option: + + @example + INTEGER IA + CHARACTER BELL + PARAMETER (IA = 'A') + PARAMETER (BELL = 7) + @end example + @item Use of Hollerith and typeless constants on the right-hand side of assignment statements to numeric types, and in other ! contexts (such as passing arguments in invocations of intrinsic procedures and statement functions) that are treated as assignments to known types (the dummy arguments, in these cases). + + Here are sample statements that are disabled by the + @samp{-fno-ugly-init} option: + + @example + IVAR = 4HABCD + PRINT *, IMAX0(2HAB, 2HBA) + @end example + @end itemize + + The above constructs, when used, + can tend to result in non-portable code. + But, they are widely used in existing Fortran code in ways + that often are quite portable. + Therefore, they are enabled by default. + + @node Ugly Integer Conversions + @subsection Ugly Integer Conversions + + The constructs enabled via @samp{-fugly-logint} are: + + @itemize @bullet + @item + Automatic conversion between @samp{INTEGER} and @samp{LOGICAL} as + dictated by + context (typically implies nonportable dependencies on how a + particular implementation encodes @samp{.TRUE.} and @samp{.FALSE.}). + + @item + Use of a @samp{LOGICAL} variable in @samp{ASSIGN} and assigned-@samp{GOTO} + statements. @end itemize + The above constructs are disabled by default because use + of them tends to lead to non-portable code. + Even existing Fortran code that uses that often turns out + to be non-portable, if not outright buggy. + + Some of this is due to differences among implementations as + far as how @samp{.TRUE.} and @samp{.FALSE.} are encoded as + @samp{INTEGER} values---Fortran code that assumes a particular + coding is likely to use one of the above constructs, and is + also likely to not work correctly on implementations using + different encodings. + + @xref{Equivalence Versus Equality}, for more information. + @include install.texi *************** incompatible externals written in other *** 4261,4267 **** --- 4776,4786 ---- might be intentional. + @cindex -fno-underscoring + @cindex -fno-second-underscore When @samp{-funderscoring} is in force, any name (external or local) that already has at least one underscore in it is 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 *************** For example: *** 4296,4300 **** @example ! Foo = 3.14159 @end example --- 4815,4819 ---- @example ! Foo = 9.436 @end example *************** of the temporary during execution of the *** 4606,4610 **** of the array remains constant during each invocation. ! For alternate entry points, the code @samp{g77} generates takes into account the possibility that a dummy adjustable array is not actually passed to the actual entry point being invoked at that time. --- 5125,5129 ---- of the array remains constant during each invocation. ! For alternate entry points, the code @code{g77} generates takes into account the possibility that a dummy adjustable array is not actually passed to the actual entry point being invoked at that time. *************** When @samp{-fno-f2c} is in force, @samp{ *** 4707,4712 **** for compatibility with f2c. ! Currently, @code{g77} does not emit any debugging information for ! items in a @samp{COMMON} area, due to an apparent bug in the GBE. Moreover, @code{g77} currently implements a @samp{COMMON} area such that its --- 5226,5249 ---- for compatibility with f2c. ! Currently, @code{g77} does not emit ``true'' debugging information for ! members of a @samp{COMMON} area, due to an apparent bug in the GBE. ! ! (As of Version 0.5.19, @code{g77} emits debugging information for such ! members in the form of a constant string specifying the base name of ! the aggregate area and the offset of the member in bytes from the start ! of the area. ! Use the @samp{-fdebug-kludge} option to enable this behavior. ! In @code{gdb}, use @samp{set language c} before printing the value ! of the member, then @samp{set language fortran} to restore the default ! language, since @code{gdb} doesn't provide a way to print a readable ! version of a character string in Fortran language mode. ! ! This kludge will be removed in a future version of @code{g77} that, ! in conjunction with a contemporary version of @code{gdb}, ! properly supports Fortran-language debugging, including access ! to members of @samp{COMMON} areas.) ! ! @xref{Code Gen Options,,Options for Code Generation Conventions}, ! for information on the @samp{-fdebug-kludge} option. Moreover, @code{g77} currently implements a @samp{COMMON} area such that its *************** connected to each other in any way via @ *** 4746,4751 **** listed in a @samp{COMMON} statement. ! Currently, @code{g77} does not emit any debugging information for ! items in a local @samp{EQUIVALENCE} area, due to an apparent bug in the GBE. Moreover, @code{g77} implements a local @samp{EQUIVALENCE} area such that its --- 5283,5306 ---- listed in a @samp{COMMON} statement. ! Currently, @code{g77} does not emit ``true'' debugging information for ! members in a local @samp{EQUIVALENCE} area, due to an apparent bug in the GBE. ! ! (As of Version 0.5.19, @code{g77} does emit debugging information for such ! members in the form of a constant string specifying the base name of ! the aggregate area and the offset of the member in bytes from the start ! of the area. ! Use the @samp{-fdebug-kludge} option to enable this behavior. ! In @code{gdb}, use @samp{set language c} before printing the value ! of the member, then @samp{set language fortran} to restore the default ! language, since @code{gdb} doesn't provide a way to print a readable ! version of a character string in Fortran language mode. ! ! This kludge will be removed in a future version of @code{g77} that, ! in conjunction with a contemporary version of @code{gdb}, ! properly supports Fortran-language debugging, including access ! to members of @samp{EQUIVALENCE} areas.) ! ! @xref{Code Gen Options,,Options for Code Generation Conventions}, ! for information on the @samp{-fdebug-kludge} option. Moreover, @code{g77} implements a local @samp{EQUIVALENCE} area such that its *************** type is an array of the C @samp{char} da *** 4753,4759 **** The name @code{g77} gives this array of @samp{char} type is @samp{__g77_equiv_@var{x}}, ! where @var{x} is the name of the first item listed in the @samp{EQUIVALENCE} ! statements for that area that is placed at the beginning (offset 0) of this array. When debugging, you must therefore access members of @samp{EQUIVALENCE} --- 5308,5316 ---- The name @code{g77} gives this array of @samp{char} type is @samp{__g77_equiv_@var{x}}, ! where @var{x} is the name of the item that is placed at the beginning (offset 0) of this array. + If more than one such item is placed at the beginning, @var{x} is + the name that sorts to the top in an alphabetical sort of the list of + such items. When debugging, you must therefore access members of @samp{EQUIVALENCE} *************** See the explanation of debugging @samp{C *** 4763,4771 **** for info applicable to debugging local @samp{EQUIVALENCE} areas. ! (Note: @code{g77} version 0.5.16 fixed a bug in how certain ! @samp{EQUIVALENCE} cases were handled. ! The bug caused the debugger to not know the size of the ! array if any variable or array in the @samp{EQUIVALENCE} was given an initial ! value via @samp{DATA} or similar.) @node Alternate Entry Points --- 5320,5332 ---- for info applicable to debugging local @samp{EQUIVALENCE} areas. ! (@emph{Note:} @code{g77} version 0.5.18 and earlier chose the name ! for @var{x} using a different method when more than one name was ! in the list of names of entities placed at the beginning of the ! array. ! Though the documentation specified that the first name listed in ! the @samp{EQUIVALENCE} statements was chosen for @var{x}, @code{g77} ! in fact chose the name using a method that was so complicated, ! it seemed easier to change it to an alphabetical sort than to describe the ! previous method in the documentation.) @node Alternate Entry Points *************** Many other compilers do this automatical *** 5071,5076 **** Fortran code developed with those compilers depends on it. ! The effect of this is that all variables and arrays are made ! static, that is, not placed on the stack or in heap storage. This might cause a buggy program to appear to work better. If so, rather than relying on this command-line option (and hoping all --- 5632,5637 ---- Fortran code developed with those compilers depends on it. ! The effect of this is that all non-automatic variables and arrays ! are made static, that is, not placed on the stack or in heap storage. This might cause a buggy program to appear to work better. If so, rather than relying on this command-line option (and hoping all *************** where possible and reasonable. *** 5087,5090 **** --- 5648,5666 ---- This tends to make programs faster. + @cindex automatic arrays + @cindex arrays, automatic + @emph{Note:} Automatic variables and arrays are not affected + by this option. + These are variables and arrays that are @emph{necessarily} automatic, + either due to explicit statements, or due to the way they are + declared. + Examples include local variables and arrays not given the + @samp{SAVE} attribute in procedures declared @samp{RECURSIVE}, + and local arrays declared with non-constant bounds (automatic + arrays). + Currently, @code{g77} supports only automatic arrays, not + @samp{RECURSIVE} procedures or other means of explicitly + specifying that variables or arrays are automatic. + @cindex -fugly option @cindex options, -fugly *************** be so affected. *** 5190,5194 **** For example, @samp{-fno-automatic}, which effectively @samp{SAVE}s ! every local variable and array, affects even things like @samp{DO} iteration variables, which rarely need to be @samp{SAVE}d, and this often reduces run-time performances. --- 5766,5771 ---- For example, @samp{-fno-automatic}, which effectively @samp{SAVE}s ! every local non-automatic variable and array, affects even things like ! @samp{DO} iteration variables, which rarely need to be @samp{SAVE}d, and this often reduces run-time performances. *************** A C-like view of @samp{DO} would hold th *** 5402,5406 **** @samp{PRINT} are never executed. However, this is the output of running the above program ! as compiled by @code{g77} on a Linux ix86 system: @smallexample --- 5979,5983 ---- @samp{PRINT} are never executed. However, this is the output of running the above program ! as compiled by @code{g77} on a GNU/Linux ix86 system: @smallexample *************** it has 30 iterations. *** 5423,5427 **** This trip count of 30 is correct when evaluated using the floating-point representations for the @var{begin}, ! @var{end}, and @var{incr} values (.1, .31, .007) on Linux ix86 are used. On other systems, an apparently more accurate trip count --- 6000,6004 ---- This trip count of 30 is correct when evaluated using the floating-point representations for the @var{begin}, ! @var{end}, and @var{incr} values (.1, .31, .007) on GNU/Linux ix86 are used. On other systems, an apparently more accurate trip count *************** This section describes known problems th *** 5626,5630 **** Most of these are not GNU Fortran bugs per se---if they were, we would fix them. ! But the result for a user may be like the result of a bug. Some of these problems are due to bugs in other software, some are --- 6203,6207 ---- Most of these are not GNU Fortran bugs per se---if they were, we would fix them. ! But the result for a user might be like the result of a bug. Some of these problems are due to bugs in other software, some are *************** might be @emph{thought} to indicate bugs *** 5687,5691 **** @cindex ld errors @cindex errors, linker ! On some older Linux systems, programs with common blocks larger than 16MB cannot be linked without some kind of error message being produced. --- 6264,6268 ---- @cindex ld errors @cindex errors, linker ! On some older GNU/Linux systems, programs with common blocks larger than 16MB cannot be linked without some kind of error message being produced. *************** Inadequate investigation as of the relea *** 5702,5706 **** 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 @samp{COMPLEX*16} dummy array, on at least some Linux machines, plus some others. --- 6279,6283 ---- 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 @samp{COMPLEX*16} dummy array, on at least some GNU/Linux machines, plus some others. *************** quietly accept. *** 5803,5806 **** --- 6380,6473 ---- Some of these conversions are accepted by @code{g77} when the @samp{-fugly} option is specified. + + @cindex stack overflow + @cindex segmentation violation + @item + @code{g77} code might fail at runtime (probably with a ``segmentation + violation'') due to overflowing the stack. + This happens most often on systems with an environment + that provides substantially more heap space (for use + when arbitrarily allocating and freeing memory) than stack + space. + + Often this can be cured by + increasing or removing your shell's limit on stack usage, typically + using @kbd{limit stacksize} (in @code{csh} and derivatives) or + @kbd{ulimit -s} (in @code{sh} and derivatives). + + Increasing the allowed stack size might, however, require + changing some operating system or system configuration parameters. + + You might be able to work around the problem by compiling with the + @samp{-fno-automatic} option to reduce stack usage, probably at the + expense of speed. + + @xref{Maximum Stackable Size}, for information on patching + @code{g77} to use different criteria for placing local + non-automatic variables and arrays on the stack. + + @cindex automatic arrays + @cindex arrays, automatic + However, if your program uses large automatic arrays + (for example, has declarations like @samp{REAL A(N)} where + @samp{A} is a local array and @samp{N} is a dummy or + @samp{COMMON} variable that can have a large value), + neither use of @samp{-fno-automatic}, + nor changing the cut-off point for @code{g77} for using the stack, + will solve the problem by changing the placement of these + large arrays, as they are @emph{necessarily} automatic. + + @code{g77} currently provides no means to specify that + automatic arrays are to be allocated on the heap instead + of the stack. + So, other than increasing the stack size, your best bet is to + change your source code to avoid large automatic arrays. + Methods for doing this currently are outside the scope of + this document. + + (@emph{Note:} If your system puts stack and heap space in the + same memory area, such that they are effectively combined, then + a stack overflow probably indicates a program that is either + simply too large for the system, or buggy.) + + @cindex segmentation violation + @cindex bus error + @cindex overwritten data + @cindex data, overwritten + @item + @code{g77} code might fail at runtime with ``segmentation violation'', + ``bus error'', or even something as subtle as a procedure call + overwriting a variable or array element that it is not supposed + to touch. + + These can be symptoms of a wide variety of actual bugs that + occurred earlier during the program's run, but manifested + themselves as @emph{visible} problems some time later. + + Overflowing the bounds of an array---usually by writing beyond + the end of it---is one of two kinds of bug that often occurs + in Fortran code. + + The other kind of bug is a mismatch between the actual arguments + passed to a procedure and the dummy arguments as declared by that + procedure. + + Both of these kinds of bugs, and some others as well, can be + difficult to track down, because the bug can change its behavior, + or even appear to not occur, when using a debugger. + + That is, these bugs can be quite sensitive to data, including + data representing the placement of other data in memory (that is, + pointers, such as the placement of stack frames in memory). + + Plans call for improving @code{g77} so that it can offer the + ability to catch and report some of these problems at compile, link, or + run time, such as by generating code to detect references to + beyond the bounds of an array, or checking for agreement between + calling and called procedures. + + In the meantime, finding and fixing the programming + bugs that lead to these behaviors is, ultimately, the user's + responsibility, as difficult as that task can sometimes be. @end itemize *************** for them. *** 5860,5864 **** @item @code{g77} rejects things other compilers accept, ! like @samp{INTRINSIC SIN,SIN}. As time permits in the future, some of these things that are easy for humans to read and write and unlikely to be intended to mean something --- 6527,6531 ---- @item @code{g77} rejects things other compilers accept, ! like @samp{INTRINSIC SQRT,SQRT}. As time permits in the future, some of these things that are easy for humans to read and write and unlikely to be intended to mean something *************** because it requires a great deal of work *** 5961,5964 **** --- 6628,6684 ---- replacing @code{libf2c}. + @cindex ENCODE statement + @cindex statements, ENCODE + @cindex DECODE statement + @cindex statements, DECODE + @item + @code{g77} doesn't support @samp{ENCODE} or @samp{DECODE}. + + These statements are best replaced by READ and WRITE statements + involving internal files (CHARACTER variables and arrays). + + For example, replace a code fragment like + + @example + INTEGER*1 LINE(80) + @dots{} + DECODE (80, 9000, LINE) A, B, C + @dots{} + 9000 FORMAT (1X, 3(F10.5)) + @end example + + with: + + @example + CHARACTER*80 LINE + @dots{} + READ (UNIT=LINE, FMT=9000) A, B, C + @dots{} + 9000 FORMAT (1X, 3(F10.5)) + @end example + + Similarly, replace a code fragment like + + @example + INTEGER*1 LINE(80) + @dots{} + ENCODE (80, 9000, LINE) A, B, C + @dots{} + 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) + @end example + + with: + + @example + CHARACTER*80 LINE + @dots{} + WRITE (UNIT=LINE, FMT=9000) A, B, C + @dots{} + 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) + @end example + + It is entirely possible that @samp{ENCODE} and @samp{DECODE} will + be supported by a future version of @code{g77}. + @cindex disposition of files @cindex OPEN statement *************** Supporting this requires a significant r *** 5999,6002 **** --- 6719,6749 ---- of @code{libf2c}. + @cindex RECURSIVE keyword + @cindex keywords, RECURSIVE + @cindex recursion, lack of + @cindex lack of recursion + @item + @code{g77} doesn't support the @samp{RECURSIVE} keyword that + F90 compilers do. + Nor does it provide any means for compiling procedures + designed to do recursion. + + @cindex automatic arrays + @cindex arrays, automatic + @item + Automatic arrays are always allocated on the stack. + For situations where the stack cannot be made large enough, + @code{g77} should offer a compiler option that specifies + allocation of automatic arrays in heap storage. + + @cindex threads + @cindex parallel processing + @item + 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 + processors). + A package such as PVM might help here. + @item Need option to suppress information messages (notes). *************** lines for free-form source as well as fi *** 6041,6044 **** --- 6788,6796 ---- various limits and diagnostics as appropriate. + @cindex array elements, in adjustable array bounds + @cindex function references, in adjustable array bounds + @cindex array bounds, adjustable + @cindex DIMENSION statement + @cindex statements, DIMENSION @item Support more general expressions to dimension *************** but that supports @samp{*} as the unit d *** 6053,6061 **** @item - Finish support for old-style @samp{PARAMETER} statement (like F77 - @samp{PARAMETER}, but type of destination is set from type of - source expression). - - @item Character-type selector/cases for @samp{SELECT CASE}. --- 6805,6808 ---- *************** For example, warn about cases like this: *** 6150,6155 **** @example DOUBLE PRECISION FOO ! PARAMETER (PI = 3.14159) ! FOO = PI * 3D0 @end example --- 6897,6902 ---- @example DOUBLE PRECISION FOO ! PARAMETER (TZPHI = 9.435784839284958) ! FOO = TZPHI * 3D0 @end example *************** provided in addition to the few utility *** 6219,6222 **** --- 6966,6996 ---- Much of this work has already been done, and is awaiting integration into @code{g77}. + + @cindex floating point exceptions + @cindex exceptions, floating point + @cindex FPE handling + @cindex NaN values + @item + The GCC backend and, consequently, @code{g77} currently provides no + control over whether or not floating point exceptions are trapped or + 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. + + Most systems provide some C-callable mechanism to change this; this can + be invoked at startup using GCC's @samp{constructor} attribute. + For example, just compiling and linking the following C with your + program will turn on exception trapping for the ``common'' exceptions + on an x86-based GNU system: + + @smallexample + #include + void __attribute__ ((constructor)) + trapfpe () @{ + (void) __setfpucw (_FPU_DEFAULT & + ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM)); + @} + @end smallexample @end itemize *************** These problems are perhaps regrettable, *** 6227,6238 **** way around them for now. ! @itemize @bullet ! @item @cindex IMPLICIT CHARACTER*(*) statement @cindex statements, IMPLICIT CHARACTER*(*) @code{g77} disallows @samp{IMPLICIT CHARACTER*(*)}. ! This is not standard-conforming, ! and there are some very good reasons for that. ! When I next remember any, I'll try to write them down. @cindex block data --- 7001,7019 ---- way around them for now. ! @menu ! * Limitation on Implicit Declarations:: No @samp{IMPLICIT CHARACTER*(*)}. ! * Multiple Definitions of External Names:: No doing both @samp{COMMON /FOO/} ! and @samp{SUBROUTINE FOO}. ! * Mangling of Names:: @samp{SUBROUTINE FOO} is given ! external name @samp{foo_}. ! @end menu ! @cindex IMPLICIT CHARACTER*(*) statement @cindex statements, IMPLICIT CHARACTER*(*) + @node Limitation on Implicit Declarations + @subsection Limitation on Implicit Declarations + @code{g77} disallows @samp{IMPLICIT CHARACTER*(*)}. ! This is not standard-conforming. @cindex block data *************** When I next remember any, I'll try to wr *** 6242,6246 **** @cindex statements, COMMON @cindex naming conflicts ! @item @code{g77} doesn't allow a common block and an external procedure or @samp{BLOCK DATA} to have the same name. --- 7023,7029 ---- @cindex statements, COMMON @cindex naming conflicts ! @node Multiple Definitions of External Names ! @subsection Multiple Definitions of External Names ! @code{g77} doesn't allow a common block and an external procedure or @samp{BLOCK DATA} to have the same name. *************** didn't have its name translated the same *** 6270,6274 **** worth.) ! @item The current external-interface design, which includes naming of external procedures, COMMON blocks, and the library interface, --- 7053,7064 ---- worth.) ! @cindex naming issues ! @cindex external names ! @cindex COMMON block names ! @cindex name space ! @cindex underscores ! @node Mangling of Names ! @subsection Mangling of Names in Source Code ! The current external-interface design, which includes naming of external procedures, COMMON blocks, and the library interface, *************** it fully controls, such as the Hurd, and *** 6283,6287 **** options for compatibility with existing systems and interoperability with popular existing compilers. - @end itemize @node Non-bugs --- 7073,7076 ---- *************** This section lists changes that people f *** 6291,6302 **** we do not make because we think GNU Fortran is better without them. ! @itemize @bullet @cindex backslash @cindex f77 support @cindex support, f77 ! @item ! @samp{-fno-backslash} should be the default, not @samp{-fbackslash}. ! First of all, you can always specify @samp{-fno-backslash} to turn off this processing. --- 7080,7109 ---- we do not make because we think GNU Fortran is better without them. ! @menu ! * Backslash in Constants:: Why @samp{'\\'} is a constant that ! is one, not two, characters long. ! * Context-Sensitive Constants:: Why @samp{9.435784839284958} is a ! single-precision (@samp{REAL}) constant, ! and might be interpreted as ! @samp{9.435785} or similar. ! * Equivalence Versus Equality:: Why @samp{.TRUE. .EQ. .TRUE.} won't work. ! * Context-Sensitive Intrinsicness:: Why @samp{CALL SQRT} won't work. ! * Initializing Before Specifying:: Why @samp{DATA VAR/1/} can't precede ! @samp{COMMON VAR}. ! * Order of Side Effects:: Why @samp{J = IFUNC() - IFUNC()} might ! not behave as expected. ! @end menu ! @cindex backslash @cindex f77 support @cindex support, f77 ! @node Backslash in Constants ! @subsection Backslash in Constants ! ! In the opinion of many experienced Fortran users, ! @samp{-fno-backslash} should be the default, not @samp{-fbackslash}, ! as currently set by @code{g77}. ! First of all, you can always specify @samp{-fno-backslash} to turn off this processing. *************** level, and the question became ``What wi *** 6329,6334 **** a replacement for @code{f77} to do, by default?'' Although at least one UNIX @code{f77} does not provide ! @samp{-fbackslash} as a default, it appears that, by far, ! the majority of them do, which suggests that, by far, the majority of code that is compiled by UNIX @code{f77} compilers expects @samp{-fbackslash} to be the default. --- 7136,7141 ---- a replacement for @code{f77} to do, by default?'' Although at least one UNIX @code{f77} does not provide ! @samp{-fbackslash} as a default, it appears that ! the majority of them do, which suggests that the majority of code that is compiled by UNIX @code{f77} compilers expects @samp{-fbackslash} to be the default. *************** In this way, users can write programs wh *** 6409,6424 **** in many Fortran dialects. ! @item @code{g77} does not use context to determine the types of ! constants or named constants (@samp{PARAMETER}). For example, consider the following statement: @example ! PRINT *, 3.1415926535 * 2D0 @end example @code{g77} will interpret the (truncated) constant ! @samp{3.1415926535} as a @samp{REAL}, not @samp{DOUBLE PRECISION}, constant, because the suffix @samp{D0} is not specified. --- 7216,7236 ---- in many Fortran dialects. ! @cindex constants, context-sensitive ! @cindex context-sensitive constants ! @node Context-Sensitive Constants ! @subsection Context-Sensitive Constants ! @code{g77} does not use context to determine the types of ! constants or named constants (@samp{PARAMETER}), except ! for (non-standard) typeless constants such as @samp{'123'O}. For example, consider the following statement: @example ! PRINT *, 9.435784839284958 * 2D0 @end example @code{g77} will interpret the (truncated) constant ! @samp{9.435784839284958} as a @samp{REAL}, not @samp{DOUBLE PRECISION}, constant, because the suffix @samp{D0} is not specified. *************** interpret constants' types based on cont *** 6489,6493 **** could be very helpful. ! @item @code{g77} treats procedure references to @emph{possible} intrinsic names as always enabling their intrinsic nature, regardless of --- 7301,7374 ---- could be very helpful. ! @cindex .EQV., with integer operands ! @cindex comparing logical expressions ! @cindex logical expressions, comparing ! @node Equivalence Versus Equality ! @subsection Equivalence Versus Equality ! ! Use of @samp{.EQ.} and @samp{.NE.} on @samp{LOGICAL} operands ! is not supported, except via @samp{-fugly}, which is not ! recommended except for legacy code (where the behavior expected ! by the @emph{code} is assumed). ! ! Legacy code should be changed, as resources permit, to use @samp{.EQV.} ! and @samp{.NEQV.} instead, as these are permitted by the various ! Fortran standards. ! ! New code should never be written expecting @samp{.EQ.} or @samp{.NE.} ! to work if either of its operands is @samp{LOGICAL}. ! ! The problem with supporting this ``feature'' is that there is ! unlikely to be consensus on how it works, as illustrated by the ! following sample program: ! ! @example ! LOGICAL L,M,N ! DATA L,M,N /3*.FALSE./ ! IF (L.AND.M.EQ.N) PRINT *,'L.AND.M.EQ.N' ! END ! @end example ! ! The issue raised by the above sample program is, what is the ! precedence of @samp{.EQ.} (and @samp{.NE.}) when applied to ! @samp{LOGICAL} operands? ! ! Some programmers will argue that it is the same as the precedence ! for @samp{.EQ.} when applied to numeric (such as @samp{INTEGER}) ! operands. ! By this interpretation, the subexpression @samp{M.EQ.N} must be ! evaluated first in the above program, resulting in a program that, ! when run, does not execute the @samp{PRINT} statement. ! ! Other programmers will argue that the precedence is the same as ! the precedence for @samp{.EQV.}, which is restricted by the standards ! to @samp{LOGICAL} operands. ! By this interpretation, the subexpression @samp{L.AND.M} must be ! evaluated first, resulting in a program that @emph{does} execute ! the @samp{PRINT} statement. ! ! Assigning arbitrary semantic interpretations to syntactic expressions ! that might legitimately have more than one ``obvious'' interpretation ! is generally unwise. ! ! The creators of the various Fortran standards have done a good job ! in this case, requiring a distinct set of operators (which have their ! own distinct precedence) to compare @samp{LOGICAL} operands. ! This requirement results in expression syntax with more certain ! precedence (without requiring substantial context), making it easier ! for programmers to read existing code. ! @code{g77} will avoid muddying up elements of the Fortran language ! that were well-designed in the first place. ! ! (Ask C programmers about the precedence of expressions such as ! @samp{(a) & (b)} and @samp{(a) - (b)}---they cannot even tell ! you, without knowing more context, whether the @samp{&} and @samp{-} ! operators are infix (binary) or unary!) ! ! @cindex intrinsics, context-sensitive ! @cindex context-sensitive intrinsics ! @node Context-Sensitive Intrinsicness ! @subsection Context-Sensitive Intrinsicness ! @code{g77} treats procedure references to @emph{possible} intrinsic names as always enabling their intrinsic nature, regardless of *************** whether the @emph{form} of the reference *** 6495,6509 **** intrinsic. ! For example, @samp{CALL IFIX} is interpreted by @code{g77} first as ! a reference to the @samp{IFIX} intrinsic, because the reference ! is a procedure invocation (as compared to @samp{J=IFIX}); only ! after establishing that, in the program unit being compiled, ! @samp{IFIX} is in fact an intrinsic and not a local name that ! happens to have the same name as an intrinsic, does @code{g77} ! recognize that the form of the reference is invalid for that ! particular intrinsic. At that point, @code{g77} issues a diagnostic. ! Some users claim that it is ``obvious'' that @samp{CALL IFIX} references an external subroutine of their own, not an intrinsic function. --- 7376,7402 ---- intrinsic. ! For example, @samp{CALL SQRT} is interpreted by @code{g77} as ! an invalid reference to the @samp{SQRT} intrinsic function, ! because the reference is a subroutine invocation. ! ! First, @code{g77} recognizes the statement @samp{CALL SQRT} ! as a reference to a @emph{procedure} named @samp{SQRT}, not ! to a @emph{variable} with that name (as it would for a statement ! such as @samp{V = SQRT}). ! ! Next, @code{g77} establishes that, in the program unit being compiled, ! @samp{SQRT} is an intrinsic---not a subroutine that ! happens to have the same name as an intrinsic (as would be ! the case if, for example, @samp{EXTERNAL SQRT} was present). ! ! Finally, @code{g77} recognizes that the @emph{form} of the ! reference is invalid for that particular intrinsic. ! That is, it recognizes that it is invalid for an intrinsic ! @emph{function}, such as @samp{SQRT}, to be invoked as ! a @emph{subroutine}. ! At that point, @code{g77} issues a diagnostic. ! Some users claim that it is ``obvious'' that @samp{CALL SQRT} references an external subroutine of their own, not an intrinsic function. *************** rejects invocations of intrinsics with t *** 6519,6529 **** of arguments. ! Use the @samp{EXTERNAL IFIX} statement in a program unit that calls ! a user-written subroutine named @samp{IFIX}. ! @item ! Allow @samp{DATA VAR/.../} to come before @samp{COMMON /.../ ...,VAR,...}. ! It is @emph{possible} @code{g77} will someday allow this. Then again, maybe it is better to have --- 7412,7434 ---- of arguments. ! So, use the @samp{EXTERNAL SQRT} statement in a program unit that calls ! a user-written subroutine named @samp{SQRT}. ! @cindex initialization, statement placement ! @cindex placing initialization statements ! @node Initializing Before Specifying ! @subsection Initializing Before Specifying ! ! @code{g77} does not allow @samp{DATA VAR/1/} to appear in the ! source code before @samp{COMMON VAR}, ! @samp{DIMENSION VAR(10)}, @samp{INTEGER VAR}, and so on. ! In general, @code{g77} requires initialization of a variable ! or array to be specified @emph{after} all other specifications ! of attributes (type, size, placement, and so on) of that variable ! or array are specified (though @emph{confirmation} of data type is ! permitted). ! It is @emph{possible} @code{g77} will someday allow all of this, ! even though it is not allowed by the FORTRAN 77 standard. Then again, maybe it is better to have *************** to be in a @samp{COMMON} area following *** 6537,6545 **** and to do this it cannot be followed by @samp{COMMON A}. - @item - Making side effects happen in the same order as in some other compiler. - @cindex side effects, order of evaluation @cindex order of evaluation, side effects It is never safe to depend on the order of evaluation of side effects. For example, an expression like this may very well behave differently --- 7442,7456 ---- and to do this it cannot be followed by @samp{COMMON A}. @cindex side effects, order of evaluation @cindex order of evaluation, side effects + @node Order of Side Effects + @subsection Order of Side Effects + + @code{g77} does not necessarily produce code that, when run, performs + side effects (such as those performed by function invocations) + in the same order as in some other compiler---or even in the same + order as another version, port, or invocation (using different + command-line options) of @code{g77}. + It is never safe to depend on the order of evaluation of side effects. For example, an expression like this may very well behave differently *************** if the compiler optimizes away one or mo *** 6583,6587 **** function, operation of the program is unaffected (aside from being speeded up). - @end itemize @node Warnings and Errors --- 7494,7497 ---- *************** Please consider offering useful answers *** 6650,6680 **** @itemize @bullet @item - @code{g77} treats constants like @samp{Z'ABCD'} and @samp{'ABCD'Z} - as typeless. - It seems like maybe the prefix-letter form, @samp{Z'ABCD'}, should - be @samp{INTEGER} instead. - - You can test for yourself whether a particular compiler treats - the prefix form as @samp{INTEGER} or typeless by running the - following program: - - @smallexample - EQUIVALENCE (I, R) - R = Z'ABCD' - J = Z'ABCD' - IF (J .EQ. I) PRINT *, 'Prefix form is TYPELESS' - IF (J .NE. I) PRINT *, 'Prefix form is INTEGER' - END - @end smallexample - - If you wish to report the results of this test to the - maintainers of @code{g77}, please include full information - on the compiler, system, and version information you're - using. - (We already know how @code{g77} handles it, of course.) - - Perhaps this will be changed in version 0.6. - - @item @samp{LOC()} and other intrinsics are probably somewhat misclassified. Is the a need for more precise classification of intrinsics, and if so, --- 7560,7563 ---- *************** Reliable compilers never crash---they ju *** 6739,6744 **** @cindex assembly code, invalid @item ! If the compiler produces invalid assembly code, for any input whatever ! (except an @code{asm} statement), that is a compiler bug, unless the compiler reports errors (not just warnings) which would ordinarily prevent the assembler from being run. --- 7622,7628 ---- @cindex assembly code, invalid @item ! If the compiler produces invalid assembly code, for any input whatever, ! @c (except an @code{asm} statement), ! that is a compiler bug, unless the compiler reports errors (not just warnings) which would ordinarily prevent the assembler from being run. *************** This sometimes appears to work, but it h *** 6799,6803 **** crucial: a newsgroup posting does not contain a mail path back to the sender. ! Thus, if maintainers need more information, they may be unable to reach you. For this reason, you should always send bug reports by mail to the proper mailing list. --- 7683,7687 ---- crucial: a newsgroup posting does not contain a mail path back to the sender. ! Thus, if maintainers need more information, they might be unable to reach you. For this reason, you should always send bug reports by mail to the proper mailing list. *************** It is not necessary to replace the @samp *** 6929,6933 **** with the actual files in the version of the source file that you send, but it might make submitting the bug report easier ! on the ends. However, be sure to @emph{reproduce} the bug using the @emph{exact} version of the source material you submit, to avoid wild-goose --- 7813,7817 ---- with the actual files in the version of the source file that you send, but it might make submitting the bug report easier ! in the end. However, be sure to @emph{reproduce} the bug using the @emph{exact} version of the source material you submit, to avoid wild-goose *************** way to simplify an example is to delete *** 7073,7077 **** except the one where the bug occurs. Those earlier in the file may be replaced by external declarations if the crucial function depends on ! them. (Exception: inline functions may affect compilation of functions defined later in the file.) --- 7957,7961 ---- except the one where the bug occurs. Those earlier in the file may be replaced by external declarations if the crucial function depends on ! them. (Exception: inline functions might affect compilation of functions defined later in the file.) *************** help clarify its nature. *** 7272,7277 **** when compiling Fortran programs. They are accepted by @code{g77} and @code{gcc}, but ! they mean something only when these commands actually ! compile Fortran programs. @item --- 8156,8160 ---- when compiling Fortran programs. They are accepted by @code{g77} and @code{gcc}, but ! they apply only when compiling Fortran programs. @item *************** when compiling most any kind of program. *** 7282,7288 **** @emph{Fortran options} are listed in the file @file{gcc/f/lang-options.h}, ! which is used when during the build of @code{gcc} to build a list of all options that are accepted by ! at last one language's compiler. This list goes into the @samp{lang_options} array in @file{gcc/toplev.c}, which uses this array to --- 8165,8171 ---- @emph{Fortran options} are listed in the file @file{gcc/f/lang-options.h}, ! which is used during the build of @code{gcc} to build a list of all options that are accepted by ! at least one language's compiler. This list goes into the @samp{lang_options} array in @file{gcc/toplev.c}, which uses this array to *************** by calling @samp{lang_option_decode}, wh *** 7293,7297 **** calls @samp{ffe_decode_option}. ! Even if the linked-in front end ``rejects'' a particular option passed to it, @file{toplev.c} just ignores the option, because @emph{some} --- 8176,8180 ---- calls @samp{ffe_decode_option}. ! If the linked-in front end ``rejects'' a particular option passed to it, @file{toplev.c} just ignores the option, because @emph{some} *************** of each option. *** 7320,7328 **** The defaults for Fortran options are set in their global definitions, also found in @file{gcc/f/top.c}. ! Some of these defaults are actually macros defined in @file{gcc/f/target.h}, since they might be ! machine-specific, although, in practice, GNU compilers should behave the same way on all configurations ! (especially when it comes to language constructs). Accessor macros for Fortran options, used by code --- 8203,8215 ---- The defaults for Fortran options are set in their global definitions, also found in @file{gcc/f/top.c}. ! Many of these defaults are actually macros defined in @file{gcc/f/target.h}, since they might be ! machine-specific. ! However, since, in practice, GNU compilers should behave the same way on all configurations ! (especially when it comes to language constructs), ! the practice of setting defaults in @file{target.h} ! is likely to be deprecated and, ultimately, stopped ! in future versions of @code{g77}. Accessor macros for Fortran options, used by code diff -rcp2N g77-0.5.18/f/gbe/2.7.0.diff g77-0.5.19/f/gbe/2.7.0.diff *** g77-0.5.18/f/gbe/2.7.0.diff Mon Aug 28 13:19:15 1995 --- g77-0.5.19/f/gbe/2.7.0.diff Wed Dec 31 19:00:00 1969 *************** *** 1,70 **** - *** gcc-2.7.0/obstack.c Thu Jun 15 18:12:08 1995 - --- g77-2.7.0-0.5.16/obstack.c Thu Aug 10 04:06:51 1995 - *************** Foundation, 675 Mass Ave, Cambridge, MA - *** 27,33 **** - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - ! it is simpler to just do this in the source for each such file. */ - - ! #if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - - --- 27,40 ---- - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - ! it is simpler to just do this in the source for each such file. - - ! Actually, don't comment this code out after all. Else, unless the - ! inlining set up by obstack.h also is commented out (and replaced by - ! including the system's ), bugs will result on a system - ! with an older obstack (with older and different inlining) installed. - ! And for now it doesn't seem worth having obstack.h #include , - ! as above, just to get __GNU_LIBRARY__ defined, for example. */ - ! - ! #if defined (_LIBC) || !defined (__GNU_LIBRARY__) || 1 - - - *** gcc-2.7.0/stor-layout.c Thu Jun 15 08:08:47 1995 - --- g77-2.7.0-0.5.16/stor-layout.c Thu Aug 10 14:00:15 1995 - *************** get_pending_sizes () - *** 82,85 **** - --- 82,95 ---- - } - - + void - + put_pending_sizes (chain) - + tree chain; - + { - + if (pending_sizes) - + abort (); - + - + pending_sizes = chain; - + } - + - /* Given a size SIZE that may not be a constant, return a SAVE_EXPR - to serve as the actual size-expression for a type or decl. */ - *** gcc-2.7.0/tree.c Thu Jun 15 08:10:23 1995 - --- g77-2.7.0-0.5.16/tree.c Mon Aug 28 12:21:15 1995 - *************** save_expr (expr) - *** 2111,2115 **** - - if (TREE_CONSTANT (t) || (TREE_READONLY (t) && ! TREE_SIDE_EFFECTS (t)) - ! || TREE_CODE (t) == SAVE_EXPR) - return t; - - --- 2111,2115 ---- - - if (TREE_CONSTANT (t) || (TREE_READONLY (t) && ! TREE_SIDE_EFFECTS (t)) - ! || TREE_CODE (t) == SAVE_EXPR || TREE_CODE (t) == ERROR_MARK) - return t; - - *** gcc-2.7.0/tree.h Thu Jun 15 08:10:49 1995 - --- g77-2.7.0-0.5.16/tree.h Thu Aug 10 04:06:52 1995 - *************** extern tree size_int PROTO((unsigned H - *** 1290,1293 **** - --- 1290,1294 ---- - extern tree round_up PROTO((tree, int)); - extern tree get_pending_sizes PROTO((void)); - + extern void put_pending_sizes PROTO((tree)); - - /* Type for sizes of data-type. */ --- 0 ---- diff -rcp2N g77-0.5.18/f/gbe/2.7.1.diff g77-0.5.19/f/gbe/2.7.1.diff *** g77-0.5.18/f/gbe/2.7.1.diff Thu Mar 7 17:35:53 1996 --- g77-0.5.19/f/gbe/2.7.1.diff Wed Dec 31 19:00:00 1969 *************** *** 1,6 **** - 1996-03-07 - - This file would have been 124K long in the g77-0.5.18 distribution, - so, since 2.7.2.diff is available, this file has been omitted. - If you insist on using gcc-2.7.1 with g77-0.5.18, you should be - okay, except you won't get some of the nifty new optimizations. --- 0 ---- diff -rcp2N g77-0.5.18/f/gbe/2.7.2.1.diff g77-0.5.19/f/gbe/2.7.2.1.diff *** g77-0.5.18/f/gbe/2.7.2.1.diff Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/gbe/2.7.2.1.diff Tue Nov 26 12:55:31 1996 *************** *** 0 **** --- 1,246 ---- + 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.1 is obtained by users). Use the following + command sequence after applying this patch: + + cd gcc-2.7.2.1; make -f Makefile.in gcc.info + + If that fails due to `makeinfo' not being installed, obtain + texinfo-3.9.tar.gz from a GNU distribution site, unpack, + build, and install it, and try the above command sequence + again. + + + diff -rcp2N gcc-2.7.2.1/flags.h gcc-2.7.2.1.f.1/flags.h + *** gcc-2.7.2.1/flags.h Thu Jun 15 07:34:11 1995 + --- gcc-2.7.2.1.f.1/flags.h Mon Nov 11 15:02:26 1996 + *************** 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. */ + diff -rcp2N gcc-2.7.2.1/gcc.texi gcc-2.7.2.1.f.1/gcc.texi + *** gcc-2.7.2.1/gcc.texi Mon Nov 11 14:54:07 1996 + --- gcc-2.7.2.1.f.1/gcc.texi Mon Nov 11 15:04:26 1996 + *************** original English. + *** 149,152 **** + --- 149,153 ---- + @sp 3 + @center Last updated 29 June 1996 + + @center (Revised for GNU Fortran 1996-03-06) + @sp 1 + @c The version number appears twice more in this file. + diff -rcp2N gcc-2.7.2.1/invoke.texi gcc-2.7.2.1.f.1/invoke.texi + *** gcc-2.7.2.1/invoke.texi Tue Oct 3 11:40:43 1995 + --- gcc-2.7.2.1.f.1/invoke.texi Mon Nov 11 15:02:33 1996 + *************** 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 + *************** Perform the optimization of loop unrolli + *** 1940,1943 **** + --- 1941,1985 ---- + and usually makes programs run more slowly. @samp{-funroll-all-loops} + 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}). + + + + 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 + diff -rcp2N gcc-2.7.2.1/loop.c gcc-2.7.2.1.f.1/loop.c + *** gcc-2.7.2.1/loop.c Mon Nov 11 14:54:08 1996 + --- gcc-2.7.2.1.f.1/loop.c Mon Nov 11 15:02:33 1996 + *************** 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 + *************** strength_reduce (scan_start, end, loop_t + *** 3821,3826 **** + exit. */ + + ! if (v->lifetime * threshold * benefit < insn_count + ! && ! bl->reversed) + { + if (loop_dump_stream) + --- 3822,3827 ---- + exit. */ + + ! if ( ! flag_reduce_all_givs && v->lifetime * threshold * benefit < insn_count + ! && ! bl->reversed ) + { + if (loop_dump_stream) + diff -rcp2N gcc-2.7.2.1/toplev.c gcc-2.7.2.1.f.1/toplev.c + *** gcc-2.7.2.1/toplev.c Fri Oct 20 17:56:35 1995 + --- gcc-2.7.2.1.f.1/toplev.c Mon Nov 11 15:02:33 1996 + *************** 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. */ + *************** struct { char *string; int *variable; in + *** 542,545 **** + --- 556,562 ---- + {"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}, + *************** rest_of_compilation (decl) + *** 2894,2897 **** + --- 2911,2916 ---- + { + loop_optimize (insns, loop_dump_file); + + if (flag_rerun_loop_opt) + + loop_optimize (insns, loop_dump_file); + }); + } + diff -rcp2N gcc-2.7.2.1/tree.c gcc-2.7.2.1.f.1/tree.c + *** gcc-2.7.2.1/tree.c Sun Oct 1 21:26:56 1995 + --- gcc-2.7.2.1.f.1/tree.c Mon Nov 11 15:02:33 1996 + *************** saveable_tree_cons (purpose, value, chai + *** 1965,1968 **** + --- 1965,1992 ---- + } + + + /* Try to find out whether the type for which the size is to be determined + + is an ARRAY(of ARRAY(of ARRAY ... of something with a constant size + + which is an integral multiple of BITS_PER_UNIT)). + + In that case, the size in bytes can be determined using an EXACT_DIV_EXPR. + + */ + + enum tree_code + + which_div_expr(type) + + tree type; + + { + + tree t; + + + + if (TREE_CODE (type) != POINTER_TYPE && TREE_CODE (type) != ARRAY_TYPE) + + return CEIL_DIV_EXPR; + + + + for (t = TREE_TYPE (type); TREE_CODE (t) == ARRAY_TYPE; t = TREE_TYPE (t)) + + ; + + + + if (TYPE_SIZE (t) != 0 && TREE_CODE (TYPE_SIZE (t)) == INTEGER_CST && + + TREE_INT_CST_LOW (TYPE_SIZE (t)) % BITS_PER_UNIT == 0) + + return EXACT_DIV_EXPR; + + else + + return CEIL_DIV_EXPR; + + } + + + /* Return the size nominally occupied by an object of type TYPE + when it resides in memory. The value is measured in units of bytes, + *************** size_in_bytes (type) + *** 1985,1989 **** + return integer_zero_node; + } + ! t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), + size_int (BITS_PER_UNIT)); + if (TREE_CODE (t) == INTEGER_CST) + --- 2009,2013 ---- + return integer_zero_node; + } + ! t = size_binop (which_div_expr (type), TYPE_SIZE (type), + size_int (BITS_PER_UNIT)); + if (TREE_CODE (t) == INTEGER_CST) + *************** int_size_in_bytes (type) + *** 2009,2013 **** + if (TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0) + { + ! tree t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), + size_int (BITS_PER_UNIT)); + return TREE_INT_CST_LOW (t); + --- 2033,2037 ---- + if (TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0) + { + ! tree t = size_binop (which_div_expr (type), TYPE_SIZE (type), + size_int (BITS_PER_UNIT)); + return TREE_INT_CST_LOW (t); + diff -rcp2N gcc-2.7.2.1/version.c gcc-2.7.2.1.f.1/version.c + *** gcc-2.7.2.1/version.c Mon Nov 11 14:54:09 1996 + --- gcc-2.7.2.1.f.1/version.c Mon Nov 11 15:02:34 1996 + *************** + *** 1 **** + ! char *version_string = "2.7.2.1"; + --- 1 ---- + ! char *version_string = "2.7.2.1.f.1"; diff -rcp2N g77-0.5.18/f/gbe/README g77-0.5.19/f/gbe/README *** g77-0.5.18/f/gbe/README Sat Nov 18 20:14:52 1995 --- g77-0.5.19/f/gbe/README Sat Dec 7 05:53:49 1996 *************** *** 1,14 **** ! 951118 ! This directory contains .diff files for various GNU CC distributions. ! The name of a file tells which version to which it applies. Prior to ! gcc version 2.7.1, g77 will not build without the appropriate .diff ! file applied to the GNU CC distribution via patch. That is because ! g77 needs certain changes to be made to the GNU CC back end, which ! it shares with not only the C front end, but with other GNU front ! ends (C++, Objective-C, Pascal, ADA, Chill, ...) as well. Version ! 2.7.1 of gcc includes the changes needed by g77 versions through 0.5.17. ! Future versions of g77 might again require changes to versions 2.7.1, ! and later versions, of gcc. This distribution of g77 is not supported for versions of gcc prior --- 1,39 ---- ! 961207 ! 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.1.diff is the patch file for gcc version 2.7.2.1. ! ! To apply a .diff file to, say, gcc 2.7.2, 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 in this example): ! ! patch -p1 -d gcc-2.7.2 < gcc-2.7.2/f/gbe/2.7.2.diff ! ! ! This version of g77 is best combined with gcc versions 2.7.2 or 2.7.2.1. ! ! However, note that applying the patch for version 2.7.2.1 ! does _not_ update the gcc.info* files that constitute the Info ! documentation for gcc. Therefore, after applying the 2.7.2.1.diff ! patch to the gcc-2.7.2.1 source directory, you must rebuild the ! Info documentation yourself via: ! ! cd gcc-2.7.2.1; 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.9.tar.gz as of this ! writing), build, and install it, then try the above command (as ! makeinfo is part of texinfo). ! ! (The 2.7.2.1 patch omits the gcc.info* patches because your gcc-2.7.2.1 ! might have one of at least two different versions of these gcc.info* ! files, depending on how you obtained the gcc source directory -- by ! unpacking gcc-2.7.2.1.tar.gz directly, or by applying a patch to upgrade ! a copy of gcc-2.7.2.) This distribution of g77 is not supported for versions of gcc prior *************** to 2.6.2. The 2.6.3 patch file should w *** 16,33 **** you should probably use gcc-2.6.3 in any case if that is possible. - To apply a .diff file to, say, gcc 2.7.0, one might use the following - command: - - patch -p1 -d gcc-2.7.0 < gcc-2.7.0/f/gbe/2.7.0.diff - 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.6.4 or gcc-2.6.5 if these were released. On the other hand, it probably wouldn't work for ! a more major release like gcc-2.7.0 or gcc-3.0.0, and you shouldn't try it. If the .diff file is missing, don't bother asking `fortran@gnu.ai.mit.edu' for it -- it is certainly ! being worked on. In the meantime, watch the usual channels ! (see gcc/f/DOC *TROUBLE (BUGS, ETC.)*) for information on ! support for the new version of gcc. --- 41,53 ---- you should probably use gcc-2.6.3 in any case if that is possible. 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 `fortran@gnu.ai.mit.edu' for it -- it is certainly ! being worked on. In the meantime, watch the usual place ! (`info -f g77') for information on support for the recent ! versions of gcc. diff -rcp2N g77-0.5.18/f/install.texi g77-0.5.19/f/install.texi *** g77-0.5.18/f/install.texi Fri Mar 15 15:57:50 1996 --- g77-0.5.19/f/install.texi Sun Dec 1 18:47:42 1996 *************** *** 6,10 **** @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-03-15 @ifclear INSTALLONLY --- 6,10 ---- @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-12-01 @ifclear INSTALLONLY *************** build @code{g77}. *** 79,83 **** You can obtain an FSF distribution of @code{gcc} from the FSF. ! @item @file{g77-0.5.18.tar.gz} You probably have already unpacked this distribution, or you are reading an advanced copy of this manual, --- 79,83 ---- You can obtain an FSF distribution of @code{gcc} from the FSF. ! @item @file{g77-0.5.19.tar.gz} You probably have already unpacked this distribution, or you are reading an advanced copy of this manual, *************** the same way you obtained @code{gcc}. *** 91,95 **** For a complete @dfn{bootstrap} build, about 100MB of disk space is required for @code{g77} by the author's ! current Linux system. Some juggling can reduce the amount of space needed; --- 91,95 ---- For a complete @dfn{bootstrap} build, about 100MB of disk space is required for @code{g77} by the author's ! current GNU/Linux system. Some juggling can reduce the amount of space needed; *************** ways. *** 240,247 **** @item @code{g77} currently requires application of a patch file to the gcc compiler ! tree (at least up through gcc version 2.7.0). 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 --- 240,247 ---- @item @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 *************** used by the author of @code{g77} on his *** 347,351 **** @example /usr/FSF/gcc-2.7.2.tar.gz ! /usr/FSF/g77-0.5.18.tar.gz @end example --- 347,351 ---- @example /usr/FSF/gcc-2.7.2.tar.gz ! /usr/FSF/g77-0.5.19.tar.gz @end example *************** sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-2. *** 385,394 **** @set unpack-gcc 2 [Might say "Broken pipe"...that is normal on some systems.] ! sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-0.5.18.tar.gz | tar xf -} @set unpack-g77 3 ["Broken pipe" again possible.] sh[ 4]# @kbd{ln -s gcc-2.7.2 gcc} @set link-gcc 4 ! sh[ 5]# @kbd{ln -s g77-0.5.18 g77} @set link-g77 5 sh[ 6]# @kbd{mv -i g77/* gcc} --- 385,394 ---- @set unpack-gcc 2 [Might say "Broken pipe"...that is normal on some systems.] ! sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-0.5.19.tar.gz | tar xf -} @set unpack-g77 3 ["Broken pipe" again possible.] sh[ 4]# @kbd{ln -s gcc-2.7.2 gcc} @set link-gcc 4 ! sh[ 5]# @kbd{ln -s g77-0.5.19 g77} @set link-g77 5 sh[ 6]# @kbd{mv -i g77/* gcc} *************** installed version of @code{g77} and @cod *** 449,456 **** @c uncompressing @code{gzip} files. @c ! @c @item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-0.5.18.tar.gz | tar xf -} @item Step @value{link-gcc}: @kbd{ln -s gcc-2.7.2 gcc} ! @item Step @value{link-g77}: @kbd{ln -s g77-0.5.18 g77} These commands mainly help reduce typing, and help reduce visual clutter in examples --- 449,456 ---- @c uncompressing @code{gzip} files. @c ! @c @item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-0.5.19.tar.gz | tar xf -} @item Step @value{link-gcc}: @kbd{ln -s gcc-2.7.2 gcc} ! @item Step @value{link-g77}: @kbd{ln -s g77-0.5.19 g77} These commands mainly help reduce typing, and help reduce visual clutter in examples *************** other than the FSF. *** 463,467 **** @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-0.5.18} to remove the empty directory and the symbol link to it. But, it might be helpful to leave them around as --- 463,467 ---- @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-0.5.19} to remove the empty directory and the symbol link to it. But, it might be helpful to leave them around as *************** and @code{g77} is: *** 616,622 **** sh# @kbd{cd /usr/src} sh# @kbd{gunzip -d < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -} ! sh# @kbd{gunzip -d < /usr/FSF/g77-0.5.18.tar.gz | tar xf -} sh# @kbd{ln -s gcc-2.7.2 gcc} ! sh# @kbd{ln -s g77-0.5.18 g77} sh# @kbd{mv -i g77/* gcc} @end example --- 616,622 ---- sh# @kbd{cd /usr/src} sh# @kbd{gunzip -d < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -} ! sh# @kbd{gunzip -d < /usr/FSF/g77-0.5.19.tar.gz | tar xf -} sh# @kbd{ln -s gcc-2.7.2 gcc} ! sh# @kbd{ln -s g77-0.5.19 g77} sh# @kbd{mv -i g77/* gcc} @end example *************** or a release one that is newer than the *** 692,695 **** --- 692,706 ---- 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 *************** that is for the newest version of @code{ *** 729,733 **** @var{major} and @var{minor} fields, as this is likely to work. ! So, for example, if @code{g77} has support for 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 --- 740,745 ---- @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 *************** To remove these, after @kbd{cd gcc}, typ *** 787,799 **** @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 GBE function required specifically ! by @code{g77}. ! This function was added to @file{gcc-2.7.1}, making ! the patch file @file{g77-0.5.17/f/gbe/2.7.1.diff} empty of ! actual patches. ! ! For @file{gcc-2.7.0} and earlier, this configuration-time checking should catch failure to apply the correct patch and, ! if so caught, it should abort the configuration with an explanation. @emph{Please} do not try to disable the check, otherwise @code{g77} might well appear to build --- 799,807 ---- @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 *************** change to @file{gcc/f/proj.h}: edit the *** 929,932 **** --- 937,946 ---- @noindent by replacing the @samp{1} with @samp{0}. + Or, you can avoid editing the source by adding + @example + CFLAGS='-DFFEPROJ_STRTOUL=0 -g' + @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 @samp{strtoul()} provided *************** and can be enabled by editing a line sim *** 940,943 **** --- 954,958 ---- for @samp{strtoul()} above in @file{gcc/f/proj.h}, if your system libraries lack @samp{bsearch()}. + The method of overriding @samp{X_CFLAGS} may also be used. These are not problems with @code{g77}, which requires an *************** End of search list. *** 1266,1270 **** ./f771 /tmp/cca03648.i -quiet -dumpbase null.F -version @dots{} GNU F77 version 2.7.1 (80386, BSD syntax) compiled @dots{} ! GNU Fortran Front End version 0.5.18 compiled: @dots{} as -o /tmp/cca036481.o /tmp/cca03648.s ld -m i386linux -o /tmp/gfa03648 /usr/lib/crt0.o -L. @dots{} --- 1281,1285 ---- ./f771 /tmp/cca03648.i -quiet -dumpbase null.F -version @dots{} GNU F77 version 2.7.1 (80386, BSD syntax) compiled @dots{} ! GNU Fortran Front End version 0.5.19 compiled: @dots{} as -o /tmp/cca036481.o /tmp/cca03648.s ld -m i386linux -o /tmp/gfa03648 /usr/lib/crt0.o -L. @dots{} *************** Then, consider your target audience and *** 1466,1470 **** be installed. ! For systems like 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 --- 1481,1485 ---- 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 *************** be pertinent in future versions of @code *** 1622,1625 **** --- 1637,1642 ---- @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 *************** stack (which can improve run-time perfor *** 1630,1633 **** --- 1647,1656 ---- 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 *************** but rather generate correct code for the *** 1646,1650 **** 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/3.1415926535/}.) @node Large Initialization --- 1669,1673 ---- 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 *************** machine (such as an Alpha, which is a 64 *** 1701,1719 **** if it has a 64-bit operating system running on it). This is because @code{g77} is known to not work ! properly on such configurations, although the reasons ! for this are not fully explored. ! This is expected to be fixed at 0.6, at which point the warning would be dropped. - (The reason the unexplored problems are expected to be - fixed at 0.6 is because some known internal design - problems @code{g77} has, which reduce portability and - the ability to configure it as a cross-compiler, are - presumed to be at least partly responsible for the - problems being encountered on the Alpha. - The problems remain unexplored partly because the - known problems exist and are scheduled to be addressed - anyway. - Plus, the @code{g77} maintainer does not yet possess - an Alpha workstation of his own.) - --- 1724,1732 ---- if it has a 64-bit operating system running on it). This is because @code{g77} is known to not work ! properly on such configurations. ! This is expected to be completely fixed at 0.6, at which point the warning would be dropped. + (Version 0.5.20 is expected to solve most of these + problems, though, as of this writing, work is still + progressing in this area.) diff -rcp2N g77-0.5.18/f/intrin.c g77-0.5.19/f/intrin.c *** g77-0.5.18/f/intrin.c Mon Mar 25 21:07:55 1996 --- g77-0.5.19/f/intrin.c Tue Nov 5 22:21:51 1996 *************** ffeintrin_check_ (ffeintrinImp imp, ffeb *** 226,229 **** --- 226,231 ---- kind = *(argc++); if ((*argc == '&') + || (*argc == 'g') + || (*argc == 's') || (*argc == 'w') || (*argc == 'x')) *************** ffeintrin_check_ (ffeintrinImp imp, ffeb *** 377,380 **** --- 379,391 ---- break; + case 'g': + if ((ffebld_op (a) != FFEBLD_opLABTER) + && (ffebld_op (a) != FFEBLD_opLABTOK)) + okay = FALSE; + break; + + case 's': + break; + case 'w': case 'x': *************** ffeintrin_check_ (ffeintrinImp imp, ffeb *** 696,699 **** --- 707,712 ---- kind = *(argc++); if ((*argc == '&') + || (*argc == 'g') + || (*argc == 's') || (*argc == 'w') || (*argc == 'x')) *************** ffeintrin_check_ (ffeintrinImp imp, ffeb *** 866,869 **** --- 879,891 ---- break; + case 'g': + if ((ffebld_op (a) != FFEBLD_opLABTER) + && (ffebld_op (a) != FFEBLD_opLABTOK)) + okay = FALSE; + break; + + case 's': + break; + case 'w': case 'x': *************** ffeintrin_init_0 () *** 1453,1457 **** } if ((c[3] == '&') ! || (c[3] == 'w') || (c[3] == 'x')) ++c; --- 1475,1480 ---- } if ((c[3] == '&') ! || (c[3] == 's') ! || (c[3] == 'w') || (c[3] == 'x')) ++c; diff -rcp2N g77-0.5.18/f/intrin.def g77-0.5.19/f/intrin.def *** g77-0.5.18/f/intrin.def Fri Mar 15 02:02:54 1996 --- g77-0.5.19/f/intrin.def Tue Nov 5 22:21:51 1996 *************** DEFNAME ("FPRRSP", "fprrsp", "FPRRSp", g *** 150,153 **** --- 150,155 ---- DEFNAME ("FPSCAL", "fpscal", "FPScal", genFPSCAL, specNONE) /* F2C */ DEFNAME ("FRACTION", "fraction", "Fraction", genNONE, specFRACTION) /* F90 */ + DEFNAME ("FSEEK", "fseek", "FSeek", genNONE, specFSEEK) /* UNIX */ + DEFNAME ("FTELL", "ftell", "FTell", genNONE, specFTELL) /* UNIX */ DEFNAME ("GETARG", "getarg", "GetArg", genNONE, specGETARG) /* UNIX */ DEFNAME ("GETENV", "getenv", "GetEnv", genNONE, specGETENV) /* UNIX */ *************** DEFSPEC (FFEINTRIN_specFRACTION, *** 1268,1271 **** --- 1270,1285 ---- FFEINTRIN_impNONE ) + DEFSPEC (FFEINTRIN_specFSEEK, + "FSEEK", + FALSE, + FFEINTRIN_familyF2U, + FFEINTRIN_impFSEEK + ) + DEFSPEC (FFEINTRIN_specFTELL, + "FTELL", + FALSE, + FFEINTRIN_familyF2U, + FFEINTRIN_impFTELL + ) DEFSPEC (FFEINTRIN_specGETARG, "GETARG", *************** DEFSPEC (FFEINTRIN_specNONE, *** 2315,2318 **** --- 2329,2333 ---- 3 (INTEGER*2, LOGICAL*2) A Same as first argument + g GOTO label (alternate-return form of CALL) s Signal handler (INTEGER FUNCTION, SUBROUTINE or dummy/global default INTEGER variable) (arg-base-type * only) *************** DEFSPEC (FFEINTRIN_specNONE, *** 2320,2324 **** --- 2335,2342 ---- is: + (default) Arg is (scalar) variable or constant & Arg can have its address taken (LOC(), for example) + g GOTO label (alternate-return form of CALL) + s Signal handler (see ) w Arg is INTENT(OUT) x Arg is INTENT(INOUT) *************** DEFIMP (ERFC, "ERFC", ERFC, "R0:-:X=R *** 2482,2485 **** --- 2500,2505 ---- DEFIMP (EXIT, "EXIT", EXIT, "--:-:Status=?I0") DEFIMP (FLUSH, "FLUSH", FLUSH, "--:-:Unit=?I0") + DEFIMP (FSEEK, "FSEEK", FSEEK, "--:-:Unit=I0,Offset=I0,Whence=I0,ErrLab=?-gg") + DEFIMP (FTELL, "FTELL", FTELL, "I1:-:Unit=?I0") DEFIMP (GETARG, "GETARG", GETARG, "--:-:Pos=I0,Value=A1w") DEFIMP (GETENV, "GETENV", GETENV, "--:-:Name=A1,Value=A1w") *************** DEFIMP (NOT, "NOT", , "I0:*:I=I0") *** 2500,2504 **** DEFIMP (OR, "OR", , "B0:*:I=B0,J=B0") DEFIMP (RSHIFT, "RSHIFT", , "I0:1:I=I0,Shift=I0") ! DEFIMP (SIGNAL, "SIGNAL", , "--:-:Number=I0,Handler=-s") DEFIMP (SYSTEM, "SYSTEM", , "--:-:Command=A1,Status=?I1") DEFIMP (XOR, "XOR", , "B0:*:I=B0,J=B0") --- 2520,2524 ---- DEFIMP (OR, "OR", , "B0:*:I=B0,J=B0") DEFIMP (RSHIFT, "RSHIFT", , "I0:1:I=I0,Shift=I0") ! DEFIMP (SIGNAL, "SIGNAL", , "--:-:Number=I0,Handler=-ss") DEFIMP (SYSTEM, "SYSTEM", , "--:-:Command=A1,Status=?I1") DEFIMP (XOR, "XOR", , "B0:*:I=B0,J=B0") diff -rcp2N g77-0.5.18/f/lang-options.h g77-0.5.19/f/lang-options.h *** g77-0.5.18/f/lang-options.h Mon Mar 18 20:04:55 1996 --- g77-0.5.19/f/lang-options.h Fri Nov 8 17:50:51 1996 *************** the Free Software Foundation, 59 Temple *** 31,36 **** "-fnull-version", "-fset-g77-defaults", ! "-fident", ! "-fno-ident", "-ff90", "-fno-f90", --- 31,40 ---- "-fnull-version", "-fset-g77-defaults", ! /*"-fident",*/ ! /*"-fno-ident",*/ ! "-ff66", ! "-fno-f66", ! "-ff77", ! "-fno-f77", "-ff90", "-fno-f90", *************** the Free Software Foundation, 59 Temple *** 55,60 **** --- 59,70 ---- "-fugly-args", "-fno-ugly-args", + "-fugly-assumed", + "-fno-ugly-assumed", + "-fugly-comma", + "-fno-ugly-comma", "-fugly-init", "-fno-ugly-init", + "-fugly-logint", + "-fno-ugly-logint", "-fdebug", "-fno-debug", *************** the Free Software Foundation, 59 Temple *** 114,122 **** "-fzeros", "-fno-zeros", ! "-Wimplicit", ! "-Wno-implicit", "-Wsurprising", "-Wno-surprising", ! "-Wall", /* Prefix options. */ "-I", --- 124,140 ---- "-fzeros", "-fno-zeros", ! "-fdebug-kludge", ! "-fno-debug-kludge", ! "-fonetrip", ! "-fno-onetrip", ! "-fsilent", ! "-fno-silent", ! "-ftypeless-boz", ! "-fno-typeless-boz", ! /*"-Wimplicit",*/ ! /*"-Wno-implicit",*/ "-Wsurprising", "-Wno-surprising", ! /*"-Wall",*/ /* Prefix options. */ "-I", diff -rcp2N g77-0.5.18/f/lex.c g77-0.5.19/f/lex.c *** g77-0.5.18/f/lex.c Mon Dec 4 02:25:00 1995 --- g77-0.5.19/f/lex.c Wed Dec 4 13:08:18 1996 *************** the Free Software Foundation, 59 Temple *** 35,38 **** --- 35,45 ---- #endif + #ifdef DWARF_DEBUGGING_INFO + void dwarfout_resume_previous_source_file (register unsigned); + void dwarfout_start_new_source_file (register char *); + void dwarfout_define (register unsigned, register char *); + void dwarfout_undef (register unsigned, register char *); + #endif DWARF_DEBUGGING_INFO + static void ffelex_append_to_token_ (char c); static int ffelex_backslash_ (int c, ffewhereColumnNumber col); *************** ffelex_backslash_ (int c, ffewhereColumn *** 272,277 **** if (warn_traditional) { ! ffebad_start_msg ("The meaning of `\\x' (at %0) varies with -traditional", ! FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 279,284 ---- if (warn_traditional) { ! ffebad_start_msg_lex ("The meaning of `\\x' (at %0) varies with -traditional", ! FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_backslash_ (int c, ffewhereColumn *** 322,327 **** if (warn_traditional) { ! ffebad_start_msg ("The meaning of `\\a' (at %0) varies with -traditional", ! FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 329,334 ---- if (warn_traditional) { ! ffebad_start_msg_lex ("The meaning of `\\a' (at %0) varies with -traditional", ! FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_backslash_ (int c, ffewhereColumn *** 351,356 **** m[0] = c; m[1] = '\0'; ! ffebad_start_msg ("Non-ANSI-C-standard escape sequence `\\%A' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); --- 358,363 ---- m[0] = c; m[1] = '\0'; ! ffebad_start_msg_lex ("Non-ANSI-C-standard escape sequence `\\%A' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); *************** ffelex_backslash_ (int c, ffewhereColumn *** 369,374 **** m[0] = c; m[1] = '\0'; ! ffebad_start_msg ("Unknown escape sequence `\\%A' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); --- 376,381 ---- m[0] = c; m[1] = '\0'; ! ffebad_start_msg_lex ("Unknown escape sequence `\\%A' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); *************** ffelex_backslash_ (int c, ffewhereColumn *** 377,382 **** else if (c == EOF) { ! ffebad_start_msg ("Unterminated escape sequence `\\' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 384,389 ---- else if (c == EOF) { ! ffebad_start_msg_lex ("Unterminated escape sequence `\\' at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_backslash_ (int c, ffewhereColumn *** 387,392 **** sprintf (&m[0], "%x", c); ! ffebad_start_msg ("Unknown escape sequence `\\' followed by char code 0x%A at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); --- 394,399 ---- sprintf (&m[0], "%x", c); ! ffebad_start_msg_lex ("Unknown escape sequence `\\' followed by char code 0x%A at %0", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); *************** ffelex_backslash_ (int c, ffewhereColumn *** 422,427 **** if (! nonnull) { ! ffebad_start_msg ("\\x used at %0 with no following hex digits", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 429,434 ---- if (! nonnull) { ! ffebad_start_msg_lex ("\\x used at %0 with no following hex digits", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_backslash_ (int c, ffewhereColumn *** 435,440 **** <= (int) firstdig))) { ! ffebad_start_msg ("Hex escape at %0 out of range", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 442,447 ---- <= (int) firstdig))) { ! ffebad_start_msg_lex ("Hex escape at %0 out of range", ! FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_backslash_ (int c, ffewhereColumn *** 468,473 **** && code >= (1 << TYPE_PRECISION (char_type_node))) { ! ffebad_start_msg ("Escape sequence at %0 out of range for character", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); --- 475,480 ---- && code >= (1 << TYPE_PRECISION (char_type_node))) { ! ffebad_start_msg_lex ("Escape sequence at %0 out of range for character", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); *************** ffelex_image_char_ (int c, ffewhereColum *** 1408,1411 **** --- 1415,1419 ---- ffelex_bad_1_ (FFEBAD_LINE_TOO_LONG, ffelex_linecount_current_, column + 1); + column += 3; return column; } *************** ffelex_image_char_ (int c, ffewhereColum *** 1437,1444 **** strcpy (&ffelex_card_image_[column], "[\\0]"); ffelex_card_length_ = column + 4; ! ffebad_start_msg ("Null character at %0 -- line ignored", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, ffelex_linecount_current_, column + 1); ffebad_finish (); } break; --- 1445,1453 ---- strcpy (&ffelex_card_image_[column], "[\\0]"); ffelex_card_length_ = column + 4; ! ffebad_start_msg_lex ("Null character at %0 -- line ignored", ! FFEBAD_severityFATAL); ffelex_bad_here_ (0, ffelex_linecount_current_, column + 1); ffebad_finish (); + column += 4; } break; *************** ffelex_file_fixed (ffewhereFile wf, FILE *** 1936,1940 **** if (ffelex_bad_line_) ! goto comment_line; /* :::::::::::::::::::: */ /* If no tab, cut off line after column 72/132. */ --- 1945,1953 ---- if (ffelex_bad_line_) ! { ! ffelex_card_image_[column] = '\0'; ! ffelex_card_length_ = column; ! goto comment_line; /* :::::::::::::::::::: */ ! } /* If no tab, cut off line after column 72/132. */ *************** ffelex_file_free (ffewhereFile wf, FILE *** 3059,3063 **** if (ffelex_bad_line_) ! goto comment_line; /* :::::::::::::::::::: */ /* If no tab, cut off line after column 132. */ --- 3072,3080 ---- if (ffelex_bad_line_) ! { ! ffelex_card_image_[column] = '\0'; ! ffelex_card_length_ = column; ! goto comment_line; /* :::::::::::::::::::: */ ! } /* If no tab, cut off line after column 132. */ diff -rcp2N g77-0.5.18/f/news.texi g77-0.5.19/f/news.texi *** g77-0.5.18/f/news.texi Mon Apr 1 10:19:28 1996 --- g77-0.5.19/f/news.texi Tue Dec 3 12:28:13 1996 *************** *** 6,10 **** @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-04-01 @ifclear NEWSONLY --- 6,10 ---- @c in the G77 distribution, as well as in the G77 manual. ! @c 1996-12-03 @ifclear NEWSONLY *************** *** 14,17 **** --- 14,142 ---- @cindex versions, recent @cindex recent versions + @c [In 0.5.20?] + @c @item + @c New option @samp{--enable-libu77} for use by installers + @c at configuration time to indicate that a version of the + @c @samp{libU77} is present and to be built and installed + @c along with the rest of @samp{libf2c}. + + @heading In 0.5.19: + @itemize @bullet + @item + Fix @samp{FORMAT} statement parsing so negative values for + specifiers such as @samp{P} (e.g. @samp{FORMAT(-1PF8.1)}) + are correctly processed as negative. + + @item + Fix @samp{SIGNAL} intrinsic so it once again accepts a + procedure as its second argument. + + @item + A temporary kludge option provides bare-bones information on + @samp{COMMON} and @samp{EQUIVALENCE} members at debug time. + + @item + New @samp{-fonetrip} option specifies FORTRAN-66-style + one-trip @samp{DO} loops. + + @item + New @samp{-fno-silent} option causes names of program units + to be printed as they are compiled, in a fashion similar to + UNIX @samp{f77} and @samp{f2c}. + + @item + New @samp{-fugly-assumed} option specifies that arrays + dimensioned via @samp{DIMENSION X(1)}, for example, are to be + treated as assumed-size. + + @item + New @samp{-fno-typeless-boz} option specifies that non-decimal-radix + constants using the prefixed-radix form (such as @samp{Z'1234'}) + are to be interpreted as @samp{INTEGER} constants. + + @item + New @samp{-ff66} option is a ``shorthand'' option that specifies + behaviors considered appropriate for FORTRAN 66 programs. + + @item + New @samp{-ff77} option is a ``shorthand'' option that specifies + behaviors considered appropriate for UNIX @samp{f77} programs. + + @item + New @samp{-fugly-comma} and @samp{-fugly-logint} options provided + to perform some of what @samp{-fugly} used to do. + @samp{-fugly} and @samp{-fno-ugly} are now ``shorthand'' options, + in that they do nothing more than enable (or disable) other + @samp{-fugly-*} options. + + @item + Fix parsing of assignment statements involving targets that + are substrings of elements of @samp{CHARACTER} arrays having + names such as @samp{READ}, @samp{WRITE}, @samp{GOTO}, and + @samp{REALFUNCTIONFOO}. + + @item + Fix crashes involving diagnosed code. + + @item + Fix handling of local @samp{EQUIVALENCE} areas so certain cases + of valid Fortran programs are not misdiagnosed as improperly + extending the area backwards. + + @item + Support @code{gcc} version 2.7.2.1. + + @item + Upgrade to @code{libf2c} as of 1996-09-26, and + fix up some of the build procedures. + + @item + Change code generation for list-directed I/O so it allows + for new versions of @samp{libf2c} that might return non-zero + status codes for some operations previously assumed to always + return zero. + + This change not only affects how @samp{IOSTAT=} variables + are set by list-directed I/O, it also affects whether + @samp{END=} and @samp{ERR=} labels are reached by these + operations. + + @item + Add intrinsic support for new @samp{FTELL} and @samp{FSEEK} + procedures in @samp{libf2c}. + + @item + Modify @samp{fseek_()} in @samp{libf2c} to be more portable + (though, in practice, there might be no systems where this + matters) and to catch invalid @samp{whence} arguments. + + @item + Some useless warnings from the @samp{-Wunused} option have + been eliminated. + + @item + Fix a problem building the @samp{f771} executable + on AIX systems by linking with the @samp{-bbigtoc} option. + + @item + Abort configuration if @samp{gcc} has not been patched + using the patch file provided in the @samp{gcc/f/gbe/} + subdirectory. + + @item + Add options @samp{--help} and @samp{--version} to the + @code{g77} command, to conform to GNU coding guidelines. + Also add printing of @code{g77} version number when + the @samp{--verbose} (@samp{-v}) option is used. + + @item + Change internally generated name for local @samp{EQUIVALENCE} + areas to one based on the alphabetically sorted first name + in the list of names for entities placed at the beginning + of the areas. + + @item + Improvements to documentation and indexing. + @end itemize @heading In 0.5.18: *************** than default @samp{INTEGER}) must be rew *** 190,193 **** --- 315,321 ---- @item + Support @code{gcc} version 2.7.2. + + @item Upgrade to @code{libf2c} as of 1996-03-23, and fix up some of the build procedures. *************** Upgrade to @code{libf2c} as of 1995-11-1 *** 309,313 **** @item Fix a code-generation bug involving complicated @samp{EQUIVALENCE} statements ! not involving @samp{COMMON} @item --- 437,441 ---- @item Fix a code-generation bug involving complicated @samp{EQUIVALENCE} statements ! not involving @samp{COMMON}. @item diff -rcp2N g77-0.5.18/f/proj.h g77-0.5.19/f/proj.h *** g77-0.5.18/f/proj.h Mon Dec 4 01:13:31 1995 --- g77-0.5.19/f/proj.h Wed Nov 27 11:05:59 1996 *************** the Free Software Foundation, 59 Temple *** 26,30 **** #if !defined (__GNUC__) || (__GNUC__ < 2) ! #error You have to use gcc 2.x to build g77 (might be fixed in g77-0.6). #endif --- 26,30 ---- #if !defined (__GNUC__) || (__GNUC__ < 2) ! #error "You have to use gcc 2.x to build g77 (might be fixed in g77-0.6)." #endif diff -rcp2N g77-0.5.18/f/runtime/ChangeLog g77-0.5.19/f/runtime/ChangeLog *** g77-0.5.18/f/runtime/ChangeLog Mon Apr 1 10:11:56 1996 --- g77-0.5.19/f/runtime/ChangeLog Sun Dec 1 21:25:33 1996 *************** *** 1,2 **** --- 1,107 ---- + Sun Dec 1 21:25:27 1996 Craig Burley + + * configure: Regenerated using autoconf-2.12. + + Mon Nov 25 21:16:15 1996 Craig Burley + + * configure: Regenerated using autoconf-2.11. + + 1996-11-19 Dave Love + + * libI77/backspace.c: Include sys/types.h for size_t. + + Wed Nov 6 14:17:27 1996 Craig Burley + + * f2c.h.in: Properly comment out the unsupported stuff so + we don't get build-time errors. + + * libF77/Version.c, libI77/Version.c: Restore macro definition + of version information. + + * libI77/Makefile.in (OBJ): Add ftell_.o to list of objects. + + * libI77/uio.c (do_ud): Fix up casts in PAD_UDread case just + like they were fixed in the other case. + + Thu Oct 31 22:27:45 1996 Craig Burley + + * libI77/ftell_.c (fseek_): Map incoming whence argument to + system's actual SEEK_CUR, SEEK_SET, or SEEK_END macro for + fseek(), and crash (gracefully) if the argument is invalid. + + 1996-10-19 Dave Love + + * configure.in: Add check that we have the tools to cross-compile + if appropriate. + (NO_EOF_CHAR_CHECK,Skip_f2c_Undefs): Define. + + * libF77/Makefile.in (F90BIT): New routines from Netlib. + + * f2c.h.in: + Use more sanitary #error (indented for K&R compliance if necessary) if + f2c_i2 defined. + Sync with Netlib: Add `uninteger'. (Commented out) integer*8 stuff. + bit_{test,clear,set} macros. + + 1996-10-19 Dave Love + + Update to Netlib version of 1996-09-26. + + * libI77/Version.c: Use , not "stdio.h". + * libF77/Version.c: Likewise. + + Wed Aug 28 13:25:29 1996 Dave Love + + * libI77/rsne.c (x_rsne): Use size_t instead f int. + + * libI77/endfile.c (copy): Use size_t in place of int. + + Wed Aug 28 13:22:20 1996 Dave Love + + * libI77/backspace.c (f_back): Cast fread arg to size_t. + + Tue Aug 27 19:11:30 1996 Dave Love + + * libI77/Version.c: Supply */ to avoid apparent nested comment. + + Tue Aug 20 09:21:43 1996 Dave Love + + * libF77/Makefile.in (ALL_CFLAGS): Fix missing ../ for include. + * libI77/Makefile.in (ALL_CFLAGS): Likewise. + + Sat Aug 17 13:00:47 1996 Dave Love + + * (libF77/qbitshft.c, libF77/qbitbits.c, libF77/lbitshft.c, + libF77/lbitbits.c): New file from Netlib. qbit... not currently + compiled. + + Sun Jul 7 18:06:33 1996 Dave Love + + * libF77/z_sqrt.c, libF77/z_sin.c, libF77/z_exp.c, libF77/z_log.c, + libF77/system_.c, libF77/z_cos.c, libF77/signal_.c, + libF77/s_stop.c, libF77/sig_die.c, libF77/s_paus.c, + libF77/s_rnge.c, libF77/s_cat.c, libF77/r_tan.c, libF77/r_tanh.c, + libF77/r_sinh.c, libF77/r_sqrt.c, libF77/r_sin.c, libF77/r_mod.c, + libF77/r_nint.c, libF77/r_lg10.c, libF77/r_log.c, libF77/r_exp.c, + libF77/r_int.c, libF77/r_cosh.c, libF77/r_atn2.c, libF77/r_cos.c, + libF77/r_asin.c, libF77/r_atan.c, libF77/r_acos.c, + libF77/pow_dd.c, libF77/pow_zz.c, libF77/main.c, libF77/i_dnnt.c, + libF77/i_nint.c, libF77/h_dnnt.c, libF77/h_nint.c, libF77/exit.c, + libF77/d_tan.c, libF77/d_tanh.c, libF77/d_sqrt.c, libF77/d_sin.c, + libF77/d_sinh.c, libF77/d_mod.c, libF77/d_nint.c, libF77/d_log.c, + libF77/d_int.c, libF77/d_lg10.c, libF77/d_cosh.c, libF77/d_exp.c, + libF77/d_atn2.c, libF77/d_cos.c, libF77/d_atan.c, libF77/d_acos.c, + libF77/d_asin.c, libF77/c_sqrt.c, libF77/cabs.c, libF77/c_sin.c, + libF77/c_exp.c, libF77/c_log.c, libF77/c_cos.c, libF77/F77_aloc.c, + libF77/abort_.c, libI77/xwsne.c, libI77/wref.c, libI77/util.c, + libI77/uio.c, libI77/rsne.c, libI77/rdfmt.c, libI77/rawio.h, + libI77/open.c, libI77/lread.c, libI77/inquire.c, libI77/fio.h, + libI77/err.c, libI77/endfile.c, libI77/close.c: + Use #include <...>, not #include "..." for mkdeps + + Sat Jul 6 21:39:21 1996 Dave Love + + * libI77/ftell_.c: Added from Netlib distribution. + Sat Mar 30 20:57:24 1996 Dave Love diff -rcp2N g77-0.5.18/f/runtime/configure g77-0.5.19/f/runtime/configure *** g77-0.5.18/f/runtime/configure Mon Apr 1 10:21:20 1996 --- g77-0.5.19/f/runtime/configure Sun Dec 1 21:25:06 1996 *************** *** 2,6 **** # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.9 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # --- 2,6 ---- # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # *************** mandir='${prefix}/man' *** 50,53 **** --- 50,55 ---- subdirs= MFLAGS= MAKEFLAGS= + # Maximum number of lines to put in a shell here document. + ac_max_here_lines=12 ac_prev= *************** EOF *** 331,335 **** -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.9" exit 0 ;; --- 333,337 ---- -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.12" exit 0 ;; *************** done *** 433,441 **** # NLS nuisances. ! # Only set LANG and LC_ALL to C if already set. ! # These must not be set unconditionally because not all systems understand ! # e.g. LANG=C (notably SCO). ! if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. --- 435,446 ---- # NLS nuisances. ! # Only set these to C if already set. These must not be set unconditionally ! # because not all systems understand e.g. LANG=C (notably SCO). ! # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! ! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi + if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi + if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi + if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. *************** ac_cpp='$CPP $CPPFLAGS' *** 499,502 **** --- 504,508 ---- ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then *************** fi *** 521,524 **** --- 527,531 ---- set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:530: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** if test -z "$CC"; then *** 549,552 **** --- 556,560 ---- set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:559: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** fi *** 595,599 **** --- 603,647 ---- fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 + echo "configure:607: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no + fi + rm -fr conftest* + + echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 + if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 + echo "configure:641: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 + echo "configure:646: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 604,608 **** #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else --- 652,656 ---- #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else *************** fi *** 612,627 **** echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes ! if test "${CFLAGS+set}" != set; then ! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ! ac_cv_prog_gcc_g=yes else ! ac_cv_prog_gcc_g=no fi rm -f conftest* --- 660,679 ---- echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + if test $ac_cv_prog_gcc = yes; then GCC=yes ! ac_test_CFLAGS="${CFLAGS+set}" ! ac_save_CFLAGS="$CFLAGS" ! CFLAGS= ! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:670: checking whether ${CC-cc} accepts -g" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ! ac_cv_prog_cc_g=yes else ! ac_cv_prog_cc_g=no fi rm -f conftest* *************** rm -f conftest* *** 629,638 **** fi ! echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 ! if test $ac_cv_prog_gcc_g = yes; then ! CFLAGS="-g -O" ! else ! CFLAGS="-O" ! fi fi else --- 681,691 ---- fi ! echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then ! CFLAGS="-g -O2" ! else ! CFLAGS="-O2" fi else *************** else *** 656,659 **** --- 709,713 ---- set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:712: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** fi *** 686,690 **** --- 740,746 ---- + # Sanity check for the cross-compilation case: echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 + echo "configure:745: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then *************** else *** 701,705 **** # not just through cpp. cat > conftest.$ac_ext < --- 757,761 ---- # not just through cpp. cat > conftest.$ac_ext < *************** Syntax Error *** 707,711 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 763,767 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** if test -z "$ac_err"; then *** 713,720 **** else echo "$ac_err" >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < --- 769,778 ---- else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < *************** Syntax Error *** 722,726 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 780,784 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** if test -z "$ac_err"; then *** 728,731 **** --- 786,791 ---- else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp *************** fi *** 742,777 **** echo "$ac_t""$CPP" 1>&6 ! # If we cannot run a trivial program, we must be cross compiling. ! echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 ! if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! ac_cv_c_cross=yes ! else ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } ! if test -s conftest && (./conftest; exit) 2>/dev/null; then ! ac_cv_c_cross=no else ! ac_cv_c_cross=yes fi fi ! rm -fr conftest* fi - echo "$ac_t""$ac_cv_c_cross" 1>&6 - cross_compiling=$ac_cv_c_cross echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 802,851 ---- echo "$ac_t""$CPP" 1>&6 ! ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'` ! echo $ac_n "checking for stdio.h""... $ac_c" 1>&6 ! echo "configure:807: checking for stdio.h" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext < EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then ! rm -rf conftest* ! eval "ac_cv_header_$ac_safe=yes" else ! echo "$ac_err" >&5 ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_header_$ac_safe=no" fi + rm -f conftest* fi ! if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! : ! else ! echo "$ac_t""no" 1>&6 ! { echo "configure: error: Can't find stdio.h. ! You must have a usable C system for the target already installed, at least ! including headers and, preferably, the library, before you can configure ! the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c', ! then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; } fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 + echo "configure:845: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** else *** 781,785 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 855,859 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** if test -z "$ac_err"; then *** 788,791 **** --- 862,867 ---- else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no *************** if test $ac_cv_header_stdc = yes; then *** 796,800 **** # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < --- 872,876 ---- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < *************** if test $ac_cv_header_stdc = yes; then *** 814,818 **** # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < --- 890,894 ---- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < *************** if test "$cross_compiling" = yes; then *** 834,839 **** : else ! cat > conftest.$ac_ext < --- 910,915 ---- : else ! cat > conftest.$ac_ext < *************** exit (0); } *** 846,858 **** EOF ! { (eval echo configure:849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } ! if test -s conftest && (./conftest; exit) 2>/dev/null; then : else ac_cv_header_stdc=no fi - fi rm -fr conftest* fi fi --- 922,938 ---- EOF ! if { (eval echo configure:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi + + fi fi *************** fi *** 868,876 **** echo $ac_n "checking for posix""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_posix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 948,957 ---- echo $ac_n "checking for posix""... $ac_c" 1>&6 + echo "configure:951: checking for posix" >&5 if eval "test \"`echo '$''{'ac_cv_header_posix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** echo "$ac_t""$ac_cv_header_posix" 1>&6 *** 898,906 **** # header isn't actually like checking the functions, though... echo $ac_n "checking for GNU library""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_lib_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 979,988 ---- # header isn't actually like checking the functions, though... echo $ac_n "checking for GNU library""... $ac_c" 1>&6 + echo "configure:982: checking for GNU library" >&5 if eval "test \"`echo '$''{'ac_cv_lib_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** fi *** 924,939 **** echo "$ac_t""$ac_cv_lib_gnu" 1>&6 ! ac_safe=`echo "fcntl.h" | tr './\055' '___'` echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1006,1022 ---- echo "$ac_t""$ac_cv_lib_gnu" 1>&6 ! ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6 + echo "configure:1011: checking for fcntl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** if test -z "$ac_err"; then *** 942,945 **** --- 1025,1030 ---- else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" *************** fi *** 966,978 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 + echo "configure:1054: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* - fi --- 1105,1118 ---- ; return 0; } EOF ! if { (eval echo configure:1108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi *************** fi *** 1040,1056 **** echo $ac_n "checking for size_t""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "size_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes --- 1126,1144 ---- echo $ac_n "checking for size_t""... $ac_c" 1>&6 + echo "configure:1129: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include + #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes *************** fi *** 1072,1080 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 1160,1169 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 + echo "configure:1163: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** void (*signal ()) (); *** 1089,1106 **** #endif ! int main() { return 0; } ! int t() { int i; ; return 0; } EOF ! if { (eval echo configure:1097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* - fi --- 1178,1195 ---- #endif ! int main() { int i; ; return 0; } EOF ! if { (eval echo configure:1185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* fi *************** EOF *** 1114,1122 **** if test $ac_cv_header_stdc != yes; then echo $ac_n "checking for atexit""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 + echo "configure:1206: checking for atexit" >&5 if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char atexit(); ! int main() { return 0; } ! int t() { /* The GNU C library defines this for functions which it implements --- 1214,1222 ---- #include /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char atexit(); ! int main() { /* The GNU C library defines this for functions which it implements *************** atexit(); *** 1140,1153 **** ; return 0; } EOF ! if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_atexit=yes" else rm -rf conftest* eval "ac_cv_func_atexit=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then echo "$ac_t""yes" 1>&6 --- 1231,1246 ---- ; return 0; } EOF ! if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_atexit=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_atexit=no" fi rm -f conftest* fi + if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then echo "$ac_t""yes" 1>&6 *************** EOF *** 1163,1171 **** echo $ac_n "checking for onexit""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 + echo "configure:1259: checking for onexit" >&5 if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char onexit(); ! int main() { return 0; } ! int t() { /* The GNU C library defines this for functions which it implements --- 1267,1275 ---- #include /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char onexit(); ! int main() { /* The GNU C library defines this for functions which it implements *************** onexit(); *** 1189,1202 **** ; return 0; } EOF ! if { (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_onexit=yes" else rm -rf conftest* eval "ac_cv_func_onexit=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then echo "$ac_t""yes" 1>&6 --- 1284,1299 ---- ; return 0; } EOF ! if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_onexit=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_onexit=no" fi rm -f conftest* fi + if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then echo "$ac_t""yes" 1>&6 *************** else *** 1205,1213 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for on_exit""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 echo $ac_n "checking for on_exit""... $ac_c" 1>&6 + echo "configure:1305: checking for on_exit" >&5 if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char on_exit(); ! int main() { return 0; } ! int t() { /* The GNU C library defines this for functions which it implements --- 1313,1321 ---- #include /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char on_exit(); ! int main() { /* The GNU C library defines this for functions which it implements *************** on_exit(); *** 1231,1244 **** ; return 0; } EOF ! if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_on_exit=yes" else rm -rf conftest* eval "ac_cv_func_on_exit=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_func_'on_exit`\" = yes"; then echo "$ac_t""yes" 1>&6 --- 1330,1345 ---- ; return 0; } EOF ! if { (eval echo configure:1333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_on_exit=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_on_exit=no" fi rm -f conftest* fi + if eval "test \"`echo '$ac_cv_func_'on_exit`\" = yes"; then echo "$ac_t""yes" 1>&6 *************** fi *** 1260,1268 **** # This should always succeed on unix: echo $ac_n "checking for fstat""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 + echo "configure:1364: checking for fstat" >&5 if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ char fstat(); ! int main() { return 0; } ! int t() { /* The GNU C library defines this for functions which it implements --- 1372,1380 ---- #include /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char fstat(); ! int main() { /* The GNU C library defines this for functions which it implements *************** fstat(); *** 1286,1299 **** ; return 0; } EOF ! if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_fstat=yes" else rm -rf conftest* eval "ac_cv_func_fstat=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_func_'fstat`\" = yes"; then echo "$ac_t""yes" 1>&6 --- 1389,1404 ---- ; return 0; } EOF ! if { (eval echo configure:1392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_fstat=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_fstat=no" fi rm -f conftest* fi + if eval "test \"`echo '$ac_cv_func_'fstat`\" = yes"; then echo "$ac_t""yes" 1>&6 *************** fi *** 1309,1333 **** # This is necessary for e.g. Linux: echo $ac_n "checking for necessary members of struct FILE""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_struct_FILE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < ! int main() { return 0; } ! int t() { FILE s; s._ptr; s._base; s._flag; ; return 0; } EOF ! if { (eval echo configure:1324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_FILE=yes else rm -rf conftest* ac_cv_struct_FILE=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_struct_FILE" 1>&6 --- 1414,1439 ---- # This is necessary for e.g. Linux: echo $ac_n "checking for necessary members of struct FILE""... $ac_c" 1>&6 + echo "configure:1417: checking for necessary members of struct FILE" >&5 if eval "test \"`echo '$''{'ac_cv_struct_FILE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < ! int main() { FILE s; s._ptr; s._base; s._flag; ; return 0; } EOF ! if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_FILE=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_FILE=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_struct_FILE" 1>&6 *************** EOF *** 1339,1344 **** fi ! echo $ac_n "checking for -lm""... $ac_c" 1>&6 ! ac_lib_var=`echo m_drem | tr '.-/+' '___p'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1445,1451 ---- fi ! echo $ac_n "checking for drem in -lm""... $ac_c" 1>&6 ! echo "configure:1449: checking for drem in -lm" >&5 ! ac_lib_var=`echo m'_'drem | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 1347,1364 **** LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" --- 1454,1474 ---- LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" *************** fi *** 1385,1393 **** # we're posix-conformant, so always do the test. echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6 if test "$cross_compiling" = yes; then ac_cv_sys_sprintf_ansi=no else ! cat > conftest.$ac_ext < --- 1495,1504 ---- # we're posix-conformant, so always do the test. echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6 + echo "configure:1498: checking for ansi/posix sprintf result" >&5 if test "$cross_compiling" = yes; then ac_cv_sys_sprintf_ansi=no else ! cat > conftest.$ac_ext < *************** cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } ! if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_sys_sprintf_ansi=yes else ac_cv_sys_sprintf_ansi=no fi - fi rm -fr conftest* if eval "test \"`echo '$''{'ac_cv_sys_sprintf_ansi'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1507,1522 ---- EOF ! if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ac_cv_sys_sprintf_ansi=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_sys_sprintf_ansi=no fi rm -fr conftest* + fi + if eval "test \"`echo '$''{'ac_cv_sys_sprintf_ansi'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** fi *** 1424,1428 **** # define NON_ANSI_RW_MODES on unix (can't hurt) cat > conftest.$ac_ext < conftest.$ac_ext <&6 + echo "configure:1574: checking f2c integer type" >&5 late_ac_cpp=$ac_cpp ac_cpp="$late_ac_cpp -I$srcdir/.. -I../.. -I$srcdir/../.. -I$srcdir/../../config" *************** if eval "test \"`echo '$''{'ac_cv_sys_f2 *** 1462,1466 **** else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> confdefs.h <<\EOF + #define NO_EOF_CHAR_CHECK 1 + EOF + + + cat >> confdefs.h <<\EOF + #define Skip_f2c_Undefs 1 + EOF + + + *************** cat > confcache <<\EOF *** 1564,1572 **** # EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ ! >> confcache if cmp -s $cache_file confcache; then : --- 1692,1714 ---- # EOF + # The following way of writing the cache mishandles newlines in values, + # but we know of no workaround that is simple, portable, and efficient. + # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set) 2>&1` in ! *ac_space=\ *) ! # `set' does not quote correctly, so add quotes (double-quote substitution ! # turns \\\\ into \\, and sed turns \\ into \). ! sed -n \ ! -e "s/'/'\\\\''/g" \ ! -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ! ;; ! *) ! # `set' quotes correctly as required by POSIX, so do not add quotes. ! sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ! ;; ! esac >> confcache if cmp -s $cache_file confcache; then : *************** do *** 1635,1639 **** exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.9" exit 0 ;; -help | --help | --hel | --he | --h) --- 1777,1781 ---- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) *************** s%@CROSS@%$CROSS%g *** 1685,1688 **** --- 1827,1866 ---- CEOF EOF + + cat >> $CONFIG_STATUS <<\EOF + + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. + ac_file=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_cmds # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds="" + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then ! # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in ! *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac ! # Adjust relative srcdir, etc. for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. --- 1869,1880 ---- cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then ! # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in ! *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac ! # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. *************** for ac_file in .. $CONFIG_FILES; do if t *** 1722,1725 **** --- 1900,1904 ---- esac + echo creating "$ac_file" rm -f "$ac_file" *************** for ac_file in .. $CONFIG_FILES; do if t *** 1730,1742 **** *) ac_comsub= ;; esac sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g ! " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done ! rm -f conftest.subs exit 0 --- 1909,1927 ---- *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g ! " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done ! rm -f conftest.s* + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 *************** chmod +x $CONFIG_STATUS *** 1745,1748 **** --- 1930,1934 ---- rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff -rcp2N g77-0.5.18/f/runtime/configure.in g77-0.5.19/f/runtime/configure.in *** g77-0.5.18/f/runtime/configure.in Mon Apr 1 10:10:48 1996 --- g77-0.5.19/f/runtime/configure.in Thu Oct 31 21:04:08 1996 *************** dnl Checks for libraries. *** 54,57 **** --- 54,65 ---- dnl Checks for header files. + # Sanity check for the cross-compilation case: + AC_CHECK_HEADER(stdio.h,:, + [AC_MSG_ERROR([Can't find stdio.h. + You must have a usable C system for the target already installed, at least + including headers and, preferably, the library, before you can configure + the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c', + then the target library, then build with \`LANGUAGES=f77'.])]) + AC_HEADER_STDC dnl We could do this if we didn't know we were using gcc *************** fi *** 117,121 **** # This should always succeed on unix: - dnl Unfortunately, the mesage implies we're just checking for -lm... AC_CHECK_FUNC(fstat,,AC_DEFINE(NON_UNIX_STDIO)) # This is necessary for e.g. Linux: --- 125,128 ---- *************** fi *** 131,134 **** --- 138,142 ---- dnl perhaps should check also for remainder + dnl Unfortunately, the message implies we're just checking for -lm... AC_CHECK_LIB(m,drem,AC_DEFINE(IEEE_drem)) *************** dnl maybe check for drem/remainder *** 230,233 **** --- 238,247 ---- AC_SUBST(CROSS) + + # This EOF_CHAR is a misfeature on unix. + AC_DEFINE(NO_EOF_CHAR_CHECK) + + AC_DEFINE(Skip_f2c_Undefs) + dnl Craig had these in f2c.h, but they're only relevant for building libf2c dnl anyway. *************** dnl * change unit preconnexion in libI77 *** 273,274 **** --- 287,294 ---- dnl * -DALWAYS_FLUSH in libI77 dnl * -DOMIT_BLANK_CC in libI77 + + dnl Local Variables: + dnl comment-start: "dnl " + dnl comment-end: "" + dnl comment-start-skip: "\\bdnl\\b\\s *" + dnl End: diff -rcp2N g77-0.5.18/f/runtime/f2c.h.in g77-0.5.19/f/runtime/f2c.h.in *** g77-0.5.18/f/runtime/f2c.h.in Sat Mar 9 17:36:10 1996 --- g77-0.5.19/f/runtime/f2c.h.in Tue Nov 5 22:21:52 1996 *************** *** 11,14 **** --- 11,15 ---- /* 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 short int shortlogical; *** 21,24 **** --- 22,32 ---- typedef char logical1; typedef char integer1; + /* integer*8 support from f2c not currently supported: */ + #if 0 + typedef @F2C_LONGINT@ /* long long */ longint; /* system-dependent */ + typedef unsigned @F2C_LONGINT@ ulongint; /* system-dependent */ + #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) + #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) + #endif typedef long long int longint; *************** typedef long long int longint; *** 34,38 **** #ifdef f2c_i2 ! WARNING: will not work with g77!!!! (This line is intended to kill compiles.) /* for -i2 */ typedef short flag; --- 42,46 ---- #ifdef f2c_i2 ! #error f2c_i2 will not work with g77!!!! /* for -i2 */ typedef short flag; *************** union Multitype { /* for multiple entry *** 135,139 **** typedef union Multitype Multitype; ! typedef long Long; /* No longer used; formerly in Namelist */ struct Vardesc { /* for Namelist */ --- 143,147 ---- typedef union Multitype Multitype; ! /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ struct Vardesc { /* for Namelist */ *************** typedef struct Namelist Namelist; *** 158,161 **** --- 166,172 ---- #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++ */ diff -rcp2N g77-0.5.18/f/runtime/libF77/F77_aloc.c g77-0.5.19/f/runtime/libF77/F77_aloc.c *** g77-0.5.18/f/runtime/libF77/F77_aloc.c Wed Aug 30 14:27:17 1995 --- g77-0.5.19/f/runtime/libF77/F77_aloc.c Thu Oct 31 05:34:26 1996 *************** *** 3,7 **** #undef min #undef max ! #include "stdio.h" static integer memfailure = 3; --- 3,7 ---- #undef min #undef max ! #include static integer memfailure = 3; *************** extern void exit_(); *** 14,18 **** F77_aloc(Len, whence) integer Len; char *whence; #else ! #include "stdlib.h" extern void exit_(integer*); --- 14,18 ---- F77_aloc(Len, whence) integer Len; char *whence; #else ! #include extern void exit_(integer*); *************** F77_aloc(integer Len, char *whence) *** 24,28 **** unsigned int uLen = (unsigned int) Len; /* for K&R C */ ! if (!(rv = malloc(uLen))) { fprintf(stderr, "malloc(%u) failure in %s\n", uLen, whence); --- 24,28 ---- unsigned int uLen = (unsigned int) Len; /* for K&R C */ ! if (!(rv = (char*)malloc(uLen))) { fprintf(stderr, "malloc(%u) failure in %s\n", uLen, whence); diff -rcp2N g77-0.5.18/f/runtime/libF77/Makefile.in g77-0.5.19/f/runtime/libF77/Makefile.in *** g77-0.5.18/f/runtime/libF77/Makefile.in Mon Apr 1 10:10:47 1996 --- g77-0.5.19/f/runtime/libF77/Makefile.in Thu Oct 31 05:34:26 1996 *************** *** 2,6 **** # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995 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 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # *************** CGFLAGS = -g0 *** 39,43 **** # 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$(srcdir) -I../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc --- 39,43 ---- # 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$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc *************** CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge. *** 76,79 **** --- 76,80 ---- EFL = ef1asc_.o ef1cmc_.o CHAR = s_cat.o s_cmp.o s_copy.o + F90BIT = lbitbits.o lbitshft.o lib = ../../../libf2c.a *************** clean: *** 109,113 **** # Not quite all these actually do depend on f2c.h... $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ ! $(HALF) $(CMP) $(EFL) $(CHAR): $(F2C_H) force: --- 110,114 ---- # Not quite all these actually do depend on f2c.h... $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ ! $(HALF) $(CMP) $(EFL) $(CHAR): $(F2C_H) $(F90BIT) force: diff -rcp2N g77-0.5.18/f/runtime/libF77/README g77-0.5.19/f/runtime/libF77/README *** g77-0.5.18/f/runtime/libF77/README Mon Mar 25 20:39:33 1996 --- g77-0.5.19/f/runtime/libF77/README Thu Oct 31 05:34:26 1996 *************** external Fortran routines. *** 88,95 **** this can be done). ! The makefile does not attempt to compile pow_qq.c, which is meant ! for use with INTEGER*8. To use it, you must modify f2c.h to ! declare longint appropriately; then add pow_qq.o to the POW = ! line in the makefile. Following Fortran 90, s_cat.c and s_copy.c allow the target of a --- 88,96 ---- this can be done). ! The makefile does not attempt to compile pow_qq.c, qbitbits.c, ! and qbitshft.c, which are meant for use with INTEGER*8. To use ! INTEGER*8, you must modify f2c.h to declare longint and ulongint ! appropriately; then add pow_qq.o to the POW = line in the makefile, ! and add " qbitbits.o qbitshft.o" to the makefile's F90BIT = line. Following Fortran 90, s_cat.c and s_copy.c allow the target of a diff -rcp2N g77-0.5.18/f/runtime/libF77/Version.c g77-0.5.19/f/runtime/libF77/Version.c *** g77-0.5.18/f/runtime/libF77/Version.c Mon Apr 1 10:14:42 1996 --- g77-0.5.19/f/runtime/libF77/Version.c Tue Nov 5 22:21:52 1996 *************** *** 1,8 **** ! static char junk[] = "\n@(#)LIBF77 VERSION 2.01 19 Mar. 1996\n"; /* */ ! char __G77_LIBF77_VERSION__[] = "0.5.18"; /* --- 1,8 ---- ! static char junk[] = "\n@(#)LIBF77 VERSION 19960619\n"; /* */ ! char __G77_LIBF77_VERSION__[] = "0.5.19"; /* *************** char __G77_LIBF77_VERSION__[] = "0.5.18" *** 46,52 **** 19 Dec. 1995: s_cat.c: fix bug when 2nd or later arg overlaps lhs. 19 Mar. 1996: s_cat.c: supply missing break after overlap detection. */ ! #include "stdio.h" void --- 46,54 ---- 19 Dec. 1995: s_cat.c: fix bug when 2nd or later arg overlaps lhs. 19 Mar. 1996: s_cat.c: supply missing break after overlap detection. + 13 May 1996: add [lq]bitbits.c and [lq]bitshft.c (f90 bit intrinsics). + 19 June 1996: add casts to unsigned in [lq]bitshft.c. */ ! #include void diff -rcp2N g77-0.5.18/f/runtime/libF77/abort_.c g77-0.5.19/f/runtime/libF77/abort_.c *** g77-0.5.18/f/runtime/libF77/abort_.c Fri Nov 18 16:24:18 1994 --- g77-0.5.19/f/runtime/libF77/abort_.c Thu Oct 31 05:34:26 1996 *************** *** 1,3 **** ! #include "stdio.h" #include "f2c.h" --- 1,3 ---- ! #include #include "f2c.h" diff -rcp2N g77-0.5.18/f/runtime/libF77/c_cos.c g77-0.5.19/f/runtime/libF77/c_cos.c *** g77-0.5.18/f/runtime/libF77/c_cos.c Fri Nov 18 16:24:20 1994 --- g77-0.5.19/f/runtime/libF77/c_cos.c Thu Oct 31 05:34:26 1996 *************** VOID c_cos(r, z) complex *r, *z; *** 7,11 **** #else #undef abs ! #include "math.h" void c_cos(complex *r, complex *z) --- 7,11 ---- #else #undef abs ! #include void c_cos(complex *r, complex *z) diff -rcp2N g77-0.5.18/f/runtime/libF77/c_exp.c g77-0.5.19/f/runtime/libF77/c_exp.c *** g77-0.5.18/f/runtime/libF77/c_exp.c Fri Nov 18 16:24:23 1994 --- g77-0.5.19/f/runtime/libF77/c_exp.c Thu Oct 31 05:34:26 1996 *************** extern double exp(), cos(), sin(); *** 7,11 **** #else #undef abs ! #include "math.h" void c_exp(complex *r, complex *z) --- 7,11 ---- #else #undef abs ! #include void c_exp(complex *r, complex *z) diff -rcp2N g77-0.5.18/f/runtime/libF77/c_log.c g77-0.5.19/f/runtime/libF77/c_log.c *** g77-0.5.18/f/runtime/libF77/c_log.c Fri Nov 18 16:24:24 1994 --- g77-0.5.19/f/runtime/libF77/c_log.c Thu Oct 31 05:34:43 1996 *************** VOID c_log(r, z) complex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" extern double f__cabs(double, double); --- 6,10 ---- #else #undef abs ! #include extern double f__cabs(double, double); diff -rcp2N g77-0.5.18/f/runtime/libF77/c_sin.c g77-0.5.19/f/runtime/libF77/c_sin.c *** g77-0.5.18/f/runtime/libF77/c_sin.c Fri Nov 18 16:24:25 1994 --- g77-0.5.19/f/runtime/libF77/c_sin.c Thu Oct 31 05:34:43 1996 *************** VOID c_sin(r, z) complex *r, *z; *** 7,11 **** #else #undef abs ! #include "math.h" void c_sin(complex *r, complex *z) --- 7,11 ---- #else #undef abs ! #include void c_sin(complex *r, complex *z) diff -rcp2N g77-0.5.18/f/runtime/libF77/c_sqrt.c g77-0.5.19/f/runtime/libF77/c_sqrt.c *** g77-0.5.18/f/runtime/libF77/c_sqrt.c Fri Nov 18 16:24:26 1994 --- g77-0.5.19/f/runtime/libF77/c_sqrt.c Thu Oct 31 05:34:43 1996 *************** VOID c_sqrt(r, z) complex *r, *z; *** 7,11 **** #else #undef abs ! #include "math.h" extern double f__cabs(double, double); --- 7,11 ---- #else #undef abs ! #include extern double f__cabs(double, double); diff -rcp2N g77-0.5.18/f/runtime/libF77/cabs.c g77-0.5.19/f/runtime/libF77/cabs.c *** g77-0.5.18/f/runtime/libF77/cabs.c Fri Nov 18 16:24:28 1994 --- g77-0.5.19/f/runtime/libF77/cabs.c Thu Oct 31 05:34:43 1996 *************** double f__cabs(real, imag) double real, *** 4,8 **** #else #undef abs ! #include "math.h" double f__cabs(double real, double imag) #endif --- 4,8 ---- #else #undef abs ! #include double f__cabs(double real, double imag) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_acos.c g77-0.5.19/f/runtime/libF77/d_acos.c *** g77-0.5.18/f/runtime/libF77/d_acos.c Fri Nov 18 16:24:30 1994 --- g77-0.5.19/f/runtime/libF77/d_acos.c Thu Oct 31 05:34:43 1996 *************** double d_acos(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_acos(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_acos(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_asin.c g77-0.5.19/f/runtime/libF77/d_asin.c *** g77-0.5.18/f/runtime/libF77/d_asin.c Fri Nov 18 16:24:31 1994 --- g77-0.5.19/f/runtime/libF77/d_asin.c Thu Oct 31 05:34:43 1996 *************** double d_asin(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_asin(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_asin(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_atan.c g77-0.5.19/f/runtime/libF77/d_atan.c *** g77-0.5.18/f/runtime/libF77/d_atan.c Fri Nov 18 16:24:32 1994 --- g77-0.5.19/f/runtime/libF77/d_atan.c Thu Oct 31 05:34:43 1996 *************** double d_atan(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_atan(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_atan(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_atn2.c g77-0.5.19/f/runtime/libF77/d_atn2.c *** g77-0.5.18/f/runtime/libF77/d_atn2.c Fri Nov 18 16:24:34 1994 --- g77-0.5.19/f/runtime/libF77/d_atn2.c Thu Oct 31 05:34:43 1996 *************** double d_atn2(x,y) doublereal *x, *y; *** 6,10 **** #else #undef abs ! #include "math.h" double d_atn2(doublereal *x, doublereal *y) #endif --- 6,10 ---- #else #undef abs ! #include double d_atn2(doublereal *x, doublereal *y) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_cos.c g77-0.5.19/f/runtime/libF77/d_cos.c *** g77-0.5.18/f/runtime/libF77/d_cos.c Fri Nov 18 16:24:36 1994 --- g77-0.5.19/f/runtime/libF77/d_cos.c Thu Oct 31 05:34:43 1996 *************** double d_cos(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_cos(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_cos(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_cosh.c g77-0.5.19/f/runtime/libF77/d_cosh.c *** g77-0.5.18/f/runtime/libF77/d_cosh.c Fri Nov 18 16:24:37 1994 --- g77-0.5.19/f/runtime/libF77/d_cosh.c Thu Oct 31 05:34:56 1996 *************** double d_cosh(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_cosh(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_cosh(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_exp.c g77-0.5.19/f/runtime/libF77/d_exp.c *** g77-0.5.18/f/runtime/libF77/d_exp.c Fri Nov 18 16:24:39 1994 --- g77-0.5.19/f/runtime/libF77/d_exp.c Thu Oct 31 05:34:56 1996 *************** double d_exp(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_exp(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_exp(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_int.c g77-0.5.19/f/runtime/libF77/d_int.c *** g77-0.5.18/f/runtime/libF77/d_int.c Fri Nov 18 16:24:42 1994 --- g77-0.5.19/f/runtime/libF77/d_int.c Thu Oct 31 05:34:56 1996 *************** double d_int(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_int(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_int(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_lg10.c g77-0.5.19/f/runtime/libF77/d_lg10.c *** g77-0.5.18/f/runtime/libF77/d_lg10.c Fri Nov 18 16:24:43 1994 --- g77-0.5.19/f/runtime/libF77/d_lg10.c Thu Oct 31 05:34:56 1996 *************** double d_lg10(x) doublereal *x; *** 8,12 **** #else #undef abs ! #include "math.h" double d_lg10(doublereal *x) #endif --- 8,12 ---- #else #undef abs ! #include double d_lg10(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_log.c g77-0.5.19/f/runtime/libF77/d_log.c *** g77-0.5.18/f/runtime/libF77/d_log.c Fri Nov 18 16:24:44 1994 --- g77-0.5.19/f/runtime/libF77/d_log.c Thu Oct 31 05:34:56 1996 *************** double d_log(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_log(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_log(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_mod.c g77-0.5.19/f/runtime/libF77/d_mod.c *** g77-0.5.18/f/runtime/libF77/d_mod.c Fri Nov 18 16:24:46 1994 --- g77-0.5.19/f/runtime/libF77/d_mod.c Thu Oct 31 05:34:56 1996 *************** double drem(double, double); *** 13,17 **** #else #undef abs ! #include "math.h" #endif double d_mod(doublereal *x, doublereal *y) --- 13,17 ---- #else #undef abs ! #include #endif double d_mod(doublereal *x, doublereal *y) diff -rcp2N g77-0.5.18/f/runtime/libF77/d_nint.c g77-0.5.19/f/runtime/libF77/d_nint.c *** g77-0.5.18/f/runtime/libF77/d_nint.c Fri Nov 18 16:24:47 1994 --- g77-0.5.19/f/runtime/libF77/d_nint.c Thu Oct 31 05:34:56 1996 *************** double d_nint(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_nint(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_nint(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_sin.c g77-0.5.19/f/runtime/libF77/d_sin.c *** g77-0.5.18/f/runtime/libF77/d_sin.c Fri Nov 18 16:24:51 1994 --- g77-0.5.19/f/runtime/libF77/d_sin.c Thu Oct 31 05:34:57 1996 *************** double d_sin(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_sin(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_sin(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_sinh.c g77-0.5.19/f/runtime/libF77/d_sinh.c *** g77-0.5.18/f/runtime/libF77/d_sinh.c Fri Nov 18 16:24:52 1994 --- g77-0.5.19/f/runtime/libF77/d_sinh.c Thu Oct 31 05:34:57 1996 *************** double d_sinh(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_sinh(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_sinh(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_sqrt.c g77-0.5.19/f/runtime/libF77/d_sqrt.c *** g77-0.5.18/f/runtime/libF77/d_sqrt.c Fri Nov 18 16:24:53 1994 --- g77-0.5.19/f/runtime/libF77/d_sqrt.c Thu Oct 31 05:35:19 1996 *************** double d_sqrt(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_sqrt(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_sqrt(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_tan.c g77-0.5.19/f/runtime/libF77/d_tan.c *** g77-0.5.18/f/runtime/libF77/d_tan.c Fri Nov 18 16:24:54 1994 --- g77-0.5.19/f/runtime/libF77/d_tan.c Thu Oct 31 05:35:19 1996 *************** double d_tan(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_tan(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_tan(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/d_tanh.c g77-0.5.19/f/runtime/libF77/d_tanh.c *** g77-0.5.18/f/runtime/libF77/d_tanh.c Fri Nov 18 16:24:55 1994 --- g77-0.5.19/f/runtime/libF77/d_tanh.c Thu Oct 31 05:35:20 1996 *************** double d_tanh(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" double d_tanh(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include double d_tanh(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/exit.c g77-0.5.19/f/runtime/libF77/exit.c *** g77-0.5.18/f/runtime/libF77/exit.c Mon Aug 7 08:17:41 1995 --- g77-0.5.19/f/runtime/libF77/exit.c Thu Oct 31 05:35:20 1996 *************** *** 14,18 **** #undef max #ifndef KR_headers ! #include "stdlib.h" #ifdef __cplusplus extern "C" { --- 14,18 ---- #undef max #ifndef KR_headers ! #include #ifdef __cplusplus extern "C" { diff -rcp2N g77-0.5.18/f/runtime/libF77/f2ch.add g77-0.5.19/f/runtime/libF77/f2ch.add *** g77-0.5.18/f/runtime/libF77/f2ch.add Thu Jan 12 17:11:24 1995 --- g77-0.5.19/f/runtime/libF77/f2ch.add Thu Oct 31 05:35:20 1996 *************** extern integer s_wsue(cilist *); *** 151,155 **** extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); ! extern int system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); --- 151,155 ---- extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); ! extern integer system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); diff -rcp2N g77-0.5.18/f/runtime/libF77/h_dnnt.c g77-0.5.19/f/runtime/libF77/h_dnnt.c *** g77-0.5.18/f/runtime/libF77/h_dnnt.c Fri Nov 18 16:25:09 1994 --- g77-0.5.19/f/runtime/libF77/h_dnnt.c Thu Oct 31 05:35:20 1996 *************** shortint h_dnnt(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" shortint h_dnnt(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include shortint h_dnnt(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/h_nint.c g77-0.5.19/f/runtime/libF77/h_nint.c *** g77-0.5.18/f/runtime/libF77/h_nint.c Fri Nov 18 16:25:14 1994 --- g77-0.5.19/f/runtime/libF77/h_nint.c Thu Oct 31 05:35:20 1996 *************** shortint h_nint(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" shortint h_nint(real *x) #endif --- 6,10 ---- #else #undef abs ! #include shortint h_nint(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/i_dnnt.c g77-0.5.19/f/runtime/libF77/i_dnnt.c *** g77-0.5.18/f/runtime/libF77/i_dnnt.c Fri Nov 18 16:25:24 1994 --- g77-0.5.19/f/runtime/libF77/i_dnnt.c Thu Oct 31 05:35:20 1996 *************** integer i_dnnt(x) doublereal *x; *** 6,10 **** #else #undef abs ! #include "math.h" integer i_dnnt(doublereal *x) #endif --- 6,10 ---- #else #undef abs ! #include integer i_dnnt(doublereal *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/i_nint.c g77-0.5.19/f/runtime/libF77/i_nint.c *** g77-0.5.18/f/runtime/libF77/i_nint.c Fri Nov 18 16:25:29 1994 --- g77-0.5.19/f/runtime/libF77/i_nint.c Thu Oct 31 05:35:20 1996 *************** integer i_nint(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" integer i_nint(real *x) #endif --- 6,10 ---- #else #undef abs ! #include integer i_nint(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/lbitbits.c g77-0.5.19/f/runtime/libF77/lbitbits.c *** g77-0.5.18/f/runtime/libF77/lbitbits.c Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/runtime/libF77/lbitbits.c Thu Oct 31 05:35:46 1996 *************** *** 0 **** --- 1,62 ---- + #include "f2c.h" + + #ifndef LONGBITS + #define LONGBITS 32 + #endif + + integer + #ifdef KR_headers + lbit_bits(a, b, len) integer a, b, len; + #else + lbit_bits(integer a, integer b, integer len) + #endif + { + /* Assume 2's complement arithmetic */ + + unsigned long x, y; + + x = (unsigned long) a; + y = (unsigned long)-1L; + x >>= b; + y <<= len; + return (integer)(x & ~y); + } + + integer + #ifdef KR_headers + lbit_cshift(a, b, len) integer a, b, len; + #else + lbit_cshift(integer a, integer b, integer len) + #endif + { + unsigned long x, y, z; + + x = (unsigned long)a; + if (len <= 0) { + if (len == 0) + return 0; + goto full_len; + } + if (len >= LONGBITS) { + full_len: + if (b >= 0) { + b %= LONGBITS; + return (integer)(x << b | x >> LONGBITS -b ); + } + b = -b; + b %= LONGBITS; + return (integer)(x << LONGBITS - b | x >> b); + } + y = z = (unsigned long)-1; + y <<= len; + z &= ~y; + y &= x; + x &= z; + if (b >= 0) { + b %= len; + return (integer)(y | z & (x << b | x >> len - b)); + } + b = -b; + b %= len; + return (integer)(y | z & (x >> b | x << len - b)); + } diff -rcp2N g77-0.5.18/f/runtime/libF77/lbitshft.c g77-0.5.19/f/runtime/libF77/lbitshft.c *** g77-0.5.18/f/runtime/libF77/lbitshft.c Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/runtime/libF77/lbitshft.c Thu Oct 31 05:35:46 1996 *************** *** 0 **** --- 1,11 ---- + #include "f2c.h" + + integer + #ifdef KR_headers + lbit_shift(a, b) integer a; integer b; + #else + lbit_shift(integer a, integer b) + #endif + { + return b >= 0 ? a << b : (integer)((uinteger)a >> -b); + } diff -rcp2N g77-0.5.18/f/runtime/libF77/main.c g77-0.5.19/f/runtime/libF77/main.c *** g77-0.5.18/f/runtime/libF77/main.c Wed Aug 30 14:27:17 1995 --- g77-0.5.19/f/runtime/libF77/main.c Thu Oct 31 05:35:46 1996 *************** *** 1,6 **** /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */ ! #include "stdio.h" ! #include "signal.h" #ifndef SIGIOT --- 1,6 ---- /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */ ! #include ! #include #ifndef SIGIOT *************** *** 12,16 **** #ifndef KR_headers #undef VOID ! #include "stdlib.h" #endif --- 12,16 ---- #ifndef KR_headers #undef VOID ! #include #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/pow_dd.c g77-0.5.19/f/runtime/libF77/pow_dd.c *** g77-0.5.18/f/runtime/libF77/pow_dd.c Fri Nov 18 16:25:40 1994 --- g77-0.5.19/f/runtime/libF77/pow_dd.c Thu Oct 31 05:35:46 1996 *************** double pow_dd(ap, bp) doublereal *ap, *b *** 6,10 **** #else #undef abs ! #include "math.h" double pow_dd(doublereal *ap, doublereal *bp) #endif --- 6,10 ---- #else #undef abs ! #include double pow_dd(doublereal *ap, doublereal *bp) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/pow_zz.c g77-0.5.19/f/runtime/libF77/pow_zz.c *** g77-0.5.18/f/runtime/libF77/pow_zz.c Fri Nov 18 16:25:49 1994 --- g77-0.5.19/f/runtime/libF77/pow_zz.c Thu Oct 31 05:35:46 1996 *************** VOID pow_zz(r,a,b) doublecomplex *r, *a, *** 6,10 **** #else #undef abs ! #include "math.h" extern double f__cabs(double,double); void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) --- 6,10 ---- #else #undef abs ! #include extern double f__cabs(double,double); void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) diff -rcp2N g77-0.5.18/f/runtime/libF77/qbitbits.c g77-0.5.19/f/runtime/libF77/qbitbits.c *** g77-0.5.18/f/runtime/libF77/qbitbits.c Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/runtime/libF77/qbitbits.c Thu Oct 31 05:35:46 1996 *************** *** 0 **** --- 1,66 ---- + #include "f2c.h" + + #ifndef LONGBITS + #define LONGBITS 32 + #endif + + #ifndef LONG8BITS + #define LONG8BITS (2*LONGBITS) + #endif + + integer + #ifdef KR_headers + qbit_bits(a, b, len) longint a; integer b, len; + #else + qbit_bits(longint a, integer b, integer len) + #endif + { + /* Assume 2's complement arithmetic */ + + ulongint x, y; + + x = (ulongint) a; + y = (ulongint)-1L; + x >>= b; + y <<= len; + return (longint)(x & y); + } + + longint + #ifdef KR_headers + qbit_cshift(a, b, len) longint a; integer b, len; + #else + qbit_cshift(longint a, integer b, integer len) + #endif + { + ulongint x, y, z; + + x = (ulongint)a; + if (len <= 0) { + if (len == 0) + return 0; + goto full_len; + } + if (len >= LONG8BITS) { + full_len: + if (b >= 0) { + b %= LONG8BITS; + return (longint)(x << b | x >> LONG8BITS - b ); + } + b = -b; + b %= LONG8BITS; + return (longint)(x << LONG8BITS - b | x >> b); + } + y = z = (unsigned long)-1; + y <<= len; + z &= ~y; + y &= x; + x &= z; + if (b >= 0) { + b %= len; + return (longint)(y | z & (x << b | x >> len - b)); + } + b = -b; + b %= len; + return (longint)(y | z & (x >> b | x << len - b)); + } diff -rcp2N g77-0.5.18/f/runtime/libF77/qbitshft.c g77-0.5.19/f/runtime/libF77/qbitshft.c *** g77-0.5.18/f/runtime/libF77/qbitshft.c Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/runtime/libF77/qbitshft.c Thu Oct 31 05:35:46 1996 *************** *** 0 **** --- 1,11 ---- + #include "f2c.h" + + longint + #ifdef KR_headers + qbit_shift(a, b) longint a; integer b; + #else + qbit_shift(longint a, integer b) + #endif + { + return b >= 0 ? a << b : (longint)((ulongint)a >> -b); + } diff -rcp2N g77-0.5.18/f/runtime/libF77/r_acos.c g77-0.5.19/f/runtime/libF77/r_acos.c *** g77-0.5.18/f/runtime/libF77/r_acos.c Fri Nov 18 16:25:52 1994 --- g77-0.5.19/f/runtime/libF77/r_acos.c Thu Oct 31 05:35:47 1996 *************** double r_acos(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_acos(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_acos(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_asin.c g77-0.5.19/f/runtime/libF77/r_asin.c *** g77-0.5.18/f/runtime/libF77/r_asin.c Fri Nov 18 16:25:53 1994 --- g77-0.5.19/f/runtime/libF77/r_asin.c Thu Oct 31 05:36:13 1996 *************** double r_asin(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_asin(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_asin(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_atan.c g77-0.5.19/f/runtime/libF77/r_atan.c *** g77-0.5.18/f/runtime/libF77/r_atan.c Fri Nov 18 16:25:54 1994 --- g77-0.5.19/f/runtime/libF77/r_atan.c Thu Oct 31 05:36:13 1996 *************** double r_atan(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_atan(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_atan(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_atn2.c g77-0.5.19/f/runtime/libF77/r_atn2.c *** g77-0.5.18/f/runtime/libF77/r_atn2.c Fri Nov 18 16:25:55 1994 --- g77-0.5.19/f/runtime/libF77/r_atn2.c Thu Oct 31 05:36:13 1996 *************** double r_atn2(x,y) real *x, *y; *** 6,10 **** #else #undef abs ! #include "math.h" double r_atn2(real *x, real *y) #endif --- 6,10 ---- #else #undef abs ! #include double r_atn2(real *x, real *y) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_cos.c g77-0.5.19/f/runtime/libF77/r_cos.c *** g77-0.5.18/f/runtime/libF77/r_cos.c Fri Nov 18 16:25:58 1994 --- g77-0.5.19/f/runtime/libF77/r_cos.c Thu Oct 31 05:36:13 1996 *************** double r_cos(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_cos(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_cos(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_cosh.c g77-0.5.19/f/runtime/libF77/r_cosh.c *** g77-0.5.18/f/runtime/libF77/r_cosh.c Fri Nov 18 16:25:59 1994 --- g77-0.5.19/f/runtime/libF77/r_cosh.c Thu Oct 31 05:36:13 1996 *************** double r_cosh(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_cosh(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_cosh(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_exp.c g77-0.5.19/f/runtime/libF77/r_exp.c *** g77-0.5.18/f/runtime/libF77/r_exp.c Fri Nov 18 16:26:01 1994 --- g77-0.5.19/f/runtime/libF77/r_exp.c Thu Oct 31 05:36:13 1996 *************** double r_exp(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_exp(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_exp(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_int.c g77-0.5.19/f/runtime/libF77/r_int.c *** g77-0.5.18/f/runtime/libF77/r_int.c Fri Nov 18 16:26:04 1994 --- g77-0.5.19/f/runtime/libF77/r_int.c Thu Oct 31 05:36:13 1996 *************** double r_int(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_int(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_int(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_lg10.c g77-0.5.19/f/runtime/libF77/r_lg10.c *** g77-0.5.18/f/runtime/libF77/r_lg10.c Fri Nov 18 16:26:05 1994 --- g77-0.5.19/f/runtime/libF77/r_lg10.c Thu Oct 31 05:36:13 1996 *************** double r_lg10(x) real *x; *** 8,12 **** #else #undef abs ! #include "math.h" double r_lg10(real *x) #endif --- 8,12 ---- #else #undef abs ! #include double r_lg10(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_log.c g77-0.5.19/f/runtime/libF77/r_log.c *** g77-0.5.18/f/runtime/libF77/r_log.c Fri Nov 18 16:26:06 1994 --- g77-0.5.19/f/runtime/libF77/r_log.c Thu Oct 31 05:36:13 1996 *************** double r_log(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_log(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_log(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_mod.c g77-0.5.19/f/runtime/libF77/r_mod.c *** g77-0.5.18/f/runtime/libF77/r_mod.c Fri Nov 18 16:26:07 1994 --- g77-0.5.19/f/runtime/libF77/r_mod.c Thu Oct 31 05:36:35 1996 *************** double drem(double, double); *** 13,17 **** #else #undef abs ! #include "math.h" #endif double r_mod(real *x, real *y) --- 13,17 ---- #else #undef abs ! #include #endif double r_mod(real *x, real *y) diff -rcp2N g77-0.5.18/f/runtime/libF77/r_nint.c g77-0.5.19/f/runtime/libF77/r_nint.c *** g77-0.5.18/f/runtime/libF77/r_nint.c Fri Nov 18 16:26:08 1994 --- g77-0.5.19/f/runtime/libF77/r_nint.c Thu Oct 31 05:36:35 1996 *************** double r_nint(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_nint(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_nint(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_sin.c g77-0.5.19/f/runtime/libF77/r_sin.c *** g77-0.5.18/f/runtime/libF77/r_sin.c Fri Nov 18 16:26:11 1994 --- g77-0.5.19/f/runtime/libF77/r_sin.c Thu Oct 31 05:36:35 1996 *************** double r_sin(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_sin(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_sin(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_sinh.c g77-0.5.19/f/runtime/libF77/r_sinh.c *** g77-0.5.18/f/runtime/libF77/r_sinh.c Fri Nov 18 16:26:12 1994 --- g77-0.5.19/f/runtime/libF77/r_sinh.c Thu Oct 31 05:36:35 1996 *************** double r_sinh(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_sinh(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_sinh(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_sqrt.c g77-0.5.19/f/runtime/libF77/r_sqrt.c *** g77-0.5.18/f/runtime/libF77/r_sqrt.c Fri Nov 18 16:26:13 1994 --- g77-0.5.19/f/runtime/libF77/r_sqrt.c Thu Oct 31 05:36:35 1996 *************** double r_sqrt(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_sqrt(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_sqrt(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_tan.c g77-0.5.19/f/runtime/libF77/r_tan.c *** g77-0.5.18/f/runtime/libF77/r_tan.c Fri Nov 18 16:26:14 1994 --- g77-0.5.19/f/runtime/libF77/r_tan.c Thu Oct 31 05:36:36 1996 *************** double r_tan(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_tan(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_tan(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/r_tanh.c g77-0.5.19/f/runtime/libF77/r_tanh.c *** g77-0.5.18/f/runtime/libF77/r_tanh.c Fri Nov 18 16:26:15 1994 --- g77-0.5.19/f/runtime/libF77/r_tanh.c Thu Oct 31 05:36:36 1996 *************** double r_tanh(x) real *x; *** 6,10 **** #else #undef abs ! #include "math.h" double r_tanh(real *x) #endif --- 6,10 ---- #else #undef abs ! #include double r_tanh(real *x) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/s_cat.c g77-0.5.19/f/runtime/libF77/s_cat.c *** g77-0.5.18/f/runtime/libF77/s_cat.c Mon Mar 25 20:39:56 1996 --- g77-0.5.19/f/runtime/libF77/s_cat.c Thu Oct 31 05:36:36 1996 *************** *** 6,10 **** #include "f2c.h" #ifndef NO_OVERWRITE ! #include "stdio.h" #undef abs #ifdef KR_headers --- 6,10 ---- #include "f2c.h" #ifndef NO_OVERWRITE ! #include #undef abs #ifdef KR_headers *************** *** 13,20 **** extern void exit_(); #else ! #include "stdlib.h" extern char *F77_aloc(ftnlen, char*); #endif ! #include "string.h" #endif /* NO_OVERWRITE */ --- 13,20 ---- extern void exit_(); #else ! #include extern char *F77_aloc(ftnlen, char*); #endif ! #include #endif /* NO_OVERWRITE */ diff -rcp2N g77-0.5.18/f/runtime/libF77/s_paus.c g77-0.5.19/f/runtime/libF77/s_paus.c *** g77-0.5.18/f/runtime/libF77/s_paus.c Mon Oct 23 09:28:33 1995 --- g77-0.5.19/f/runtime/libF77/s_paus.c Thu Oct 31 05:36:36 1996 *************** *** 1,3 **** ! #include "stdio.h" #include "f2c.h" #define PAUSESIG 15 --- 1,3 ---- ! #include #include "f2c.h" #define PAUSESIG 15 *************** *** 12,17 **** #undef min #undef max ! #include "stdlib.h" ! #include "signal.h" #ifdef __cplusplus extern "C" { --- 12,17 ---- #undef min #undef max ! #include ! #include #ifdef __cplusplus extern "C" { diff -rcp2N g77-0.5.18/f/runtime/libF77/s_rnge.c g77-0.5.19/f/runtime/libF77/s_rnge.c *** g77-0.5.18/f/runtime/libF77/s_rnge.c Fri Nov 18 16:26:23 1994 --- g77-0.5.19/f/runtime/libF77/s_rnge.c Thu Oct 31 05:36:51 1996 *************** *** 1,3 **** ! #include "stdio.h" #include "f2c.h" --- 1,3 ---- ! #include #include "f2c.h" diff -rcp2N g77-0.5.18/f/runtime/libF77/s_stop.c g77-0.5.19/f/runtime/libF77/s_stop.c *** g77-0.5.18/f/runtime/libF77/s_stop.c Fri Nov 18 16:26:24 1994 --- g77-0.5.19/f/runtime/libF77/s_stop.c Thu Oct 31 05:36:52 1996 *************** *** 1,3 **** ! #include "stdio.h" #include "f2c.h" --- 1,3 ---- ! #include #include "f2c.h" *************** VOID s_stop(s, n) char *s; ftnlen n; *** 9,13 **** #undef min #undef max ! #include "stdlib.h" #ifdef __cplusplus extern "C" { --- 9,13 ---- #undef min #undef max ! #include #ifdef __cplusplus extern "C" { diff -rcp2N g77-0.5.18/f/runtime/libF77/sig_die.c g77-0.5.19/f/runtime/libF77/sig_die.c *** g77-0.5.18/f/runtime/libF77/sig_die.c Fri Nov 18 16:26:25 1994 --- g77-0.5.19/f/runtime/libF77/sig_die.c Thu Oct 31 05:36:52 1996 *************** *** 1,4 **** ! #include "stdio.h" ! #include "signal.h" #ifndef SIGIOT --- 1,4 ---- ! #include ! #include #ifndef SIGIOT *************** *** 11,15 **** void sig_die(s, kill) register char *s; int kill; #else ! #include "stdlib.h" #ifdef __cplusplus extern "C" { --- 11,15 ---- void sig_die(s, kill) register char *s; int kill; #else ! #include #ifdef __cplusplus extern "C" { diff -rcp2N g77-0.5.18/f/runtime/libF77/signal_.c g77-0.5.19/f/runtime/libF77/signal_.c *** g77-0.5.18/f/runtime/libF77/signal_.c Wed Aug 30 14:27:18 1995 --- g77-0.5.19/f/runtime/libF77/signal_.c Thu Oct 31 05:36:52 1996 *************** extern sig_type signal(); *** 16,20 **** ftnint signal_(sigp, proc) integer *sigp; sig_type proc; #else ! #include "signal.h" typedef int (*sig_proc)(int); --- 16,20 ---- ftnint signal_(sigp, proc) integer *sigp; sig_type proc; #else ! #include typedef int (*sig_proc)(int); diff -rcp2N g77-0.5.18/f/runtime/libF77/system_.c g77-0.5.19/f/runtime/libF77/system_.c *** g77-0.5.18/f/runtime/libF77/system_.c Wed Aug 30 14:33:25 1995 --- g77-0.5.19/f/runtime/libF77/system_.c Thu Oct 31 05:36:52 1996 *************** system_(s, n) register char *s; ftnlen n *** 12,16 **** #undef min #undef max ! #include "stdlib.h" extern char *F77_aloc(ftnlen, char*); --- 12,16 ---- #undef min #undef max ! #include extern char *F77_aloc(ftnlen, char*); diff -rcp2N g77-0.5.18/f/runtime/libF77/z_cos.c g77-0.5.19/f/runtime/libF77/z_cos.c *** g77-0.5.18/f/runtime/libF77/z_cos.c Fri Nov 18 16:26:30 1994 --- g77-0.5.19/f/runtime/libF77/z_cos.c Thu Oct 31 05:36:52 1996 *************** VOID z_cos(r, z) doublecomplex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" void z_cos(doublecomplex *r, doublecomplex *z) #endif --- 6,10 ---- #else #undef abs ! #include void z_cos(doublecomplex *r, doublecomplex *z) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/z_exp.c g77-0.5.19/f/runtime/libF77/z_exp.c *** g77-0.5.18/f/runtime/libF77/z_exp.c Fri Nov 18 16:26:33 1994 --- g77-0.5.19/f/runtime/libF77/z_exp.c Thu Oct 31 05:36:52 1996 *************** VOID z_exp(r, z) doublecomplex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" void z_exp(doublecomplex *r, doublecomplex *z) #endif --- 6,10 ---- #else #undef abs ! #include void z_exp(doublecomplex *r, doublecomplex *z) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/z_log.c g77-0.5.19/f/runtime/libF77/z_log.c *** g77-0.5.18/f/runtime/libF77/z_log.c Fri Nov 18 16:26:34 1994 --- g77-0.5.19/f/runtime/libF77/z_log.c Thu Oct 31 05:36:52 1996 *************** VOID z_log(r, z) doublecomplex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" extern double f__cabs(double, double); void z_log(doublecomplex *r, doublecomplex *z) --- 6,10 ---- #else #undef abs ! #include extern double f__cabs(double, double); void z_log(doublecomplex *r, doublecomplex *z) diff -rcp2N g77-0.5.18/f/runtime/libF77/z_sin.c g77-0.5.19/f/runtime/libF77/z_sin.c *** g77-0.5.18/f/runtime/libF77/z_sin.c Fri Nov 18 16:26:35 1994 --- g77-0.5.19/f/runtime/libF77/z_sin.c Thu Oct 31 05:37:15 1996 *************** VOID z_sin(r, z) doublecomplex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" void z_sin(doublecomplex *r, doublecomplex *z) #endif --- 6,10 ---- #else #undef abs ! #include void z_sin(doublecomplex *r, doublecomplex *z) #endif diff -rcp2N g77-0.5.18/f/runtime/libF77/z_sqrt.c g77-0.5.19/f/runtime/libF77/z_sqrt.c *** g77-0.5.18/f/runtime/libF77/z_sqrt.c Fri Nov 18 16:26:36 1994 --- g77-0.5.19/f/runtime/libF77/z_sqrt.c Thu Oct 31 05:37:15 1996 *************** VOID z_sqrt(r, z) doublecomplex *r, *z; *** 6,10 **** #else #undef abs ! #include "math.h" extern double f__cabs(double, double); void z_sqrt(doublecomplex *r, doublecomplex *z) --- 6,10 ---- #else #undef abs ! #include extern double f__cabs(double, double); void z_sqrt(doublecomplex *r, doublecomplex *z) diff -rcp2N g77-0.5.18/f/runtime/libI77/Makefile.in g77-0.5.19/f/runtime/libI77/Makefile.in *** g77-0.5.18/f/runtime/libI77/Makefile.in Mon Apr 1 10:10:47 1996 --- g77-0.5.19/f/runtime/libI77/Makefile.in Tue Nov 5 22:21:52 1996 *************** *** 2,6 **** # Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the # file `Notice'). ! # Portions of this file Copyright (C) 1995 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 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # *************** CGFLAGS = -g0 *** 39,43 **** # 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$(srcdir) -I../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc --- 39,43 ---- # 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$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc *************** OBJ = VersionI.o backspace.o close.o dfe *** 59,63 **** fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \ rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \ ! util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o lib = ../../../libf2c.a --- 59,64 ---- fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \ rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \ ! util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \ ! ftell_.o lib = ../../../libf2c.a *************** lib = ../../../libf2c.a *** 65,69 **** F2C_H = ../../include/f2c.h ! all: ../../include/f2c.h $(lib) $(lib): force $(OBJ) --- 66,70 ---- F2C_H = ../../include/f2c.h ! all: $(F2C_H) $(lib) $(lib): force $(OBJ) *************** err.o: fio.h rawio.h *** 98,101 **** --- 99,103 ---- fmt.o: fio.h fmt.o: fmt.h + ftell_.o: fio.h iio.o: fio.h iio.o: fmt.h diff -rcp2N g77-0.5.18/f/runtime/libI77/README g77-0.5.19/f/runtime/libI77/README *** g77-0.5.18/f/runtime/libI77/README Mon Mar 25 20:39:33 1996 --- g77-0.5.19/f/runtime/libI77/README Thu Oct 31 05:37:16 1996 *************** assumes FILE='fort.n' . You can change *** 135,138 **** --- 135,142 ---- and endfile.c suitably. + Unless you adjust the "#define MXUNIT" line in fio.h, Fortran units + 0, 1, ..., 99 are available, i.e., the highest allowed unit number + is MXUNIT - 1. + Lines protected from compilation by #ifdef Allow_TYQUAD are for a possible extension to 64-bit integers in which *************** or (on some systems) *** 200,201 **** --- 204,222 ---- exec /usr/bin/ar lts $1 >/dev/null + + Most of the routines in libI77 are support routines for Fortran + I/O. There are a few exceptions, summarized below -- I/O related + functions and subroutines that appear to your program as ordinary + external Fortran routines. + + 1. CALL FLUSH flushes all buffers. + + 2. FTELL(i) is an INTEGER function that returns the current + offset of Fortran unit i (or -1 if unit i is not open). + + 3. CALL FSEEK(i, offset, whence, *errlab) attemps to move + Fortran unit i to the specified offset: absolute offset + if whence = 0; relative to the current offset if whence = 1; + relative to the end of the file if whence = 2. It branches + to label errlab if unit i is not open or if the call + otherwise fails. diff -rcp2N g77-0.5.18/f/runtime/libI77/Version.c g77-0.5.19/f/runtime/libI77/Version.c *** g77-0.5.18/f/runtime/libI77/Version.c Mon Apr 1 10:14:50 1996 --- g77-0.5.19/f/runtime/libI77/Version.c Tue Nov 5 22:21:52 1996 *************** *** 1,8 **** ! static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19960315\n"; /* */ ! char __G77_LIBI77_VERSION__[] = "0.5.18"; /* --- 1,8 ---- ! static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19960925\n"; /* */ ! char __G77_LIBI77_VERSION__[] = "0.5.19"; /* *************** wrtfmt.c: *** 101,105 **** records from int to long (for systems where sizeof(int) can vary, depending on the compiler or compiler options). */ ! /* 14 Nov. 1991: change uint to Uint in fmt.h, rdfmt.c, wrtfmt.c. /* 25 Nov. 1991: change uint to Uint in lwrite.c; change sizeof(int) to sizeof(uioint) in fseeks in sue.c (missed on 17 Oct.). */ --- 101,105 ---- records from int to long (for systems where sizeof(int) can vary, depending on the compiler or compiler options). */ ! /* 14 Nov. 1991: change uint to Uint in fmt.h, rdfmt.c, wrtfmt.c. */ /* 25 Nov. 1991: change uint to Uint in lwrite.c; change sizeof(int) to sizeof(uioint) in fseeks in sue.c (missed on 17 Oct.). */ *************** wrtfmt.c: *** 234,238 **** /* 15 Mar. 1996: lread.c, rsfe.c: honor END= in READ stmt with empty iolist */ ! #include "stdio.h" void --- 234,248 ---- /* 15 Mar. 1996: lread.c, rsfe.c: honor END= in READ stmt with empty iolist */ ! /* 13 May 1996: add ftell_.c and fseek_.c */ ! /* 9 June 1996: Adjust rsli.c and lread.c so internal list input with ! too few items in the input string will honor end= . */ ! /* 12 Sept. 1995:fmtlib.c: fix glitch in printing the most negative integer. */ ! /* 25 Sept. 1995:fmt.h: for formatted writes of negative integer*1 values, ! make ic signed on ANSI systems. If formatted writes of ! integer*1 values trouble you when using a K&R C compiler, ! switch to an ANSI compiler or use a compiler flag that ! makes characters signed. */ ! ! #include void diff -rcp2N g77-0.5.18/f/runtime/libI77/backspace.c g77-0.5.19/f/runtime/libI77/backspace.c *** g77-0.5.18/f/runtime/libI77/backspace.c Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/backspace.c Thu Nov 21 13:26:21 1996 *************** *** 1,2 **** --- 1,3 ---- + #include #include "f2c.h" #include "fio.h" *************** integer f_back(alist *a) *** 59,63 **** x -= sizeof(buf); (void) fseek(b->ufd,x,SEEK_SET); ! n=fread(buf,1,(int)(y-x), b->ufd); for(i = n - ndec; --i >= 0; ) { --- 60,64 ---- 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; ) { diff -rcp2N g77-0.5.18/f/runtime/libI77/close.c g77-0.5.19/f/runtime/libI77/close.c *** g77-0.5.18/f/runtime/libI77/close.c Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/close.c Thu Oct 31 05:37:16 1996 *************** integer f_clos(a) cllist *a; *** 7,11 **** #undef min #undef max ! #include "stdlib.h" #ifdef NON_UNIX_STDIO #ifndef unlink --- 7,11 ---- #undef min #undef max ! #include #ifdef NON_UNIX_STDIO #ifndef unlink diff -rcp2N g77-0.5.18/f/runtime/libI77/endfile.c g77-0.5.19/f/runtime/libI77/endfile.c *** g77-0.5.18/f/runtime/libI77/endfile.c Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/endfile.c Thu Oct 31 05:37:16 1996 *************** *** 1,5 **** #include "f2c.h" #include "fio.h" ! #include "sys/types.h" #include "rawio.h" --- 1,5 ---- #include "f2c.h" #include "fio.h" ! #include #include "rawio.h" *************** extern char *strcpy(); *** 10,15 **** #undef min #undef max ! #include "stdlib.h" ! #include "string.h" #endif --- 10,15 ---- #undef min #undef max ! #include ! #include #endif *************** copy(char *from, register long len, char *** 80,84 **** #endif { ! register int n; int k, rc = 0, tmp; char buf[BUFSIZ]; --- 80,84 ---- #endif { ! register size_t n; int k, rc = 0, tmp; char buf[BUFSIZ]; *************** copy(char *from, register long len, char *** 88,92 **** if ((tmp = creat(to,0666)) < 0) return 1; ! while((n = read(k, buf, len > BUFSIZ ? BUFSIZ : (int)len)) > 0) { if (write(tmp, buf, n) != n) { rc = 1; break; } --- 88,92 ---- 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; } diff -rcp2N g77-0.5.18/f/runtime/libI77/err.c g77-0.5.19/f/runtime/libI77/err.c *** g77-0.5.18/f/runtime/libI77/err.c Thu Nov 16 04:57:27 1995 --- g77-0.5.19/f/runtime/libI77/err.c Thu Oct 31 05:37:35 1996 *************** *** 1,5 **** #ifndef NON_UNIX_STDIO ! #include "sys/types.h" ! #include "sys/stat.h" #endif #include "f2c.h" --- 1,5 ---- #ifndef NON_UNIX_STDIO ! #include ! #include #endif #include "f2c.h" *************** extern char *malloc(); *** 14,18 **** #undef min #undef max ! #include "stdlib.h" #endif #endif --- 14,18 ---- #undef min #undef max ! #include #endif #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/f2ch.add g77-0.5.19/f/runtime/libI77/f2ch.add *** g77-0.5.18/f/runtime/libI77/f2ch.add Thu Jan 12 17:11:56 1995 --- g77-0.5.19/f/runtime/libI77/f2ch.add Thu Oct 31 05:37:35 1996 *************** extern integer s_wsue(cilist *); *** 151,155 **** extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); ! extern int system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); --- 151,155 ---- extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); ! extern integer system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); diff -rcp2N g77-0.5.18/f/runtime/libI77/fio.h g77-0.5.19/f/runtime/libI77/fio.h *** g77-0.5.18/f/runtime/libI77/fio.h Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/fio.h Thu Oct 31 05:37:35 1996 *************** *** 1,7 **** ! #include "stdio.h" ! #include "errno.h" #ifndef NULL /* ANSI C */ ! #include "stddef.h" #endif --- 1,7 ---- ! #include ! #include #ifndef NULL /* ANSI C */ ! #include #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/fmt.h g77-0.5.19/f/runtime/libI77/fmt.h *** g77-0.5.18/f/runtime/libI77/fmt.h Thu Nov 16 04:57:25 1995 --- g77-0.5.19/f/runtime/libI77/fmt.h Thu Oct 31 05:37:35 1996 *************** typedef union *** 46,50 **** typedef union { short is; ! char ic; integer il; #ifdef Allow_TYQUAD --- 46,53 ---- typedef union { short is; ! #ifndef KR_headers ! signed ! #endif ! char ic; integer il; #ifdef Allow_TYQUAD diff -rcp2N g77-0.5.18/f/runtime/libI77/ftell_.c g77-0.5.19/f/runtime/libI77/ftell_.c *** g77-0.5.18/f/runtime/libI77/ftell_.c Wed Dec 31 19:00:00 1969 --- g77-0.5.19/f/runtime/libI77/ftell_.c Thu Oct 31 22:30:58 1996 *************** *** 0 **** --- 1,54 ---- + #include "f2c.h" + #include "fio.h" + + static FILE * + #ifdef KR_headers + unit_chk(unit, who) integer unit; char *who; + #else + unit_chk(integer unit, char *who) + #endif + { + if (unit >= MXUNIT || unit < 0) + f__fatal(101, who); + return f__units[unit].ufd; + } + + integer + #ifdef KR_headers + ftell_(unit) integer *unit; + #else + ftell_(integer *unit) + #endif + { + FILE *f; + return (f = unit_chk(*unit, "ftell")) ? ftell(f) : -1L; + } + + int + #ifdef KR_headers + fseek_(unit, offset, xwhence) integer *unit, *offset, *xwhence; + #else + fseek_(integer *unit, integer *offset, integer *xwhence) + #endif + { + int whence; + FILE *f; + + switch (*xwhence) { + default: + errno = EINVAL; + return 1; + case 0: + whence = SEEK_SET; + break; + case 1: + whence = SEEK_CUR; + break; + case 2: + whence = SEEK_END; + break; + } + + return !(f = unit_chk(*unit, "fseek")) + || fseek(f, *offset, whence) ? 1 : 0; + } diff -rcp2N g77-0.5.18/f/runtime/libI77/inquire.c g77-0.5.19/f/runtime/libI77/inquire.c *** g77-0.5.18/f/runtime/libI77/inquire.c Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/inquire.c Thu Oct 31 05:37:35 1996 *************** integer f_inqu(a) inlist *a; *** 8,12 **** #undef min #undef max ! #include "string.h" #include "io.h" #endif --- 8,12 ---- #undef min #undef max ! #include #include "io.h" #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/lread.c g77-0.5.19/f/runtime/libI77/lread.c *** g77-0.5.18/f/runtime/libI77/lread.c Tue Mar 19 12:59:07 1996 --- g77-0.5.19/f/runtime/libI77/lread.c Thu Oct 31 05:37:36 1996 *************** *** 3,7 **** #include "fmt.h" #include "lio.h" ! #include "ctype.h" #include "fp.h" --- 3,7 ---- #include "fmt.h" #include "lio.h" ! #include #include "fp.h" *************** int (*f__lioproc)(), (*l_getc)(), (*l_un *** 21,25 **** #undef min #undef max ! #include "stdlib.h" int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint), (*l_getc)(void), (*l_ungetc)(int,FILE*); --- 21,25 ---- #undef min #undef max ! #include int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint), (*l_getc)(void), (*l_ungetc)(int,FILE*); *************** l_read(ftnint *number, char *ptr, ftnlen *** 525,529 **** switch(ch) { case EOF: ! goto loopend; case ' ': case '\t': --- 525,529 ---- switch(ch) { case EOF: ! err(f__elist->ciend,(EOF),"list in") case ' ': case '\t': *************** l_read(ftnint *number, char *ptr, ftnlen *** 579,589 **** loopend: if(f__lquit) return(0); ! if(f__cf) { ! if (feof(f__cf)) ! err(f__elist->ciend,(EOF),"list in") ! else if(ferror(f__cf)) { ! clearerr(f__cf); ! errfl(f__elist->cierr,errno,"list in"); ! } } if(f__ltype==0) goto bump; --- 579,585 ---- loopend: if(f__lquit) return(0); ! if(f__cf && ferror(f__cf)) { ! clearerr(f__cf); ! errfl(f__elist->cierr,errno,"list in"); } if(f__ltype==0) goto bump; diff -rcp2N g77-0.5.18/f/runtime/libI77/open.c g77-0.5.19/f/runtime/libI77/open.c *** g77-0.5.18/f/runtime/libI77/open.c Thu Nov 16 05:08:30 1995 --- g77-0.5.19/f/runtime/libI77/open.c Thu Oct 31 05:37:36 1996 *************** *** 1,9 **** #ifndef NON_UNIX_STDIO ! #include "sys/types.h" ! #include "sys/stat.h" #endif #include "f2c.h" #include "fio.h" ! #include "string.h" #include "rawio.h" --- 1,9 ---- #ifndef NON_UNIX_STDIO ! #include ! #include #endif #include "f2c.h" #include "fio.h" ! #include #include "rawio.h" *************** extern integer f_clos(); *** 15,19 **** #undef min #undef max ! #include "stdlib.h" extern int f__canseek(FILE*); extern integer f_clos(cllist*); --- 15,19 ---- #undef min #undef max ! #include extern int f__canseek(FILE*); extern integer f_clos(cllist*); diff -rcp2N g77-0.5.18/f/runtime/libI77/rawio.h g77-0.5.19/f/runtime/libI77/rawio.h *** g77-0.5.18/f/runtime/libI77/rawio.h Mon Oct 23 08:59:32 1995 --- g77-0.5.19/f/runtime/libI77/rawio.h Thu Oct 31 05:37:36 1996 *************** extern char *mktemp(char*); *** 35,39 **** #ifndef NO_FCNTL ! #include "fcntl.h" #endif --- 35,39 ---- #ifndef NO_FCNTL ! #include #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/rdfmt.c g77-0.5.19/f/runtime/libI77/rdfmt.c *** g77-0.5.18/f/runtime/libI77/rdfmt.c Tue Mar 19 12:59:07 1996 --- g77-0.5.19/f/runtime/libI77/rdfmt.c Thu Oct 31 05:37:53 1996 *************** *** 3,7 **** #include "fmt.h" #include "fp.h" ! #include "ctype.h" extern int f__cursor; --- 3,7 ---- #include "fmt.h" #include "fp.h" ! #include extern int f__cursor; *************** extern double atof(); *** 12,16 **** #undef min #undef max ! #include "stdlib.h" #endif --- 12,16 ---- #undef min #undef max ! #include #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/rsli.c g77-0.5.19/f/runtime/libI77/rsli.c *** g77-0.5.18/f/runtime/libI77/rsli.c Fri Nov 18 16:18:11 1994 --- g77-0.5.19/f/runtime/libI77/rsli.c Thu Oct 31 05:37:53 1996 *************** static int i_getc(Void) *** 19,23 **** } f__recpos++; ! if(f__icptr >= f__icend) err(f__svic->iciend,(EOF),"internal read"); return(*f__icptr++); } --- 19,24 ---- } f__recpos++; ! if(f__icptr >= f__icend) ! return EOF; return(*f__icptr++); } diff -rcp2N g77-0.5.18/f/runtime/libI77/rsne.c g77-0.5.19/f/runtime/libI77/rsne.c *** g77-0.5.18/f/runtime/libI77/rsne.c Thu Nov 16 05:09:31 1995 --- g77-0.5.19/f/runtime/libI77/rsne.c Thu Oct 31 05:37:53 1996 *************** un_getc(x,f__cf) int x; FILE *f__cf; *** 55,60 **** #undef min #undef max ! #include "stdlib.h" ! #include "string.h" #ifdef ungetc --- 55,60 ---- #undef min #undef max ! #include ! #include #ifdef ungetc *************** x_rsne(cilist *a) *** 341,345 **** } have_amp: ! if (ch = getname(buf,sizeof(buf))) return ch; nl = (Namelist *)a->cifmt; --- 341,345 ---- } have_amp: ! if (ch = getname(buf,(int) sizeof(buf))) return ch; nl = (Namelist *)a->cifmt; *************** x_rsne(cilist *a) *** 396,400 **** continue; Ungetc(ch,f__cf); ! if (ch = getname(buf,sizeof(buf))) return ch; goto havename; --- 396,400 ---- continue; Ungetc(ch,f__cf); ! if (ch = getname(buf,(int) sizeof(buf))) return ch; goto havename; diff -rcp2N g77-0.5.18/f/runtime/libI77/uio.c g77-0.5.19/f/runtime/libI77/uio.c *** g77-0.5.18/f/runtime/libI77/uio.c Sun Feb 12 01:06:48 1995 --- g77-0.5.19/f/runtime/libI77/uio.c Wed Nov 6 11:20:21 1996 *************** *** 1,5 **** #include "f2c.h" #include "fio.h" ! #include "sys/types.h" uiolen f__reclen; --- 1,5 ---- #include "f2c.h" #include "fio.h" ! #include uiolen f__reclen; *************** do_us(ftnint *number, char *ptr, ftnlen *** 15,19 **** if(f__recpos>f__reclen) err(f__elist->cierr, 110, "do_us"); ! if (fread(ptr,(int)len,(int)(*number),f__cf) != *number) err(f__elist->ciend, EOF, "do_us"); return(0); --- 15,19 ---- if(f__recpos>f__reclen) err(f__elist->cierr, 110, "do_us"); ! if (fread(ptr,(size_t)len,(size_t)(*number),f__cf) != *number) err(f__elist->ciend, EOF, "do_us"); return(0); *************** do_us(ftnint *number, char *ptr, ftnlen *** 22,26 **** { f__reclen += *number * len; ! (void) fwrite(ptr,(int)len,(int)(*number),f__cf); return(0); } --- 22,26 ---- { f__reclen += *number * len; ! (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf); return(0); } *************** integer do_ud(ftnint *number, char *ptr, *** 43,47 **** size_t i; #endif ! if (!(i = fread(ptr,(int)len,(int)(*number),f__cf)) && !(f__recpos - *number*len)) err(f__elist->cierr,EOF,"do_ud") --- 43,47 ---- size_t i; #endif ! if (!(i = fread(ptr,(size_t)len,(size_t)(*number),f__cf)) && !(f__recpos - *number*len)) err(f__elist->cierr,EOF,"do_ud") *************** integer do_ud(ftnint *number, char *ptr, *** 50,59 **** return 0; #else ! if(fread(ptr,(int)len,(int)(*number),f__cf) != *number) err(f__elist->cierr,EOF,"do_ud") else return(0); #endif } ! (void) fwrite(ptr,(int)len,(int)(*number),f__cf); return(0); } --- 50,59 ---- return 0; #else ! if(fread(ptr,(size_t)len,(size_t)(*number),f__cf) != *number) err(f__elist->cierr,EOF,"do_ud") else return(0); #endif } ! (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf); return(0); } diff -rcp2N g77-0.5.18/f/runtime/libI77/util.c g77-0.5.19/f/runtime/libI77/util.c *** g77-0.5.18/f/runtime/libI77/util.c Fri Nov 18 16:18:18 1994 --- g77-0.5.19/f/runtime/libI77/util.c Thu Oct 31 05:37:53 1996 *************** *** 1,5 **** #ifndef NON_UNIX_STDIO ! #include "sys/types.h" ! #include "sys/stat.h" #endif #include "f2c.h" --- 1,5 ---- #ifndef NON_UNIX_STDIO ! #include ! #include #endif #include "f2c.h" diff -rcp2N g77-0.5.18/f/runtime/libI77/wref.c g77-0.5.19/f/runtime/libI77/wref.c *** g77-0.5.18/f/runtime/libI77/wref.c Thu Aug 17 06:19:08 1995 --- g77-0.5.19/f/runtime/libI77/wref.c Thu Oct 31 05:37:53 1996 *************** *** 4,8 **** #include "fp.h" #ifndef VAX ! #include "ctype.h" #endif --- 4,8 ---- #include "fp.h" #ifndef VAX ! #include #endif *************** *** 11,16 **** #undef min #undef max ! #include "stdlib.h" ! #include "string.h" #endif --- 11,16 ---- #undef min #undef max ! #include ! #include #endif diff -rcp2N g77-0.5.18/f/runtime/libI77/xwsne.c g77-0.5.19/f/runtime/libI77/xwsne.c *** g77-0.5.18/f/runtime/libI77/xwsne.c Thu Nov 16 04:57:24 1995 --- g77-0.5.19/f/runtime/libI77/xwsne.c Thu Oct 31 05:37:54 1996 *************** nl_donewrec(Void) *** 16,20 **** x_wsne(a) cilist *a; #else ! #include "string.h" VOID --- 16,20 ---- x_wsne(a) cilist *a; #else ! #include VOID diff -rcp2N g77-0.5.18/f/stb.c g77-0.5.19/f/stb.c *** g77-0.5.18/f/stb.c Sat Mar 9 13:53:38 1996 --- g77-0.5.19/f/stb.c Thu Nov 21 16:47:13 1996 *************** static ffelexHandler ffestb_R90913_ (ffe *** 777,780 **** --- 777,782 ---- static ffelexHandler ffestb_R90914_ (ffelexToken ft, ffebld expr, ffelexToken t); + static ffelexHandler ffestb_R90915_ (ffelexToken ft, ffebld expr, + ffelexToken t); static ffelexHandler ffestb_R9101_ (ffelexToken t); static ffelexHandler ffestb_R9102_ (ffelexToken t); *************** static ffelexHandler ffestb_R91012_ (ffe *** 794,797 **** --- 796,801 ---- static ffelexHandler ffestb_R91013_ (ffelexToken ft, ffebld expr, ffelexToken t); + static ffelexHandler ffestb_R91014_ (ffelexToken ft, ffebld expr, + ffelexToken t); static ffelexHandler ffestb_R9111_ (ffelexToken ft, ffebld expr, ffelexToken t); *************** ffestb_goto3_ (ffelexToken t) *** 3525,3528 **** --- 3529,3534 ---- default: ffesta_confirmed (); + /* Fall through. */ + case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ return (ffelexHandler) (*((ffelexHandler) ffeexpr_rhs (ffesta_output_pool, FFEEXPR_contextCGOTO, *************** ffestb_goto5_ (ffelexToken ft, ffebld ex *** 3598,3601 **** --- 3604,3608 ---- if (expr == NULL) break; + ffesta_confirmed (); if (!ffesta_is_inhibited ()) ffestc_R837 (ffestb_subrargs_.label_list.labels, expr, ft); *************** ffestb_R10013_ (ffelexToken t) *** 9156,9160 **** { case FFELEX_typeNUMBER: - ffestb_local_.format.sign = TRUE; /* Sign present. */ ffestb_local_.format.pre.present = TRUE; ffestb_local_.format.pre.rtexpr = FALSE; --- 9163,9166 ---- *************** ffestb_R10013_ (ffelexToken t) *** 9162,9165 **** --- 9168,9172 ---- ffestb_local_.format.pre.u.signed_val = ffestb_local_.format.sign ? unsigned_val : -unsigned_val; + ffestb_local_.format.sign = TRUE; /* Sign present. */ return (ffelexHandler) ffestb_R10014_; *************** ffestb_R9091_ (ffelexToken ft, ffebld ex *** 15099,15103 **** return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90914_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); --- 15106,15110 ---- return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90915_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); *************** ffestb_R9094_ (ffelexToken ft, ffebld ex *** 15218,15222 **** ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90914_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); --- 15225,15229 ---- ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90915_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); *************** ffestb_R90913_ (ffelexToken t) *** 15637,15640 **** --- 15644,15650 ---- default: + ffesta_confirmed (); + /* Fall through. */ + case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ break; } *************** ffestb_R90913_ (ffelexToken t) *** 15643,15651 **** about it, so leave it up to that code. */ - ffesta_confirmed (); - if (!ffesta_is_inhibited ()) - ffestc_R909_start (FALSE); - ffestb_subr_kill_read_ (); - /* EXTENSION: Allow an optional preceding COMMA here if not pedantic. (f2c provides this extension, as do other compilers, supposedly.) */ --- 15653,15656 ---- *************** ffestb_R90914_ (ffelexToken ft, ffebld e *** 15678,15686 **** if (expr == NULL) break; if (!ffesta_is_inhibited ()) ffestc_R909_item (expr, ft); return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90914_); case FFELEX_typeEOS: --- 15683,15743 ---- if (expr == NULL) break; + + ffesta_confirmed (); + if (!ffesta_is_inhibited ()) + ffestc_R909_start (FALSE); + ffestb_subr_kill_read_ (); + + if (!ffesta_is_inhibited ()) + ffestc_R909_item (expr, ft); + return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, + ffestc_context_iolist (), + (ffeexprCallback) ffestb_R90915_); + + case FFELEX_typeEOS: + case FFELEX_typeSEMICOLON: + if (expr == NULL) + break; + + ffesta_confirmed (); + if (!ffesta_is_inhibited ()) + ffestc_R909_start (FALSE); + ffestb_subr_kill_read_ (); + + if (!ffesta_is_inhibited ()) + { + ffestc_R909_item (expr, ft); + ffestc_R909_finish (); + } + return (ffelexHandler) ffesta_zero (t); + + default: + break; + } + + ffestb_subr_kill_read_ (); + ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM, "READ", t); + return (ffelexHandler) ffelex_swallow_tokens (t, (ffelexHandler) ffesta_zero); + } + + /* ffestb_R90915_ -- "READ(...)" expr COMMA expr + + (ffestb_R90915_) // to expression handler + + Handle COMMA or EOS/SEMICOLON here. */ + + static ffelexHandler + ffestb_R90915_ (ffelexToken ft, ffebld expr, ffelexToken t) + { + switch (ffelex_token_type (t)) + { + case FFELEX_typeCOMMA: + if (expr == NULL) + break; if (!ffesta_is_inhibited ()) ffestc_R909_item (expr, ft); return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), ! (ffeexprCallback) ffestb_R90915_); case FFELEX_typeEOS: *************** ffestb_R91012_ (ffelexToken t) *** 16199,16205 **** default: ffesta_confirmed (); ! if (!ffesta_is_inhibited ()) ! ffestc_R910_start (); ! ffestb_subr_kill_write_ (); /* EXTENSION: Allow an optional preceding COMMA here if not pedantic. --- 16256,16261 ---- default: ffesta_confirmed (); ! /* Fall through. */ ! case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ /* EXTENSION: Allow an optional preceding COMMA here if not pedantic. *************** ffestb_R91013_ (ffelexToken ft, ffebld e *** 16238,16245 **** if (expr == NULL) break; if (!ffesta_is_inhibited ()) ffestc_R910_item (expr, ft); return (ffelexHandler) ffeexpr_rhs (ffesta_output_pool, ! ffestc_context_iolist (), (ffeexprCallback) ffestb_R91013_); case FFELEX_typeEOS: --- 16294,16352 ---- if (expr == NULL) break; + + ffesta_confirmed (); + if (!ffesta_is_inhibited ()) + ffestc_R910_start (); + ffestb_subr_kill_write_ (); + if (!ffesta_is_inhibited ()) ffestc_R910_item (expr, ft); return (ffelexHandler) ffeexpr_rhs (ffesta_output_pool, ! ffestc_context_iolist (), (ffeexprCallback) ffestb_R91014_); ! ! case FFELEX_typeEOS: ! case FFELEX_typeSEMICOLON: ! if (expr == NULL) ! break; ! ! ffesta_confirmed (); ! if (!ffesta_is_inhibited ()) ! ffestc_R910_start (); ! ffestb_subr_kill_write_ (); ! ! if (!ffesta_is_inhibited ()) ! { ! ffestc_R910_item (expr, ft); ! ffestc_R910_finish (); ! } ! return (ffelexHandler) ffesta_zero (t); ! ! default: ! break; ! } ! ! ffestb_subr_kill_write_ (); ! ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM, "WRITE", t); ! return (ffelexHandler) ffelex_swallow_tokens (t, (ffelexHandler) ffesta_zero); ! } ! ! /* ffestb_R91014_ -- "WRITE(...)" expr COMMA expr ! ! (ffestb_R91014_) // to expression handler ! ! Handle COMMA or EOS/SEMICOLON here. */ ! ! static ffelexHandler ! ffestb_R91014_ (ffelexToken ft, ffebld expr, ffelexToken t) ! { ! switch (ffelex_token_type (t)) ! { ! case FFELEX_typeCOMMA: ! if (expr == NULL) ! break; ! if (!ffesta_is_inhibited ()) ! ffestc_R910_item (expr, ft); ! return (ffelexHandler) ffeexpr_rhs (ffesta_output_pool, ! ffestc_context_iolist (), (ffeexprCallback) ffestb_R91014_); case FFELEX_typeEOS: *************** ffestb_decl_entsp_5_ (ffelexToken t) *** 22796,22802 **** } ffesta_confirmed (); /* We've seen an ASTERISK, so even EQUALS confirmed. */ - assert (ffestb_local_.decl.aster_after); ffestb_subr_ambig_to_ents_ (); ffestb_subrargs_.dim_list.dims = NULL; --- 22903,22909 ---- } + assert (ffestb_local_.decl.aster_after); ffesta_confirmed (); /* We've seen an ASTERISK, so even EQUALS confirmed. */ ffestb_subr_ambig_to_ents_ (); ffestb_subrargs_.dim_list.dims = NULL; *************** ffestb_decl_entsp_6_ (ffelexToken t) *** 22843,22846 **** --- 22950,22954 ---- case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) *************** ffestb_decl_entsp_7_ (ffelexToken t) *** 22888,22891 **** --- 22996,23000 ---- case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) *************** ffestb_decl_entsp_8_ (ffelexToken t) *** 22942,22945 **** --- 23051,23055 ---- case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) diff -rcp2N g77-0.5.18/f/ste.c g77-0.5.19/f/ste.c *** g77-0.5.18/f/ste.c Mon Mar 25 20:39:34 1996 --- g77-0.5.19/f/ste.c Sat Nov 2 17:08:28 1996 *************** ffeste_begin_iterdo_ (ffestw block, tree *** 338,373 **** { /* For warnings only, nothing else happens here. */ ! tree try = ffecom_2 (MINUS_EXPR, TREE_TYPE (tvar), ! tend, ! tstart); ! try = ffecom_2 (PLUS_EXPR, TREE_TYPE (tvar), ! try, ! tincr); ! ! if (TREE_CODE (TREE_TYPE (tvar)) != REAL_TYPE) ! try = ffecom_2 (TRUNC_DIV_EXPR, integer_type_node, try, ! tincr); ! else ! try = convert (integer_type_node, ! ffecom_2 (RDIV_EXPR, TREE_TYPE (tvar), ! try, ! tincr)); ! ! /* Warn if loop never executed, since we've done the evaluation ! of the unofficial iteration count already. */ ! ! try = ffecom_truth_value (ffecom_2 (LE_EXPR, integer_type_node, ! try, ! convert (TREE_TYPE (tvar), ! integer_zero_node))); ! ! if (integer_onep (try)) { ! ffebad_start (FFEBAD_DO_NULL); ! ffebad_here (0, ffelex_token_where_line (start_token), ! ffelex_token_where_column (start_token)); ! ffebad_string (msg); ! ffebad_finish (); } --- 338,378 ---- { /* For warnings only, nothing else happens here. */ ! tree try; ! if (!ffe_is_onetrip ()) { ! try = ffecom_2 (MINUS_EXPR, TREE_TYPE (tvar), ! tend, ! tstart); ! ! try = ffecom_2 (PLUS_EXPR, TREE_TYPE (tvar), ! try, ! tincr); ! ! if (TREE_CODE (TREE_TYPE (tvar)) != REAL_TYPE) ! try = ffecom_2 (TRUNC_DIV_EXPR, integer_type_node, try, ! tincr); ! else ! try = convert (integer_type_node, ! ffecom_2 (RDIV_EXPR, TREE_TYPE (tvar), ! try, ! tincr)); ! ! /* Warn if loop never executed, since we've done the evaluation ! of the unofficial iteration count already. */ ! ! try = ffecom_truth_value (ffecom_2 (LE_EXPR, integer_type_node, ! try, ! convert (TREE_TYPE (tvar), ! integer_zero_node))); ! ! if (integer_onep (try)) ! { ! ffebad_start (FFEBAD_DO_NULL); ! ffebad_here (0, ffelex_token_where_line (start_token), ! ffelex_token_where_column (start_token)); ! ffebad_string (msg); ! ffebad_finish (); ! } } *************** ffeste_begin_iterdo_ (ffestw block, tree *** 398,404 **** TREE_CONSTANT (tstart) ? tstart : tvar); ! expr = ffecom_2 (PLUS_EXPR, TREE_TYPE (expr), ! expr, ! convert (TREE_TYPE (expr), tincr_saved)); if (TREE_CODE (TREE_TYPE (tvar)) != REAL_TYPE) --- 403,412 ---- TREE_CONSTANT (tstart) ? tstart : tvar); ! if (!ffe_is_onetrip ()) ! { ! expr = ffecom_2 (PLUS_EXPR, TREE_TYPE (expr), ! expr, ! convert (TREE_TYPE (expr), tincr_saved)); ! } if (TREE_CODE (TREE_TYPE (tvar)) != REAL_TYPE) *************** ffeste_begin_iterdo_ (ffestw block, tree *** 438,452 **** expand_start_loop_continue_elsewhere (1)); ! expr = ffecom_truth_value ! (ffecom_2 (GE_EXPR, integer_type_node, ! ffecom_2 (PREDECREMENT_EXPR, ! TREE_TYPE (niters), ! niters, ! convert (TREE_TYPE (niters), ! ffecom_integer_one_node)), ! convert (TREE_TYPE (niters), ! ffecom_integer_zero_node))); ! expand_exit_loop_if_false (0, expr); clear_momentary (); /* Discard the above now that we're done with --- 446,463 ---- expand_start_loop_continue_elsewhere (1)); ! if (!ffe_is_onetrip ()) ! { ! expr = ffecom_truth_value ! (ffecom_2 (GE_EXPR, integer_type_node, ! ffecom_2 (PREDECREMENT_EXPR, ! TREE_TYPE (niters), ! niters, ! convert (TREE_TYPE (niters), ! ffecom_integer_one_node)), ! convert (TREE_TYPE (niters), ! ffecom_integer_zero_node))); ! expand_exit_loop_if_false (0, expr); ! } clear_momentary (); /* Discard the above now that we're done with *************** ffeste_end_iterdo_ (tree tvar, tree tinc *** 477,482 **** --- 488,510 ---- { tree expr; + tree niters = itersvar; expand_loop_continue_here (); + + if (ffe_is_onetrip ()) + { + expr = ffecom_truth_value + (ffecom_2 (GE_EXPR, integer_type_node, + ffecom_2 (PREDECREMENT_EXPR, + TREE_TYPE (niters), + niters, + convert (TREE_TYPE (niters), + ffecom_integer_one_node)), + convert (TREE_TYPE (niters), + ffecom_integer_zero_node))); + + expand_exit_loop_if_false (0, expr); + } + expr = ffecom_modify (void_type_node, tvar, ffecom_2 (PLUS_EXPR, TREE_TYPE (tvar), *************** ffeste_io_call_ (tree call, bool do_chec *** 520,535 **** expand_expr_stmt (call); ! if (!do_check) return; /* Generate optional test. */ ! if ((ffeste_io_abort_ != NULL_TREE) ! && (TREE_CODE (ffeste_io_abort_) != ERROR_MARK)) ! { ! expand_start_cond (ffecom_truth_value (ffeste_io_iostat_), 0); ! expand_goto (ffeste_io_abort_); ! expand_end_cond (); ! } } --- 548,561 ---- expand_expr_stmt (call); ! if (!do_check ! || (ffeste_io_abort_ == NULL_TREE) ! || (TREE_CODE (ffeste_io_abort_) == ERROR_MARK)) return; /* Generate optional test. */ ! expand_start_cond (ffecom_truth_value (ffeste_io_iostat_), 0); ! expand_goto (ffeste_io_abort_); ! expand_end_cond (); } *************** ffeste_io_impdo_ (ffebld impdo, ffelexTo *** 1524,1529 **** ffeste_io_impdo_ (item, impdo_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (item), ! (ffeste_io_abort_ != NULL_TREE)); clear_momentary (); } --- 1550,1554 ---- ffeste_io_impdo_ (item, impdo_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (item), TRUE); clear_momentary (); } *************** ffeste_subr_beru_ (ffestpBeruStmt *info, *** 2013,2018 **** ffeste_io_call_ (ffecom_call_gfrt (rt, alist), ! !ffeste_io_abort_is_temp_ ! && (ffeste_io_abort_ != NULL_TREE)); /* If we've got a temp label, generate its code here. */ --- 2038,2042 ---- ffeste_io_call_ (ffecom_call_gfrt (rt, alist), ! !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ *************** ffeste_R904 (ffestpOpenStmt *info) *** 3273,3277 **** ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFOPEN, args), ! !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); /* If we've got a temp label, generate its code here. */ --- 3297,3301 ---- ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFOPEN, args), ! !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ *************** ffeste_R907 (ffestpCloseStmt *info) *** 3380,3384 **** ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFCLOS, args), ! !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); /* If we've got a temp label, generate its code here. */ --- 3404,3408 ---- ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFCLOS, args), ! !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ *************** ffeste_R909_start (ffestpReadStmt *info, *** 3655,3661 **** ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! (ffeste_io_abort_ != NULL_TREE) ! && (!ffeste_io_abort_is_temp_ ! || (end != FFECOM_gfrt))); } --- 3679,3683 ---- ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } *************** ffeste_R909_item (ffebld expr, ffelexTok *** 3694,3699 **** ffeste_io_impdo_ (expr, expr_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (expr), ! (ffeste_io_abort_ != NULL_TREE)); clear_momentary (); #else --- 3716,3720 ---- ffeste_io_impdo_ (expr, expr_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (expr), TRUE); clear_momentary (); #else *************** ffeste_R909_finish () *** 3720,3738 **** label, since we're gonna fall through to there anyway. */ - /* SPECIAL CASE: for e_rsle and e_rsli, don't generate the check AND don't - even let ffeste_io_call_ bother writing to IOSTAT=, since - dmg@bell-labs.com claims that e_[rw]sl[ei] always return 0. */ - { - tree iostat = ffeste_io_iostat_; - - if (ffeste_io_driver_ == ffeste_io_dolio_) - ffeste_io_iostat_ = NULL_TREE; - if (ffeste_io_endgfrt_ != FFECOM_gfrt) ffeste_io_call_ (ffecom_call_gfrt (ffeste_io_endgfrt_, NULL_TREE), ! !ffeste_io_abort_is_temp_ ! && (ffeste_io_abort_ != NULL_TREE) ! && (ffeste_io_driver_ != ffeste_io_dolio_)); clear_momentary (); --- 3741,3748 ---- label, since we're gonna fall through to there anyway. */ { if (ffeste_io_endgfrt_ != FFECOM_gfrt) ffeste_io_call_ (ffecom_call_gfrt (ffeste_io_endgfrt_, NULL_TREE), ! !ffeste_io_abort_is_temp_); clear_momentary (); *************** ffeste_R909_finish () *** 3755,3759 **** expand_start_cond (ffecom_truth_value (ffecom_2 (LT_EXPR, integer_type_node, ! iostat, ffecom_integer_zero_node)), 0); --- 3765,3769 ---- expand_start_cond (ffecom_truth_value (ffecom_2 (LT_EXPR, integer_type_node, ! ffeste_io_iostat_, ffecom_integer_zero_node)), 0); *************** ffeste_R909_finish () *** 3769,3773 **** expand_start_cond (ffecom_truth_value (ffecom_2 (GT_EXPR, integer_type_node, ! iostat, ffecom_integer_zero_node)), 0); --- 3779,3783 ---- expand_start_cond (ffecom_truth_value (ffecom_2 (GT_EXPR, integer_type_node, ! ffeste_io_iostat_, ffecom_integer_zero_node)), 0); *************** ffeste_R910_start (ffestpWriteStmt *info *** 3980,3986 **** ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! (ffeste_io_abort_ != NULL_TREE) ! && (!ffeste_io_abort_is_temp_ ! || (end != FFECOM_gfrt))); } --- 3990,3994 ---- ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } *************** ffeste_R910_item (ffebld expr, ffelexTok *** 4015,4020 **** ffeste_io_impdo_ (expr, expr_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (expr), ! (ffeste_io_abort_ != NULL_TREE)); clear_momentary (); #else --- 4023,4027 ---- ffeste_io_impdo_ (expr, expr_token); else ! ffeste_io_call_ ((*ffeste_io_driver_) (expr), TRUE); clear_momentary (); #else *************** ffeste_R910_finish () *** 4041,4057 **** label, since we're gonna fall through to there anyway. */ - /* SPECIAL CASE: for e_rsle and e_rsli, don't generate the check AND don't - even let ffeste_io_call_ bother writing to IOSTAT=, since - dmg@bell-labs.com claims that e_[rw]sl[ei] always return 0. */ - { - if (ffeste_io_driver_ == ffeste_io_dolio_) - ffeste_io_iostat_ = NULL_TREE; - if (ffeste_io_endgfrt_ != FFECOM_gfrt) ffeste_io_call_ (ffecom_call_gfrt (ffeste_io_endgfrt_, NULL_TREE), ! !ffeste_io_abort_is_temp_ ! && (ffeste_io_abort_ != NULL_TREE) ! && (ffeste_io_driver_ != ffeste_io_dolio_)); clear_momentary (); --- 4048,4055 ---- label, since we're gonna fall through to there anyway. */ { if (ffeste_io_endgfrt_ != FFECOM_gfrt) ffeste_io_call_ (ffecom_call_gfrt (ffeste_io_endgfrt_, NULL_TREE), ! !ffeste_io_abort_is_temp_); clear_momentary (); *************** ffeste_R911_start (ffestpPrintStmt *info *** 4179,4185 **** ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! (ffeste_io_abort_ != NULL_TREE) ! && (!ffeste_io_abort_is_temp_ ! || (end != FFECOM_gfrt))); } --- 4177,4181 ---- ffeste_io_call_ (ffecom_call_gfrt (start, cilist), ! !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } *************** ffeste_R923A (ffestpInquireStmt *info, b *** 4446,4450 **** ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFINQU, args), ! !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); /* If we've got a temp label, generate its code here. */ --- 4442,4446 ---- ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFINQU, args), ! !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ diff -rcp2N g77-0.5.18/f/storag.c g77-0.5.19/f/storag.c *** g77-0.5.18/f/storag.c Mon Mar 18 18:37:51 1996 --- g77-0.5.19/f/storag.c Thu Nov 21 20:49:09 1996 *************** ffestorag_dump (ffestorag s) *** 132,137 **** fprintf (dmpout, "\"%s\" ", ffesymbol_text (s->symbol)); ! fprintf (dmpout, "at %" ffetargetOffset_f "u size %" ffetargetOffset_f ! "u, align loc%%%" ffetargetAlign_f "u=%" ffetargetAlign_f "u, bt=%s, kt=%s", s->offset, --- 132,137 ---- fprintf (dmpout, "\"%s\" ", ffesymbol_text (s->symbol)); ! fprintf (dmpout, "at %" ffetargetOffset_f "d size %" ffetargetOffset_f ! "d, align loc%%%" ffetargetAlign_f "u=%" ffetargetAlign_f "u, bt=%s, kt=%s", s->offset, diff -rcp2N g77-0.5.18/f/storag.h g77-0.5.19/f/storag.h *** g77-0.5.18/f/storag.h Mon Mar 18 18:23:57 1996 --- g77-0.5.19/f/storag.h Thu Nov 21 22:45:47 1996 *************** struct _ffestorag_ *** 79,83 **** area. */ ffetargetOffset size; /* Size of area. */ ! ffetargetOffset offset; /* Offset of entity within area. */ ffetargetAlign alignment; /* Initial alignment for entity. */ ffetargetAlign modulo; /* Modulo within alignment. */ --- 79,85 ---- area. */ ffetargetOffset size; /* Size of area. */ ! ffetargetOffset offset; /* Offset of entity within area, 0 for CBLOCK ! and non-equivalence LOCAL, <= 0 for equivalence ! LOCAL. */ ffetargetAlign alignment; /* Initial alignment for entity. */ ffetargetAlign modulo; /* Modulo within alignment. */ diff -rcp2N g77-0.5.18/f/stt.c g77-0.5.19/f/stt.c *** g77-0.5.18/f/stt.c Mon Dec 4 01:10:30 1995 --- g77-0.5.19/f/stt.c Thu Oct 31 06:21:34 1996 *************** ffestt_dimlist_as_expr (ffesttDimList li *** 215,218 **** --- 215,219 ---- ffeinfoKindtype nkt; ffetargetIntegerDefault low; + ffetargetIntegerDefault high; bool zero = FALSE; /* Zero-size array. */ bool any = FALSE; *************** ffestt_dimlist_as_expr (ffesttDimList li *** 234,240 **** else low = ffebld_constant_integerdefault (ffebld_conter (next->lower)); if (low ! > ffebld_constant_integerdefault (ffebld_conter (next->upper))) zero = TRUE; } else if (((next->lower != NULL) --- 235,252 ---- else low = ffebld_constant_integerdefault (ffebld_conter (next->lower)); + high = ffebld_constant_integerdefault (ffebld_conter (next->upper)); if (low ! > high) zero = TRUE; + if ((next->next == list) + && ffe_is_ugly_assumed () + && (next->lower == NULL) + && (high == 1)) + { + star = TRUE; + ffebld_append_item (&bottom, + ffebld_new_bounds (NULL, ffebld_new_star ())); + continue; + } } else if (((next->lower != NULL) diff -rcp2N g77-0.5.18/f/stu.c g77-0.5.19/f/stu.c *** g77-0.5.18/f/stu.c Mon Mar 25 15:09:49 1996 --- g77-0.5.19/f/stu.c Thu Nov 21 12:44:34 1996 *************** the Free Software Foundation, 59 Temple *** 58,62 **** static void ffestu_list_exec_transition_ (ffebld list); ! static void ffestu_symter_exec_transition_ (ffebld expr); static bool ffestu_dummies_transition_ (ffesymbol (*symfunc) (), ffebld list); --- 58,63 ---- static void ffestu_list_exec_transition_ (ffebld list); ! static bool ffestu_symter_end_transition_ (ffebld expr); ! static bool ffestu_symter_exec_transition_ (ffebld expr); static bool ffestu_dummies_transition_ (ffesymbol (*symfunc) (), ffebld list); *************** ffestu_sym_end_transition (ffesymbol s) *** 99,102 **** --- 100,111 ---- return s; } + else if (((swh == FFEINFO_whereLOCAL) + || (swh == FFEINFO_whereNONE)) + && (skd == FFEINFO_kindENTITY) + && ffestu_symter_end_transition_ (ffesymbol_dims (s))) + { /* Bad dimension expressions. */ + ffesymbol_error (s, NULL); + return s; + } break; *************** ffestu_sym_end_transition (ffesymbol s) *** 107,114 **** ffestu_dummies_transition_ (ffecom_sym_end_transition, ffesymbol_dummyargs (s)); ! else if ((swh == FFEINFO_whereDUMMY) ! && (ffesymbol_numentries (s) == 0)) ! { /* Not actually in any dummy list! */ ! ffesymbol_error (s, ffesta_tokens[0]); return s; } --- 116,136 ---- ffestu_dummies_transition_ (ffecom_sym_end_transition, ffesymbol_dummyargs (s)); ! else if (swh == FFEINFO_whereDUMMY) ! { ! if (ffesymbol_numentries (s) == 0) ! { /* Not actually in any dummy list! */ ! ffesymbol_error (s, ffesta_tokens[0]); ! return s; ! } ! if (ffestu_symter_end_transition_ (ffesymbol_dims (s))) ! { /* Bad dimension expressions. */ ! ffesymbol_error (s, NULL); ! return s; ! } ! } ! else if ((swh == FFEINFO_whereLOCAL) ! && ffestu_symter_end_transition_ (ffesymbol_dims (s))) ! { /* Bad dimension expressions. */ ! ffesymbol_error (s, NULL); return s; } *************** ffestu_sym_end_transition (ffesymbol s) *** 197,200 **** --- 219,228 ---- | FFESYMBOL_attrsTYPE))); + if (ffestu_symter_end_transition_ (ffesymbol_dims (s))) + { + ffesymbol_error (s, NULL); + return s; + } + if (sa & FFESYMBOL_attrsADJUSTABLE) { /* Not actually in any dummy list! */ *************** ffestu_sym_exec_transition (ffesymbol s) *** 444,449 **** nwh = FFEINFO_whereDUMMY; ! if (sa & (FFESYMBOL_attrsADJUSTABLE | FFESYMBOL_attrsANYSIZE)) ! ffestu_symter_exec_transition_ (ffesymbol_dims (s)); if (sa & (FFESYMBOL_attrsADJUSTS | FFESYMBOL_attrsARRAY --- 472,478 ---- nwh = FFEINFO_whereDUMMY; ! if (ffestu_symter_exec_transition_ (ffesymbol_dims (s))) ! na = FFESYMBOL_attrsetNONE; ! if (sa & (FFESYMBOL_attrsADJUSTS | FFESYMBOL_attrsARRAY *************** ffestu_sym_exec_transition (ffesymbol s) *** 452,456 **** | FFESYMBOL_attrsSFARG)) nkd = FFEINFO_kindENTITY; ! else { if (!(sa & FFESYMBOL_attrsTYPE)) --- 481,485 ---- | FFESYMBOL_attrsSFARG)) nkd = FFEINFO_kindENTITY; ! else if (sa & FFESYMBOL_attrsDUMMY) /* Still okay. */ { if (!(sa & FFESYMBOL_attrsTYPE)) *************** ffestu_sym_exec_transition (ffesymbol s) *** 599,608 **** nkd = FFEINFO_kindENTITY; ! if (sa & FFESYMBOL_attrsADJUSTABLE) ! ffestu_symter_exec_transition_ (ffesymbol_dims (s)); if (sa & (FFESYMBOL_attrsANYLEN | FFESYMBOL_attrsANYSIZE)) nwh = FFEINFO_whereDUMMY; ! else { nwh = FFEINFO_whereNONE; /* DUMMY, LOCAL. */ --- 628,638 ---- nkd = FFEINFO_kindENTITY; ! if (ffestu_symter_exec_transition_ (ffesymbol_dims (s))) ! na = FFESYMBOL_attrsetNONE; if (sa & (FFESYMBOL_attrsANYLEN | FFESYMBOL_attrsANYSIZE)) nwh = FFEINFO_whereDUMMY; ! else if (sa & (FFESYMBOL_attrsADJUSTABLE | FFESYMBOL_attrsANYSIZE)) ! /* Still okay. */ { nwh = FFEINFO_whereNONE; /* DUMMY, LOCAL. */ *************** ffestu_list_exec_transition_ (ffebld lis *** 849,852 **** --- 879,950 ---- } + /* ffestu_symter_end_transition_ -- Update SYMTERs in expr w/in symbol + + ffebld expr; + ffestu_symter_end_transition_(expr); + + Any SYMTER in expr's tree with whereNONE gets updated to the + (recursively transitioned) sym it identifies (DUMMY or COMMON). */ + + static bool + ffestu_symter_end_transition_ (ffebld expr) + { + ffesymbol symbol; + bool any = FALSE; + + /* Label used for tail recursion (reset expr and go here instead of calling + self). */ + + tail: /* :::::::::::::::::::: */ + + if (expr == NULL) + return any; + + switch (ffebld_op (expr)) + { + case FFEBLD_opITEM: + while (ffebld_trail (expr) != NULL) + { + if (ffestu_symter_end_transition_ (ffebld_head (expr))) + any = TRUE; + expr = ffebld_trail (expr); + } + expr = ffebld_head (expr); + goto tail; /* :::::::::::::::::::: */ + + case FFEBLD_opSYMTER: + symbol = ffecom_sym_end_transition (ffebld_symter (expr)); + if ((symbol != NULL) + && ffesymbol_attr (symbol, FFESYMBOL_attrANY)) + any = TRUE; + ffebld_set_info (expr, ffesymbol_info (symbol)); + break; + + case FFEBLD_opANY: + return TRUE; + + default: + break; + } + + switch (ffebld_arity (expr)) + { + case 2: + if (ffestu_symter_end_transition_ (ffebld_left (expr))) + any = TRUE; + expr = ffebld_right (expr); + goto tail; /* :::::::::::::::::::: */ + + case 1: + expr = ffebld_left (expr); + goto tail; /* :::::::::::::::::::: */ + + default: + break; + } + + return any; + } + /* ffestu_symter_exec_transition_ -- Update SYMTERs in expr w/in symbol *************** ffestu_list_exec_transition_ (ffebld lis *** 855,866 **** Any SYMTER in expr's tree with whereNONE gets updated to the ! (recursively transitioned) sym it identifies (DUMMY or COMMON). ! Make sure we don't get called recursively ourselves! */ ! ! static void ffestu_symter_exec_transition_ (ffebld expr) { ffesymbol symbol; /* Label used for tail recursion (reset expr and go here instead of calling --- 953,963 ---- Any SYMTER in expr's tree with whereNONE gets updated to the ! (recursively transitioned) sym it identifies (DUMMY or COMMON). */ ! static bool ffestu_symter_exec_transition_ (ffebld expr) { ffesymbol symbol; + bool any = FALSE; /* Label used for tail recursion (reset expr and go here instead of calling *************** tail: /* :::::::::::::::::::: */ *** 870,874 **** if (expr == NULL) ! return; switch (ffebld_op (expr)) --- 967,971 ---- if (expr == NULL) ! return any; switch (ffebld_op (expr)) *************** tail: /* :::::::::::::::::::: */ *** 877,881 **** while (ffebld_trail (expr) != NULL) { ! ffestu_symter_exec_transition_ (ffebld_head (expr)); expr = ffebld_trail (expr); } --- 974,979 ---- while (ffebld_trail (expr) != NULL) { ! if (ffestu_symter_exec_transition_ (ffebld_head (expr))) ! any = TRUE; expr = ffebld_trail (expr); } *************** tail: /* :::::::::::::::::::: */ *** 883,886 **** --- 981,995 ---- goto tail; /* :::::::::::::::::::: */ + case FFEBLD_opSYMTER: + symbol = ffecom_sym_exec_transition (ffebld_symter (expr)); + if ((symbol != NULL) + && ffesymbol_attr (symbol, FFESYMBOL_attrANY)) + any = TRUE; + ffebld_set_info (expr, ffesymbol_info (symbol)); + break; + + case FFEBLD_opANY: + return TRUE; + default: break; *************** tail: /* :::::::::::::::::::: */ *** 890,894 **** { case 2: ! ffestu_symter_exec_transition_ (ffebld_left (expr)); expr = ffebld_right (expr); goto tail; /* :::::::::::::::::::: */ --- 999,1004 ---- { case 2: ! if (ffestu_symter_exec_transition_ (ffebld_left (expr))) ! any = TRUE; expr = ffebld_right (expr); goto tail; /* :::::::::::::::::::: */ *************** tail: /* :::::::::::::::::::: */ *** 899,918 **** default: - switch (ffebld_op (expr)) - { - case FFEBLD_opSYMTER: - if (ffeinfo_where (ffebld_info (expr)) != FFEINFO_whereNONE) - break; /* Already have needed info. */ - symbol = ffecom_sym_exec_transition (ffebld_symter (expr)); - ffebld_set_info (expr, ffesymbol_info (symbol)); - break; - - default: - break; - } break; } ! return; } --- 1009,1016 ---- default: break; } ! return any; } diff -rcp2N g77-0.5.18/f/symbol.c g77-0.5.19/f/symbol.c *** g77-0.5.18/f/symbol.c Mon Mar 18 18:27:40 1996 --- g77-0.5.19/f/symbol.c Thu Nov 21 20:49:09 1996 *************** void *** 837,841 **** ffesymbol_error (ffesymbol s, ffelexToken t) { ! if (ffest_ffebad_start (FFEBAD_SYMERR)) { ffebad_string (ffesymbol_text (s)); --- 837,842 ---- ffesymbol_error (ffesymbol s, ffelexToken t) { ! if ((t != NULL) ! && ffest_ffebad_start (FFEBAD_SYMERR)) { ffebad_string (ffesymbol_text (s)); *************** ffesymbol_report (ffesymbol s) *** 1004,1008 **** if (s->accretion != NULL) { ! fprintf (dmpout, " accretion (%" ffetargetOffset_f "u left): ", s->accretes); ffebld_dump (s->accretion); --- 1005,1009 ---- if (s->accretion != NULL) { ! fprintf (dmpout, " accretion (%" ffetargetOffset_f "d left): ", s->accretes); ffebld_dump (s->accretion); *************** ffesymbol_report (ffesymbol s) *** 1010,1014 **** } else if (s->accretes != 0) ! fprintf (dmpout, " accretes!! = %" ffetargetOffset_f "u left\n", s->accretes); --- 1011,1015 ---- } else if (s->accretes != 0) ! fprintf (dmpout, " accretes!! = %" ffetargetOffset_f "d left\n", s->accretes); diff -rcp2N g77-0.5.18/f/target.c g77-0.5.19/f/target.c *** g77-0.5.18/f/target.c Mon Mar 18 16:20:36 1996 --- g77-0.5.19/f/target.c Thu Oct 31 06:25:38 1996 *************** ffetarget_integer1 (ffetargetInteger1 *v *** 1250,1253 **** --- 1250,1443 ---- #endif + /* ffetarget_integerbinary -- Convert token to a binary integer + + ffetarget_integerbinary x; + if (ffetarget_integerdefault_8(&x,integer_token)) + // conversion ok. + + Token use count not affected overall. */ + + bool + ffetarget_integerbinary (ffetargetIntegerDefault *val, ffelexToken integer) + { + ffetargetIntegerDefault x; + char *p; + char c; + bool bad_digit; + + assert ((ffelex_token_type (integer) == FFELEX_typeNAME) + || (ffelex_token_type (integer) == FFELEX_typeNUMBER)); + + p = ffelex_token_text (integer); + x = 0; + + /* Skip past leading zeros. */ + + while (((c = *p) != '\0') && (c == '0')) + ++p; + + /* Interpret rest of number. */ + + bad_digit = FALSE; + while (c != '\0') + { + if ((c >= '0') && (c <= '1')) + c -= '0'; + else + { + bad_digit = TRUE; + c = 0; + } + + #if 0 /* Don't complain about signed overflow; just + unsigned overflow. */ + if ((x == FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY) + && (c == FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY) + && (*(p + 1) == '\0')) + { + *val = FFETARGET_integerBIG_OVERFLOW_BINARY; + return TRUE; + } + else + #endif + #if FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY == 0 + if ((x & FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY) != 0) + #else + if (x == FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY) + { + if ((c > FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY) + || (*(p + 1) != '\0')) + { + ffebad_start (FFEBAD_INTEGER_TOO_LARGE); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + *val = 0; + return FALSE; + } + } + else if (x > FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY) + #endif + { + ffebad_start (FFEBAD_INTEGER_TOO_LARGE); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + *val = 0; + return FALSE; + } + x = (x << 1) + c; + c = *(++p); + }; + + if (bad_digit) + { + ffebad_start (FFEBAD_INVALID_BINARY_DIGIT); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + } + + *val = x; + return !bad_digit; + } + + /* ffetarget_integerhex -- Convert token to a hex integer + + ffetarget_integerhex x; + if (ffetarget_integerdefault_8(&x,integer_token)) + // conversion ok. + + Token use count not affected overall. */ + + bool + ffetarget_integerhex (ffetargetIntegerDefault *val, ffelexToken integer) + { + ffetargetIntegerDefault x; + char *p; + char c; + bool bad_digit; + + assert ((ffelex_token_type (integer) == FFELEX_typeNAME) + || (ffelex_token_type (integer) == FFELEX_typeNUMBER)); + + p = ffelex_token_text (integer); + x = 0; + + /* Skip past leading zeros. */ + + while (((c = *p) != '\0') && (c == '0')) + ++p; + + /* Interpret rest of number. */ + + bad_digit = FALSE; + while (c != '\0') + { + if ((c >= 'A') && (c <= 'F')) + c = c - 'A' + 10; + else if ((c >= 'a') && (c <= 'f')) + c = c - 'a' + 10; + else if ((c >= '0') && (c <= '9')) + c -= '0'; + else + { + bad_digit = TRUE; + c = 0; + } + + #if 0 /* Don't complain about signed overflow; just + unsigned overflow. */ + if ((x == FFETARGET_integerALMOST_BIG_OVERFLOW_HEX) + && (c == FFETARGET_integerFINISH_BIG_OVERFLOW_HEX) + && (*(p + 1) == '\0')) + { + *val = FFETARGET_integerBIG_OVERFLOW_HEX; + return TRUE; + } + else + #endif + #if FFETARGET_integerFINISH_BIG_OVERFLOW_HEX == 0 + if (x >= FFETARGET_integerALMOST_BIG_OVERFLOW_HEX) + #else + if (x == FFETARGET_integerALMOST_BIG_OVERFLOW_HEX) + { + if ((c > FFETARGET_integerFINISH_BIG_OVERFLOW_HEX) + || (*(p + 1) != '\0')) + { + ffebad_start (FFEBAD_INTEGER_TOO_LARGE); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + *val = 0; + return FALSE; + } + } + else if (x > FFETARGET_integerALMOST_BIG_OVERFLOW_HEX) + #endif + { + ffebad_start (FFEBAD_INTEGER_TOO_LARGE); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + *val = 0; + return FALSE; + } + x = (x << 4) + c; + c = *(++p); + }; + + if (bad_digit) + { + ffebad_start (FFEBAD_INVALID_HEX_DIGIT); + ffebad_here (0, ffelex_token_where_line (integer), + ffelex_token_where_column (integer)); + ffebad_finish (); + } + + *val = x; + return !bad_digit; + } + /* ffetarget_integeroctal -- Convert token to an octal integer *************** ffetarget_integeroctal (ffetargetInteger *** 1266,1270 **** bool bad_digit; ! assert (ffelex_token_type (integer) == FFELEX_typeNUMBER); p = ffelex_token_text (integer); --- 1456,1461 ---- bool bad_digit; ! assert ((ffelex_token_type (integer) == FFELEX_typeNAME) ! || (ffelex_token_type (integer) == FFELEX_typeNUMBER)); p = ffelex_token_text (integer); *************** ffetarget_integeroctal (ffetargetInteger *** 1281,1288 **** while (c != '\0') { #if 0 /* Don't complain about signed overflow; just unsigned overflow. */ if ((x == FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL) ! && (c == '0' + FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) && (*(p + 1) == '\0')) { --- 1472,1487 ---- while (c != '\0') { + if ((c >= '0') && (c <= '7')) + c -= '0'; + else + { + bad_digit = TRUE; + c = 0; + } + #if 0 /* Don't complain about signed overflow; just unsigned overflow. */ if ((x == FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL) ! && (c == FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) && (*(p + 1) == '\0')) { *************** ffetarget_integeroctal (ffetargetInteger *** 1297,1301 **** if (x == FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL) { ! if ((c > '0' + FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) || (*(p + 1) != '\0')) { --- 1496,1500 ---- if (x == FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL) { ! if ((c > FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) || (*(p + 1) != '\0')) { *************** ffetarget_integeroctal (ffetargetInteger *** 1318,1324 **** return FALSE; } ! x = (x << 3) + c - '0'; ! if (c >= '8') ! bad_digit = TRUE; c = *(++p); }; --- 1517,1521 ---- return FALSE; } ! x = (x << 3) + c; c = *(++p); }; diff -rcp2N g77-0.5.18/f/target.h g77-0.5.19/f/target.h *** g77-0.5.18/f/target.h Mon Mar 18 16:47:45 1996 --- g77-0.5.19/f/target.h Thu Nov 21 20:48:24 1996 *************** the Free Software Foundation, 59 Temple *** 83,95 **** #define FFETARGET_defaultIS_PEDANTIC 0 #endif - #ifndef FFETARGET_defaultIS_UGLY - #define FFETARGET_defaultIS_UGLY 0 - #endif - #ifndef FFETARGET_defaultIS_UGLY_ARGS - #define FFETARGET_defaultIS_UGLY_ARGS 1 - #endif - #ifndef FFETARGET_defaultIS_UGLY_INIT - #define FFETARGET_defaultIS_UGLY_INIT 1 - #endif #ifndef FFETARGET_defaultIS_VXT_NOT_90 #define FFETARGET_defaultIS_VXT_NOT_90 0 --- 83,86 ---- *************** the Free Software Foundation, 59 Temple *** 204,213 **** #define FFETARGET_integerALMOST_BIG_MAGICAL 214748364 #endif #ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL ! #define FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL 04000000000 #endif #ifndef FFETARGET_integerFINISH_BIG_MAGICAL #define FFETARGET_integerFINISH_BIG_MAGICAL 8 #endif #ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL #define FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL 0 --- 195,216 ---- #define FFETARGET_integerALMOST_BIG_MAGICAL 214748364 #endif + #ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY + #define FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY 0x80000000 + #endif + #ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_HEX + #define FFETARGET_integerALMOST_BIG_OVERFLOW_HEX 0x10000000 + #endif #ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL ! #define FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL 0x20000000 #endif #ifndef FFETARGET_integerFINISH_BIG_MAGICAL #define FFETARGET_integerFINISH_BIG_MAGICAL 8 #endif + #ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY + #define FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY 0 + #endif + #ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_HEX + #define FFETARGET_integerFINISH_BIG_OVERFLOW_HEX 0 + #endif #ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL #define FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL 0 *************** typedef void (*ffetargetCopyfunc) (void *** 262,267 **** typedef ffetargetCharacterSize ffetargetHollerithSize; #define ffetargetHollerithSize_f "l" ! typedef unsigned long ffetargetOffset; ! #define ffetargetOffset_f "l" #if FFETARGET_okINTEGER1 --- 265,270 ---- typedef ffetargetCharacterSize ffetargetHollerithSize; #define ffetargetHollerithSize_f "l" ! typedef long long ffetargetOffset; ! #define ffetargetOffset_f "ll" #if FFETARGET_okINTEGER1 *************** bool ffetarget_integer7 (ffetargetIntege *** 683,686 **** --- 686,693 ---- bool ffetarget_integer8 (ffetargetInteger8 *val, ffelexToken integer); #endif + bool ffetarget_integerbinary (ffetargetIntegerDefault *val, + ffelexToken integer); + bool ffetarget_integerhex (ffetargetIntegerDefault *val, + ffelexToken integer); bool ffetarget_integeroctal (ffetargetIntegerDefault *val, ffelexToken integer); diff -rcp2N g77-0.5.18/f/top.c g77-0.5.19/f/top.c *** g77-0.5.18/f/top.c Mon Mar 18 20:46:01 1996 --- g77-0.5.19/f/top.c Wed Nov 27 13:55:49 1996 *************** bool ffe_is_underscoring_ = FFETARGET_de *** 69,72 **** --- 69,73 ---- || FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED; bool ffe_is_second_underscore_ = FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED; + bool ffe_is_debug_kludge_ = FALSE; bool ffe_is_dollar_ok_ = FFETARGET_defaultIS_DOLLAR_OK; bool ffe_is_f2c_ = FFETARGET_defaultIS_F2C; *************** bool ffe_is_init_local_zero_ = FFETARGET *** 78,86 **** bool ffe_is_mainprog_; /* TRUE if current prog unit known to be main. */ bool ffe_is_pedantic_ = FFETARGET_defaultIS_PEDANTIC; bool ffe_is_saveall_; /* TRUE if mainprog or SAVE (no args) seen. */ ! bool ffe_is_ugly_ = FFETARGET_defaultIS_UGLY; ! bool ffe_is_ugly_args_ = FFETARGET_defaultIS_UGLY_ARGS; ! bool ffe_is_ugly_init_ = FFETARGET_defaultIS_UGLY_INIT; bool ffe_is_version_ = FALSE; bool ffe_is_vxt_not_90_ = FFETARGET_defaultIS_VXT_NOT_90; --- 79,92 ---- bool ffe_is_mainprog_; /* TRUE if current prog unit known to be main. */ + bool ffe_is_onetrip_ = FALSE; + bool ffe_is_silent_ = TRUE; + bool ffe_is_typeless_boz_ = TRUE; /* Will become FALSE as of 0.5.20 or so. */ bool ffe_is_pedantic_ = FFETARGET_defaultIS_PEDANTIC; bool ffe_is_saveall_; /* TRUE if mainprog or SAVE (no args) seen. */ ! bool ffe_is_ugly_args_ = TRUE; ! bool ffe_is_ugly_assumed_ = FALSE; /* DIMENSION X([...,]1) => DIMENSION X([...,]*) */ ! bool ffe_is_ugly_comma_ = FALSE; ! bool ffe_is_ugly_init_ = TRUE; ! bool ffe_is_ugly_logint_ = FALSE; bool ffe_is_version_ = FALSE; bool ffe_is_vxt_not_90_ = FFETARGET_defaultIS_VXT_NOT_90; *************** ffe_decode_option (char *opt) *** 163,169 **** --- 169,177 ---- { 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; flag_rerun_loop_opt = 1; + #endif } else if (strcmp (&opt[2], "ident") == 0) *************** ffe_decode_option (char *opt) *** 171,174 **** --- 179,201 ---- else if (strcmp (&opt[2], "no-ident") == 0) ffe_set_is_ident (FALSE); + else if (strcmp (&opt[2], "f66") == 0) + { + ffe_set_is_onetrip (TRUE); + ffe_set_is_ugly_assumed (TRUE); + } + else if (strcmp (&opt[2], "no-f66") == 0) + { + ffe_set_is_onetrip (FALSE); + ffe_set_is_ugly_assumed (FALSE); + } + else if (strcmp (&opt[2], "f77") == 0) + { + ffe_set_is_backslash (TRUE); + ffe_set_is_typeless_boz (FALSE); + } + else if (strcmp (&opt[2], "no-f77") == 0) + { + ffe_set_is_backslash (FALSE); + } else if (strcmp (&opt[2], "f90") == 0) ffe_set_is_90 (TRUE); *************** ffe_decode_option (char *opt) *** 209,221 **** else if (strcmp (&opt[2], "ugly") == 0) { - ffe_set_is_ugly (TRUE); ffe_set_is_ugly_args (TRUE); ffe_set_is_ugly_init (TRUE); } else if (strcmp (&opt[2], "no-ugly") == 0) { - ffe_set_is_ugly (FALSE); ffe_set_is_ugly_args (FALSE); ffe_set_is_ugly_init (FALSE); } else if (strcmp (&opt[2], "ugly-args") == 0) --- 236,252 ---- else if (strcmp (&opt[2], "ugly") == 0) { ffe_set_is_ugly_args (TRUE); + ffe_set_is_ugly_assumed (TRUE); + ffe_set_is_ugly_comma (TRUE); ffe_set_is_ugly_init (TRUE); + ffe_set_is_ugly_logint (TRUE); } else if (strcmp (&opt[2], "no-ugly") == 0) { ffe_set_is_ugly_args (FALSE); + ffe_set_is_ugly_assumed (FALSE); + ffe_set_is_ugly_comma (FALSE); ffe_set_is_ugly_init (FALSE); + ffe_set_is_ugly_logint (FALSE); } else if (strcmp (&opt[2], "ugly-args") == 0) *************** ffe_decode_option (char *opt) *** 223,230 **** --- 254,273 ---- else if (strcmp (&opt[2], "no-ugly-args") == 0) ffe_set_is_ugly_args (FALSE); + else if (strcmp (&opt[2], "ugly-assumed") == 0) + ffe_set_is_ugly_assumed (TRUE); + else if (strcmp (&opt[2], "no-ugly-assumed") == 0) + ffe_set_is_ugly_assumed (FALSE); + else if (strcmp (&opt[2], "ugly-comma") == 0) + ffe_set_is_ugly_comma (TRUE); + else if (strcmp (&opt[2], "no-ugly-comma") == 0) + ffe_set_is_ugly_comma (FALSE); else if (strcmp (&opt[2], "ugly-init") == 0) ffe_set_is_ugly_init (TRUE); else if (strcmp (&opt[2], "no-ugly-init") == 0) ffe_set_is_ugly_init (FALSE); + else if (strcmp (&opt[2], "ugly-logint") == 0) + ffe_set_is_ugly_logint (TRUE); + else if (strcmp (&opt[2], "no-ugly-logint") == 0) + ffe_set_is_ugly_logint (FALSE); else if (strcmp (&opt[2], "debug") == 0) ffe_set_is_ffedebug (TRUE); *************** ffe_decode_option (char *opt) *** 247,250 **** --- 290,313 ---- else if (strcmp (&opt[2], "no-second-underscore") == 0) ffe_set_is_second_underscore (FALSE); + else if (strcmp (&opt[2], "zeros") == 0) + ffe_set_is_zeros (TRUE); + else if (strcmp (&opt[2], "no-zeros") == 0) + ffe_set_is_zeros (FALSE); + else if (strcmp (&opt[2], "debug-kludge") == 0) + ffe_set_is_debug_kludge (TRUE); + else if (strcmp (&opt[2], "no-debug-kludge") == 0) + ffe_set_is_debug_kludge (FALSE); + else if (strcmp (&opt[2], "onetrip") == 0) + ffe_set_is_onetrip (TRUE); + else if (strcmp (&opt[2], "no-onetrip") == 0) + ffe_set_is_onetrip (FALSE); + else if (strcmp (&opt[2], "silent") == 0) + ffe_set_is_silent (TRUE); + else if (strcmp (&opt[2], "no-silent") == 0) + ffe_set_is_silent (FALSE); + else if (strcmp (&opt[2], "typeless-boz") == 0) + ffe_set_is_typeless_boz (TRUE); + else if (strcmp (&opt[2], "no-typeless-boz") == 0) + ffe_set_is_typeless_boz (FALSE); else if (strcmp (&opt[2], "intrin-case-initcap") == 0) ffe_set_case_intrin (FFE_caseINITCAP); *************** ffe_decode_option (char *opt) *** 367,374 **** else if (strcmp (&opt[2], "vxt-intrinsics-enable") == 0) ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED); - else if (strcmp (&opt[2], "zeros") == 0) - ffe_set_is_zeros (TRUE); - else if (strcmp (&opt[2], "no-zeros") == 0) - ffe_set_is_zeros (FALSE); else if (strncmp (&opt[2], "fixed-line-length-", strlen ("fixed-line-length-")) == 0) --- 430,433 ---- *************** ffe_decode_option (char *opt) *** 420,424 **** warn_uninitialized = 2; warn_unused = 1; - ffe_set_is_warn_surprising (TRUE); } else --- 479,482 ---- diff -rcp2N g77-0.5.18/f/top.h g77-0.5.19/f/top.h *** g77-0.5.18/f/top.h Mon Mar 18 16:56:33 1996 --- g77-0.5.19/f/top.h Thu Nov 7 19:10:35 1996 *************** extern bool ffe_is_backslash_; *** 85,88 **** --- 85,89 ---- extern bool ffe_is_underscoring_; extern bool ffe_is_second_underscore_; + extern bool ffe_is_debug_kludge_; extern bool ffe_is_dollar_ok_; extern bool ffe_is_f2c_; *************** extern bool ffe_is_ident_; *** 93,101 **** extern bool ffe_is_init_local_zero_; extern bool ffe_is_mainprog_; extern bool ffe_is_pedantic_; extern bool ffe_is_saveall_; - extern bool ffe_is_ugly_; extern bool ffe_is_ugly_args_; extern bool ffe_is_ugly_init_; extern bool ffe_is_version_; extern bool ffe_is_vxt_not_90_; --- 94,107 ---- extern bool ffe_is_init_local_zero_; extern bool ffe_is_mainprog_; + extern bool ffe_is_onetrip_; + extern bool ffe_is_silent_; + extern bool ffe_is_typeless_boz_; extern bool ffe_is_pedantic_; extern bool ffe_is_saveall_; extern bool ffe_is_ugly_args_; + extern bool ffe_is_ugly_assumed_; + extern bool ffe_is_ugly_comma_; extern bool ffe_is_ugly_init_; + extern bool ffe_is_ugly_logint_; extern bool ffe_is_version_; extern bool ffe_is_vxt_not_90_; *************** void ffe_terminate_4 (void); *** 158,161 **** --- 164,168 ---- #define ffe_is_automatic() ffe_is_automatic_ #define ffe_is_backslash() ffe_is_backslash_ + #define ffe_is_debug_kludge() ffe_is_debug_kludge_ #define ffe_is_do_internal_checks() ffe_is_do_internal_checks_ #define ffe_is_dollar_ok() ffe_is_dollar_ok_ *************** void ffe_terminate_4 (void); *** 167,177 **** #define ffe_is_init_local_zero() ffe_is_init_local_zero_ #define ffe_is_mainprog() ffe_is_mainprog_ #define ffe_is_pedantic() ffe_is_pedantic_ #define ffe_is_pedantic_not_90() (ffe_is_pedantic_ && !ffe_is_90_) #define ffe_is_saveall() ffe_is_saveall_ #define ffe_is_second_underscore() ffe_is_second_underscore_ ! #define ffe_is_ugly() ffe_is_ugly_ #define ffe_is_ugly_args() ffe_is_ugly_args_ #define ffe_is_ugly_init() ffe_is_ugly_init_ #define ffe_is_underscoring() ffe_is_underscoring_ #define ffe_is_version() ffe_is_version_ --- 174,189 ---- #define ffe_is_init_local_zero() ffe_is_init_local_zero_ #define ffe_is_mainprog() ffe_is_mainprog_ + #define ffe_is_onetrip() ffe_is_onetrip_ #define ffe_is_pedantic() ffe_is_pedantic_ #define ffe_is_pedantic_not_90() (ffe_is_pedantic_ && !ffe_is_90_) #define ffe_is_saveall() ffe_is_saveall_ #define ffe_is_second_underscore() ffe_is_second_underscore_ ! #define ffe_is_silent() ffe_is_silent_ ! #define ffe_is_typeless_boz() ffe_is_typeless_boz_ #define ffe_is_ugly_args() ffe_is_ugly_args_ + #define ffe_is_ugly_assumed() ffe_is_ugly_assumed_ + #define ffe_is_ugly_comma() ffe_is_ugly_comma_ #define ffe_is_ugly_init() ffe_is_ugly_init_ + #define ffe_is_ugly_logint() ffe_is_ugly_logint_ #define ffe_is_underscoring() ffe_is_underscoring_ #define ffe_is_version() ffe_is_version_ *************** void ffe_terminate_4 (void); *** 197,200 **** --- 209,213 ---- #define ffe_set_is_automatic(f) (ffe_is_automatic_ = (f)) #define ffe_set_is_backslash(f) (ffe_is_backslash_ = (f)) + #define ffe_set_is_debug_kludge(f) (ffe_is_debug_kludge_ = (f)) #define ffe_set_is_do_internal_checks(f) (ffe_set_is_do_internal_checks_ = (f)) #define ffe_set_is_dollar_ok(f) (ffe_is_dollar_ok_ = (f)) *************** void ffe_terminate_4 (void); *** 206,215 **** #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_pedantic(f) (ffe_is_pedantic_ = (f)) #define ffe_set_is_saveall(f) (ffe_is_saveall_ = (f)) #define ffe_set_is_second_underscore(f) (ffe_is_second_underscore_ = (f)) ! #define ffe_set_is_ugly(f) (ffe_is_ugly_ = (f)) #define ffe_set_is_ugly_args(f) (ffe_is_ugly_args_ = (f)) #define ffe_set_is_ugly_init(f) (ffe_is_ugly_init_ = (f)) #define ffe_set_is_underscoring(f) (ffe_is_underscoring_ = (f)) #define ffe_set_is_version(f) (ffe_is_version_ = (f)) --- 219,233 ---- #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_onetrip(f) (ffe_is_onetrip_ = (f)) #define ffe_set_is_pedantic(f) (ffe_is_pedantic_ = (f)) #define ffe_set_is_saveall(f) (ffe_is_saveall_ = (f)) #define ffe_set_is_second_underscore(f) (ffe_is_second_underscore_ = (f)) ! #define ffe_set_is_silent(f) (ffe_is_silent_ = (f)) ! #define ffe_set_is_typeless_boz(f) (ffe_is_typeless_boz_ = (f)) #define ffe_set_is_ugly_args(f) (ffe_is_ugly_args_ = (f)) + #define ffe_set_is_ugly_assumed(f) (ffe_is_ugly_assumed_ = (f)) + #define ffe_set_is_ugly_comma(f) (ffe_is_ugly_comma_ = (f)) #define ffe_set_is_ugly_init(f) (ffe_is_ugly_init_ = (f)) + #define ffe_set_is_ugly_logint(f) (ffe_is_ugly_logint_ = (f)) #define ffe_set_is_underscoring(f) (ffe_is_underscoring_ = (f)) #define ffe_set_is_version(f) (ffe_is_version_ = (f)) diff -rcp2N g77-0.5.18/f/zzz.c g77-0.5.19/f/zzz.c *** g77-0.5.18/f/zzz.c Mon Apr 1 10:14:31 1996 --- g77-0.5.19/f/zzz.c Sat Dec 7 05:57:23 1996 *************** the Free Software Foundation, 59 Temple *** 30,34 **** */ - #include "proj.h" #include "zzz.h" --- 30,33 ---- *************** the Free Software Foundation, 59 Temple *** 38,48 **** #ifndef FFEZZZ_DATE #define FFEZZZ_DATE __DATE__ ! #endif #ifndef FFEZZZ_TIME #define FFEZZZ_TIME __TIME__ ! #endif ! char *ffezzz_version_string = "0.5.18"; char *ffezzz_date = FFEZZZ_DATE; char *ffezzz_time = FFEZZZ_TIME; --- 37,56 ---- #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.19"; char *ffezzz_date = FFEZZZ_DATE; char *ffezzz_time = FFEZZZ_TIME;