diff options
Diffstat (limited to 'gnu')
137 files changed, 4430 insertions, 1203 deletions
diff --git a/gnu/usr.bin/gcc/f/BUGS b/gnu/usr.bin/gcc/f/BUGS index 7faed1860bc..f6232ce52ba 100644 --- a/gnu/usr.bin/gcc/f/BUGS +++ b/gnu/usr.bin/gcc/f/BUGS @@ -44,8 +44,6 @@ port, build, and install `g77', *Note Problems Installing::. the way the `gcc' command does. For example, `gcc' accepts 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. @@ -99,6 +97,13 @@ port, build, and install `g77', *Note Problems Installing::. similar bug for 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. + + *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 must currently set a breakpoint at `MAIN__' (or `MAIN___' or @@ -132,9 +137,9 @@ port, build, and install `g77', *Note Problems Installing::. up only when compiling the Fortran program with `-O'. * `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. + 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" support for `COMPLEX' types. Based on their input, it seems many @@ -142,11 +147,9 @@ port, build, and install `g77', *Note Problems Installing::. `__complex__' type, such as `__complex__ int' (where the real and 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. + 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 general expressions (other than simple variables/arrays), to diff --git a/gnu/usr.bin/gcc/f/ChangeLog b/gnu/usr.bin/gcc/f/ChangeLog index b3c88fcea1a..b432f0f3cb7 100644 --- a/gnu/usr.bin/gcc/f/ChangeLog +++ b/gnu/usr.bin/gcc/f/ChangeLog @@ -1,3 +1,340 @@ +Fri Dec 6 12:23:55 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * 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 <d.love@dl.ac.uk> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + 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 <burley@gnu.ai.mit.edu> + + 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 <d.love@dl.ac.uk> + + * lex.c: Fix last change. + +1996-11-14 Dave Love <d.love@dl.ac.uk> + + * Make-lang.in, config-lang.in: Remove the (broken) libU77 stuff, + pending 0.5.20. + +Thu Nov 14 15:40:59 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * bad.def (FFEBAD_UNIMPL_STMT): Explain that invalid + intrinsic references can trigger this message, too. + +1996-11-12 Dave Love <d.love@dl.ac.uk> + + * lex.c: Declare dwarfout routines. + + * config-lang.in: Sink grep o/p. + +Mon Nov 11 14:21:13 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * g77.c (main): Might as well print version number + for --verbose as well. + +Thu Nov 7 18:41:41 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * target.c (ffetarget_integerhex): Fix dumb bug. + +1996-10-20 Dave Love <d.love@dl.ac.uk> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <d.love@dl.ac.uk> + + * 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 <d.love@dl.ac.uk> + + * 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 <d.love@dl.ac.uk> + + * Make-lang.in (f77-runtime): + `stmp-hdrs' should have been `stmp-headers'. + +1996-08-20 Dave Love <d.love@dl.ac.uk> + + * Make-lang.in (f77-runtime): + Depend on stmp-hdrs, not stmp-int-hdrs, since libF77 + needs float.h. + +1996-05-20 Dave Love <d.love@dl.ac.uk> + + * 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 <burley@gnu.ai.mit.edu> + + * top.c (ffe_decode_option): -Wall no longer implies + -Wsurprising. + +Sat Apr 13 14:50:06 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> * Version 0.5.18 released. diff --git a/gnu/usr.bin/gcc/f/INSTALL b/gnu/usr.bin/gcc/f/INSTALL index b0e71c08674..01fefceae0d 100644 --- a/gnu/usr.bin/gcc/f/INSTALL +++ b/gnu/usr.bin/gcc/f/INSTALL @@ -51,7 +51,7 @@ follow the `g77' installation instructions: Without an applicable `gcc' source tree, you cannot build `g77'. You can obtain an FSF distribution of `gcc' from the FSF. -`g77-0.5.18.tar.gz' +`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 this distribution. This distribution approximately 1MB large. @@ -61,7 +61,7 @@ follow the `g77' installation instructions: 100MB disk space For a complete "bootstrap" build, about 100MB of disk space is - required for `g77' by the author's current Linux system. + required for `g77' by the author's current GNU/Linux system. Some juggling can reduce the amount of space needed; during the bootstrap process, once Stage 3 starts, during which the version @@ -177,11 +177,10 @@ General Problems `LD' and `AR' in the appropriate ways. * `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. + compiler tree. The necessary patches should be folded in to the + mainline gcc distribution. - (Some combinations of versions of `g77' and `gcc' might actually + 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. These patch files might contain unnecessary, but possibly helpful, @@ -260,7 +259,7 @@ is assumed that the source distributions themselves already reside in system: /usr/FSF/gcc-2.7.2.tar.gz - /usr/FSF/g77-0.5.18.tar.gz + /usr/FSF/g77-0.5.19.tar.gz Users of the following systems should not blindly follow these quick-start instructions, because of problems their systems have coping @@ -283,49 +282,49 @@ trouble, including possibly breaking existing programs for other users of your system. Before doing so, it is wise to review the explanations of some of the steps. These explanations follow this list of steps. - sh[ 1]# `cd /usr/src' + sh[ 1]# cd /usr/src - sh[ 2]# `gunzip -c < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -' + 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 -' + 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[ 4]# ln -s gcc-2.7.2 gcc - sh[ 5]# `ln -s g77-0.5.18 g77' + sh[ 5]# ln -s g77-0.5.19 g77 - sh[ 6]# `mv -i g77/* gcc' + 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' + 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' + 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' + 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' + 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 + You might need a different --prefix=..., as described below.] - sh[12]# `make bootstrap' + sh[12]# make bootstrap [This takes a long time, and is where most problems occur.] - sh[13]# `rm -fr stage1' + sh[13]# rm -fr stage1 - sh[14]# `make -k install' + sh[14]# make -k install [The actual installation.] - sh[15]# `g77 -v' + sh[15]# g77 -v [Verify that g77 is installed, obtain version info.] sh[16]# @@ -344,7 +343,7 @@ Step 1: `cd /usr/src' installed version of `g77' and `gcc' in any case. Step 4: `ln -s gcc-2.7.2 gcc' -Step 5: `ln -s g77-0.5.18 g77' +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 `g77'. @@ -354,7 +353,7 @@ Step 5: `ln -s g77-0.5.18 g77' 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 + 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 system. @@ -462,12 +461,12 @@ generally only the documentation is immediately usable. 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' + 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 pipe...' as they complete. That is nothing to worry about, unless you @@ -520,6 +519,12 @@ are using either an old, unsupported version, or a release one that is newer than the newest `gcc' version supported by the version of `g77' 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 that distribution. The format is, generally, MAJOR.MINOR.PATCH, with @@ -547,10 +552,11 @@ the version number for `gcc' differs only in the PATCH field, you might as well try applying the `g77' patch that is for the newest version of `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). + 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 version of `g77' no matter which patch file was used, so a new version @@ -592,16 +598,12 @@ type `rm -i *.~*~'. *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. +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/'. @@ -700,7 +702,11 @@ change to `gcc/f/proj.h': edit the line reading #define FFEPROJ_STRTOUL 1 ... -by replacing the `1' with `0'. +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 `g77' distribution to be compiled and linked into whatever `g77' @@ -709,7 +715,8 @@ function in their system libraries. 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()'. +`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 environment. You should upgrade your system to one that provides a @@ -942,8 +949,8 @@ work. Here are some commands you can try, and output typically printed by them when they work: - sh# `cd /usr/src/gcc' - sh# `./g77 --driver=./xgcc -B./ -v' + sh# cd /usr/src/gcc + sh# ./g77 --driver=./xgcc -B./ -v ./xgcc -B./ -v -fnull-version -o /tmp/gfa03648 ... Reading specs from ./specs gcc version 2.7.1 @@ -959,11 +966,11 @@ them when they work: End of search list. ./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: ... + 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' + sh# ./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone Reading specs from ./specs gcc version 2.7.1 ./cpp -lang-c -v -isystem ./include -undef ... @@ -1077,9 +1084,9 @@ other versions of `gcc', this was called `make realclean'), and, to ensure that `bison' is not invoked by `make' during the build, type 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# 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# These commands update the date-time-modified information for all the @@ -1116,7 +1123,7 @@ file `gcc/COPYING' thoroughly). Then, consider your target audience and decide where `g77' should be installed. - For systems like Linux that have no native Fortran compiler (or + 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 installation in `/usr/bin' instead of `/usr/local/bin'. Specify the @@ -1247,6 +1254,11 @@ larger-sized entities to be put on the stack (which can improve run-time performance, as it presents more opportunities for the GBE to optimize the generated code). + *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 --------------------------- @@ -1257,8 +1269,7 @@ improvements for g77-0.6 will give it the capabilities it needs to not have to crash the build but rather generate correct code for the target. (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/'.) +that does something like `EQUIVALENCE (I,R)' and `DATA R/9.43578/'.) Initialization of Large Aggregate Areas --------------------------------------- @@ -1298,14 +1309,9 @@ Alpha Problems target configuration that is not basically a 32-bit machine (such as an Alpha, which is a 64-bit machine, especially if it has a 64-bit operating system running on it). 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.) +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 --git a/gnu/usr.bin/gcc/f/Make-lang.in b/gnu/usr.bin/gcc/f/Make-lang.in index 71fe1520691..1c4cd537dc3 100644 --- a/gnu/usr.bin/gcc/f/Make-lang.in +++ b/gnu/usr.bin/gcc/f/Make-lang.in @@ -1,5 +1,5 @@ -# Top level makefile fragment for GNU Fortran. -# Copyright (C) 1995 Free Software Foundation, Inc. +# Top level makefile fragment for GNU Fortran. -*-makefile-*- +# Copyright (C) 1995, 1996 Free Software Foundation, Inc. #This file is part of GNU Fortran. @@ -48,6 +48,7 @@ F77_FLAGS_TO_PASS = \ BISONFLAGS="$(BISONFLAGS)" \ CC="$(CC)" \ CFLAGS="$(CFLAGS)" \ + X_CFLAGS="$(X_CFLAGS)" \ LDFLAGS="$(LDFLAGS)" \ LEX="$(LEX)" \ LEXFLAGS="$(LEXFLAGS)" \ @@ -107,14 +108,23 @@ F77 f77: f771 f77-runtime f77.maintainer-clean f77.realclean f77.stage1 f77.stage2 f77.stage3 \ f77.stage4 f77.distdir f77.rebuilt -# Create the compiler driver for g77. +# Create the compiler driver for g77 (only if `f77' is in LANGUAGES). g77: f/g77.c $(CONFIG_H) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ $(srcdir)/f/g77.c $(LIBS) + 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. +# 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) - $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ \ - -DGCC_NAME=\"$(GCC_CROSS_NAME)\" $(srcdir)/f/g77.c version.o $(LIBS) + 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. $(build_infodir)/f/g77.info: f/g77.texi f/bugs.texi f/install.texi f/news.texi @@ -241,8 +251,9 @@ f/Makefile: $(srcdir)/f/Makefile.in $(srcdir)/configure # to keep stage? links around everywhere) unless this value has been # 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) \ +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*) top=`pwd`; \ @@ -257,7 +268,7 @@ f77-runtime: f/runtime/Makefile include/f2c.h $(stmp-int-headers) \ # This one doesn't depend on cc1 etc. but f2c.h may not be found, # in particular, at present... f77-runtime-unsafe: - $(MAKE) stmp-int-hdrs= GCC_PARTS= f77-runtime + $(MAKE) stmp-headers= GCC_PARTS= f77-runtime # The configuration of the runtime system relies on an autoconf-type # configure, not a Cygnus-type one. It needs to be run *after* the @@ -269,7 +280,7 @@ f/runtime/libF77/Makefile f/runtime/libI77/Makefile: \ $(srcdir)/f/com.h f/proj.h $(srcdir)/f/runtime/Makefile.in \ $(srcdir)/f/runtime/libF77/Makefile.in \ $(srcdir)/f/runtime/libI77/Makefile.in \ - $(GCC_PARTS) $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) + $(GCC_PARTS) # The make "stage?" in compiler spec. is fully qualified as above top=`pwd`; \ src=`cd $(srcdir); pwd`; \ @@ -281,7 +292,7 @@ f/runtime/libF77/Makefile f/runtime/libI77/Makefile: \ $${src}/f/runtime/configure --srcdir=$${src}/f/runtime #For now, omit f2c stuff. -- burley -#f2c: stmp-int-hdrs f/f2c/Makefile +#f2c: stmp-headers f/f2c/Makefile # cd f/f2c; $(MAKE) all # #f/f2c/Makefile: $(srcdir)/f/f2c/Makefile.in $(GCC_PARTS) \ @@ -460,11 +471,13 @@ f77.mostlyclean: -rm -f f/*$(objext) -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 +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. f77.extraclean: f77.distclean diff --git a/gnu/usr.bin/gcc/f/Makefile.in b/gnu/usr.bin/gcc/f/Makefile.in index 8d9f4d3da80..fd29ecc10c5 100644 --- a/gnu/usr.bin/gcc/f/Makefile.in +++ b/gnu/usr.bin/gcc/f/Makefile.in @@ -138,8 +138,11 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) # 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 ` +# 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 --git a/gnu/usr.bin/gcc/f/NEWS b/gnu/usr.bin/gcc/f/NEWS index 4ecf6d3a862..1ac6a81f94c 100644 --- a/gnu/usr.bin/gcc/f/NEWS +++ b/gnu/usr.bin/gcc/f/NEWS @@ -6,6 +6,93 @@ notice and permission notice. News About GNU Fortran ********************** +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: ========== @@ -137,6 +224,8 @@ In 0.5.18: using that wider type (wider than default `INTEGER') must be rewritten.) + * Support `gcc' version 2.7.2. + * Upgrade to `libf2c' as of 1996-03-23, and fix up some of the build procedures. @@ -233,7 +322,7 @@ In 0.5.16: ========== * Fix a code-generation bug involving complicated `EQUIVALENCE' - statements not involving `COMMON' + statements not involving `COMMON'. * Fix code-generation bugs involving invoking "gratis" library procedures in `libf2c' from code compiled with `-fno-f2c' by diff --git a/gnu/usr.bin/gcc/f/bad.def b/gnu/usr.bin/gcc/f/bad.def index 23e871d4117..4fc20eccec2 100644 --- a/gnu/usr.bin/gcc/f/bad.def +++ b/gnu/usr.bin/gcc/f/bad.def @@ -104,6 +104,12 @@ FFEBAD_MSGS2 (FFEBAD_INVALID_DOTDOT, FATAL, FFEBAD_MSGS2 (FFEBAD_QUOTE_MISSES_DIGITS, FATAL, "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", "Invalid octal constant at %0") @@ -167,7 +173,7 @@ FFEBAD_MSGS2 (FFEBAD_UNREC_STMT, FATAL, "Unrecognized statement name at %0 and invalid form for assignment or statement-function definition at %1", "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)", +"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, "Invalid form for %A statement at %0", @@ -563,7 +569,7 @@ FFEBAD_MSGS1 (FFEBAD_EQUIV_COMMON, FATAL, FFEBAD_MSGS1 (FFEBAD_EQUIV_ALIGN, FATAL, "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'") +"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_MSGS1 (FFEBAD_EQUIV_SUBSTR, FATAL, @@ -576,7 +582,7 @@ FFEBAD_MSGS2 (FFEBAD_COMMON_PAD, WARN, "Padding of %A %D required before `%B' in common block `%C' at %0 -- consider reordering members, largest-type-size first", "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'") +"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") FFEBAD_MSGS1 (FFEBAD_EQUIV_MANY, FATAL, diff --git a/gnu/usr.bin/gcc/f/bld.c b/gnu/usr.bin/gcc/f/bld.c index 04e05f39997..63fe91d678a 100644 --- a/gnu/usr.bin/gcc/f/bld.c +++ b/gnu/usr.bin/gcc/f/bld.c @@ -1486,11 +1486,49 @@ ffebld_constant_new_integer4_val (ffetargetInteger4 val) } #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 decimal integer constant, thus it must be an + Parses the token as a octal integer constant, thus it must be an FFELEX_typeNUMBER. */ ffebldConstant @@ -1498,7 +1536,8 @@ ffebld_constant_new_integeroctal (ffelexToken t) { ffetargetIntegerDefault val; - assert (ffelex_token_type (t) == FFELEX_typeNUMBER); + assert ((ffelex_token_type (t) == FFELEX_typeNAME) + || (ffelex_token_type (t) == FFELEX_typeNUMBER)); ffetarget_integeroctal (&val, t); return ffebld_constant_new_integerdefault_val (val); @@ -1995,10 +2034,10 @@ ffebld_constantarray_dump (ffebldConstantArray array, ffeinfoBasictype bt, if (value && (length != 0)) { if (length == 1) - fprintf (dmpout, "[%" ffetargetOffset_f "u]:", offset); + fprintf (dmpout, "[%" ffetargetOffset_f "d]:", offset); else fprintf (dmpout, - "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "u]:", + "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "d]:", offset, offset + length - 1); for (i = 0; i < length; ++i, ++offset) { diff --git a/gnu/usr.bin/gcc/f/bld.h b/gnu/usr.bin/gcc/f/bld.h index 8b48ccb9af5..7e77c1e26cb 100644 --- a/gnu/usr.bin/gcc/f/bld.h +++ b/gnu/usr.bin/gcc/f/bld.h @@ -586,6 +586,8 @@ ffebldConstant ffebld_constant_new_integer7_val (ffetargetInteger7 val); ffebldConstant ffebld_constant_new_integer8 (ffelexToken t); 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 ffebldConstant ffebld_constant_new_logical1 (bool truth); diff --git a/gnu/usr.bin/gcc/f/bugs.texi b/gnu/usr.bin/gcc/f/bugs.texi index a7305e235e5..4feeab0d0ca 100644 --- a/gnu/usr.bin/gcc/f/bugs.texi +++ b/gnu/usr.bin/gcc/f/bugs.texi @@ -5,7 +5,7 @@ @c The text of this file appears in the file BUGS @c in the G77 distribution, as well as in the G77 manual. -@c 1996-03-25 +@c 1996-11-27 @ifclear BUGSONLY @node Actual Bugs @@ -72,9 +72,6 @@ For example, @code{gcc} accepts abbreviated forms of long options, @code{g77} generally doesn't. @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. @@ -148,11 +145,18 @@ one debug format---perhaps it works with others. And it turns out there's a similar bug for local equivalence areas, so that has been disabled as well. -@item +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 set a breakpoint at @samp{MAIN__} (or @samp{MAIN___} or @samp{MAIN_} if @@ -204,10 +208,9 @@ The known problem shows up only when compiling the Fortran program with @cindex support, Alpha @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. +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 @cindex support, COMPLEX @@ -220,12 +223,10 @@ the problems affect only the more-general facilities for gcc's (where the real and imaginary parts are integers) that GNU 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. +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 @cindex support, ELF diff --git a/gnu/usr.bin/gcc/f/com-rt.def b/gnu/usr.bin/gcc/f/com-rt.def index 0d79ef73754..dae8b2a864f 100644 --- a/gnu/usr.bin/gcc/f/com-rt.def +++ b/gnu/usr.bin/gcc/f/com-rt.def @@ -156,6 +156,8 @@ DEFGFRT (FFECOM_gfrtERFC, "erfc_", FFECOM_rttypeDOUBLE_, "&r", FALSE, FALSE) DEFGFRT (FFECOM_gfrtEXIT, "exit_", FFECOM_rttypeVOID_, "&i", TRUE, FALSE) 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) DEFGFRT (FFECOM_gfrtIABS, "i_abs", FFECOM_rttypeINTEGER_, "&i", FALSE, FALSE) diff --git a/gnu/usr.bin/gcc/f/com.c b/gnu/usr.bin/gcc/f/com.c index 46c5e3c0f50..96386eb5bf2 100644 --- a/gnu/usr.bin/gcc/f/com.c +++ b/gnu/usr.bin/gcc/f/com.c @@ -421,6 +421,8 @@ static ffecomConcatList_ static void ffecom_concat_list_kill_ (ffecomConcatList_ catlist); 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, ffebld dest, bool *dest_used, @@ -1342,6 +1344,8 @@ ffecom_char_args_ (tree *xitem, tree *length, ffebld expr) TREE_TYPE (*length) = ffecom_f2c_ftnlen_type_node; } } + else if (item == error_mark_node) + *length = error_mark_node; else /* FFEINFO_kindFUNCTION: */ *length = NULL_TREE; if (!ffesymbol_hook (s).addr @@ -1809,6 +1813,92 @@ ffecom_concat_list_new_ (ffebld expr, ffetargetCharacterSize max) } #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 ffesymbol fn; // the SUBROUTINE, FUNCTION, or ENTRY symbol itself @@ -2322,6 +2412,10 @@ ffecom_expr_ (ffebld expr, tree dest_tree, s = ffebld_symter (expr); 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) { @@ -3004,8 +3098,6 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, bt = ffeinfo_basictype (ffebld_info (expr)); 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) { @@ -4047,25 +4139,23 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, arg1_tree); #endif expr_tree - = ffecom_2s (MODIFY_EXPR, tree_type, + = 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, 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), + = 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, tree_type, - convert (tree_type, arg4_tree), + = ffecom_2 (COMPOUND_EXPR, void_type_node, + arg4_tree, expr_tree); } @@ -4226,6 +4316,8 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, case FFEINTRIN_impABORT: case FFEINTRIN_impGETARG: case FFEINTRIN_impGETENV: + case FFEINTRIN_impFTELL: + case FFEINTRIN_impFSEEK: break; default: @@ -5143,6 +5235,10 @@ ffecom_expr_power_integer_ (ffebld left, ffebld right) tree rtype = TREE_TYPE (r); tree result = NULL_TREE; + if (l == error_mark_node + || r == error_mark_node) + return error_mark_node; + if (TREE_CODE (r) == INTEGER_CST) { int sgn = tree_int_cst_sgn (r); @@ -6181,6 +6277,8 @@ ffecom_intrinsic_len_ (ffebld expr) TREE_TYPE (length) = ffecom_f2c_ftnlen_type_node; } } + else if (item == error_mark_node) + length = error_mark_node; else /* FFEINFO_kindFUNCTION: */ length = NULL_TREE; } @@ -6635,7 +6733,8 @@ ffecom_member_phase2_ (ffestorag mst, ffestorag st) = gen_rtx (MEM, TYPE_MODE (type), plus_constant (XEXP (DECL_RTL (mt), 0), ffestorag_modulo (mst) - + ffestorag_offset (st))); + + ffestorag_offset (st) + - ffestorag_offset (mst))); t = start_decl (t, FALSE); @@ -7079,9 +7178,12 @@ ffecom_sym_transform_ (ffesymbol s) yes = suspend_momentary (); offset = ffestorag_modulo (est) - + ffestorag_offset (ffesymbol_storage (s)); + + ffestorag_offset (ffesymbol_storage (s)) + - ffestorag_offset (est); + + ffecom_debug_kludge_ (et, "EQUIVALENCE", s, type, offset); - /* (t_type *) (((void *) &et) + offset */ + /* (t_type *) (((char *) &et) + offset) */ t = convert (string_type_node, /* (char *) */ ffecom_1 (ADDR_EXPR, @@ -7541,7 +7643,10 @@ ffecom_sym_transform_ (ffesymbol s) cs = ffesymbol_common (s); /* The COMMON area itself. */ if (st != NULL) /* Else not laid out. */ - ffecom_transform_common_ (cs); + { + ffecom_transform_common_ (cs); + st = ffesymbol_storage (s); + } yes = suspend_momentary (); @@ -7560,11 +7665,18 @@ ffecom_sym_transform_ (ffesymbol s) else { ffetargetOffset offset; + ffestorag cst; + + cst = ffestorag_parent (st); + assert (cst == ffesymbol_storage (cs)); - offset = ffestorag_modulo (ffesymbol_storage (cs)) - + ffestorag_offset (st); + offset = ffestorag_modulo (cst) + + ffestorag_offset (st) + - ffestorag_offset (cst); - /* (t_type *) (((char *) &ct) + offset */ + ffecom_debug_kludge_ (ct, "COMMON", s, type, offset); + + /* (t_type *) (((char *) &ct) + offset) */ t = convert (string_type_node, /* (char *) */ ffecom_1 (ADDR_EXPR, @@ -8223,6 +8335,11 @@ ffecom_transform_equiv_ (ffestorag eqst) 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 alignment of all entities actually placed in the EQUIVALENCE, but @@ -11434,6 +11551,14 @@ ffecom_notify_primary_entry (ffesymbol s) else 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) { @@ -13588,6 +13713,18 @@ pushdecl (x) 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); assert ((t == NULL_TREE) || (DECL_CONTEXT (x) == NULL_TREE)); diff --git a/gnu/usr.bin/gcc/f/config-lang.in b/gnu/usr.bin/gcc/f/config-lang.in index 2e72979fb5e..fc0240aef59 100644 --- a/gnu/usr.bin/gcc/f/config-lang.in +++ b/gnu/usr.bin/gcc/f/config-lang.in @@ -26,12 +26,22 @@ # stagestuff - files to add to $(STAGESTUFF) # diff_excludes - files to ignore when building diffs between two versions. -if grep put_pending_sizes $srcdir/stor-layout.c >/dev/null; then true +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 - 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 + if grep put_pending_sizes $srcdir/stor-layout.c >/dev/null; then true + else + echo "You haven't applied the patches to the GCC 2.6.x distribution in" + echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README." + echo "" + exit 1 + fi fi language="f77" diff --git a/gnu/usr.bin/gcc/f/data.c b/gnu/usr.bin/gcc/f/data.c index 1998bca51ce..16864e00c6f 100644 --- a/gnu/usr.bin/gcc/f/data.c +++ b/gnu/usr.bin/gcc/f/data.c @@ -100,7 +100,7 @@ static bool ffedata_reported_error_; /* Error has been reported. */ static ffesymbol ffedata_symbol_ = NULL; /* Symbol being initialized. */ static ffeinfoBasictype ffedata_basictype_; /* Info on symbol. */ static ffeinfoKindtype ffedata_kindtype_; -static ffestorag ffedata_storage_; /* If non-NULL, inits go here. */ +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_; static ffetargetOffset ffedata_storage_size_; /* Size of entire storage. */ @@ -1192,7 +1192,8 @@ ffedata_gather_ (ffestorag mst, ffestorag st) kt);/* Find out unit size of source datum. */ assert (units % ffedata_storage_units_ == 0); units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; - offset = ffestorag_offset (st) / ffedata_storage_units_; + offset = (ffestorag_offset (st) - ffestorag_offset (mst)) + / ffedata_storage_units_; /* Does an accretion array exist? If not, create it. */ @@ -1560,7 +1561,8 @@ ffedata_value_ (ffebld value, ffelexToken token) assert (units % ffedata_storage_units_ == 0); units_expected = ffedata_charexpected_ * units / ffedata_storage_units_; offset *= units / ffedata_storage_units_; - offset += ffestorag_offset (ffesymbol_storage (ffedata_symbol_)) + offset += (ffestorag_offset (ffesymbol_storage (ffedata_symbol_)) + - ffestorag_offset (ffedata_storage_)) / ffedata_storage_units_; assert (offset + units_expected - 1 <= ffedata_storage_size_); diff --git a/gnu/usr.bin/gcc/f/equiv.c b/gnu/usr.bin/gcc/f/equiv.c index 8d24cf9ece0..0dc60d85e01 100644 --- a/gnu/usr.bin/gcc/f/equiv.c +++ b/gnu/usr.bin/gcc/f/equiv.c @@ -72,7 +72,7 @@ static struct _ffeequiv_list_ ffeequiv_list_; static void ffeequiv_layout_local_ (ffeequiv eq); static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s, ffebld expr, bool subtract, - ffetargetOffset adjust); + ffetargetOffset adjust, bool no_precede); /* Internal macros. */ @@ -84,25 +84,25 @@ static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s, 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. */ + 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) { - 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. */ + 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; ffetargetAlign pad; @@ -110,7 +110,6 @@ ffeequiv_layout_local_ (ffeequiv eq) ffetargetOffset num_elements; bool new_storage; /* Established new storage info. */ bool need_storage; /* Have need for more storage info. */ - bool ok; bool init; assert (eq != NULL); @@ -121,63 +120,60 @@ ffeequiv_layout_local_ (ffeequiv eq) return; } - /* 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; + /* 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 fprintf (stderr, "Equiv1:\n"); #endif + root_sym = NULL; + root_exp = NULL; + for (list = ffeequiv_list (eq); list != NULL; list = ffebld_trail (list)) { /* 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) + ffetargetOffset ign; /* Ignored. */ + + root_exp = ffebld_head (item); + root_sym = ffeequiv_symbol (root_exp); + if (root_sym == NULL) continue; /* Ignore me. */ -#if FFEEQUIV_DEBUG - fprintf (stderr, "%s,", ffesymbol_text (s)); -#endif + assert (ffesymbol_storage (root_sym) == NULL); /* No storage yet. */ - 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)) + if (!ffeequiv_offset_ (&ign, root_sym, root_exp, FALSE, 0, FALSE)) { - root_offset = var_offset; - sr = s; + ffesymbol_set_equiv (root_sym, NULL); /* Equiv area slated for + death. */ + root_sym = NULL; + continue; /* Something's wrong with eqv expr, try another. */ } - } -#if FFEEQUIV_DEBUG - fprintf (stderr, ")\n"); -#endif + break; /* Use first valid eqv expr for root exp/sym. */ + } + if (root_sym != NULL) + break; } - if (!ok || (sr == NULL)) + if (root_sym == NULL) { ffeequiv_kill (eq); return; } + +#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. */ @@ -185,75 +181,70 @@ ffeequiv_layout_local_ (ffeequiv eq) ffestorag_set_parent (st, NULL); /* Initializations happen here. */ 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_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 (sr)); - ffestorag_set_kindtype (st, ffesymbol_kindtype (sr)); - ffestorag_set_typesymbol (st, sr); + 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 (sr)) + if (ffesymbol_is_save (root_sym)) ffestorag_update_save (st); ffestorag_set_is_init (st, ffeequiv_is_init (eq)); - if (ffesymbol_is_init (sr)) + 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 (sr) == 0) + if (ffesymbol_rank (root_sym) == 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); + (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, modulo); 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... */ + 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 (rst); - ffestorag_set_is_init (rst, FALSE); /* Assume FALSE, then... */ + 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 (rst); - ffestorag_set_size (st, size); - ffesymbol_set_storage (sr, rst); - ffesymbol_signal_unreported (sr); - init = ffesymbol_is_init (sr); + 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 do the actual storage allocation. Keep doing this until we've gone 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; for (list = ffeequiv_list (eq); @@ -261,160 +252,250 @@ ffeequiv_layout_local_ (ffeequiv eq) list = ffebld_trail (list)) { /* For every equivalence list in the list of equivs */ -#if FFEEQUIV_DEBUG - fprintf (stderr, " ("); -#endif + /* 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; - 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 + 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 ((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)) + if ((rooted_st = ffesymbol_storage (rooted_sym)) == NULL) { - root = var; - root_offset = var_offset; - sr = sv; - rst = vst; + rooted_sym = NULL; + continue; /* No storage for this guy, try another. */ } - } - if (sr == NULL) /* No storage to go on, try later. */ - { + #if FFEEQUIV_DEBUG - fprintf (stderr, ")\n"); + fprintf (stderr, " Rooted: `%s' at %" ffetargetOffset_f "d\n", + ffesymbol_text (rooted_sym), + ffestorag_offset (rooted_st)); #endif - continue; + + /* 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, ") %s:\n (", ffesymbol_text (sr)); + fprintf (stderr, "No roots.\n"); #endif + continue; + } - /* 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 + /* 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. */ 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; /* Except erroneous stuff (opANY). */ - if (var == root) + 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)) { - /* 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. */ + ffesymbol_set_equiv (item_sym, NULL); /* Don't bother with me anymore. */ + continue; } - 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); + fprintf (stderr, " Item `%s' at %" ffetargetOffset_f "d", + ffesymbol_text (item_sym), item_offset); #endif - if (ffesymbol_rank (sv) == 0) + if (ffesymbol_rank (item_sym) == 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), + (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), - var_offset, alignment, modulo); + item_offset, alignment, modulo); if (pad != 0) { ffebad_start (FFEBAD_EQUIV_ALIGN); - ffebad_string (ffesymbol_text (sv)); + ffebad_string (ffesymbol_text (item_sym)); 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 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 ((vst = ffesymbol_storage (sv)) == NULL) + 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; - vst = ffestorag_new (ffestorag_list_equivs (st)); - ffestorag_set_parent (vst, st); /* Initializations + item_st = ffestorag_new (ffestorag_list_equivs (st)); + ffestorag_set_parent (item_st, 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... */ + 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 (vst); /* if needed. */ - ffestorag_set_is_init (vst, FALSE); /* Assume FALSE... */ + 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 (vst); /* if needed. */ - if (!ffetarget_offset_add (&size, var_offset, size)) - /* Find one size of equiv area, complain if overflow. */ + 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)) - /* 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; + 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 (var_offset != ffestorag_offset (vst)) + 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 (sv)); + 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) */ -#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 equivs) */ @@ -444,7 +525,8 @@ ffeequiv_layout_local_ (ffeequiv eq) static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s UNUSED, - ffebld expr, bool subtract, ffetargetOffset adjust) + ffebld expr, bool subtract, ffetargetOffset adjust, + bool no_precede) { ffetargetIntegerDefault value = 0; ffetargetOffset cval; /* Converted value. */ @@ -470,15 +552,23 @@ again: /* :::::::::::::::::::: */ if (ffesymbol_basictype (sym) == FFEINFO_basictypeANY) 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 it's wanted.... */ 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 (cval > adjust) + if (no_precede && (cval > adjust)) { neg: /* :::::::::::::::::::: */ ffebad_start (FFEBAD_COMMON_NEG); @@ -486,28 +576,22 @@ again: /* :::::::::::::::::::: */ ffebad_finish (); return FALSE; } - *offset = adjust - cval; - return TRUE; + return ffetarget_offset_add (offset, -cval, adjust); } if (!ffetarget_offset (&cval, value)) 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; + if (!subtract) + return ffetarget_offset_add (offset, cval, adjust); + + if (no_precede && (cval > adjust)) + goto neg; /* :::::::::::::::::::: */ + + return ffetarget_offset_add (offset, -cval, adjust); } case FFEBLD_opARRAYREF: @@ -881,7 +965,7 @@ ffeequiv_layout_cblock (ffestorag st) { root = ffebld_head (root); /* Lose its opITEM. */ ok = ffeequiv_offset_ (&root_offset, sr, root, FALSE, - ffestorag_offset (rst)); + ffestorag_offset (rst), TRUE); /* Equiv point prior to start of common area? */ } else if (altroot != NULL) @@ -890,7 +974,8 @@ ffeequiv_layout_cblock (ffestorag st) root = ffebld_head (altroot); ok = ffeequiv_offset_ (&root_offset, altrootsym, root, FALSE, - ffestorag_offset (ffesymbol_storage (altrootsym))); + ffestorag_offset (ffesymbol_storage (altrootsym)), + TRUE); ffesymbol_set_equiv (altrootsym, NULL); } else @@ -920,7 +1005,7 @@ ffeequiv_layout_cblock (ffestorag st) if (!ok || !ffeequiv_offset_ (&var_offset, sv, ffebld_head (var), TRUE, - root_offset)) + root_offset, TRUE)) continue; /* Can't do negative offset wrt COMMON. */ if (ffesymbol_rank (sv) == 0) @@ -988,8 +1073,16 @@ ffeequiv_layout_cblock (ffestorag st) /* Make sure offset agrees with known offset. */ 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 --git a/gnu/usr.bin/gcc/f/expr.c b/gnu/usr.bin/gcc/f/expr.c index 4dc68320825..b1ec1d46be2 100644 --- a/gnu/usr.bin/gcc/f/expr.c +++ b/gnu/usr.bin/gcc/f/expr.c @@ -6964,7 +6964,7 @@ ffeexpr_convert (ffebld source, ffelexToken source_token, ffelexToken dest_token break; case FFEINFO_basictypeINTEGER: - bad = !ffe_is_ugly (); + bad = !ffe_is_ugly_logint (); break; case FFEINFO_basictypeCHARACTER: @@ -6989,7 +6989,7 @@ ffeexpr_convert (ffebld source, ffelexToken source_token, ffelexToken dest_token break; case FFEINFO_basictypeLOGICAL: - bad = !ffe_is_ugly (); + bad = !ffe_is_ugly_logint (); break; case FFEINFO_basictypeCHARACTER: @@ -9620,7 +9620,7 @@ ffeexpr_reduce_ () { case FFEEXPR_operatorADD_: reduced = ffebld_new_uplus (expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); reduced = ffeexpr_collapse_uplus (reduced, operator->token); @@ -9629,7 +9629,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorSUBTRACT_: submag = TRUE; /* Ok to negate a magic number. */ reduced = ffebld_new_uminus (expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1_ (reduced, operator, operand); reduced = ffeexpr_reduced_math1_ (reduced, operator, operand); reduced = ffeexpr_collapse_uminus (reduced, operator->token); @@ -9637,7 +9637,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorNOT_: reduced = ffebld_new_not (expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly1log_ (reduced, operator, operand); reduced = ffeexpr_reduced_bool1_ (reduced, operator, operand); reduced = ffeexpr_collapse_not (reduced, operator->token); @@ -9676,7 +9676,7 @@ ffeexpr_reduce_ () { case FFEEXPR_operatorADD_: reduced = ffebld_new_add (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_math2_ (reduced, left_operand, operator, @@ -9688,7 +9688,7 @@ ffeexpr_reduce_ () submag = TRUE; /* Just to pick the right error if magic number. */ reduced = ffebld_new_subtract (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_math2_ (reduced, left_operand, operator, @@ -9698,7 +9698,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorMULTIPLY_: reduced = ffebld_new_multiply (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_math2_ (reduced, left_operand, operator, @@ -9708,7 +9708,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorDIVIDE_: reduced = ffebld_new_divide (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_math2_ (reduced, left_operand, operator, @@ -9718,7 +9718,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorPOWER_: reduced = ffebld_new_power (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_power_ (reduced, left_operand, operator, @@ -9735,7 +9735,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorLT_: reduced = ffebld_new_lt (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_relop2_ (reduced, left_operand, operator, @@ -9745,7 +9745,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorLE_: reduced = ffebld_new_le (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_relop2_ (reduced, left_operand, operator, @@ -9755,7 +9755,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorEQ_: reduced = ffebld_new_eq (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_eqop2_ (reduced, left_operand, operator, @@ -9765,7 +9765,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorNE_: reduced = ffebld_new_ne (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_eqop2_ (reduced, left_operand, operator, @@ -9775,7 +9775,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorGT_: reduced = ffebld_new_gt (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_relop2_ (reduced, left_operand, operator, @@ -9785,7 +9785,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorGE_: reduced = ffebld_new_ge (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_relop2_ (reduced, left_operand, operator, @@ -9795,7 +9795,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorAND_: reduced = ffebld_new_and (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_bool2_ (reduced, left_operand, operator, @@ -9805,7 +9805,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorOR_: reduced = ffebld_new_or (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_bool2_ (reduced, left_operand, operator, @@ -9815,7 +9815,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorXOR_: reduced = ffebld_new_xor (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_bool2_ (reduced, left_operand, operator, @@ -9825,7 +9825,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorEQV_: reduced = ffebld_new_eqv (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_bool2_ (reduced, left_operand, operator, @@ -9835,7 +9835,7 @@ ffeexpr_reduce_ () case FFEEXPR_operatorNEQV_: reduced = ffebld_new_neqv (left_expr, expr); - if (ffe_is_ugly ()) + if (ffe_is_ugly_logint ()) reduced = ffeexpr_reduced_ugly2log_ (reduced, left_operand, operator, operand); reduced = ffeexpr_reduced_bool2_ (reduced, left_operand, operator, @@ -9917,7 +9917,7 @@ ffeexpr_reduced_bool1_ (ffebld reduced, ffeexprExpr_ op, ffeexprExpr_ r) rwh = ffeinfo_where (rinfo); if (((rbt == FFEINFO_basictypeLOGICAL) - || (ffe_is_ugly () && (rbt == FFEINFO_basictypeINTEGER))) + || (ffe_is_ugly_logint () && (rbt == FFEINFO_basictypeINTEGER))) && (rrk == 0)) { switch (rwh) @@ -9942,7 +9942,7 @@ ffeexpr_reduced_bool1_ (ffebld reduced, ffeexprExpr_ op, ffeexprExpr_ r) } if ((rbt != FFEINFO_basictypeLOGICAL) - && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) + && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) && ffebad_start (FFEBAD_BOOL_ARG_TYPE)) @@ -10012,7 +10012,7 @@ ffeexpr_reduced_bool2_ (ffebld reduced, ffeexprExpr_ l, ffeexprExpr_ op, ffeexpr_type_combine (&nbt, &nkt, lbt, lkt, rbt, rkt, op->token); if (((nbt == FFEINFO_basictypeLOGICAL) - || (ffe_is_ugly () && (nbt == FFEINFO_basictypeINTEGER))) + || (ffe_is_ugly_logint () && (nbt == FFEINFO_basictypeINTEGER))) && (lrk == 0) && (rrk == 0)) { switch (lwh) @@ -10066,10 +10066,10 @@ ffeexpr_reduced_bool2_ (ffebld reduced, ffeexprExpr_ l, ffeexprExpr_ op, } if ((lbt != FFEINFO_basictypeLOGICAL) - && (!ffe_is_ugly () || (lbt != FFEINFO_basictypeINTEGER))) + && (!ffe_is_ugly_logint () || (lbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeLOGICAL) - && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) + && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((lbt != FFEINFO_basictypeANY) && (rbt != FFEINFO_basictypeANY) && ffebad_start (FFEBAD_BOOL_ARGS_TYPE)) @@ -10092,7 +10092,7 @@ ffeexpr_reduced_bool2_ (ffebld reduced, ffeexprExpr_ l, ffeexprExpr_ op, } } else if ((rbt != FFEINFO_basictypeLOGICAL) - && (!ffe_is_ugly () || (rbt != FFEINFO_basictypeINTEGER))) + && (!ffe_is_ugly_logint () || (rbt != FFEINFO_basictypeINTEGER))) { if ((rbt != FFEINFO_basictypeANY) && ffebad_start (FFEBAD_BOOL_ARG_TYPE)) @@ -12208,7 +12208,7 @@ again: /* :::::::::::::::::::: */ switch (ffeinfo_basictype (info)) { case FFEINFO_basictypeLOGICAL: - error = !ffe_is_ugly (); + error = !ffe_is_ugly_logint (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ expr = ffeexpr_convert (expr, ft, ft, FFEINFO_basictypeINTEGER, @@ -12276,7 +12276,7 @@ again: /* :::::::::::::::::::: */ break; case FFEINFO_basictypeLOGICAL: - error = !ffe_is_ugly () + error = !ffe_is_ugly_logint () || (ffeinfo_kindtype (info) != FFEINFO_kindtypeLOGICALDEFAULT); break; @@ -12576,7 +12576,7 @@ again: /* :::::::::::::::::::: */ switch (ffeinfo_basictype (info)) { case FFEINFO_basictypeLOGICAL: - error = error && !ffe_is_ugly (); + error = error && !ffe_is_ugly_logint (); if (!ffeexpr_stack_->is_rhs) break; /* Don't convert lhs variable. */ expr = ffeexpr_convert (expr, ft, ft, FFEINFO_basictypeINTEGER, @@ -15418,6 +15418,47 @@ ffeexpr_token_name_apos_name_ (ffelexToken t) { 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) { case FFESRC_CASE_MATCH_INIT ('B', 'b', match_b, no_match): @@ -15784,7 +15825,7 @@ ffeexpr_declare_unadorned_ (ffelexToken t, bool maybe_intrin) break; /* Will turn into errors below. */ default: - assert ("UNCERTAIN/NONE bad context" == NULL); + ffesymbol_error (s, t); break; } /* Fall through. */ @@ -15922,7 +15963,6 @@ ffeexpr_declare_unadorned_ (ffelexToken t, bool maybe_intrin) break; default: - assert ("UNDERSTOOD bad context" == NULL); bad = TRUE; break; } @@ -16001,7 +16041,7 @@ ffeexpr_declare_unadorned_ (ffelexToken t, bool maybe_intrin) goto understood; /* :::::::::::::::::::: */ default: - assert ("SEEN bad context" == NULL); + ffesymbol_error (s, t); break; } return s; @@ -17506,7 +17546,7 @@ ffeexpr_declare_parenthesized_ (ffelexToken t, bool maybe_intrin, break; /* Will turn into errors below. */ default: - assert ("UNCERTAIN/NONE bad context" == NULL); + ffesymbol_error (s, t); break; } /* Fall through. */ @@ -17607,7 +17647,6 @@ ffeexpr_declare_parenthesized_ (ffelexToken t, bool maybe_intrin, break; default: - assert ("UNDERSTOOD bad context" == NULL); bad = TRUE; break; } @@ -17734,11 +17773,9 @@ ffeexpr_declare_parenthesized_ (ffelexToken t, bool maybe_intrin, case FFEEXPR_contextDIMLISTCOMMON: case FFEEXPR_contextINITVAL: case FFEEXPR_contextEQVINDEX_: - ffesymbol_error (s, t); break; case FFEEXPR_contextINCLUDE: - bad = TRUE; break; case FFEEXPR_contextINDEX_: @@ -17756,7 +17793,6 @@ ffeexpr_declare_parenthesized_ (ffelexToken t, bool maybe_intrin, goto understood; /* :::::::::::::::::::: */ default: - assert ("SEEN bad context" == NULL); break; } k = ffesymbol_kind (s); @@ -18133,7 +18169,7 @@ ffeexpr_token_arguments_ (ffelexToken ft, ffebld expr, ffelexToken t) } } } - else if ((expr != NULL) || ffe_is_ugly () + else if ((expr != NULL) || ffe_is_ugly_comma () || (ffelex_token_type (t) == FFELEX_typeCOMMA)) ffebld_append_item (&ffeexpr_stack_->bottom, expr); diff --git a/gnu/usr.bin/gcc/f/g77.c b/gnu/usr.bin/gcc/f/g77.c index e2125508ff7..bc924176ead 100644 --- a/gnu/usr.bin/gcc/f/g77.c +++ b/gnu/usr.bin/gcc/f/g77.c @@ -51,7 +51,27 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA handling of arguments, primarily to make it more consistent with `gcc' itself. */ +#ifndef LANGUAGE_F77 +#define LANGUAGE_F77 1 /* Assume f77 language wanted. */ +#endif + +#if LANGUAGE_F77 != 1 +#include <stdio.h> + +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 <sys/types.h> #include <errno.h> @@ -204,6 +224,7 @@ typedef enum OPTION_c, /* Aka --compile. */ OPTION_driver, /* Wrapper-specific option. */ OPTION_E, /* Aka --preprocess. */ + OPTION_help, /* --help. */ OPTION_i, /* -imacros, -include, -include-*. */ OPTION_M, /* Aka --dependencies. */ OPTION_MM, /* Aka --user-dependencies. */ @@ -212,21 +233,24 @@ typedef enum OPTION_P, /* Aka --print-*-name. */ OPTION_S, /* Aka --assemble. */ OPTION_v, /* Aka --verbose. */ + OPTION_version, /* --version. */ OPTION_V, /* Aka --use-version. */ OPTION_x, /* Aka --language. */ OPTION_ /* Unrecognized or unimportant. */ } Option; -/* THE FOLLOWING COMES STRAIGHT FROM gcc-2.7.0/gcc.c: */ +/* THE FOLLOWING COMES STRAIGHT FROM prerelease gcc-2.8.0/gcc.c: */ /* This defines which switch letters take arguments. */ -#ifndef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ +#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \ ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ || (CHAR) == 'L' || (CHAR) == 'A') + +#ifndef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR) #endif /* This defines which multi-letter switches take arguments. */ @@ -753,12 +777,16 @@ lookup_option (xopt, xskip, xarg, text) "imacros", "aux-info", "idirafter", "iprefix", "iwithprefix", "iwithprefixbefore", "isystem". */ ; + else if (text[1] != '-') + skip = 0; else if (strcmp (text, "--assemble") == 0) opt = OPTION_S; else if (strcmp (text, "--compile") == 0) opt = OPTION_c; else if (opteq (&skip, &arg, text, "--driver") == 0) opt = OPTION_driver; + else if (strcmp (text, "--help") == 0) + opt = OPTION_help; else if ((opteq (&skip, &arg, text, "--imacros") == 0) || (opteq (&skip, &arg, text, "--include") == 0) || (opteq (&skip, &arg, text, "--include-directory-after") == 0) @@ -793,6 +821,8 @@ lookup_option (xopt, xskip, xarg, text) opt = OPTION_V; else if (strcmp (text, "--verbose") == 0) opt = OPTION_v; + else if (strcmp (text, "--version") == 0) + opt = OPTION_version; else if (strcmp (text, "-Xlinker") == 0) skip = 1; else if ((opteq (&skip, &arg, text, "--assert") == 0) @@ -962,6 +992,7 @@ main (argc, argv) case OPTION_v: verbose = 1; + printf ("g77 version %s\n", ffezzz_version_string); break; case OPTION_b: @@ -973,6 +1004,55 @@ main (argc, argv) appropriate version info. */ 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; break; @@ -1166,3 +1246,4 @@ main (argc, argv) return 0; } +#endif /* LANGUAGE_F77 == 1 */ diff --git a/gnu/usr.bin/gcc/f/g77.texi b/gnu/usr.bin/gcc/f/g77.texi index 0e295c1ef8f..4b7970ec637 100644 --- a/gnu/usr.bin/gcc/f/g77.texi +++ b/gnu/usr.bin/gcc/f/g77.texi @@ -102,16 +102,16 @@ was contributed to Craig by David Ronis (@code{ronis@@onsager.chem.mcgill.ca}). @sp 2 @center James Craig Burley @sp 3 -@center Last updated 1996-03-23 +@center Last updated 1996-12-03 @sp 1 @c The version number appears some more times in this file. -@center for version 0.5.18 +@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.18* +For GNU Fortran Version 0.5.19* @sp 1 Published by the Free Software Foundation @* 59 Temple Place - Suite 330@* @@ -152,19 +152,19 @@ original English. @ifset USING 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. +report bugs. It corresponds to GNU Fortran version 0.5.19. @end ifset @end ifset @ifclear INTERNALS 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. +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.18. +bugs. It corresponds to GNU Fortran version 0.5.19. @end ifclear @end ifinfo @@ -1223,8 +1223,8 @@ appropriately before submitting it to the @code{gcc} command. @cindex g77 options, -v @cindex options, -v @cindex -@w{}-driver option -@cindex g77 options, --driver -@cindex options, --driver +@cindex g77 options, -@w{}-driver +@cindex options, -@w{}-driver Use the @samp{-v} option with @code{g77} to see what is going on---the first line of output is the invocation of the @code{gcc} command. @@ -1251,11 +1251,11 @@ the @code{gcc} command: @table @code @cindex -@w{}-driver option @cindex g77 options, driver -@cindex 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 gcc build directory after +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./}. @end table @@ -1275,6 +1275,7 @@ one is not the default. * Overall Options:: Controlling the kind of output: 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. * Warning Options:: How picky should the compiler be? @@ -1300,6 +1301,15 @@ by type. Explanations are in the following sections. @xref{Overall Options,,Options Controlling the Kind of Output}. @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 @item Fortran Language Options @@ -1307,6 +1317,9 @@ by type. Explanations are in the following sections. @smallexample -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 -fmatch-case-initcap -fmatch-case-upper @@ -1335,9 +1348,8 @@ by type. Explanations are in the following sections. @xref{Warning Options,,Options to Request or Suppress Warnings}. @smallexample -fsyntax-only -pedantic -pedantic-errors -fpedantic --fugly -fno-ugly-args -fno-ugly-init -w -Wimplicit --Wunused -Wuninitialized -Wall -Wsurprising -Werror --W +-w -Wimplicit -Wunused -Wuninitialized -Wall -Wsurprising +-Werror -W @end smallexample @item Debugging Options @@ -1371,7 +1383,8 @@ by type. Explanations are in the following sections. -ff2c-library -fno-underscoring -fno-ident -fpcc-struct-return -freg-struct-return -fshort-double -fno-common -fpack-struct --fzeros +-fzeros -fno-second-underscore +-fdebug-kludge @end smallexample @end table @@ -1379,6 +1392,7 @@ by type. Explanations are in the following sections. * Overall Options:: Controlling the kind of output: 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. * Warning Options:: How picky should the compiler be? @@ -1477,7 +1491,7 @@ information on this option. @item -fversion 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} +(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.) @@ -1486,7 +1500,7 @@ and when the resulting commands compile Fortran source files.) @item -fset-g77-defaults 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 +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. The description of this option is here so that users seeing @@ -1495,6 +1509,19 @@ there. Also, developers who run @code{f771} directly might want to specify it 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 @xref{Overall Options,,Options Controlling the Kind of Output, @@ -1502,6 +1529,93 @@ gcc,Using and Porting GNU CC}, for information on more options that control the overall operation of the @code{gcc} command (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 @cindex dialect options @@ -1592,10 +1706,137 @@ whereas other compilers that support backslash might not support the three-octal-digit form, and thus treat that string as longer than three characters. -@xref{Non-bugs,,Certain Changes We Don't Want to Make}, for +@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 @item -fintrin-case-initcap @@ -1792,13 +2033,16 @@ For example, if your code invokes @code{FLUSH} as a library function and thus works with other UNIX Fortran 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. +more convenient for you, compile with the +@samp{-funix-intrinsics-hide} or +@samp{-funix-intrinsics-delete} option. @cindex ABORT() intrinsic @cindex intrinsics, ABORT() @cindex EXIT() intrinsic @cindex intrinsics, EXIT() +@cindex FSEEK() intrinsic +@cindex intrinsics, FSEEK() @cindex SIGNAL() intrinsic @cindex intrinsics, SIGNAL() @cindex SYSTEM() intrinsic @@ -1809,10 +2053,12 @@ more convenient for you, compile with the -funix-intrinsics-hide or @cindex functions, intrinsic @cindex side effects @cindex intrinsics, side effects of -Note that @code{ABORT}, @code{EXIT}, @code{FLUSH}, @code{SIGNAL}, and +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{SIGNAL} and -@code{SYSTEM}, append a final argument specifying an @samp{INTEGER} +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)}.) @@ -1929,35 +2175,6 @@ warnings. @item -fpedantic 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 @item -w @@ -1999,12 +2216,13 @@ when optimizing. If you don't specify @samp{-O}, you simply won't get these warnings. 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 +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 may be no warning about a variable that is used only +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 are printed. @@ -2031,7 +2249,7 @@ another common case: @example SUBROUTINE MAYBE(FLAG) LOGICAL FLAG -IF (FLAG) VALUE = 3.14 +IF (FLAG) VALUE = 9.4 @dots{} IF (FLAG) PRINT *, VALUE END @@ -2107,6 +2325,17 @@ For example, @samp{-2**2} produces a warning, because the precedence is @samp{-(2**2)}, yielding -4, not @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, there is no computational difference between the @@ -2235,6 +2464,13 @@ Support for this option in Fortran programs is incomplete. In particular, names of variables and arrays in common blocks 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 @xref{Debugging Options,,Options for Debugging Your Program or GNU CC, @@ -2413,7 +2649,7 @@ Also note that the general behavior of @samp{-I} and @samp{#include} in the @code{cpp} preprocessor, with regard to looking for @file{header.gcc} files and other such things. -@xref{Directory Optoins,,Options for Directory Search, +@xref{Directory Options,,Options for Directory Search, gcc,Using and Porting GNU CC}, for information on the @samp{-I} option. @end table @@ -2505,7 +2741,9 @@ source file by appending underscores to them. With @samp{-funderscoring} in effect, @code{g77} appends two underscores 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.) +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 UNIX Fortran compilers, including @code{f2c}, which perform the @@ -2575,7 +2813,7 @@ interfaces. Do not append a second underscore to names of entities specified in the Fortran source file. -This option has no effect if @samp{-fno-underscoring} is not +This option has no effect if @samp{-fno-underscoring} is in effect. Otherwise, with this option, an external name such as @samp{MAX_COUNT} @@ -2610,6 +2848,75 @@ all initializations, zero or otherwise. differently. 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 @xref{Code Gen Options,,Options for Code Generation Conventions, @@ -2678,13 +2985,78 @@ or whatever is the equivalent on your system. instead, or use @samp{gate-2}, @samp{gate-3}, @samp{gate-4}, and so on, instead of @samp{gate-1}.) -Alternatively, retrieve @file{gnu.ai.mit.edu:/g77.plan} via +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. (The @code{finger} command shown above obtains the most recent 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: @itemize @bullet @@ -2800,7 +3172,7 @@ of better bug reports easily. Many improvements to the @code{g77} command to better fulfill its role as a front-end to the @code{gcc} driver. For example, @code{g77} now -recognizes @samp{--version} as a verbose way of specifying @samp{-v}. +recognizes @samp{--verbose} as a verbose way of specifying @samp{-v}. @item Compiling preprocessed (@file{*.F} and @file{*.fpp}) files now @@ -2887,7 +3259,8 @@ dummy arguments. @item Block data program units now may contain @samp{NAMELIST}, @samp{EXTERNAL}, -@samp{INTRINSIC}, and @samp{VOLATILE} statements. +@c @samp{INTRINSIC}, and @samp{VOLATILE} statements. +and @samp{INTRINSIC} statements. @item Zero-length character expressions now supported. @@ -2903,9 +3276,13 @@ lines allowed, now lifted. @node Language @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. +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 are popular among users of other compilers (such as Digital @@ -3252,18 +3629,14 @@ in future versions of @code{g77}---avoid writing code depending on them. @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, +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. @@ -3273,12 +3646,12 @@ assigned in a way that encourages clarity, consistency, and portability. @cindex types, constants @code{g77} strictly assigns types to all constants not -documented as ``typeless'' (the typeless constants include things like -@samp{Z'1'}). +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{3.141592653545256234} is always type @samp{REAL} (even if the +@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} is always type @samp{DOUBLE PRECISION}. @@ -3424,6 +3797,7 @@ result). @item Automatic conversion of numeric expressions to @samp{INTEGER} in contexts such as: + @itemize -- @item Array-reference indexes. @@ -3529,7 +3903,8 @@ Low-level switches are identified in this discussion thusly: @itemize @w{} @item A -Source Case Conversion +Source Case Conversion: + @itemize @w{} @item 0 Preserve (see Note 1) @@ -3541,6 +3916,7 @@ Convert to Lower Case @item B Built-in Keyword Matching: + @itemize @w{} @item 0 Match Any Case (per-character basis) @@ -3554,6 +3930,7 @@ Match InitialCaps Only (see tables for spellings) @item C Built-in Intrinsic Matching: + @itemize @w{} @item 0 Match Any Case (per-character basis) @@ -3566,7 +3943,8 @@ Match InitialCaps Only (see tables for spellings) @end itemize @item D -User-defined Symbol Possibilities (warnings only) +User-defined Symbol Possibilities (warnings only): + @itemize @w{} @item 0 Allow Any Case (per-character basis) @@ -3604,6 +3982,7 @@ in uppercase but will someday be lowercase (when a @samp{libg77} is written), but that seems to be overkill for a product in beta test. Note 2: Rules for InitialCaps names are: + @itemize -- @item Must be a single uppercase letter, @strong{or} @@ -3934,7 +4313,7 @@ either.) @section Object Compatibility @cindex object code @cindex code, object -@cindex compatibility +@cindex compatibility, @code{f2c} @cindex f2c compatibility @cindex compilers, compatibility @@ -4101,54 +4480,126 @@ command. @cindex ugly features @cindex features, ugly -The @samp{-fugly} command-line options determine whether certain +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 portable constructs, are accepted. These are humorously referred to as ``distensions'', extensions that just plain look ugly in the harsh light of day. -The constructs enabled via @samp{-fugly} include: +@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 -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.}). +Passing of typeless and Hollerith constants as actual arguments +in procedure invocations. -@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}. +For example, @samp{CALL FOO(4HABCD)}. -@item -Use of a @samp{LOGICAL} variable in @samp{ASSIGN} and assigned-@samp{GOTO} -statements. +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 -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. +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{CALL FOO(,)} means ``pass -two null arguments'' when @samp{-fugly} is used, rather than -``pass one null argument''. +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 -The construct disabled via @samp{-fno-ugly-args} is: +@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 -@cindex Hollerith constants -@cindex constants, Hollerith @item -Passing of typeless and Hollerith constants as actual arguments -in procedure invocations. +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''. -For example, @samp{CALL FOO(4HABCD)}. +@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: @itemize @bullet @@ -4160,21 +4611,85 @@ initial (compile-time) values for variables, arrays, and named constants---that is, @samp{DATA} and @samp{PARAMETER} statements, plus 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 @item In the same contexts as above, use of character constants to initialize 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 to in invocations of +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 @node Debugging and Interfacing @@ -4260,9 +4775,13 @@ the transformation certainly improves the chances of colliding with incompatible externals written in other languages---but that 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 that are different in the source code---@code{f2c} does the same thing, but @@ -4295,7 +4814,7 @@ case, or to leave them exactly as written in the source file. For example: @example -Foo = 3.14159 +Foo = 9.436 @end example @noindent @@ -4605,7 +5124,7 @@ Since the user program cannot (legitimately) change the value of the temporary during execution of the procedure, the size of the array remains constant during each invocation. -For alternate entry points, the code @samp{g77} generates takes into +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. In that case, the public procedure implementing the entry point @@ -4706,8 +5225,26 @@ When @samp{-fno-f2c} is in force, @samp{REAL} functions return @samp{float}. @code{g77} names and lays out @samp{COMMON} areas the same way f2c does, 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. +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 type is an array of the C @samp{char} data type. @@ -4745,16 +5282,36 @@ A local @samp{EQUIVALENCE} area is a collection of variables and arrays connected to each other in any way via @samp{EQUIVALENCE}, none of which are 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. +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} data type. 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) +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} areas by specifying the appropriate @samp{__g77_equiv_@var{x}} @@ -4762,11 +5319,15 @@ array section with the appropriate offset. See the explanation of debugging @samp{COMMON} blocks 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.) +(@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 @section Alternate Entry Points (ENTRY) @@ -5070,8 +5631,8 @@ are to be treated as if they were named in @samp{SAVE} statements.) Many other compilers do this automatically, which means lots of 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. +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 compilers provide the equivalent one), add @samp{SAVE} @@ -5086,6 +5647,21 @@ and put variables and arrays on the stack (or in fast registers) where possible and reasonable. 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 @item -fugly @@ -5189,7 +5765,8 @@ options in a given program actually needs to be so affected. For example, @samp{-fno-automatic}, which effectively @samp{SAVE}s -every local variable and array, affects even things like @samp{DO} iteration +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. Similarly, @samp{-fno-init-local-zero} forces such @@ -5401,7 +5978,7 @@ Consider the following program: A C-like view of @samp{DO} would hold that the two ``exclamatory'' @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: +as compiled by @code{g77} on a GNU/Linux ix86 system: @smallexample .100000001 @@ -5422,7 +5999,7 @@ the loop is correctly implemented by @code{g77}, in that it has 30 iterations. 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 +@var{end}, and @var{incr} values (.1, .31, .007) on GNU/Linux ix86 are used. On other systems, an apparently more accurate trip count of 31 might result, but, nevertheless, @code{g77} is @@ -5625,7 +6202,7 @@ system than @code{f2c}. This section describes known problems that affect users of GNU Fortran. 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. +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 missing features that are too much work to add, and some are places @@ -5686,7 +6263,7 @@ might be @emph{thought} to indicate bugs. @cindex linker errors @cindex ld errors @cindex errors, linker -On some older Linux systems, programs with common blocks larger +On some older GNU/Linux systems, programs with common blocks larger than 16MB cannot be linked without some kind of error message being produced. @@ -5701,7 +6278,7 @@ compiled by @code{g77}. Inadequate investigation as of the release of 0.5.16 results in not 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 +of a @samp{COMPLEX*16} dummy array, on at least some GNU/Linux machines, plus some others. @item @@ -5802,6 +6379,96 @@ quietly accept. 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 @include bugs.texi @@ -5859,7 +6526,7 @@ for them. @item @code{g77} rejects things other compilers accept, -like @samp{INTRINSIC SIN,SIN}. +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 else will be accepted by @code{g77} (though @samp{-fpedantic} should @@ -5960,6 +6627,59 @@ lower on the list of large, important things to add to @code{g77}, partly because it requires a great deal of work either upgrading or replacing @code{libf2c}. +@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 @cindex statements, OPEN @@ -5998,6 +6718,33 @@ in implementing this feature soon afterwards. Supporting this requires a significant redesign or replacement 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). @samp{-w} does this but also suppresses warnings. @@ -6040,6 +6787,11 @@ This includes allowing arbitrarily long lines for free-form source as well as fixed-form source and providing 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 arrays, such as array element references, function @@ -6052,11 +6804,6 @@ but that supports @samp{*} as the unit designator (same unit as for @samp{PRINT}). @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}. @item @@ -6149,8 +6896,8 @@ For example, warn about cases like this: @example DOUBLE PRECISION FOO -PARAMETER (PI = 3.14159) -FOO = PI * 3D0 +PARAMETER (TZPHI = 9.435784839284958) +FOO = TZPHI * 3D0 @end example @item @@ -6218,6 +6965,33 @@ The sort of routines usually found in the BSD-ish @code{libU77} should be provided in addition to the few utility routines in @code{libf2c}. 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 <fpu_control.h> +void __attribute__ ((constructor)) +trapfpe () @{ + (void) __setfpucw (_FPU_DEFAULT & + ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM)); +@} +@end smallexample @end itemize @node Disappointments @@ -6226,14 +7000,21 @@ integration into @code{g77}. These problems are perhaps regrettable, but we don't know any practical way around them for now. -@itemize @bullet -@item +@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, -and there are some very good reasons for that. -When I next remember any, I'll try to write them down. +This is not standard-conforming. @cindex block data @cindex BLOCK DATA statement @@ -6241,7 +7022,9 @@ When I next remember any, I'll try to write them down. @cindex COMMON statement @cindex statements, COMMON @cindex naming conflicts -@item +@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. Some systems allow this, but @code{g77} does not, @@ -6269,7 +7052,14 @@ didn't have its name translated the same way. @samp{BLOCK DATA}, but that probably invites more trouble than it's worth.) -@item +@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, has various usability problems, including things like adding @@ -6282,7 +7072,6 @@ Project GNU should at least get all this ``right'' for systems it fully controls, such as the Hurd, and provide defaults and options for compatibility with existing systems and interoperability with popular existing compilers. -@end itemize @node Non-bugs @section Certain Changes We Don't Want to Make @@ -6290,14 +7079,32 @@ with popular existing compilers. This section lists changes that people frequently request, but which we do not make because we think GNU Fortran is better without them. -@itemize @bullet +@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 -@item -@samp{-fno-backslash} should be the default, not @samp{-fbackslash}. +@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 +First of all, you can always specify @samp{-fno-backslash} to turn off this processing. Despite not being within the spirit (though apparently within the @@ -6328,8 +7135,8 @@ The primary focus on compatibility is at the source-code level, and the question became ``What will users expect 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, +@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. @@ -6408,18 +7215,23 @@ be used instead, for readability.) In this way, users can write programs which have the same meaning in many Fortran dialects. -@item +@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}). +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 *, 3.1415926535 * 2D0 +PRINT *, 9.435784839284958 * 2D0 @end example @code{g77} will interpret the (truncated) constant -@samp{3.1415926535} as a @samp{REAL}, not @samp{DOUBLE PRECISION}, +@samp{9.435784839284958} as a @samp{REAL}, not @samp{DOUBLE PRECISION}, constant, because the suffix @samp{D0} is not specified. As a result, the output of the above statement when @@ -6488,23 +7300,104 @@ interpret constants' types based on context, so anything @code{g77} can do to help flag cases of this in such code could be very helpful. -@item +@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 is valid for that 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. +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 IFIX} +Some users claim that it is ``obvious'' that @samp{CALL SQRT} references an external subroutine of their own, not an intrinsic function. @@ -6518,13 +7411,25 @@ of intrinsics that are not functions, just as it (and most compilers) rejects invocations of intrinsics with the wrong number (or types) of arguments. -Use the @samp{EXTERNAL IFIX} statement in a program unit that calls -a user-written subroutine named @samp{IFIX}. +So, use the @samp{EXTERNAL SQRT} statement in a program unit that calls +a user-written subroutine named @samp{SQRT}. -@item -Allow @samp{DATA VAR/.../} to come before @samp{COMMON /.../ ...,VAR,...}. +@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 this. +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 @code{g77} always require placement of @samp{DATA} @@ -6536,11 +7441,17 @@ be immediately writable to canonical assembler, unless it's already known to be in a @samp{COMMON} area following as-yet-uninitialized stuff, 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 +@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 from one compiler to another: @@ -6582,7 +7493,6 @@ Such a function can be safely used in expressions, because if the compiler optimizes away one or more calls to the function, operation of the program is unaffected (aside from being speeded up). -@end itemize @node Warnings and Errors @section Warning Messages and Error Messages @@ -6649,33 +7559,6 @@ Please consider offering useful answers to these questions! @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, what are the appropriate groupings? @@ -6738,8 +7621,9 @@ Reliable compilers never crash---they just remain obsolete. @cindex invalid assembly code @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 +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. @@ -6798,7 +7682,7 @@ mailing them. This sometimes appears to work, but it has one problem which can be crucial: a newsgroup posting does not contain a mail path back to the sender. -Thus, if maintainers need more information, they may be unable +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. @@ -6928,7 +7812,7 @@ and so on. It is not necessary to replace the @samp{INCLUDE} statements 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. +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 chases. @@ -7072,7 +7956,7 @@ Most GNU Fortran bugs involve just one function, so the most straightforward way to simplify an example is to delete all the function definitions 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 +them. (Exception: inline functions might affect compilation of functions defined later in the file.) However, simplification is not vital; if you don't want to do this, @@ -7271,8 +8155,7 @@ help clarify its nature. @emph{Fortran options} are options that apply only 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. +they apply only when compiling Fortran programs. @item @emph{Compiler options} are options that apply @@ -7281,9 +8164,9 @@ when compiling most any kind of program. @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 +which is used during the build of @code{gcc} to build a list of all options that are accepted by -at last one language's compiler. +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 determine whether a particular option should be @@ -7292,7 +8175,7 @@ by calling @samp{lang_option_decode}, which, for @code{g77}, is in @file{gcc/f/com.c} and just calls @samp{ffe_decode_option}. -Even if the linked-in front end ``rejects'' a +If the linked-in front end ``rejects'' a particular option passed to it, @file{toplev.c} just ignores the option, because @emph{some} language's compiler is willing to accept it. @@ -7319,11 +8202,15 @@ of each option. 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 +Many of these defaults are actually macros defined in @file{gcc/f/target.h}, since they might be -machine-specific, although, in practice, GNU compilers +machine-specific. +However, since, in practice, GNU compilers should behave the same way on all configurations -(especially when it comes to language constructs). +(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 in the @code{g77} FFE, are defined in @file{gcc/f/top.h}. diff --git a/gnu/usr.bin/gcc/f/gbe/2.7.0.diff b/gnu/usr.bin/gcc/f/gbe/2.7.0.diff index 5144d81128c..e69de29bb2d 100644 --- a/gnu/usr.bin/gcc/f/gbe/2.7.0.diff +++ b/gnu/usr.bin/gcc/f/gbe/2.7.0.diff @@ -1,70 +0,0 @@ -*** 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 <obstack.h>), 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 <stdio.h>, -! 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. */ diff --git a/gnu/usr.bin/gcc/f/gbe/2.7.1.diff b/gnu/usr.bin/gcc/f/gbe/2.7.1.diff index e7bd45621e3..e69de29bb2d 100644 --- a/gnu/usr.bin/gcc/f/gbe/2.7.1.diff +++ b/gnu/usr.bin/gcc/f/gbe/2.7.1.diff @@ -1,6 +0,0 @@ -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. diff --git a/gnu/usr.bin/gcc/f/gbe/2.7.2.1.diff b/gnu/usr.bin/gcc/f/gbe/2.7.2.1.diff new file mode 100644 index 00000000000..95b84789fd6 --- /dev/null +++ b/gnu/usr.bin/gcc/f/gbe/2.7.2.1.diff @@ -0,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 --git a/gnu/usr.bin/gcc/f/gbe/README b/gnu/usr.bin/gcc/f/gbe/README index 0e7585f90c3..1752b600aed 100644 --- a/gnu/usr.bin/gcc/f/gbe/README +++ b/gnu/usr.bin/gcc/f/gbe/README @@ -1,33 +1,53 @@ -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. +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 work for version 2.6.2, but 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 +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.7.0 or gcc-3.0.0, and you +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 channels -(see gcc/f/DOC *TROUBLE (BUGS, ETC.)*) for information on -support for the new version of gcc. +being worked on. In the meantime, watch the usual place +(`info -f g77') for information on support for the recent +versions of gcc. diff --git a/gnu/usr.bin/gcc/f/install.texi b/gnu/usr.bin/gcc/f/install.texi index 54b2c72231d..08ee8003ffc 100644 --- a/gnu/usr.bin/gcc/f/install.texi +++ b/gnu/usr.bin/gcc/f/install.texi @@ -5,7 +5,7 @@ @c The text of this file appears in the file INSTALL @c in the G77 distribution, as well as in the G77 manual. -@c 1996-03-15 +@c 1996-12-01 @ifclear INSTALLONLY @node Installation @@ -78,7 +78,7 @@ Without an applicable @code{gcc} source tree, you cannot build @code{g77}. You can obtain an FSF distribution of @code{gcc} from the FSF. -@item @file{g77-0.5.18.tar.gz} +@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, which is contained in this distribution. @@ -90,7 +90,7 @@ the same way you obtained @code{gcc}. @item 100MB disk space For a complete @dfn{bootstrap} build, about 100MB of disk space is required for @code{g77} by the author's -current Linux system. +current GNU/Linux system. Some juggling can reduce the amount of space needed; during the bootstrap process, once Stage 3 starts, @@ -239,10 +239,10 @@ ways. @cindex GBE @item @code{g77} currently requires application of a patch file to the gcc compiler -tree (at least up through gcc version 2.7.0). +tree. The necessary patches should be folded in to the mainline gcc distribution. -(Some combinations +Some combinations of versions of @code{g77} and @code{gcc} might actually @emph{require} no patches, but the patch files will be provided anyway as long as there are more changes expected in subsequent releases. @@ -346,7 +346,7 @@ used by the author of @code{g77} on his own system: @example /usr/FSF/gcc-2.7.2.tar.gz -/usr/FSF/g77-0.5.18.tar.gz +/usr/FSF/g77-0.5.19.tar.gz @end example Users of the following systems should not blindly follow @@ -384,12 +384,12 @@ sh[ 1]# @kbd{cd /usr/src} sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-2.7.2.tar.gz | tar xf -} @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 -} +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.18 g77} +sh[ 5]# @kbd{ln -s g77-0.5.19 g77} @set link-g77 5 sh[ 6]# @kbd{mv -i g77/* gcc} @set merge-g77 6 @@ -448,10 +448,10 @@ installed version of @code{g77} and @code{gcc} in any case. @c Some systems have a version of @code{tar} that support @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 -} +@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.18 g77} +@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 in this manual showing what to type to install @code{g77}. @@ -462,7 +462,7 @@ other than the FSF. @item Step @value{merge-g77}: @kbd{mv -i g77/* gcc} After doing this, you can, if you like, type -@samp{rm g77} and @samp{rmdir g77-0.5.18} to remove +@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 quick reminders of which version(s) of @code{g77} are @@ -615,9 +615,9 @@ and @code{g77} is: @example 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{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.18 g77} +sh# @kbd{ln -s g77-0.5.19 g77} sh# @kbd{mv -i g77/* gcc} @end example @@ -691,6 +691,17 @@ does not exist, you are using either an old, unsupported version, or a release one that is newer than the newest @code{gcc} version supported by the version of @code{g77} you have. +@cindex gcc version numbering +@cindex version numbering +@cindex g77 version number +@cindex GNU version numbering +As of version 0.5.18, @code{g77} modifies the version number +of @code{gcc} via the pertinent patches. +This is done because the resulting version of @code{gcc} is +deemed sufficiently different from the vanilla distribution +to make it worthwhile to present, to the user, information +signaling the fact that there are some differences. + GNU version numbers make it easy to figure out whether a particular version of a distribution is newer or older than some other version of that distribution. @@ -728,7 +739,8 @@ If the version number for @code{gcc} differs only in the that is for the newest version of @code{gcc} having the same @var{major} and @var{minor} fields, as this is likely to work. -So, for example, if @code{g77} has support for versions 2.7.0 and 2.7.1, +So, for example, if a particular version of @code{g77} has support for +@code{gcc} versions 2.7.0 and 2.7.1, it is likely that @file{gcc-2.7.2} would work well with @code{g77} by using the @file{2.7.1.diff} patch file provided with @code{g77} (aside from some offsets reported by @code{patch}, @@ -786,15 +798,11 @@ To remove these, after @kbd{cd gcc}, type @kbd{rm -i *.~*~}. @pindex config-lang.in @emph{Note:} @code{g77}'s configuration file @file{gcc/f/config-lang.in} ensures that the source code for the version of @code{gcc} -being configured has at least one 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 +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, it should abort the configuration with an explanation. +if so caught, should abort the configuration with an explanation. @emph{Please} do not try to disable the check, otherwise @code{g77} might well appear to build and install correctly, and even appear to compile correctly, @@ -928,6 +936,12 @@ change to @file{gcc/f/proj.h}: edit the line reading @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 as part of the @code{g77} distribution to be compiled and @@ -939,6 +953,7 @@ Similarly, a minimal version of @samp{bsearch()} is available and can be enabled by editing a line similar to the one 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 ANSI C environment. @@ -1265,7 +1280,7 @@ GNU CPP version 2.7.1 (80386, BSD syntax) End of search list. ./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{} +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{} /usr/lib/crt0.o(.text+0x35): undefined reference to `main' @@ -1465,7 +1480,7 @@ the file @file{gcc/COPYING} thoroughly). Then, consider your target audience and decide where @code{g77} should be installed. -For systems like Linux that have no native Fortran compiler (or +For systems like GNU/Linux that have no native Fortran compiler (or where @code{g77} could be considered the native compiler for Fortran and @code{gcc} for C, etc.), you should definitely configure @code{g77} for installation @@ -1621,6 +1636,8 @@ be pertinent in future versions of @code{g77}. @vindex FFECOM_sizeMAXSTACKITEM @cindex code, stack variables @cindex maximum stackable size +@cindex stack allocation +@cindex segmentation violation @code{g77}, on most machines, puts many variables and arrays on the stack where possible, and can be configured (by changing @samp{FFECOM_sizeMAXSTACKITEM} in @file{gcc/f/com.c}) to force @@ -1629,6 +1646,12 @@ on stack space) or permit larger-sized entities to be put on the stack (which can improve run-time performance, as it presents more opportunities for the GBE to optimize the generated code). +@emph{Note:} Putting more variables and arrays on the stack +might cause problems due to system-dependent limits on stack size. +Also, the value of @samp{FFECOM_sizeMAXSTACKITEM} has no +effect on automatic variables and arrays. +@xref{But-bugs}, for more information. + @node Floating-point Bit Patterns @subsection Floating-point Bit Patterns @@ -1645,7 +1668,7 @@ but rather generate correct code for the target. (Currently, @code{g77} would generate bad code under such circumstances if it didn't crash during the build, e.g. when compiling a source file that does -something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/3.1415926535/}.) +something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.) @node Large Initialization @subsection Initialization of Large Aggregate Areas @@ -1700,20 +1723,10 @@ for a target configuration that is not basically a 32-bit machine (such as an Alpha, which is a 64-bit machine, especially if it has a 64-bit operating system running on it). 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 +properly on such configurations. +This is expected to be completely 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.) - +(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 --git a/gnu/usr.bin/gcc/f/intrin.c b/gnu/usr.bin/gcc/f/intrin.c index dac8d6a912a..231e795ec77 100644 --- a/gnu/usr.bin/gcc/f/intrin.c +++ b/gnu/usr.bin/gcc/f/intrin.c @@ -225,6 +225,8 @@ ffeintrin_check_ (ffeintrinImp imp, ffebldOp op, basic = *(argc++); kind = *(argc++); if ((*argc == '&') + || (*argc == 'g') + || (*argc == 's') || (*argc == 'w') || (*argc == 'x')) extra = *(argc++); @@ -376,6 +378,15 @@ ffeintrin_check_ (ffeintrinImp imp, ffebldOp op, okay = FALSE; break; + case 'g': + if ((ffebld_op (a) != FFEBLD_opLABTER) + && (ffebld_op (a) != FFEBLD_opLABTOK)) + okay = FALSE; + break; + + case 's': + break; + case 'w': case 'x': if ((ffeinfo_kind (i) != FFEINFO_kindENTITY) @@ -695,6 +706,8 @@ ffeintrin_check_ (ffeintrinImp imp, ffebldOp op, basic = *(argc++); kind = *(argc++); if ((*argc == '&') + || (*argc == 'g') + || (*argc == 's') || (*argc == 'w') || (*argc == 'x')) extra = *(argc++); @@ -865,6 +878,15 @@ ffeintrin_check_ (ffeintrinImp imp, ffebldOp op, okay = FALSE; break; + case 'g': + if ((ffebld_op (a) != FFEBLD_opLABTER) + && (ffebld_op (a) != FFEBLD_opLABTOK)) + okay = FALSE; + break; + + case 's': + break; + case 'w': case 'x': if ((ffeinfo_kind (i) != FFEINFO_kindENTITY) @@ -1452,7 +1474,8 @@ ffeintrin_init_0 () break; } if ((c[3] == '&') - || (c[3] == 'w') + || (c[3] == 's') + || (c[3] == 'w') || (c[3] == 'x')) ++c; if (c[3] == ',') diff --git a/gnu/usr.bin/gcc/f/intrin.def b/gnu/usr.bin/gcc/f/intrin.def index 0a834918f60..d0031414c70 100644 --- a/gnu/usr.bin/gcc/f/intrin.def +++ b/gnu/usr.bin/gcc/f/intrin.def @@ -149,6 +149,8 @@ DEFNAME ("FPMAKE", "fpmake", "FPMake", genFPMAKE, specNONE) /* F2C */ DEFNAME ("FPRRSP", "fprrsp", "FPRRSp", genFPRRSP, specNONE) /* F2C */ 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 */ DEFNAME ("HUGE", "huge", "Huge", genNONE, specHUGE) /* F90 */ @@ -1267,6 +1269,18 @@ DEFSPEC (FFEINTRIN_specFRACTION, FFEINTRIN_familyF90, FFEINTRIN_impNONE ) +DEFSPEC (FFEINTRIN_specFSEEK, + "FSEEK", + FALSE, + FFEINTRIN_familyF2U, + FFEINTRIN_impFSEEK + ) +DEFSPEC (FFEINTRIN_specFTELL, + "FTELL", + FALSE, + FFEINTRIN_familyF2U, + FFEINTRIN_impFTELL + ) DEFSPEC (FFEINTRIN_specGETARG, "GETARG", FALSE, @@ -2314,12 +2328,16 @@ DEFSPEC (FFEINTRIN_specNONE, 2 (COMPLEX*16, INTEGER*1, LOGICAL*1, REAL*8) 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) <arg-extra> 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 <arg-kind>) w Arg is INTENT(OUT) x Arg is INTENT(INOUT) @@ -2481,6 +2499,8 @@ DEFIMP (ERF, "ERF", ERF, "R0:-:X=R0") DEFIMP (ERFC, "ERFC", ERFC, "R0:-:X=R0") 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 (IACHAR, "IACHAR", , "I1:-:C=A0") @@ -2499,7 +2519,7 @@ DEFIMP (MVBITS, "MVBITS", , "--:-:From=I0,FromPos=I0,Len=I0,TO=IAx,ToPos=I0") DEFIMP (NOT, "NOT", , "I0:*:I=I0") 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 (SIGNAL, "SIGNAL", , "--:-:Number=I0,Handler=-ss") DEFIMP (SYSTEM, "SYSTEM", , "--:-:Command=A1,Status=?I1") DEFIMP (XOR, "XOR", , "B0:*:I=B0,J=B0") DEFIMP (NONE, "none", , "") diff --git a/gnu/usr.bin/gcc/f/lang-options.h b/gnu/usr.bin/gcc/f/lang-options.h index 55321330474..f9eab62cc37 100644 --- a/gnu/usr.bin/gcc/f/lang-options.h +++ b/gnu/usr.bin/gcc/f/lang-options.h @@ -30,8 +30,12 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA "-fversion", "-fnull-version", "-fset-g77-defaults", - "-fident", - "-fno-ident", +/*"-fident",*/ +/*"-fno-ident",*/ + "-ff66", + "-fno-f66", + "-ff77", + "-fno-f77", "-ff90", "-fno-f90", "-fautomatic", @@ -54,8 +58,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA "-fno-ugly", "-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", "-finit-local-zero", @@ -113,11 +123,19 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA "-fvxt-intrinsics-enable", "-fzeros", "-fno-zeros", - "-Wimplicit", - "-Wno-implicit", + "-fdebug-kludge", + "-fno-debug-kludge", + "-fonetrip", + "-fno-onetrip", + "-fsilent", + "-fno-silent", + "-ftypeless-boz", + "-fno-typeless-boz", +/*"-Wimplicit",*/ +/*"-Wno-implicit",*/ "-Wsurprising", "-Wno-surprising", - "-Wall", +/*"-Wall",*/ /* Prefix options. */ "-I", "-ffixed-line-length-", diff --git a/gnu/usr.bin/gcc/f/lex.c b/gnu/usr.bin/gcc/f/lex.c index f0855c61770..21c493d22e8 100644 --- a/gnu/usr.bin/gcc/f/lex.c +++ b/gnu/usr.bin/gcc/f/lex.c @@ -34,6 +34,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree.j" #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); static void ffelex_bad_1_ (ffebad errnum, ffewhereLineNumber ln0, @@ -271,8 +278,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) case 'x': if (warn_traditional) { - ffebad_start_msg ("The meaning of `\\x' (at %0) varies with -traditional", - FFEBAD_severityWARNING); + ffebad_start_msg_lex ("The meaning of `\\x' (at %0) varies with -traditional", + FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -321,8 +328,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) case 'a': if (warn_traditional) { - ffebad_start_msg ("The meaning of `\\a' (at %0) varies with -traditional", - FFEBAD_severityWARNING); + ffebad_start_msg_lex ("The meaning of `\\a' (at %0) varies with -traditional", + FFEBAD_severityWARNING); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -350,8 +357,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) m[0] = c; m[1] = '\0'; - ffebad_start_msg ("Non-ANSI-C-standard escape sequence `\\%A' at %0", - FFEBAD_severityPEDANTIC); + ffebad_start_msg_lex ("Non-ANSI-C-standard escape sequence `\\%A' at %0", + FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); ffebad_finish (); @@ -368,16 +375,16 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) m[0] = c; m[1] = '\0'; - ffebad_start_msg ("Unknown escape sequence `\\%A' at %0", - FFEBAD_severityPEDANTIC); + ffebad_start_msg_lex ("Unknown escape sequence `\\%A' at %0", + FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_string (m); ffebad_finish (); } else if (c == EOF) { - ffebad_start_msg ("Unterminated escape sequence `\\' at %0", - FFEBAD_severityPEDANTIC); + ffebad_start_msg_lex ("Unterminated escape sequence `\\' at %0", + FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -386,8 +393,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) char m[20]; sprintf (&m[0], "%x", c); - ffebad_start_msg ("Unknown escape sequence `\\' followed by char code 0x%A at %0", - FFEBAD_severityPEDANTIC); + 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); ffebad_finish (); @@ -421,8 +428,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) if (! nonnull) { - ffebad_start_msg ("\\x used at %0 with no following hex digits", - FFEBAD_severityFATAL); + ffebad_start_msg_lex ("\\x used at %0 with no following hex digits", + FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -434,8 +441,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) && ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4)) <= (int) firstdig))) { - ffebad_start_msg ("Hex escape at %0 out of range", - FFEBAD_severityPEDANTIC); + ffebad_start_msg_lex ("Hex escape at %0 out of range", + FFEBAD_severityPEDANTIC); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -467,8 +474,8 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) && TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT && code >= (1 << TYPE_PRECISION (char_type_node))) { - ffebad_start_msg ("Escape sequence at %0 out of range for character", - FFEBAD_severityFATAL); + ffebad_start_msg_lex ("Escape sequence at %0 out of range for character", + FFEBAD_severityFATAL); ffelex_bad_here_ (0, line, column); ffebad_finish (); } @@ -1407,6 +1414,7 @@ ffelex_image_char_ (int c, ffewhereColumnNumber column) ffelex_card_length_ = column + 3; ffelex_bad_1_ (FFEBAD_LINE_TOO_LONG, ffelex_linecount_current_, column + 1); + column += 3; return column; } @@ -1436,10 +1444,11 @@ ffelex_image_char_ (int c, ffewhereColumnNumber column) ffelex_bad_line_ = TRUE; strcpy (&ffelex_card_image_[column], "[\\0]"); ffelex_card_length_ = column + 4; - ffebad_start_msg ("Null character at %0 -- line ignored", - FFEBAD_severityFATAL); + 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; @@ -1935,7 +1944,11 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f) column = ffelex_image_char_ (c, column); if (ffelex_bad_line_) - goto comment_line; /* :::::::::::::::::::: */ + { + ffelex_card_image_[column] = '\0'; + ffelex_card_length_ = column; + goto comment_line; /* :::::::::::::::::::: */ + } /* If no tab, cut off line after column 72/132. */ @@ -3058,7 +3071,11 @@ ffelex_file_free (ffewhereFile wf, FILE *f) column = ffelex_image_char_ (c, column); if (ffelex_bad_line_) - goto comment_line; /* :::::::::::::::::::: */ + { + ffelex_card_image_[column] = '\0'; + ffelex_card_length_ = column; + goto comment_line; /* :::::::::::::::::::: */ + } /* If no tab, cut off line after column 132. */ diff --git a/gnu/usr.bin/gcc/f/news.texi b/gnu/usr.bin/gcc/f/news.texi index d75553c94a2..91b1ef5f54e 100644 --- a/gnu/usr.bin/gcc/f/news.texi +++ b/gnu/usr.bin/gcc/f/news.texi @@ -5,7 +5,7 @@ @c The text of this file appears in the file BUGS @c in the G77 distribution, as well as in the G77 manual. -@c 1996-04-01 +@c 1996-12-03 @ifclear NEWSONLY @node News @@ -13,6 +13,131 @@ @end ifclear @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: @itemize @bullet @@ -189,6 +314,9 @@ using that wider type (wider than default @samp{INTEGER}) must be rewritten.) @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. @@ -308,7 +436,7 @@ Upgrade to @code{libf2c} as of 1995-11-15. @itemize @bullet @item Fix a code-generation bug involving complicated @samp{EQUIVALENCE} statements -not involving @samp{COMMON} +not involving @samp{COMMON}. @item Fix code-generation bugs involving invoking ``gratis'' library procedures diff --git a/gnu/usr.bin/gcc/f/proj.h b/gnu/usr.bin/gcc/f/proj.h index 55f91e8a726..ca092fa8985 100644 --- a/gnu/usr.bin/gcc/f/proj.h +++ b/gnu/usr.bin/gcc/f/proj.h @@ -25,7 +25,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define _H_f_proj #if !defined (__GNUC__) || (__GNUC__ < 2) -#error You have to use gcc 2.x to build g77 (might be fixed in g77-0.6). +#error "You have to use gcc 2.x to build g77 (might be fixed in g77-0.6)." #endif #ifndef BUILT_WITH_270 diff --git a/gnu/usr.bin/gcc/f/runtime/ChangeLog b/gnu/usr.bin/gcc/f/runtime/ChangeLog index f2b40ce5eb5..8d2f0b12590 100644 --- a/gnu/usr.bin/gcc/f/runtime/ChangeLog +++ b/gnu/usr.bin/gcc/f/runtime/ChangeLog @@ -1,3 +1,108 @@ +Sun Dec 1 21:25:27 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * configure: Regenerated using autoconf-2.12. + +Mon Nov 25 21:16:15 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * configure: Regenerated using autoconf-2.11. + +1996-11-19 Dave Love <d.love@dl.ac.uk> + + * libI77/backspace.c: Include sys/types.h for size_t. + +Wed Nov 6 14:17:27 1996 Craig Burley <burley@gnu.ai.mit.edu> + + * 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 <burley@gnu.ai.mit.edu> + + * 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 <d.love@dl.ac.uk> + + * 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 <d.love@dl.ac.uk> + + Update to Netlib version of 1996-09-26. + + * libI77/Version.c: Use <stdio.h>, not "stdio.h". + * libF77/Version.c: Likewise. + +Wed Aug 28 13:25:29 1996 Dave Love <d.love@dl.ac.uk> + + * 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 <d.love@dl.ac.uk> + + * libI77/backspace.c (f_back): Cast fread arg to size_t. + +Tue Aug 27 19:11:30 1996 Dave Love <d.love@dl.ac.uk> + + * libI77/Version.c: Supply */ to avoid apparent nested comment. + +Tue Aug 20 09:21:43 1996 Dave Love <d.love@dl.ac.uk> + + * libF77/Makefile.in (ALL_CFLAGS): Fix missing ../ for include. + * libI77/Makefile.in (ALL_CFLAGS): Likewise. + +Sat Aug 17 13:00:47 1996 Dave Love <d.love@dl.ac.uk> + + * (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 <d.love@dl.ac.uk> + + * 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 <d.love@dl.ac.uk> + + * libI77/ftell_.c: Added from Netlib distribution. + Sat Mar 30 20:57:24 1996 Dave Love <d.love@dl.ac.uk> * configure.in: Eliminate explicit use of diff --git a/gnu/usr.bin/gcc/f/runtime/configure b/gnu/usr.bin/gcc/f/runtime/configure index e136ab2f986..0f412c86932 100644 --- a/gnu/usr.bin/gcc/f/runtime/configure +++ b/gnu/usr.bin/gcc/f/runtime/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.9 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -49,6 +49,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -330,7 +332,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.9" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -432,11 +434,14 @@ do done # 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 +# 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. rm -rf conftest* confdefs.h @@ -498,6 +503,7 @@ ac_ext=c 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 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -520,6 +526,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. 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 else @@ -548,6 +555,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. 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 else @@ -594,7 +602,47 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } 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 <<EOF +#line 617 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +if { (eval echo configure:621: \"$ac_link\") 1>&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 @@ -603,7 +651,7 @@ else yes; #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 +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 ac_cv_prog_gcc=no @@ -611,29 +659,34 @@ fi fi 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 + 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_gcc_g=yes + ac_cv_prog_cc_g=yes else - ac_cv_prog_gcc_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* 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 +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 GCC= @@ -655,6 +708,7 @@ else # Extract the first word of "ranlib", so it can be a program name with args. 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 else @@ -685,7 +739,9 @@ fi +# 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 CPP= @@ -700,33 +756,37 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 704 "configure" +#line 760 "configure" #include "confdefs.h" #include <assert.h> Syntax Error 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; } +{ (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 : 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 <<EOF -#line 719 "configure" +#line 777 "configure" #include "confdefs.h" #include <assert.h> Syntax Error 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; } +{ (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 : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -741,38 +801,52 @@ else fi 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 +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 - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext <<EOF -#line 754 "configure" + cat > conftest.$ac_ext <<EOF +#line 812 "configure" #include "confdefs.h" -main(){return(0);} +#include <stdio.h> EOF -{ (eval echo configure:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_cross=no +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 - ac_cv_c_cross=yes + 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 -rm -fr conftest* +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_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 +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 <<EOF -#line 776 "configure" +#line 850 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -780,13 +854,15 @@ else #include <float.h> 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; } +{ (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 rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -795,7 +871,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 799 "configure" +#line 875 "configure" #include "confdefs.h" #include <string.h> EOF @@ -813,7 +889,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 817 "configure" +#line 893 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -833,8 +909,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else -cat > conftest.$ac_ext <<EOF -#line 838 "configure" + cat > conftest.$ac_ext <<EOF +#line 914 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -845,15 +921,19 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -{ (eval echo configure:849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +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 -fi rm -fr conftest* fi + +fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 @@ -867,11 +947,12 @@ fi 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 <<EOF -#line 875 "configure" +#line 956 "configure" #include "confdefs.h" #include <sys/types.h> #include <unistd.h> @@ -897,11 +978,12 @@ echo "$ac_t""$ac_cv_header_posix" 1>&6 # We can rely on the GNU library being posix-ish. I guess checking the # 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 <<EOF -#line 905 "configure" +#line 987 "configure" #include "confdefs.h" #include <stdio.h> #ifdef __GNU_LIBRARY__ @@ -923,24 +1005,27 @@ fi echo "$ac_t""$ac_cv_lib_gnu" 1>&6 -ac_safe=`echo "fcntl.h" | tr './\055' '___'` +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 -#line 933 "configure" +#line 1016 "configure" #include "confdefs.h" #include <fcntl.h> 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; } +{ (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 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 @@ -965,15 +1050,15 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&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 <<EOF -#line 973 "configure" +#line 1059 "configure" #include "confdefs.h" -int main() { return 0; } -int t() { +int main() { /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; @@ -1019,15 +1104,16 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +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 echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -1039,19 +1125,21 @@ EOF fi 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 <<EOF -#line 1047 "configure" +#line 1134 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> +#include <stddef.h> #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "size_t" >/dev/null 2>&1; then + egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else @@ -1071,11 +1159,12 @@ fi 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 <<EOF -#line 1079 "configure" +#line 1168 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -1088,20 +1177,20 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { return 0; } -int t() { +int main() { int i; ; return 0; } EOF -if { (eval echo configure:1097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +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 echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -1113,20 +1202,22 @@ EOF # we'll get atexit by default if test $ac_cv_header_stdc != yes; then echo $ac_n "checking for atexit""... $ac_c" 1>&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 <<EOF -#line 1121 "configure" +#line 1211 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char atexit(); below. */ #include <assert.h> /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1139,16 +1230,18 @@ atexit(); ; return 0; } EOF -if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +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 cat >> confdefs.h <<\EOF @@ -1162,20 +1255,22 @@ else EOF echo $ac_n "checking for onexit""... $ac_c" 1>&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 <<EOF -#line 1170 "configure" +#line 1264 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char onexit(); below. */ #include <assert.h> /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1188,36 +1283,40 @@ onexit(); ; return 0; } EOF -if { (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +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 echo "$ac_t""no" 1>&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 <<EOF -#line 1212 "configure" +#line 1310 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char on_exit(); below. */ #include <assert.h> /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1230,16 +1329,18 @@ on_exit(); ; return 0; } EOF -if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +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 cat >> confdefs.h <<\EOF @@ -1259,20 +1360,22 @@ fi # This should always succeed on unix: echo $ac_n "checking for fstat""... $ac_c" 1>&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 <<EOF -#line 1267 "configure" +#line 1369 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char fstat(); below. */ #include <assert.h> /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1285,16 +1388,18 @@ fstat(); ; return 0; } EOF -if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +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 : @@ -1308,27 +1413,28 @@ fi # 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 <<EOF -#line 1316 "configure" +#line 1422 "configure" #include "confdefs.h" #include <stdio.h> -int main() { return 0; } -int t() { +int main() { 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 +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 if test $ac_cv_struct_FILE = no; then @@ -1338,28 +1444,32 @@ EOF fi -echo $ac_n "checking for -lm""... $ac_c" 1>&6 -ac_lib_var=`echo m_drem | tr '.-/+' '___p'` +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 ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 1350 "configure" +#line 1457 "configure" #include "confdefs.h" /* 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 drem(); -int main() { return 0; } -int t() { +int main() { drem() ; return 0; } EOF -if { (eval echo configure:1360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1468: \"$ac_link\") 1>&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 @@ -1384,25 +1494,30 @@ fi # However, on my sunos4/gcc setup unistd.h leads us wrongly to believe # 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 <<EOF -#line 1392 "configure" + cat > conftest.$ac_ext <<EOF +#line 1503 "configure" #include "confdefs.h" #include <stdio.h> /* does sprintf return the number of chars transferred? */ main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);} EOF -{ (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +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 -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 else @@ -1423,7 +1538,7 @@ fi # define NON_ANSI_RW_MODES on unix (can't hurt) cat > conftest.$ac_ext <<EOF -#line 1427 "configure" +#line 1542 "configure" #include "confdefs.h" #ifdef unix yes @@ -1455,13 +1570,14 @@ EOF # (via com.h). proj.h and com.h are in $srcdir/.., config.h which they need # is in ../.. and the config files are in $srcdir/../../config. echo $ac_n "checking f2c integer type""... $ac_c" 1>&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_f2cinteger'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1465 "configure" +#line 1581 "configure" #include "confdefs.h" #include "proj.h" #define FFECOM_DETERMINE_TYPES 1 @@ -1484,7 +1600,7 @@ rm -f conftest* if test "$ac_cv_sys_f2cinteger" = ""; then cat > conftest.$ac_ext <<EOF -#line 1488 "configure" +#line 1604 "configure" #include "confdefs.h" #include "proj.h" #define FFECOM_DETERMINE_TYPES 1 @@ -1522,6 +1638,18 @@ ac_cpp=late_ac_cpp +# This EOF_CHAR is a misfeature on unix. +cat >> confdefs.h <<\EOF +#define NO_EOF_CHAR_CHECK 1 +EOF + + +cat >> confdefs.h <<\EOF +#define Skip_f2c_Undefs 1 +EOF + + + cat >> confdefs.h <<\EOF @@ -1563,11 +1691,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # 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 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + 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 : else @@ -1634,7 +1776,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" 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" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1684,20 +1826,56 @@ s%@CROSS@%$CROSS%g 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 <<EOF CONFIG_FILES=\${CONFIG_FILES-"Makefile ../../include/f2c.h:f2c.h.in libI77/Makefile libF77/Makefile"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) 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. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -1721,6 +1899,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1729,15 +1908,21 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) 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 -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* +EOF +cat >> $CONFIG_STATUS <<EOF +EOF +cat >> $CONFIG_STATUS <<\EOF exit 0 EOF @@ -1746,3 +1931,4 @@ rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/gnu/usr.bin/gcc/f/runtime/configure.in b/gnu/usr.bin/gcc/f/runtime/configure.in index ce7eefca3f4..755894abd6e 100644 --- a/gnu/usr.bin/gcc/f/runtime/configure.in +++ b/gnu/usr.bin/gcc/f/runtime/configure.in @@ -53,6 +53,14 @@ dnl AC_PROG_MAKE_SET dnl Checks for libraries. 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 dnl AC_MSG_CHECKING(for prototype-savvy compiler) @@ -116,7 +124,6 @@ else true fi # 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: AC_MSG_CHECKING([for necessary members of struct FILE]) @@ -130,6 +137,7 @@ if test $ac_cv_struct_FILE = no; then fi 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 for U77: @@ -229,6 +237,12 @@ dnl maybe check for drem/remainder 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. @@ -272,3 +286,9 @@ dnl not s_cat.o) dnl * change unit preconnexion in libI77/err.c (f_init.c) 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 --git a/gnu/usr.bin/gcc/f/runtime/f2c.h.in b/gnu/usr.bin/gcc/f/runtime/f2c.h.in index fff134d292a..9d1d5905bf7 100644 --- a/gnu/usr.bin/gcc/f/runtime/f2c.h.in +++ b/gnu/usr.bin/gcc/f/runtime/f2c.h.in @@ -10,6 +10,7 @@ /* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ /* we assume short, float are OK */ typedef @F2C_INTEGER@ /* long int */ integer; +typedef unsigned @F2C_INTEGER@ /* long */ uinteger; typedef char *address; typedef short int shortint; typedef float real; @@ -20,6 +21,13 @@ typedef @F2C_INTEGER@ /* long int */ logical; typedef short int shortlogical; 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; #define TRUE_ (1) @@ -33,7 +41,7 @@ typedef long long int longint; /* I/O stuff */ #ifdef f2c_i2 -WARNING: will not work with g77!!!! (This line is intended to kill compiles.) + #error f2c_i2 will not work with g77!!!! /* for -i2 */ typedef short flag; typedef short ftnlen; @@ -134,7 +142,7 @@ union Multitype { /* for multiple entry points */ typedef union Multitype Multitype; -typedef long Long; /* No longer used; formerly in Namelist */ +/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ struct Vardesc { /* for Namelist */ char *name; @@ -157,6 +165,9 @@ typedef struct Namelist Namelist; #define max(a,b) ((a) >= (b) ? (a) : (b)) #define dmin(a,b) (doublereal)min(a,b) #define dmax(a,b) (doublereal)max(a,b) +#define bit_test(a,b) ((a) >> (b) & 1) +#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) +#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) /* procedure parameter types for -A and -C++ */ diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/F77_aloc.c b/gnu/usr.bin/gcc/f/runtime/libF77/F77_aloc.c index 18a345f4552..b44ba61c333 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/F77_aloc.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/F77_aloc.c @@ -2,7 +2,7 @@ #undef abs #undef min #undef max -#include "stdio.h" +#include <stdio.h> static integer memfailure = 3; @@ -13,7 +13,7 @@ extern void exit_(); char * F77_aloc(Len, whence) integer Len; char *whence; #else -#include "stdlib.h" +#include <stdlib.h> extern void exit_(integer*); char * @@ -23,7 +23,7 @@ F77_aloc(integer Len, char *whence) char *rv; unsigned int uLen = (unsigned int) Len; /* for K&R C */ - if (!(rv = malloc(uLen))) { + if (!(rv = (char*)malloc(uLen))) { fprintf(stderr, "malloc(%u) failure in %s\n", uLen, whence); exit_(&memfailure); diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/Makefile.in b/gnu/usr.bin/gcc/f/runtime/libF77/Makefile.in index f9c30590e82..164c7bcef38 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/Makefile.in +++ b/gnu/usr.bin/gcc/f/runtime/libF77/Makefile.in @@ -1,7 +1,7 @@ # Makefile for GNU F77 compiler runtime. # 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. +# Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of GNU Fortran. @@ -38,7 +38,7 @@ DEFS = @DEFS@ CGFLAGS = -g0 # f2c.h should already be installed in xgcc's include directory but add that # to -I anyhow in case not using xgcc. -ALL_CFLAGS = -I$(srcdir) -I../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) +ALL_CFLAGS = -I$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc RANLIB = @RANLIB@ @@ -75,6 +75,7 @@ HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o EFL = ef1asc_.o ef1cmc_.o CHAR = s_cat.o s_cmp.o s_copy.o +F90BIT = lbitbits.o lbitshft.o lib = ../../../libf2c.a @@ -108,6 +109,6 @@ clean: # Not quite all these actually do depend on f2c.h... $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ - $(HALF) $(CMP) $(EFL) $(CHAR): $(F2C_H) + $(HALF) $(CMP) $(EFL) $(CHAR): $(F2C_H) $(F90BIT) force: diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/README b/gnu/usr.bin/gcc/f/runtime/libF77/README index c6b2b64bb26..f3afeb6855f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/README +++ b/gnu/usr.bin/gcc/f/runtime/libF77/README @@ -87,10 +87,11 @@ external Fortran routines. cmd to the system's command processor (on systems where 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. +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 (character string) assignment to be appear on its right-hand, at diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/Version.c b/gnu/usr.bin/gcc/f/runtime/libF77/Version.c index 17d310f9cea..d38e01d1907 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/Version.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/Version.c @@ -1,9 +1,9 @@ -static char junk[] = "\n@(#)LIBF77 VERSION 2.01 19 Mar. 1996\n"; +static char junk[] = "\n@(#)LIBF77 VERSION 19960619\n"; /* */ -char __G77_LIBF77_VERSION__[] = "0.5.18"; +char __G77_LIBF77_VERSION__[] = "0.5.19"; /* 2.00 11 June 1980. File version.c added to library. @@ -45,9 +45,11 @@ char __G77_LIBF77_VERSION__[] = "0.5.18"; 6 Sept. 1995: fix return type of system_ under -DKR_headers. 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 "stdio.h" +#include <stdio.h> void g77_libf77_version () diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/abort_.c b/gnu/usr.bin/gcc/f/runtime/libF77/abort_.c index 9d4a0568ec7..7a7e55236b8 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/abort_.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/abort_.c @@ -1,4 +1,4 @@ -#include "stdio.h" +#include <stdio.h> #include "f2c.h" #ifdef KR_headers diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/c_cos.c b/gnu/usr.bin/gcc/f/runtime/libF77/c_cos.c index d5fadd43b18..09c8719848f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/c_cos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/c_cos.c @@ -6,7 +6,7 @@ extern double sin(), cos(), sinh(), cosh(); VOID c_cos(r, z) complex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void c_cos(complex *r, complex *z) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/c_exp.c b/gnu/usr.bin/gcc/f/runtime/libF77/c_exp.c index 8252c7f7012..68aebd3dbfb 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/c_exp.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/c_exp.c @@ -6,7 +6,7 @@ extern double exp(), cos(), sin(); VOID c_exp(r, z) complex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void c_exp(complex *r, complex *z) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/c_log.c b/gnu/usr.bin/gcc/f/runtime/libF77/c_log.c index a77521aee54..39dcfa50967 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/c_log.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/c_log.c @@ -5,7 +5,7 @@ extern double log(), f__cabs(), atan2(); VOID c_log(r, z) complex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double, double); void c_log(complex *r, complex *z) diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/c_sin.c b/gnu/usr.bin/gcc/f/runtime/libF77/c_sin.c index ffdef1d171f..620360ce53e 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/c_sin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/c_sin.c @@ -6,7 +6,7 @@ extern double sin(), cos(), sinh(), cosh(); VOID c_sin(r, z) complex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void c_sin(complex *r, complex *z) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/c_sqrt.c b/gnu/usr.bin/gcc/f/runtime/libF77/c_sqrt.c index 3b7342f4a49..4095ce17b5b 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/c_sqrt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/c_sqrt.c @@ -6,7 +6,7 @@ extern double sqrt(), f__cabs(); VOID c_sqrt(r, z) complex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double, double); void c_sqrt(complex *r, complex *z) diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/cabs.c b/gnu/usr.bin/gcc/f/runtime/libF77/cabs.c index 09e90af8639..2fad044e884 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/cabs.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/cabs.c @@ -3,7 +3,7 @@ extern double sqrt(); double f__cabs(real, imag) double real, imag; #else #undef abs -#include "math.h" +#include <math.h> double f__cabs(double real, double imag) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_acos.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_acos.c index ecb56e87f54..33da5369db2 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_acos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_acos.c @@ -5,7 +5,7 @@ double acos(); double d_acos(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_acos(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_asin.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_asin.c index 045e73301c8..79b33ca1bd6 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_asin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_asin.c @@ -5,7 +5,7 @@ double asin(); double d_asin(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_asin(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_atan.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_atan.c index 03530a1857c..caea4a406e0 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_atan.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_atan.c @@ -5,7 +5,7 @@ double atan(); double d_atan(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_atan(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_atn2.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_atn2.c index 7c25ac04608..6748a55d56f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_atn2.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_atn2.c @@ -5,7 +5,7 @@ double atan2(); double d_atn2(x,y) doublereal *x, *y; #else #undef abs -#include "math.h" +#include <math.h> double d_atn2(doublereal *x, doublereal *y) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_cos.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_cos.c index 45c4838baee..fa4d6ca406f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_cos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_cos.c @@ -5,7 +5,7 @@ double cos(); double d_cos(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_cos(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_cosh.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_cosh.c index 1181833cc1f..edc0ebc1092 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_cosh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_cosh.c @@ -5,7 +5,7 @@ double cosh(); double d_cosh(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_cosh(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_exp.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_exp.c index 3f2b6ffcc45..be12fd70551 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_exp.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_exp.c @@ -5,7 +5,7 @@ double exp(); double d_exp(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_exp(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_int.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_int.c index 6c0e64215d8..beff1e7d378 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_int.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_int.c @@ -5,7 +5,7 @@ double floor(); double d_int(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_int(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_lg10.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_lg10.c index f03ff0043f8..c0892bd512a 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_lg10.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_lg10.c @@ -7,7 +7,7 @@ double log(); double d_lg10(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_lg10(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_log.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_log.c index d7a1941d56a..592015b2821 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_log.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_log.c @@ -5,7 +5,7 @@ double log(); double d_log(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_log(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_mod.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_mod.c index 0d3ffbff9eb..23f19299168 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_mod.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_mod.c @@ -12,7 +12,7 @@ double d_mod(x,y) doublereal *x, *y; double drem(double, double); #else #undef abs -#include "math.h" +#include <math.h> #endif double d_mod(doublereal *x, doublereal *y) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_nint.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_nint.c index 2ead3df200a..064beff669c 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_nint.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_nint.c @@ -5,7 +5,7 @@ double floor(); double d_nint(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_nint(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_sin.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_sin.c index 0013af03496..fdd699eede5 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_sin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_sin.c @@ -5,7 +5,7 @@ double sin(); double d_sin(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_sin(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_sinh.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_sinh.c index 1ccd02ead97..77f36904f8e 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_sinh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_sinh.c @@ -5,7 +5,7 @@ double sinh(); double d_sinh(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_sinh(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_sqrt.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_sqrt.c index bee10a3a551..b5cf83b946f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_sqrt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_sqrt.c @@ -5,7 +5,7 @@ double sqrt(); double d_sqrt(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_sqrt(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_tan.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_tan.c index 23fa423188e..af94a053223 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_tan.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_tan.c @@ -5,7 +5,7 @@ double tan(); double d_tan(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_tan(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/d_tanh.c b/gnu/usr.bin/gcc/f/runtime/libF77/d_tanh.c index 0363a49b1be..92a02d4fd6b 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/d_tanh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/d_tanh.c @@ -5,7 +5,7 @@ double tanh(); double d_tanh(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> double d_tanh(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/exit.c b/gnu/usr.bin/gcc/f/runtime/libF77/exit.c index da3ab5c10ec..2c3116edaa2 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/exit.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/exit.c @@ -13,7 +13,7 @@ #undef min #undef max #ifndef KR_headers -#include "stdlib.h" +#include <stdlib.h> #ifdef __cplusplus extern "C" { #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/f2ch.add b/gnu/usr.bin/gcc/f/runtime/libF77/f2ch.add index 4ab0d8078c6..a2acc17a159 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/f2ch.add +++ b/gnu/usr.bin/gcc/f/runtime/libF77/f2ch.add @@ -150,7 +150,7 @@ extern integer s_wsni(icilist *); extern integer s_wsue(cilist *); extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); -extern int system_(char *, ftnlen); +extern integer system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *); diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/h_dnnt.c b/gnu/usr.bin/gcc/f/runtime/libF77/h_dnnt.c index 9fbeb5ce624..9d0aa25f1d3 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/h_dnnt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/h_dnnt.c @@ -5,7 +5,7 @@ double floor(); shortint h_dnnt(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> shortint h_dnnt(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/h_nint.c b/gnu/usr.bin/gcc/f/runtime/libF77/h_nint.c index bf63df128d8..0af3735da42 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/h_nint.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/h_nint.c @@ -5,7 +5,7 @@ double floor(); shortint h_nint(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> shortint h_nint(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/i_dnnt.c b/gnu/usr.bin/gcc/f/runtime/libF77/i_dnnt.c index 9d46c4b6ad9..8fcecb68200 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/i_dnnt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/i_dnnt.c @@ -5,7 +5,7 @@ double floor(); integer i_dnnt(x) doublereal *x; #else #undef abs -#include "math.h" +#include <math.h> integer i_dnnt(doublereal *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/i_nint.c b/gnu/usr.bin/gcc/f/runtime/libF77/i_nint.c index ccde7854888..c0f6795171f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/i_nint.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/i_nint.c @@ -5,7 +5,7 @@ double floor(); integer i_nint(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> integer i_nint(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/lbitbits.c b/gnu/usr.bin/gcc/f/runtime/libF77/lbitbits.c new file mode 100644 index 00000000000..75e9f9c603f --- /dev/null +++ b/gnu/usr.bin/gcc/f/runtime/libF77/lbitbits.c @@ -0,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 --git a/gnu/usr.bin/gcc/f/runtime/libF77/lbitshft.c b/gnu/usr.bin/gcc/f/runtime/libF77/lbitshft.c new file mode 100644 index 00000000000..81b0fdbeaba --- /dev/null +++ b/gnu/usr.bin/gcc/f/runtime/libF77/lbitshft.c @@ -0,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 --git a/gnu/usr.bin/gcc/f/runtime/libF77/main.c b/gnu/usr.bin/gcc/f/runtime/libF77/main.c index 79f19435a08..7ecd3761cd3 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/main.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/main.c @@ -1,7 +1,7 @@ /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */ -#include "stdio.h" -#include "signal.h" +#include <stdio.h> +#include <signal.h> #ifndef SIGIOT #ifdef SIGABRT @@ -11,7 +11,7 @@ #ifndef KR_headers #undef VOID -#include "stdlib.h" +#include <stdlib.h> #endif #ifndef VOID diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/pow_dd.c b/gnu/usr.bin/gcc/f/runtime/libF77/pow_dd.c index d2bb0e39bfd..d0dd0ff2744 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/pow_dd.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/pow_dd.c @@ -5,7 +5,7 @@ double pow(); double pow_dd(ap, bp) doublereal *ap, *bp; #else #undef abs -#include "math.h" +#include <math.h> double pow_dd(doublereal *ap, doublereal *bp) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/pow_zz.c b/gnu/usr.bin/gcc/f/runtime/libF77/pow_zz.c index 55785dffbe6..20faf29cfb8 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/pow_zz.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/pow_zz.c @@ -5,7 +5,7 @@ double log(), exp(), cos(), sin(), atan2(), f__cabs(); VOID pow_zz(r,a,b) doublecomplex *r, *a, *b; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double,double); void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/qbitbits.c b/gnu/usr.bin/gcc/f/runtime/libF77/qbitbits.c new file mode 100644 index 00000000000..ad4ac963ce2 --- /dev/null +++ b/gnu/usr.bin/gcc/f/runtime/libF77/qbitbits.c @@ -0,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 --git a/gnu/usr.bin/gcc/f/runtime/libF77/qbitshft.c b/gnu/usr.bin/gcc/f/runtime/libF77/qbitshft.c new file mode 100644 index 00000000000..87fffb91ff8 --- /dev/null +++ b/gnu/usr.bin/gcc/f/runtime/libF77/qbitshft.c @@ -0,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 --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_acos.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_acos.c index 328812ab6aa..330f88a3092 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_acos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_acos.c @@ -5,7 +5,7 @@ double acos(); double r_acos(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_acos(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_asin.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_asin.c index a30c6706b06..45ece4b749e 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_asin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_asin.c @@ -5,7 +5,7 @@ double asin(); double r_asin(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_asin(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_atan.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_atan.c index 1e3817bdf66..36479c915b0 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_atan.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_atan.c @@ -5,7 +5,7 @@ double atan(); double r_atan(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_atan(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_atn2.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_atn2.c index 3832a27f3e3..9347e1f13a9 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_atn2.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_atn2.c @@ -5,7 +5,7 @@ double atan2(); double r_atn2(x,y) real *x, *y; #else #undef abs -#include "math.h" +#include <math.h> double r_atn2(real *x, real *y) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_cos.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_cos.c index cf5c8eb4af2..5bda158cee9 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_cos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_cos.c @@ -5,7 +5,7 @@ double cos(); double r_cos(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_cos(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_cosh.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_cosh.c index 5756c172427..7ae72cc0cef 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_cosh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_cosh.c @@ -5,7 +5,7 @@ double cosh(); double r_cosh(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_cosh(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_exp.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_exp.c index a95f4bc7f2b..d1dea75563f 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_exp.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_exp.c @@ -5,7 +5,7 @@ double exp(); double r_exp(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_exp(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_int.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_int.c index 11264bf1924..8378e775726 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_int.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_int.c @@ -5,7 +5,7 @@ double floor(); double r_int(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_int(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_lg10.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_lg10.c index 4ea02f45100..51f84201711 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_lg10.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_lg10.c @@ -7,7 +7,7 @@ double log(); double r_lg10(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_lg10(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_log.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_log.c index aec6726ef5b..4873fb418e8 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_log.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_log.c @@ -5,7 +5,7 @@ double log(); double r_log(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_log(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_mod.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_mod.c index 7adb44cdbec..faea344a7b7 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_mod.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_mod.c @@ -12,7 +12,7 @@ double r_mod(x,y) real *x, *y; double drem(double, double); #else #undef abs -#include "math.h" +#include <math.h> #endif double r_mod(real *x, real *y) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_nint.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_nint.c index c45bac6458f..f5382af660a 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_nint.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_nint.c @@ -5,7 +5,7 @@ double floor(); double r_nint(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_nint(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_sin.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_sin.c index d2a3dac8581..095b9510de9 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_sin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_sin.c @@ -5,7 +5,7 @@ double sin(); double r_sin(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_sin(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_sinh.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_sinh.c index 00cba0cb07f..3bf4bb138be 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_sinh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_sinh.c @@ -5,7 +5,7 @@ double sinh(); double r_sinh(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_sinh(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_sqrt.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_sqrt.c index 26b45458aac..d0203d3d19b 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_sqrt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_sqrt.c @@ -5,7 +5,7 @@ double sqrt(); double r_sqrt(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_sqrt(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_tan.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_tan.c index 736b37893c4..fc0009e4774 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_tan.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_tan.c @@ -5,7 +5,7 @@ double tan(); double r_tan(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_tan(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/r_tanh.c b/gnu/usr.bin/gcc/f/runtime/libF77/r_tanh.c index 044255a08cc..818c6a8451b 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/r_tanh.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/r_tanh.c @@ -5,7 +5,7 @@ double tanh(); double r_tanh(x) real *x; #else #undef abs -#include "math.h" +#include <math.h> double r_tanh(real *x) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/s_cat.c b/gnu/usr.bin/gcc/f/runtime/libF77/s_cat.c index 19e1ab599d8..7bfb11eb881 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/s_cat.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/s_cat.c @@ -5,17 +5,17 @@ #include "f2c.h" #ifndef NO_OVERWRITE -#include "stdio.h" +#include <stdio.h> #undef abs #ifdef KR_headers extern char *F77_aloc(); extern void free(); extern void exit_(); #else -#include "stdlib.h" +#include <stdlib.h> extern char *F77_aloc(ftnlen, char*); #endif -#include "string.h" +#include <string.h> #endif /* NO_OVERWRITE */ VOID diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/s_paus.c b/gnu/usr.bin/gcc/f/runtime/libF77/s_paus.c index 8944c538239..6a2e86e1262 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/s_paus.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/s_paus.c @@ -1,4 +1,4 @@ -#include "stdio.h" +#include <stdio.h> #include "f2c.h" #define PAUSESIG 15 @@ -11,8 +11,8 @@ #undef abs #undef min #undef max -#include "stdlib.h" -#include "signal.h" +#include <stdlib.h> +#include <signal.h> #ifdef __cplusplus extern "C" { #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/s_rnge.c b/gnu/usr.bin/gcc/f/runtime/libF77/s_rnge.c index b200fce1bf3..189b5247ced 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/s_rnge.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/s_rnge.c @@ -1,4 +1,4 @@ -#include "stdio.h" +#include <stdio.h> #include "f2c.h" /* called when a subscript is out of range */ diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/s_stop.c b/gnu/usr.bin/gcc/f/runtime/libF77/s_stop.c index be3c28ba5e5..2e3f1035b30 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/s_stop.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/s_stop.c @@ -1,4 +1,4 @@ -#include "stdio.h" +#include <stdio.h> #include "f2c.h" #ifdef KR_headers @@ -8,7 +8,7 @@ VOID s_stop(s, n) char *s; ftnlen n; #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> #ifdef __cplusplus extern "C" { #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/sig_die.c b/gnu/usr.bin/gcc/f/runtime/libF77/sig_die.c index dba1521f81a..bebb1e7b8f7 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/sig_die.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/sig_die.c @@ -1,5 +1,5 @@ -#include "stdio.h" -#include "signal.h" +#include <stdio.h> +#include <signal.h> #ifndef SIGIOT #ifdef SIGABRT @@ -10,7 +10,7 @@ #ifdef KR_headers void sig_die(s, kill) register char *s; int kill; #else -#include "stdlib.h" +#include <stdlib.h> #ifdef __cplusplus extern "C" { #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/signal_.c b/gnu/usr.bin/gcc/f/runtime/libF77/signal_.c index b62cedad25c..d848bf564d6 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/signal_.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/signal_.c @@ -15,7 +15,7 @@ extern sig_type signal(); ftnint signal_(sigp, proc) integer *sigp; sig_type proc; #else -#include "signal.h" +#include <signal.h> typedef int (*sig_proc)(int); ftnint signal_(integer *sigp, sig_proc proc) diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/system_.c b/gnu/usr.bin/gcc/f/runtime/libF77/system_.c index e6b3a02d527..71884166e94 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/system_.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/system_.c @@ -11,7 +11,7 @@ system_(s, n) register char *s; ftnlen n; #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> extern char *F77_aloc(ftnlen, char*); integer diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/z_cos.c b/gnu/usr.bin/gcc/f/runtime/libF77/z_cos.c index bc9e23e18a7..ef02be4c38c 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/z_cos.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/z_cos.c @@ -5,7 +5,7 @@ double sin(), cos(), sinh(), cosh(); VOID z_cos(r, z) doublecomplex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void z_cos(doublecomplex *r, doublecomplex *z) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/z_exp.c b/gnu/usr.bin/gcc/f/runtime/libF77/z_exp.c index 56138f3d34b..4e94a14b4cc 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/z_exp.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/z_exp.c @@ -5,7 +5,7 @@ double exp(), cos(), sin(); VOID z_exp(r, z) doublecomplex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void z_exp(doublecomplex *r, doublecomplex *z) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/z_log.c b/gnu/usr.bin/gcc/f/runtime/libF77/z_log.c index fa1ac803eb3..097c0a1b120 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/z_log.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/z_log.c @@ -5,7 +5,7 @@ double log(), f__cabs(), atan2(); VOID z_log(r, z) doublecomplex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double, double); void z_log(doublecomplex *r, doublecomplex *z) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/z_sin.c b/gnu/usr.bin/gcc/f/runtime/libF77/z_sin.c index bd908046f39..dece95e5c60 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/z_sin.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/z_sin.c @@ -5,7 +5,7 @@ double sin(), cos(), sinh(), cosh(); VOID z_sin(r, z) doublecomplex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> void z_sin(doublecomplex *r, doublecomplex *z) #endif { diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/z_sqrt.c b/gnu/usr.bin/gcc/f/runtime/libF77/z_sqrt.c index eed38d0cef8..a469703129b 100644 --- a/gnu/usr.bin/gcc/f/runtime/libF77/z_sqrt.c +++ b/gnu/usr.bin/gcc/f/runtime/libF77/z_sqrt.c @@ -5,7 +5,7 @@ double sqrt(), f__cabs(); VOID z_sqrt(r, z) doublecomplex *r, *z; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double, double); void z_sqrt(doublecomplex *r, doublecomplex *z) #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/Makefile.in b/gnu/usr.bin/gcc/f/runtime/libI77/Makefile.in index 4c452f150b4..9dde6519245 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/Makefile.in +++ b/gnu/usr.bin/gcc/f/runtime/libI77/Makefile.in @@ -1,7 +1,7 @@ # Makefile for GNU F77 compiler runtime. # 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. +# Portions of this file Copyright (C) 1995, 1996 Free Software Foundation, Inc. # Contributed by Dave Love (d.love@dl.ac.uk). # #This file is part of GNU Fortran. @@ -38,7 +38,7 @@ DEFS = @DEFS@ CGFLAGS = -g0 # f2c.h should already be installed in xgcc's include directory but add that # to -I anyhow in case not using xgcc. -ALL_CFLAGS = -I$(srcdir) -I../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) +ALL_CFLAGS = -I$(srcdir) -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS) AR = @AR@ AR_FLAGS = rc RANLIB = @RANLIB@ @@ -58,13 +58,14 @@ CROSS = @CROSS@ OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ 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 + util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \ + ftell_.o lib = ../../../libf2c.a F2C_H = ../../include/f2c.h -all: ../../include/f2c.h $(lib) +all: $(F2C_H) $(lib) $(lib): force $(OBJ) # Don't worry if ar fails, that can happen when a root-like user installs a @@ -97,6 +98,7 @@ endfile.o: fio.h rawio.h err.o: fio.h rawio.h fmt.o: fio.h fmt.o: fmt.h +ftell_.o: fio.h iio.o: fio.h iio.o: fmt.h ilnw.o: fio.h diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/README b/gnu/usr.bin/gcc/f/runtime/libI77/README index 012279998f8..3e822f8c506 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/README +++ b/gnu/usr.bin/gcc/f/runtime/libI77/README @@ -134,6 +134,10 @@ not specify a file name (and does not specify STATUS='SCRATCH') assumes FILE='fort.n' . You can change this by editing open.c 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 integer = int = 32 bits and longint = long = 64 bits. @@ -199,3 +203,20 @@ one-line shell script or (on some systems) 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 --git a/gnu/usr.bin/gcc/f/runtime/libI77/Version.c b/gnu/usr.bin/gcc/f/runtime/libI77/Version.c index 11b9943f333..f59a17679db 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/Version.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/Version.c @@ -1,9 +1,9 @@ -static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19960315\n"; +static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19960925\n"; /* */ -char __G77_LIBI77_VERSION__[] = "0.5.18"; +char __G77_LIBI77_VERSION__[] = "0.5.19"; /* 2.01 $ format added @@ -100,7 +100,7 @@ wrtfmt.c: /* 17 Oct. 1991: change type of length field in sequential unformatted 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. +/* 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.). */ /* 1 Dec. 1991: uio.c: add test for read failure (seq. unformatted reads); @@ -233,7 +233,17 @@ wrtfmt.c: to err.c */ /* 15 Mar. 1996: lread.c, rsfe.c: honor END= in READ stmt with empty iolist */ -#include "stdio.h" +/* 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 <stdio.h> void g77_libi77_version () diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/backspace.c b/gnu/usr.bin/gcc/f/runtime/libI77/backspace.c index 001ffbf4c02..f995db22ed9 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/backspace.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/backspace.c @@ -1,3 +1,4 @@ +#include <sys/types.h> #include "f2c.h" #include "fio.h" #ifdef KR_headers @@ -58,7 +59,7 @@ integer f_back(alist *a) else x -= sizeof(buf); (void) fseek(b->ufd,x,SEEK_SET); - n=fread(buf,1,(int)(y-x), b->ufd); + n=fread(buf,1,(size_t)(y-x), b->ufd); for(i = n - ndec; --i >= 0; ) { if(buf[i]!='\n') continue; diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/close.c b/gnu/usr.bin/gcc/f/runtime/libI77/close.c index 043a8b327ed..2ed158fd7d6 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/close.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/close.c @@ -6,7 +6,7 @@ integer f_clos(a) cllist *a; #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> #ifdef NON_UNIX_STDIO #ifndef unlink #define unlink remove diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/endfile.c b/gnu/usr.bin/gcc/f/runtime/libI77/endfile.c index 454be1388b7..b86dad9dd5d 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/endfile.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/endfile.c @@ -1,6 +1,6 @@ #include "f2c.h" #include "fio.h" -#include "sys/types.h" +#include <sys/types.h> #include "rawio.h" #ifdef KR_headers @@ -9,8 +9,8 @@ extern char *strcpy(); #undef abs #undef min #undef max -#include "stdlib.h" -#include "string.h" +#include <stdlib.h> +#include <string.h> #endif #ifdef NON_UNIX_STDIO @@ -79,7 +79,7 @@ copy(from, len, to) char *from, *to; register long len; copy(char *from, register long len, char *to) #endif { - register int n; + register size_t n; int k, rc = 0, tmp; char buf[BUFSIZ]; @@ -87,7 +87,7 @@ copy(char *from, register long len, char *to) return 1; if ((tmp = creat(to,0666)) < 0) return 1; - while((n = read(k, buf, len > BUFSIZ ? BUFSIZ : (int)len)) > 0) { + while((n = read(k, buf, (size_t) (len > BUFSIZ ? BUFSIZ : (int)len))) > 0) { if (write(tmp, buf, n) != n) { rc = 1; break; } if ((len -= n) <= 0) diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/err.c b/gnu/usr.bin/gcc/f/runtime/libI77/err.c index e470bc91991..171cb97f145 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/err.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/err.c @@ -1,6 +1,6 @@ #ifndef NON_UNIX_STDIO -#include "sys/types.h" -#include "sys/stat.h" +#include <sys/types.h> +#include <sys/stat.h> #endif #include "f2c.h" #include "fio.h" @@ -13,7 +13,7 @@ extern char *malloc(); #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> #endif #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/f2ch.add b/gnu/usr.bin/gcc/f/runtime/libI77/f2ch.add index 4ab0d8078c6..a2acc17a159 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/f2ch.add +++ b/gnu/usr.bin/gcc/f/runtime/libI77/f2ch.add @@ -150,7 +150,7 @@ extern integer s_wsni(icilist *); extern integer s_wsue(cilist *); extern void sig_die(char *, int); extern integer signal_(integer *, void (*)(int)); -extern int system_(char *, ftnlen); +extern integer system_(char *, ftnlen); extern double z_abs(doublecomplex *); extern void z_cos(doublecomplex *, doublecomplex *); extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *); diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/fio.h b/gnu/usr.bin/gcc/f/runtime/libI77/fio.h index 0fd2c2e6520..d3b8c275c8e 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/fio.h +++ b/gnu/usr.bin/gcc/f/runtime/libI77/fio.h @@ -1,8 +1,8 @@ -#include "stdio.h" -#include "errno.h" +#include <stdio.h> +#include <errno.h> #ifndef NULL /* ANSI C */ -#include "stddef.h" +#include <stddef.h> #endif #ifndef SEEK_SET diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/fmt.h b/gnu/usr.bin/gcc/f/runtime/libI77/fmt.h index e94bc1cabc3..509746e13b9 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/fmt.h +++ b/gnu/usr.bin/gcc/f/runtime/libI77/fmt.h @@ -45,7 +45,10 @@ typedef union } ufloat; typedef union { short is; - char ic; +#ifndef KR_headers + signed +#endif + char ic; integer il; #ifdef Allow_TYQUAD longint ili; diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/ftell_.c b/gnu/usr.bin/gcc/f/runtime/libI77/ftell_.c new file mode 100644 index 00000000000..8e5b825326d --- /dev/null +++ b/gnu/usr.bin/gcc/f/runtime/libI77/ftell_.c @@ -0,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 --git a/gnu/usr.bin/gcc/f/runtime/libI77/inquire.c b/gnu/usr.bin/gcc/f/runtime/libI77/inquire.c index 33587f926c9..f195944cb95 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/inquire.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/inquire.c @@ -7,7 +7,7 @@ integer f_inqu(a) inlist *a; #undef abs #undef min #undef max -#include "string.h" +#include <string.h> #include "io.h" #endif integer f_inqu(inlist *a) diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/lread.c b/gnu/usr.bin/gcc/f/runtime/libI77/lread.c index 9c0eb857b21..b987a5f18ab 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/lread.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/lread.c @@ -2,7 +2,7 @@ #include "fio.h" #include "fmt.h" #include "lio.h" -#include "ctype.h" +#include <ctype.h> #include "fp.h" extern char *f__fmtbuf; @@ -20,7 +20,7 @@ int (*f__lioproc)(), (*l_getc)(), (*l_ungetc)(); #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint), (*l_getc)(void), (*l_ungetc)(int,FILE*); #endif @@ -524,7 +524,7 @@ l_read(ftnint *number, char *ptr, ftnlen len, ftnint type) GETC(ch); switch(ch) { case EOF: - goto loopend; + err(f__elist->ciend,(EOF),"list in") case ' ': case '\t': case '\n': @@ -578,13 +578,9 @@ l_read(ftnint *number, char *ptr, ftnlen len, ftnint type) Ungetc(ch,f__cf); 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__cf && ferror(f__cf)) { + clearerr(f__cf); + errfl(f__elist->cierr,errno,"list in"); } if(f__ltype==0) goto bump; switch((int)type) diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/open.c b/gnu/usr.bin/gcc/f/runtime/libI77/open.c index 75386b9ca9f..14f1c7815a7 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/open.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/open.c @@ -1,10 +1,10 @@ #ifndef NON_UNIX_STDIO -#include "sys/types.h" -#include "sys/stat.h" +#include <sys/types.h> +#include <sys/stat.h> #endif #include "f2c.h" #include "fio.h" -#include "string.h" +#include <string.h> #include "rawio.h" #ifdef KR_headers @@ -14,7 +14,7 @@ extern integer f_clos(); #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> extern int f__canseek(FILE*); extern integer f_clos(cllist*); #endif diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/rawio.h b/gnu/usr.bin/gcc/f/runtime/libI77/rawio.h index 75e1ac7ddf1..c1a92f4e973 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/rawio.h +++ b/gnu/usr.bin/gcc/f/runtime/libI77/rawio.h @@ -34,7 +34,7 @@ extern char *mktemp(char*); #endif #ifndef NO_FCNTL -#include "fcntl.h" +#include <fcntl.h> #endif #ifndef O_WRONLY diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/rdfmt.c b/gnu/usr.bin/gcc/f/runtime/libI77/rdfmt.c index 03b325efc6c..3229db08287 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/rdfmt.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/rdfmt.c @@ -2,7 +2,7 @@ #include "fio.h" #include "fmt.h" #include "fp.h" -#include "ctype.h" +#include <ctype.h> extern int f__cursor; #ifdef KR_headers @@ -11,7 +11,7 @@ extern double atof(); #undef abs #undef min #undef max -#include "stdlib.h" +#include <stdlib.h> #endif static int diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/rsli.c b/gnu/usr.bin/gcc/f/runtime/libI77/rsli.c index 999b0d4abe5..a081cd589aa 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/rsli.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/rsli.c @@ -18,7 +18,8 @@ static int i_getc(Void) z_rnew(); } f__recpos++; - if(f__icptr >= f__icend) err(f__svic->iciend,(EOF),"internal read"); + if(f__icptr >= f__icend) + return EOF; return(*f__icptr++); } diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/rsne.c b/gnu/usr.bin/gcc/f/runtime/libI77/rsne.c index ad7ad26c8fb..9e2acad3d7d 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/rsne.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/rsne.c @@ -54,8 +54,8 @@ un_getc(x,f__cf) int x; FILE *f__cf; #undef abs #undef min #undef max -#include "stdlib.h" -#include "string.h" +#include <stdlib.h> +#include <string.h> #ifdef ungetc static int @@ -340,7 +340,7 @@ x_rsne(cilist *a) #endif } have_amp: - if (ch = getname(buf,sizeof(buf))) + if (ch = getname(buf,(int) sizeof(buf))) return ch; nl = (Namelist *)a->cifmt; if (strcmp(buf, nl->name)) @@ -395,7 +395,7 @@ x_rsne(cilist *a) if (ch <= ' ' && ch >= 0 || ch == ',') continue; Ungetc(ch,f__cf); - if (ch = getname(buf,sizeof(buf))) + if (ch = getname(buf,(int) sizeof(buf))) return ch; goto havename; } diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/uio.c b/gnu/usr.bin/gcc/f/runtime/libI77/uio.c index 6214009ffdb..645392d7af5 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/uio.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/uio.c @@ -1,6 +1,6 @@ #include "f2c.h" #include "fio.h" -#include "sys/types.h" +#include <sys/types.h> uiolen f__reclen; #ifdef KR_headers @@ -14,14 +14,14 @@ do_us(ftnint *number, char *ptr, ftnlen len) f__recpos += (int)(*number * len); if(f__recpos>f__reclen) err(f__elist->cierr, 110, "do_us"); - if (fread(ptr,(int)len,(int)(*number),f__cf) != *number) + if (fread(ptr,(size_t)len,(size_t)(*number),f__cf) != *number) err(f__elist->ciend, EOF, "do_us"); return(0); } else { f__reclen += *number * len; - (void) fwrite(ptr,(int)len,(int)(*number),f__cf); + (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf); return(0); } } @@ -42,19 +42,19 @@ integer do_ud(ftnint *number, char *ptr, ftnlen len) #else size_t i; #endif - if (!(i = fread(ptr,(int)len,(int)(*number),f__cf)) + if (!(i = fread(ptr,(size_t)len,(size_t)(*number),f__cf)) && !(f__recpos - *number*len)) err(f__elist->cierr,EOF,"do_ud") if (i < *number) memset(ptr + i*len, 0, (*number - i)*len); return 0; #else - if(fread(ptr,(int)len,(int)(*number),f__cf) != *number) + 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,(int)len,(int)(*number),f__cf); + (void) fwrite(ptr,(size_t)len,(size_t)(*number),f__cf); return(0); } #ifdef KR_headers diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/util.c b/gnu/usr.bin/gcc/f/runtime/libI77/util.c index 5275499e76e..a24932533c1 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/util.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/util.c @@ -1,6 +1,6 @@ #ifndef NON_UNIX_STDIO -#include "sys/types.h" -#include "sys/stat.h" +#include <sys/types.h> +#include <sys/stat.h> #endif #include "f2c.h" #include "fio.h" diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/wref.c b/gnu/usr.bin/gcc/f/runtime/libI77/wref.c index eda9a8fa763..43493dc5496 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/wref.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/wref.c @@ -3,15 +3,15 @@ #include "fmt.h" #include "fp.h" #ifndef VAX -#include "ctype.h" +#include <ctype.h> #endif #ifndef KR_headers #undef abs #undef min #undef max -#include "stdlib.h" -#include "string.h" +#include <stdlib.h> +#include <string.h> #endif #ifdef KR_headers diff --git a/gnu/usr.bin/gcc/f/runtime/libI77/xwsne.c b/gnu/usr.bin/gcc/f/runtime/libI77/xwsne.c index 41c929b0796..71f6f1d5da5 100644 --- a/gnu/usr.bin/gcc/f/runtime/libI77/xwsne.c +++ b/gnu/usr.bin/gcc/f/runtime/libI77/xwsne.c @@ -15,7 +15,7 @@ nl_donewrec(Void) #ifdef KR_headers x_wsne(a) cilist *a; #else -#include "string.h" +#include <string.h> VOID x_wsne(cilist *a) diff --git a/gnu/usr.bin/gcc/f/stb.c b/gnu/usr.bin/gcc/f/stb.c index ec3547faf81..ac03ae7685b 100644 --- a/gnu/usr.bin/gcc/f/stb.c +++ b/gnu/usr.bin/gcc/f/stb.c @@ -776,6 +776,8 @@ static ffelexHandler ffestb_R90912_ (ffelexToken t); static ffelexHandler ffestb_R90913_ (ffelexToken t); 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_R9103_ (ffelexToken ft, ffebld expr, @@ -793,6 +795,8 @@ static ffelexHandler ffestb_R91011_ (ffelexToken t); static ffelexHandler ffestb_R91012_ (ffelexToken t); 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); static ffelexHandler ffestb_R9112_ (ffelexToken ft, ffebld expr, @@ -3524,6 +3528,8 @@ ffestb_goto3_ (ffelexToken t) default: ffesta_confirmed (); + /* Fall through. */ + case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ return (ffelexHandler) (*((ffelexHandler) ffeexpr_rhs (ffesta_output_pool, FFEEXPR_contextCGOTO, (ffeexprCallback) ffestb_goto5_))) @@ -3597,6 +3603,7 @@ ffestb_goto5_ (ffelexToken ft, ffebld expr, ffelexToken t) case FFELEX_typeSEMICOLON: if (expr == NULL) break; + ffesta_confirmed (); if (!ffesta_is_inhibited ()) ffestc_R837 (ffestb_subrargs_.label_list.labels, expr, ft); ffelex_token_kill (ffesta_tokens[1]); @@ -9155,12 +9162,12 @@ ffestb_R10013_ (ffelexToken t) switch (ffelex_token_type (t)) { case FFELEX_typeNUMBER: - ffestb_local_.format.sign = TRUE; /* Sign present. */ ffestb_local_.format.pre.present = TRUE; ffestb_local_.format.pre.rtexpr = FALSE; unsigned_val = strtoul (ffelex_token_text (t), NULL, 10); 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_; default: @@ -15098,7 +15105,7 @@ ffestb_R9091_ (ffelexToken ft, ffebld expr, ffelexToken t) if (ffelex_token_type (t) == FFELEX_typeCOMMA) return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), - (ffeexprCallback) ffestb_R90914_); + (ffeexprCallback) ffestb_R90915_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); return (ffelexHandler) ffesta_zero (t); @@ -15217,7 +15224,7 @@ ffestb_R9094_ (ffelexToken ft, ffebld expr, ffelexToken t) return (ffelexHandler) ffeexpr_lhs (ffesta_output_pool, ffestc_context_iolist (), - (ffeexprCallback) ffestb_R90914_); + (ffeexprCallback) ffestb_R90915_); if (!ffesta_is_inhibited ()) ffestc_R909_finish (); return (ffelexHandler) ffesta_zero (t); @@ -15636,17 +15643,15 @@ ffestb_R90913_ (ffelexToken t) return (ffelexHandler) ffesta_zero (t); default: + ffesta_confirmed (); + /* Fall through. */ + case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ break; } /* If token isn't NAME or OPEN_PAREN, ffeexpr_lhs will ultimately whine 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.) */ @@ -15677,11 +15682,63 @@ ffestb_R90914_ (ffelexToken ft, ffebld expr, ffelexToken t) case FFELEX_typeCOMMA: 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_R90914_); + (ffeexprCallback) ffestb_R90915_); case FFELEX_typeEOS: case FFELEX_typeSEMICOLON: @@ -16198,9 +16255,8 @@ ffestb_R91012_ (ffelexToken t) default: ffesta_confirmed (); - if (!ffesta_is_inhibited ()) - ffestc_R910_start (); - ffestb_subr_kill_write_ (); + /* Fall through. */ + case FFELEX_typeOPEN_PAREN: /* Could still be assignment!! */ /* EXTENSION: Allow an optional preceding COMMA here if not pedantic. (f2c provides this extension, as do other compilers, supposedly.) */ @@ -16237,10 +16293,61 @@ ffestb_R91013_ (ffelexToken ft, ffebld expr, ffelexToken t) case FFELEX_typeCOMMA: 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_R91013_); + 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: case FFELEX_typeSEMICOLON: @@ -22795,9 +22902,9 @@ ffestb_decl_entsp_5_ (ffelexToken t) break; } + assert (ffestb_local_.decl.aster_after); 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; return (ffelexHandler) ffestb_decl_ents_7_ (t); @@ -22842,6 +22949,7 @@ ffestb_decl_entsp_6_ (ffelexToken t) case FFELEX_typePOINTS: case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) break; /* type(params)name or type*val name, either @@ -22887,6 +22995,7 @@ ffestb_decl_entsp_7_ (ffelexToken t) case FFELEX_typePOINTS: case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) break; /* type(params)name or type*val name, either @@ -22941,6 +23050,7 @@ ffestb_decl_entsp_8_ (ffelexToken t) case FFELEX_typePOINTS: case FFELEX_typePERCENT: case FFELEX_typePERIOD: + case FFELEX_typeOPEN_PAREN: if ((ffestb_local_.decl.kindt != NULL) || (ffestb_local_.decl.lent != NULL)) break; /* type(params)name or type*val name, either diff --git a/gnu/usr.bin/gcc/f/ste.c b/gnu/usr.bin/gcc/f/ste.c index f75f50d8fad..3ad03bf12bc 100644 --- a/gnu/usr.bin/gcc/f/ste.c +++ b/gnu/usr.bin/gcc/f/ste.c @@ -337,38 +337,43 @@ ffeste_begin_iterdo_ (ffestw block, tree *xtvar, tree *xtincr, { /* For warnings only, nothing else happens here. */ - tree try = ffecom_2 (MINUS_EXPR, TREE_TYPE (tvar), - tend, - tstart); + tree try; - try = ffecom_2 (PLUS_EXPR, TREE_TYPE (tvar), - try, - tincr); + if (!ffe_is_onetrip ()) + { + try = ffecom_2 (MINUS_EXPR, TREE_TYPE (tvar), + tend, + tstart); - 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)); + try = ffecom_2 (PLUS_EXPR, TREE_TYPE (tvar), + try, + tincr); - /* Warn if loop never executed, since we've done the evaluation - of the unofficial iteration count already. */ + 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)); - try = ffecom_truth_value (ffecom_2 (LE_EXPR, integer_type_node, - try, - convert (TREE_TYPE (tvar), - integer_zero_node))); + /* Warn if loop never executed, since we've done the evaluation + of the unofficial iteration count already. */ - 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 (); + 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 (); + } } /* Warn if end plus incr would overflow. */ @@ -397,9 +402,12 @@ ffeste_begin_iterdo_ (ffestw block, tree *xtvar, tree *xtincr, tend, TREE_CONSTANT (tstart) ? tstart : tvar); - expr = ffecom_2 (PLUS_EXPR, TREE_TYPE (expr), - expr, - convert (TREE_TYPE (expr), tincr_saved)); + 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) expr = ffecom_2 (TRUNC_DIV_EXPR, TREE_TYPE (expr), @@ -437,17 +445,20 @@ ffeste_begin_iterdo_ (ffestw block, tree *xtvar, tree *xtincr, ffestw_set_do_hook (block, 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); + 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 DO stmt. */ @@ -476,8 +487,25 @@ static void ffeste_end_iterdo_ (tree tvar, tree tincr, tree itersvar) { 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), tvar, @@ -519,18 +547,16 @@ ffeste_io_call_ (tree call, bool do_check) } expand_expr_stmt (call); - if (!do_check) + if (!do_check + || (ffeste_io_abort_ == NULL_TREE) + || (TREE_CODE (ffeste_io_abort_) == ERROR_MARK)) 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 (); - } + expand_start_cond (ffecom_truth_value (ffeste_io_iostat_), 0); + expand_goto (ffeste_io_abort_); + expand_end_cond (); } #endif @@ -1523,8 +1549,7 @@ ffeste_io_impdo_ (ffebld impdo, ffelexToken impdo_token) if (ffebld_op (item) == FFEBLD_opIMPDO) ffeste_io_impdo_ (item, impdo_token); else - ffeste_io_call_ ((*ffeste_io_driver_) (item), - (ffeste_io_abort_ != NULL_TREE)); + ffeste_io_call_ ((*ffeste_io_driver_) (item), TRUE); clear_momentary (); } @@ -2012,8 +2037,7 @@ ffeste_subr_beru_ (ffestpBeruStmt *info, ffecomGfrt rt) label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (rt, alist), - !ffeste_io_abort_is_temp_ - && (ffeste_io_abort_ != NULL_TREE)); + !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ @@ -3272,7 +3296,7 @@ ffeste_R904 (ffestpOpenStmt *info) label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFOPEN, args), - !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); + !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ @@ -3379,7 +3403,7 @@ ffeste_R907 (ffestpCloseStmt *info) label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFCLOS, args), - !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); + !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ @@ -3654,9 +3678,7 @@ ffeste_R909_start (ffestpReadStmt *info, bool only_format UNUSED, label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (start, cilist), - (ffeste_io_abort_ != NULL_TREE) - && (!ffeste_io_abort_is_temp_ - || (end != FFECOM_gfrt))); + !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } #undef specified @@ -3693,8 +3715,7 @@ ffeste_R909_item (ffebld expr, ffelexToken expr_token) if (ffebld_op (expr) == FFEBLD_opIMPDO) ffeste_io_impdo_ (expr, expr_token); else - ffeste_io_call_ ((*ffeste_io_driver_) (expr), - (ffeste_io_abort_ != NULL_TREE)); + ffeste_io_call_ ((*ffeste_io_driver_) (expr), TRUE); clear_momentary (); #else #error @@ -3719,21 +3740,10 @@ ffeste_R909_finish () /* Don't generate "if (iostat != 0) goto label;" if label is temp abort 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_)); + !ffeste_io_abort_is_temp_); clear_momentary (); pop_momentary (); @@ -3754,7 +3764,7 @@ ffeste_R909_finish () { expand_start_cond (ffecom_truth_value (ffecom_2 (LT_EXPR, integer_type_node, - iostat, + ffeste_io_iostat_, ffecom_integer_zero_node)), 0); expand_goto (ffeste_io_end_); @@ -3768,7 +3778,7 @@ ffeste_R909_finish () { expand_start_cond (ffecom_truth_value (ffecom_2 (GT_EXPR, integer_type_node, - iostat, + ffeste_io_iostat_, ffecom_integer_zero_node)), 0); expand_goto (ffeste_io_err_); @@ -3979,9 +3989,7 @@ ffeste_R910_start (ffestpWriteStmt *info, ffestvUnit unit, label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (start, cilist), - (ffeste_io_abort_ != NULL_TREE) - && (!ffeste_io_abort_is_temp_ - || (end != FFECOM_gfrt))); + !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } #undef specified @@ -4014,8 +4022,7 @@ ffeste_R910_item (ffebld expr, ffelexToken expr_token) if (ffebld_op (expr) == FFEBLD_opIMPDO) ffeste_io_impdo_ (expr, expr_token); else - ffeste_io_call_ ((*ffeste_io_driver_) (expr), - (ffeste_io_abort_ != NULL_TREE)); + ffeste_io_call_ ((*ffeste_io_driver_) (expr), TRUE); clear_momentary (); #else #error @@ -4040,19 +4047,10 @@ ffeste_R910_finish () /* Don't generate "if (iostat != 0) goto label;" if label is temp abort 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_)); + !ffeste_io_abort_is_temp_); clear_momentary (); pop_momentary (); @@ -4178,9 +4176,7 @@ ffeste_R911_start (ffestpPrintStmt *info, ffestvFormat format) label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (start, cilist), - (ffeste_io_abort_ != NULL_TREE) - && (!ffeste_io_abort_is_temp_ - || (end != FFECOM_gfrt))); + !ffeste_io_abort_is_temp_ || (end != FFECOM_gfrt)); } push_momentary (); @@ -4445,7 +4441,7 @@ ffeste_R923A (ffestpInquireStmt *info, bool by_file UNUSED) label, since we're gonna fall through to there anyway. */ ffeste_io_call_ (ffecom_call_gfrt (FFECOM_gfrtFINQU, args), - !ffeste_io_abort_is_temp_ && (ffeste_io_abort_ != NULL_TREE)); + !ffeste_io_abort_is_temp_); /* If we've got a temp label, generate its code here. */ diff --git a/gnu/usr.bin/gcc/f/storag.c b/gnu/usr.bin/gcc/f/storag.c index 5104fe4ed9c..9b30b5e8638 100644 --- a/gnu/usr.bin/gcc/f/storag.c +++ b/gnu/usr.bin/gcc/f/storag.c @@ -131,8 +131,8 @@ ffestorag_dump (ffestorag s) if (s->symbol != NULL) fprintf (dmpout, "\"%s\" ", ffesymbol_text (s->symbol)); - fprintf (dmpout, "at %" ffetargetOffset_f "u size %" ffetargetOffset_f - "u, align loc%%%" + fprintf (dmpout, "at %" ffetargetOffset_f "d size %" ffetargetOffset_f + "d, align loc%%%" ffetargetAlign_f "u=%" ffetargetAlign_f "u, bt=%s, kt=%s", s->offset, s->size, (unsigned int) s->alignment, (unsigned int) s->modulo, diff --git a/gnu/usr.bin/gcc/f/storag.h b/gnu/usr.bin/gcc/f/storag.h index 782a0a4eb23..74a0065e779 100644 --- a/gnu/usr.bin/gcc/f/storag.h +++ b/gnu/usr.bin/gcc/f/storag.h @@ -78,7 +78,9 @@ struct _ffestorag_ ffestoragList_ equivs_; /* NULL if typeLOCAL and not an EQUIVALENCE area. */ ffetargetOffset size; /* Size of area. */ - ffetargetOffset offset; /* Offset of entity within 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. */ #ifdef FFECOM_storageHOOK diff --git a/gnu/usr.bin/gcc/f/stt.c b/gnu/usr.bin/gcc/f/stt.c index 3b827189524..0995daad23c 100644 --- a/gnu/usr.bin/gcc/f/stt.c +++ b/gnu/usr.bin/gcc/f/stt.c @@ -214,6 +214,7 @@ ffestt_dimlist_as_expr (ffesttDimList list, ffeinfoRank *rank, ffeinfoRank r; ffeinfoKindtype nkt; ffetargetIntegerDefault low; + ffetargetIntegerDefault high; bool zero = FALSE; /* Zero-size array. */ bool any = FALSE; bool star = FALSE; /* Adjustable array. */ @@ -233,9 +234,20 @@ ffestt_dimlist_as_expr (ffesttDimList list, ffeinfoRank *rank, low = 1; else low = ffebld_constant_integerdefault (ffebld_conter (next->lower)); + high = ffebld_constant_integerdefault (ffebld_conter (next->upper)); if (low - > ffebld_constant_integerdefault (ffebld_conter (next->upper))) + > 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) && (ffebld_op (next->lower) == FFEBLD_opANY)) diff --git a/gnu/usr.bin/gcc/f/stu.c b/gnu/usr.bin/gcc/f/stu.c index 056b302fa31..8138dc74605 100644 --- a/gnu/usr.bin/gcc/f/stu.c +++ b/gnu/usr.bin/gcc/f/stu.c @@ -57,7 +57,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Static functions (internal). */ static void ffestu_list_exec_transition_ (ffebld list); -static void ffestu_symter_exec_transition_ (ffebld expr); +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); @@ -98,6 +99,14 @@ ffestu_sym_end_transition (ffesymbol s) ffesymbol_error (s, ffesta_tokens[0]); 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; case FFESYMBOL_stateUNDERSTOOD: @@ -106,10 +115,23 @@ ffestu_sym_end_transition (ffesymbol s) || (skd == FFEINFO_kindSUBROUTINE))) 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]); + 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; } @@ -196,6 +218,12 @@ ffestu_sym_end_transition (ffesymbol s) | FFESYMBOL_attrsADJUSTABLE | 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! */ if (ffe_is_pedantic () @@ -443,15 +471,16 @@ ffestu_sym_exec_transition (ffesymbol s) nwh = FFEINFO_whereDUMMY; - if (sa & (FFESYMBOL_attrsADJUSTABLE | FFESYMBOL_attrsANYSIZE)) - ffestu_symter_exec_transition_ (ffesymbol_dims (s)); + if (ffestu_symter_exec_transition_ (ffesymbol_dims (s))) + na = FFESYMBOL_attrsetNONE; + if (sa & (FFESYMBOL_attrsADJUSTS | FFESYMBOL_attrsARRAY | FFESYMBOL_attrsANYLEN | FFESYMBOL_attrsNAMELIST | FFESYMBOL_attrsSFARG)) nkd = FFEINFO_kindENTITY; - else + else if (sa & FFESYMBOL_attrsDUMMY) /* Still okay. */ { if (!(sa & FFESYMBOL_attrsTYPE)) needs_type = FALSE; /* Don't assign type to SUBROUTINE! */ @@ -598,12 +627,13 @@ ffestu_sym_exec_transition (ffesymbol s) nkd = FFEINFO_kindENTITY; - if (sa & FFESYMBOL_attrsADJUSTABLE) - ffestu_symter_exec_transition_ (ffesymbol_dims (s)); + if (ffestu_symter_exec_transition_ (ffesymbol_dims (s))) + na = FFESYMBOL_attrsetNONE; if (sa & (FFESYMBOL_attrsANYLEN | FFESYMBOL_attrsANYSIZE)) nwh = FFEINFO_whereDUMMY; - else + else if (sa & (FFESYMBOL_attrsADJUSTABLE | FFESYMBOL_attrsANYSIZE)) + /* Still okay. */ { nwh = FFEINFO_whereNONE; /* DUMMY, LOCAL. */ ns = FFESYMBOL_stateUNCERTAIN; @@ -848,20 +878,87 @@ ffestu_list_exec_transition_ (ffebld list) in_progress = FALSE; } +/* 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 ffebld expr; ffestu_symter_exec_transition_(expr); 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! */ + (recursively transitioned) sym it identifies (DUMMY or COMMON). */ -static void +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 self). */ @@ -869,19 +966,31 @@ ffestu_symter_exec_transition_ (ffebld expr) tail: /* :::::::::::::::::::: */ if (expr == NULL) - return; + return any; switch (ffebld_op (expr)) { case FFEBLD_opITEM: while (ffebld_trail (expr) != NULL) { - ffestu_symter_exec_transition_ (ffebld_head (expr)); + if (ffestu_symter_exec_transition_ (ffebld_head (expr))) + any = TRUE; expr = ffebld_trail (expr); } expr = ffebld_head (expr); 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; } @@ -889,7 +998,8 @@ tail: /* :::::::::::::::::::: */ switch (ffebld_arity (expr)) { case 2: - ffestu_symter_exec_transition_ (ffebld_left (expr)); + if (ffestu_symter_exec_transition_ (ffebld_left (expr))) + any = TRUE; expr = ffebld_right (expr); goto tail; /* :::::::::::::::::::: */ @@ -898,22 +1008,10 @@ tail: /* :::::::::::::::::::: */ goto tail; /* :::::::::::::::::::: */ 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; + return any; } /* ffestu_dummies_transition_ -- Update SYMTERs in ITEM list w/in entry diff --git a/gnu/usr.bin/gcc/f/symbol.c b/gnu/usr.bin/gcc/f/symbol.c index 2c24ded7b67..f4978a0dc24 100644 --- a/gnu/usr.bin/gcc/f/symbol.c +++ b/gnu/usr.bin/gcc/f/symbol.c @@ -836,7 +836,8 @@ ffesymbol_dump (ffesymbol s) void ffesymbol_error (ffesymbol s, ffelexToken t) { - if (ffest_ffebad_start (FFEBAD_SYMERR)) + if ((t != NULL) + && ffest_ffebad_start (FFEBAD_SYMERR)) { ffebad_string (ffesymbol_text (s)); ffebad_here (0, ffelex_token_where_line (t), @@ -1003,13 +1004,13 @@ ffesymbol_report (ffesymbol s) if (s->accretion != NULL) { - fprintf (dmpout, " accretion (%" ffetargetOffset_f "u left): ", + fprintf (dmpout, " accretion (%" ffetargetOffset_f "d left): ", s->accretes); ffebld_dump (s->accretion); fputs ("\n", dmpout); } else if (s->accretes != 0) - fprintf (dmpout, " accretes!! = %" ffetargetOffset_f "u left\n", + fprintf (dmpout, " accretes!! = %" ffetargetOffset_f "d left\n", s->accretes); if (s->dummy_args != NULL) diff --git a/gnu/usr.bin/gcc/f/target.c b/gnu/usr.bin/gcc/f/target.c index 93cb698743a..308771569d5 100644 --- a/gnu/usr.bin/gcc/f/target.c +++ b/gnu/usr.bin/gcc/f/target.c @@ -1249,6 +1249,196 @@ ffetarget_integer1 (ffetargetInteger1 *val, ffelexToken integer) } #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 x; @@ -1265,7 +1455,8 @@ ffetarget_integeroctal (ffetargetIntegerDefault *val, ffelexToken integer) char c; bool bad_digit; - assert (ffelex_token_type (integer) == FFELEX_typeNUMBER); + assert ((ffelex_token_type (integer) == FFELEX_typeNAME) + || (ffelex_token_type (integer) == FFELEX_typeNUMBER)); p = ffelex_token_text (integer); x = 0; @@ -1280,10 +1471,18 @@ ffetarget_integeroctal (ffetargetIntegerDefault *val, ffelexToken integer) bad_digit = FALSE; 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 == '0' + FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) + && (c == FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) && (*(p + 1) == '\0')) { *val = FFETARGET_integerBIG_OVERFLOW_OCTAL; @@ -1296,7 +1495,7 @@ ffetarget_integeroctal (ffetargetIntegerDefault *val, ffelexToken integer) #else if (x == FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL) { - if ((c > '0' + FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) + if ((c > FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL) || (*(p + 1) != '\0')) { ffebad_start (FFEBAD_INTEGER_TOO_LARGE); @@ -1317,9 +1516,7 @@ ffetarget_integeroctal (ffetargetIntegerDefault *val, ffelexToken integer) *val = 0; return FALSE; } - x = (x << 3) + c - '0'; - if (c >= '8') - bad_digit = TRUE; + x = (x << 3) + c; c = *(++p); }; diff --git a/gnu/usr.bin/gcc/f/target.h b/gnu/usr.bin/gcc/f/target.h index 2b3ea3d9dc8..d68f49235db 100644 --- a/gnu/usr.bin/gcc/f/target.h +++ b/gnu/usr.bin/gcc/f/target.h @@ -82,15 +82,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef FFETARGET_defaultIS_PEDANTIC #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 #endif @@ -203,12 +194,24 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef FFETARGET_integerALMOST_BIG_MAGICAL #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 04000000000 +#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 #endif @@ -261,8 +264,8 @@ typedef long ffetargetCharacterSize; typedef void (*ffetargetCopyfunc) (void *, void *, size_t); typedef ffetargetCharacterSize ffetargetHollerithSize; #define ffetargetHollerithSize_f "l" -typedef unsigned long ffetargetOffset; -#define ffetargetOffset_f "l" +typedef long long ffetargetOffset; +#define ffetargetOffset_f "ll" #if FFETARGET_okINTEGER1 typedef long int ffetargetInteger1; @@ -682,6 +685,10 @@ bool ffetarget_integer7 (ffetargetInteger7 *val, ffelexToken integer); #if FFETARGET_okINTEGER8 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); void ffetarget_integer_bad_magical (ffelexToken t); diff --git a/gnu/usr.bin/gcc/f/top.c b/gnu/usr.bin/gcc/f/top.c index e7aadea7959..6599de944fc 100644 --- a/gnu/usr.bin/gcc/f/top.c +++ b/gnu/usr.bin/gcc/f/top.c @@ -68,6 +68,7 @@ bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH; bool ffe_is_underscoring_ = FFETARGET_defaultEXTERNAL_UNDERSCORED || 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_f2c_library_ = FFETARGET_defaultIS_F2C_LIBRARY; @@ -77,11 +78,16 @@ bool ffe_is_ident_ = TRUE; bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO; 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_ = FFETARGET_defaultIS_UGLY; -bool ffe_is_ugly_args_ = FFETARGET_defaultIS_UGLY_ARGS; -bool ffe_is_ugly_init_ = FFETARGET_defaultIS_UGLY_INIT; +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; bool ffe_is_warn_implicit_ = FALSE; @@ -162,14 +168,35 @@ ffe_decode_option (char *opt) else if (strcmp (&opt[2], "set-g77-defaults") == 0) { ffe_is_do_internal_checks_ = 0; +#if BUILT_FOR_270 /* User must have applied patch (circa 2.7.2 and beyond). */ flag_move_all_movables = 1; flag_reduce_all_givs = 1; flag_rerun_loop_opt = 1; +#endif } else if (strcmp (&opt[2], "ident") == 0) ffe_set_is_ident (TRUE); 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); else if (strcmp (&opt[2], "no-f90") == 0) @@ -208,24 +235,40 @@ ffe_decode_option (char *opt) ffe_set_is_vxt_not_90 (FALSE); else if (strcmp (&opt[2], "ugly") == 0) { - ffe_set_is_ugly (TRUE); 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 (FALSE); 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_set_is_ugly_args (TRUE); 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); else if (strcmp (&opt[2], "no-debug") == 0) @@ -246,6 +289,26 @@ ffe_decode_option (char *opt) ffe_set_is_second_underscore (TRUE); 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); else if (strcmp (&opt[2], "intrin-case-upper") == 0) @@ -366,10 +429,6 @@ ffe_decode_option (char *opt) ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDISABLED); 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) { @@ -419,7 +478,6 @@ ffe_decode_option (char *opt) if (warn_uninitialized != 1) warn_uninitialized = 2; warn_unused = 1; - ffe_set_is_warn_surprising (TRUE); } else return 0; diff --git a/gnu/usr.bin/gcc/f/top.h b/gnu/usr.bin/gcc/f/top.h index 24bee4f895e..99685932773 100644 --- a/gnu/usr.bin/gcc/f/top.h +++ b/gnu/usr.bin/gcc/f/top.h @@ -84,6 +84,7 @@ extern bool ffe_is_automatic_; extern bool ffe_is_backslash_; 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_f2c_library_; @@ -92,11 +93,16 @@ extern bool ffe_is_free_form_; extern bool ffe_is_ident_; 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_; 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_; extern bool ffe_is_warn_implicit_; @@ -157,6 +163,7 @@ void ffe_terminate_4 (void); #define ffe_is_90() ffe_is_90_ #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_ #define ffe_is_f2c() ffe_is_f2c_ @@ -166,13 +173,18 @@ void ffe_terminate_4 (void); #define ffe_is_ident() ffe_is_ident_ #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_ugly() ffe_is_ugly_ +#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_ #define ffe_is_vxt_not_90() ffe_is_vxt_not_90_ @@ -196,6 +208,7 @@ void ffe_terminate_4 (void); #define ffe_set_is_90(f) (ffe_is_90_ = (f)) #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)) #define ffe_set_is_f2c(f) (ffe_is_f2c_ = (f)) @@ -205,12 +218,17 @@ void ffe_terminate_4 (void); #define ffe_set_is_ident(f) (ffe_is_ident_ = (f)) #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_ugly(f) (ffe_is_ugly_ = (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)) #define ffe_set_is_vxt_not_90(f) (ffe_is_vxt_not_90_ = (f)) diff --git a/gnu/usr.bin/gcc/f/zzz.c b/gnu/usr.bin/gcc/f/zzz.c index d59050a63d0..55d18a4faca 100644 --- a/gnu/usr.bin/gcc/f/zzz.c +++ b/gnu/usr.bin/gcc/f/zzz.c @@ -29,7 +29,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA Modifications: */ -#include "proj.h" #include "zzz.h" /* If you want to override the version date/time info with your own @@ -37,12 +36,21 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA go ahead! */ #ifndef FFEZZZ_DATE +#ifdef __DATE__ #define FFEZZZ_DATE __DATE__ -#endif +#else /* !defined (__DATE__) */ +#define FFEZZZ_DATE "date unknown" +#endif /* !defined (__DATE__) */ +#endif /* !defined (FFEZZZ_DATE) */ + #ifndef FFEZZZ_TIME +#ifdef __TIME__ #define FFEZZZ_TIME __TIME__ -#endif +#else /* !defined (__TIME__) */ +#define FFEZZZ_TIME "time unknown" +#endif /* !defined (__TIME__) */ +#endif /* !defined (FFEZZZ_TIME) */ -char *ffezzz_version_string = "0.5.18"; +char *ffezzz_version_string = "0.5.19"; char *ffezzz_date = FFEZZZ_DATE; char *ffezzz_time = FFEZZZ_TIME; |