diff -rcp2N g77-0.5.14/README.g77 g77-0.5.15/README.g77 *** g77-0.5.14/README.g77 Fri Apr 28 05:33:42 1995 --- g77-0.5.15/README.g77 Fri May 19 11:44:58 1995 *************** *** 1,5 **** ! 950428 ! This directory contains the version 0.5.14 release of the GNU Fortran compiler. The GNU Fortran compiler is free software. See the file COPYING.g77 for copying permission. --- 1,5 ---- ! 950519 ! This directory contains the version 0.5.15 release of the GNU Fortran compiler. The GNU Fortran compiler is free software. See the file COPYING.g77 for copying permission. *************** If you have just unpacked the g77 distri *** 21,25 **** you must merge the contents of the g77 distribution with the appropriate gcc distribution on your system before proceeding. Using sample ! versions of 2.6.3 for gcc and 0.5.14 for g77, the process of unpacking and merging both distributions would be done as follows (where # is the shell prompt): --- 21,25 ---- you must merge the contents of the g77 distribution with the appropriate gcc distribution on your system before proceeding. Using sample ! versions of 2.6.3 for gcc and 0.5.15 for g77, the process of unpacking and merging both distributions would be done as follows (where # is the shell prompt): *************** shell prompt): *** 26,32 **** # tar xf gcc-2.6.3.tar # Creates ./gcc-2.6.3/ ! # tar xf g77-0.5.14.tar # Creates ./g77-0.5.14/ ! * # mv g77-0.5.14/* gcc-2.6.3/ # Merges gcc and g77 into ./gcc-2.6.3/ ! # rmdir g77-0.5.14 # Remove empty ./g77-0.5.14/ Another approach is to do the following: --- 26,32 ---- # tar xf gcc-2.6.3.tar # Creates ./gcc-2.6.3/ ! # tar xf g77-0.5.15.tar # Creates ./g77-0.5.15/ ! * # mv g77-0.5.15/* gcc-2.6.3/ # Merges gcc and g77 into ./gcc-2.6.3/ ! # rmdir g77-0.5.15 # Remove empty ./g77-0.5.15/ Another approach is to do the following: *************** Another approach is to do the following: *** 33,38 **** # tar xf gcc-2.6.3.tar # Creates ./gcc-2.6.3/ ! # ln -s gcc-2.6.3 g77-0.5.14 # Make g77-0.5.14 a link to gcc-2.6.3 ! # tar xf g77-0.5.14.tar # Unpacks g77 into gcc-2.6.3 The latter approach leaves the symbolic link, which might help others --- 33,38 ---- # tar xf gcc-2.6.3.tar # Creates ./gcc-2.6.3/ ! # ln -s gcc-2.6.3 g77-0.5.15 # Make g77-0.5.15 a link to gcc-2.6.3 ! # tar xf g77-0.5.15.tar # Unpacks g77 into gcc-2.6.3 The latter approach leaves the symbolic link, which might help others *************** problem occurs using one of the above me *** 46,50 **** The resulting directory layout is as follows, where gcc/ might be, ! for example, gcc-0.5.14/: gcc/ Non-Fortran files in gcc (not part of g77*.tar) --- 46,50 ---- The resulting directory layout is as follows, where gcc/ might be, ! for example, gcc-0.5.15/: gcc/ Non-Fortran files in gcc (not part of g77*.tar) diff -rcp2N g77-0.5.14/f/ChangeLog g77-0.5.15/f/ChangeLog *** g77-0.5.14/f/ChangeLog Fri Apr 28 05:47:29 1995 --- g77-0.5.15/f/ChangeLog Fri May 19 11:17:26 1995 *************** *** 1,2 **** --- 1,68 ---- + Fri May 19 11:00:36 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * com.c (ffecom_expr_power_integer_): Push temp vars + before expanding a statement expression, since that seems + to cause temp vars to be "forgotten" after the end of the + expansion in the back end. Disallow more temp-var + pushing during such an expansion, just in case. + (ffecom_push_tempvar): Crash if a new variable needs to be + pushed but cannot be at this point (should never happen). + + Wed May 17 12:26:16 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * expr.c (ffeexpr_collapse_convert): Add code to convert + LOGICAL to CHARACTER. Reject conversion of REAL or COMPLEX + to CHARACTER entirely, as it cannot be supported with all + configurations. + + * target.h, target.c (ffetarget_convert_character1_logical1): + New function. + + Sun May 14 00:00:09 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * com.c (ffecom_do_entry_, ffecom_gen_sfuncdef_, + ffecom_start_progunit_, ffecom_sym_transform_, + ffecom_init_0, start_function): Changes to have REAL + external functions return same type as DOUBLE PRECISION + external functions when -ff2c is in force; while at it, + some code cleanups done. + + * stc.c (ffestc_R547_item_object): Disallow array declarator + if one already exists for symbol. + + * ste.c (ffeste_R1227): Convert result variable to type + of function result as seen by back end (e.g. for when REAL + external function actually returns result as double). + + * target.h (FFETARGET_defaultFIXED_LINE_LENGTH): New + macro for default for -ffixed-line-length-N option. + + * top.c (ffe_fixed_line_length_): Initialize this to new + target.h macro instead of constant 72. + + Tue May 9 01:20:03 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * lex.c (ffelex_send_token_): If sending CHARACTER token with + null text field, put a single '\0' in it and set length/size + fields to 0 (to fix 950508-0.f). + (ffelex_image_char_): When setting ffelex_bad_line_ to TRUE, + always "close" card image by appending a null char and setting + ffelex_card_length_. As part of this, append useful text + to identify the two kinds of problems that involve this. + (ffelex_file_fixed): Reset ffelex_bad_line_ to FALSE after + seeing a line with invalid first character (fixes 950508-1.f). + If final nontab column is zero, assume tab seen in line. + (ffelex_card_image_): Always make this array 8 characters + longer than reflected by ffelex_card_size_. + (ffelex_init_1): Get final nontab column info from top instead + of assuming 72. + + * options-lang.h: Add -ffixed-line-length- prefix. + + * top.h: Add ffe_fixed_line_length() and _set_ version, plus + corresponding extern. + + * top.c: Handle -ffixed-line-length- option prefix. + Fri Apr 28 05:40:25 1995 Craig Burley (burley@gnu.ai.mit.edu) diff -rcp2N g77-0.5.14/f/DOC g77-0.5.15/f/DOC *** g77-0.5.14/f/DOC Fri Apr 28 05:38:10 1995 --- g77-0.5.15/f/DOC Fri May 19 11:17:26 1995 *************** *** 1,3 **** ! 950428 *IMPORTANT GENERAL INFORMATION* --- 1,3 ---- ! 950513 *IMPORTANT GENERAL INFORMATION* *************** a hassle, requiring manual intervention. *** 65,68 **** --- 65,80 ---- *USER-VISIBLE CHANGES DURING 0.5.x* + In 0.5.15: + + - -ffixed-line-length-N, a new option where N is 72 by default, + sets the column after which characters are ignored in typical + fixed-form lines in the source file -- popular values for N + include 72 (standard), 80 (card image), and 132 (corresponds + to "extended-source" options in some popular compilers); + "none" is supported for N, meaning that the entire line is + meaningful, and that continued character constants never have + implicit spaces appended to them to fill out the line (since + they'd be infinite); note that N="0" is the same as N="none" + In 0.5.14: *************** made: *** 565,574 **** *LIBRARY AND PROCEDURE-CALLING INTERFACE* ! Currently, -ff2c and -ff2c-library are defaults and must be in force ! for g77 to work properly. In particular, how COMPLEX FUNCTIONs are ! called is governed by these command-line options. Also, diagnostics ! are issued for some features unsupported by the f2c library, such as ! NAMELIST in combination with source case preservation. *SOURCE FORM* --- 577,609 ---- *LIBRARY AND PROCEDURE-CALLING INTERFACE* ! Currently, -ff2c and -ff2c-library are defaults and -ff2c-library must be ! in force for g77 to work properly. + The -ff2c option specifies that g77 is to generate code that is + link-time and run-time compatible with code generated by an + version of f2c built to be generally compatible with g77. (This + will normally be the case, but it is possible that with older or + perhaps even newer versions of f2c, or with certain configuration + changes to f2c internals, incompatibilities will nevertheless + result.) + + Specifying -fno-f2c allows g77 to generate, in some cases, faster code. + For example, how REAL and [DOUBLE] COMPLEX FUNCTIONs are called is + governed by the -ff2c command-line option. With -fno-f2c, they + are compiled as returning the appropriate type (float, __complex__ float, + __complex__ double), whereas with -ff2c, they are compiled differently + (with perhaps slower run-time performance) to accommodate the restrictions + inherent in f2c's use of K&R C as an intermediate language -- REAL + functions return double, while [DOUBLE] COMPLEX functions return void + but have an extra argument pointing to a place for the functions to + return their values. (It is possible that in some cases -ff2c might + produce faster code. Experiment and enjoy.) + + An example of the effect of -ff2c-library, which is the default (and + currently must be in force, since g77 compiles code for use only + with libf2c), is that diagnostics are issued for some features + unsupported by the f2c library, such as NAMELIST in combination with + source case preservation. + *SOURCE FORM* *************** default is -fautomatic, which tells g77 *** 602,605 **** --- 637,666 ---- arrays on the stack where possible and reasonable. + *OPTIONS FOR SPEEDING UP PROGRAMS* + + Aside from the usual gcc options, such as -O, -ffast-math, and so on + (see the gcc documentation), consider trying: + + -fno-f2c, if you aren't linking with any f2c-produced code (other + than libf2c) + + If you're using -fno-automatic already, you probably should change + your code to allow compilation with -fautomatic, because the program + should run faster. Similarly, you should be able to use + -fno-init-local-zero instead of -finit-local-zero. This is because + it is rare that every variable affected by these options in a given + program actually needs to be so affected. For example, + -fno-automatic, which effectively SAVEs every local variable and + array, affects even things like DO iteration variables, which rarely + need to be SAVEd, and this often reduces run-time performances. + Similarly, -fno-init-local-zero forces such variables to be + initialized to zero -- when SAVEd (e.g. via -fno-automatic), this + by itself generally affects only startup time for a program, but + when not SAVEd, it can slow down the procedure every time it is called. + + See *SUMMARY OF OVERLY CONVENIENT COMMAND-LINE OPTIONS* for information + on the -fno-automatic and -finit-local-zero options and how to convert + their use into selective changes in your own code. + *PEDANTIC COMPILATION* *************** If your program doesn't link, due to unr *** 1029,1036 **** like "_main", make sure you're using the `g77' command to do the link, since this command ensures that the necessary libraries are ! loaded by specifying `-lf2c -lc -lm' when it invokes the `gcc' command to do the actual link. (Use the `-v' option to discover more about what actually happens when you use the `g77' and `gcc' ! commands.) If your program successfully compiles and links, but doesn't work, --- 1090,1099 ---- like "_main", make sure you're using the `g77' command to do the link, since this command ensures that the necessary libraries are ! loaded by specifying `-lf2c -lm' when it invokes the `gcc' command to do the actual link. (Use the `-v' option to discover more about what actually happens when you use the `g77' and `gcc' ! commands.) Also, try specifying `-lc' as the last item on the g77 ! command line, because some systems need it and g77 doesn't do it ! automatically. If your program successfully compiles and links, but doesn't work, *************** the following: *** 1049,1052 **** --- 1112,1123 ---- and run the resulting program trying to reproduce the bug. + If a run-time bug occurs both when your program is compiled with g77 + and when compiled with f2c, that suggests (but does not prove) that + the bug is not in g77, rather that it is either in your own code + (quite likely), in libf2c, in gcc, or elsewhere. Probably 99% of the + time the bug is in your own code, EVEN IN CASES WHERE YOUR OWN CODE + "WORKS" WITH OTHER COMPILERS. Please follow the instructions above + to try and find bugs in your code before submitting bug reports. + *SUMMARY OF OVERLY CONVENIENT COMMAND-LINE OPTIONS* *************** a given program, but rather should make *** 1066,1070 **** -Wuninitialized (which requires -O) first to find likely candidates. -fno-automatic ! Use SAVE statements in the appropriate places instead. -fugly* Fix the source code so that -fno-ugly (the default) will work. --- 1137,1142 ---- -Wuninitialized (which requires -O) first to find likely candidates. -fno-automatic ! Use SAVE statements in the appropriate places instead. Consider ! using -Wuninitialized (which requires -O) to find likely candidates. -fugly* Fix the source code so that -fno-ugly (the default) will work. diff -rcp2N g77-0.5.14/f/NEWS g77-0.5.15/f/NEWS *** g77-0.5.14/f/NEWS Fri Apr 28 05:28:48 1995 --- g77-0.5.15/f/NEWS Fri May 19 11:17:26 1995 *************** *** 1,2 **** --- 1,34 ---- + Changes in 0.5.15: + Fix bad code generation involving X**I and temporary, internal variables + generated by g77 and the back end (such as for DO loops) + Fix crash given CHARACTER A;DATA A/.TRUE./ + Replace crash with diagnostic given CHARACTER A;DATA A/1.0/ + Fix crash or other erratic behavior when null character constant + ('') is encountered + Fix crash or other erratic behavior involving diagnosed code + Fix code generation for external functions returning type REAL when + the -ff2c option is in force (which it is by default) so that + f2c compatibility is indeed provided + Disallow COMMON I(10) if I has previously been specified with an + array declarator + New -ffixed-line-length-N option, where N is the maximum length + of a typical fixed-form line, defaulting to 72 columns, such + that characters beyond column N are ignored, or N is "none", + meaning no characters are ignored -- does not affect lines + with "&" in column 1, which are always processed as if + -ffixed-line-length-none were in effect + No longer generate better code for some kinds of array references, + as gcc back end is to be fixed to do this even better, and it + turned out to slow down some code in some cases after all + In COMMON and EQUIVALENCE areas with any members given initial + values (e.g. via DATA), uninitialized members now always + initialized to binary zeros (though this is not required by + the F77 standard, and might not be done in future versions + of g77) -- previously, in some COMMON/EQUIVALENCE areas + (essentially those with members of more than one type), the + uninitialized members were initialized to spaces, to + cater to CHARACTER types, but it seems no existing code expects + that, while much existing code expects binary zeros + Changes in 0.5.14: Don't emit bad code when low bound of adjustable array is nonconstant *************** Changes in 0.5.14: *** 82,88 **** it were a CHARACTER expression (so CALL FOO(%DESCR(D)), where D is REAL*8, is the same as CALL FOO(D,%VAL(8))) - g77 driver now includes -lc in list of libraries it specified for - linking, making the list -lf2c -lc -lm, to fix problems - on some system configurations Name of multi-entrypoint master function changed to incorporate the name of the primary entry point instead of a decimal --- 114,117 ---- diff -rcp2N g77-0.5.14/f/bld.c g77-0.5.15/f/bld.c *** g77-0.5.14/f/bld.c Wed Apr 12 10:03:09 1995 --- g77-0.5.15/f/bld.c Fri May 19 11:17:27 1995 *************** ffebld_constantarray_new (ffeinfoBasicty *** 2451,2455 **** ptr.character1 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit1), ! ' '); break; #endif --- 2451,2455 ---- ptr.character1 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit1), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2459,2463 **** ptr.character2 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit2), ! ' '); break; #endif --- 2459,2463 ---- ptr.character2 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit2), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2467,2471 **** ptr.character3 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit3), ! ' '); break; #endif --- 2467,2471 ---- ptr.character3 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit3), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2475,2479 **** ptr.character4 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit4), ! ' '); break; #endif --- 2475,2479 ---- ptr.character4 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit4), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2483,2487 **** ptr.character5 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit5), ! ' '); break; #endif --- 2483,2487 ---- ptr.character5 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit5), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2491,2495 **** ptr.character6 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit6), ! ' '); break; #endif --- 2491,2495 ---- ptr.character6 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit6), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2499,2503 **** ptr.character7 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit7), ! ' '); break; #endif --- 2499,2503 ---- ptr.character7 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit7), ! 0); break; #endif *************** ffebld_constantarray_new (ffeinfoBasicty *** 2507,2511 **** ptr.character8 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit8), ! ' '); break; #endif --- 2507,2511 ---- ptr.character8 = malloc_new_zkp (FFEBLD_CONSTANT_POOL_, "ffebldConstantArray", size *= sizeof (ffetargetCharacterUnit8), ! 0); break; #endif diff -rcp2N g77-0.5.14/f/com.c g77-0.5.15/f/com.c *** g77-0.5.14/f/com.c Fri Apr 28 05:26:10 1995 --- g77-0.5.15/f/com.c Fri May 19 11:17:28 1995 *************** extern char *rindex (); *** 156,160 **** /* Externals defined here. */ ! #define FFECOM_FASTER_ARRAY_REFS 1 /* Generates faster code? */ #if FFECOM_targetCURRENT == FFECOM_targetGCC --- 156,160 ---- /* Externals defined here. */ ! #define FFECOM_FASTER_ARRAY_REFS 0 /* Generates faster code? */ #if FFECOM_targetCURRENT == FFECOM_targetGCC *************** tree ffecom_integer_one_node; /* " */ *** 221,224 **** --- 221,228 ---- tree ffecom_tree_type[FFEINFO_basictype][FFEINFO_kindtype]; + /* _fun_type things are the f2c-specific versions. For -fno-f2c, + just use build_function_type and build_pointer_type on the + appropriate _tree_type array element. */ + static tree ffecom_tree_fun_type[FFEINFO_basictype][FFEINFO_kindtype]; static tree ffecom_tree_ptr_to_fun_type[FFEINFO_basictype][FFEINFO_kindtype]; *************** static tree ffecom_which_entrypoint_decl *** 447,450 **** --- 451,455 ---- static ffecomTemp_ ffecom_latest_temp_; static int ffecom_pending_calls_ = 0; + static int ffecom_no_new_tempvars_ = 0; static tree ffecom_float_zero_ = NULL_TREE; static tree ffecom_float_half_ = NULL_TREE; *************** ffecom_do_entry_ (ffesymbol fn, int entr *** 1372,1387 **** kt = ffesymbol_kindtype (fn); } ! if (!(charfunc = (bt == FFEINFO_basictypeCHARACTER))) ! cmplxfunc = (bt == FFEINFO_basictypeCOMPLEX) && ffesymbol_is_f2c (fn); else ! cmplxfunc = FALSE; ! if (charfunc || cmplxfunc) ! type = void_type_node; else ! { ! type = ffecom_tree_type[bt][kt]; ! if (type == NULL_TREE) ! type = integer_type_node; /* _sym_exec_transition whines. */ ! } multi = (ffecom_master_bt_ == FFEINFO_basictypeNONE); break; --- 1377,1400 ---- kt = ffesymbol_kindtype (fn); } ! ! if (bt == FFEINFO_basictypeCHARACTER) ! charfunc = TRUE, cmplxfunc = FALSE; ! else if ((bt == FFEINFO_basictypeCOMPLEX) ! && ffesymbol_is_f2c (fn)) ! charfunc = FALSE, cmplxfunc = TRUE; else ! charfunc = cmplxfunc = FALSE; ! ! if (charfunc) ! type = ffecom_tree_fun_type_void; ! else if (ffesymbol_is_f2c (fn)) ! type = ffecom_tree_fun_type[bt][kt]; else ! type = build_function_type (ffecom_tree_type[bt][kt], NULL_TREE); ! ! if ((type == NULL_TREE) ! || (TREE_TYPE (type) == NULL_TREE)) ! type = ffecom_tree_fun_type_void; /* _sym_exec_transition. */ ! multi = (ffecom_master_bt_ == FFEINFO_basictypeNONE); break; *************** ffecom_do_entry_ (ffesymbol fn, int entr *** 1403,1412 **** } if (altreturning) ! type = integer_type_node; else ! type = void_type_node; } else ! type = void_type_node; charfunc = FALSE; cmplxfunc = FALSE; --- 1416,1425 ---- } if (altreturning) ! type = ffecom_tree_subr_type; else ! type = ffecom_tree_fun_type_void; } else ! type = ffecom_tree_fun_type_void; charfunc = FALSE; cmplxfunc = FALSE; *************** ffecom_do_entry_ (ffesymbol fn, int entr *** 1638,1644 **** result = ffecom_modify (NULL_TREE, result, ! ffecom_2 (COMPONENT_REF, TREE_TYPE (result), ! multi_retval, ! ffecom_multi_fields_[bt][kt])); expand_return (result); } --- 1651,1659 ---- result = ffecom_modify (NULL_TREE, result, ! convert (TREE_TYPE (result), ! ffecom_2 (COMPONENT_REF, ! ffecom_tree_type[bt][kt], ! multi_retval, ! ffecom_multi_fields_[bt][kt]))); expand_return (result); } *************** ffecom_do_entry_ (ffesymbol fn, int entr *** 1655,1659 **** else { ! result = ffecom_modify (NULL_TREE, result, call); expand_return (result); } --- 1670,1677 ---- else { ! result = ffecom_modify (NULL_TREE, ! result, ! convert (TREE_TYPE (result), ! call)); expand_return (result); } *************** ffecom_expr_ (ffebld expr, tree dest_tre *** 1781,1785 **** --- 1799,1805 ---- { ffebld dims[FFECOM_dimensionsMAX]; + #if FFECOM_FASTER_ARRAY_REFS tree array; + #endif int i; *************** ffecom_expr_power_integer_ (ffebld left, *** 4900,4905 **** = build_int_2 ((TREE_CODE (ltype) == INTEGER_TYPE), 0); - se = expand_start_stmt_expr (); - rtmp = ffecom_push_tempvar (rtype, FFETARGET_charactersizeNONE, -1, TRUE); --- 4920,4923 ---- *************** ffecom_expr_power_integer_ (ffebld left, *** 4909,4912 **** --- 4927,4934 ---- TRUE); + se = expand_start_stmt_expr (); + ++ffecom_no_new_tempvars_; /* not while expanding stmt expr, + see sequence_rtl_expr in back end. */ + expand_expr_stmt (ffecom_modify (void_type_node, rtmp, *************** ffecom_expr_power_integer_ (ffebld left, *** 5012,5015 **** --- 5034,5038 ---- expand_expr_stmt (result); + --ffecom_no_new_tempvars_; result = expand_end_stmt_expr (se); TREE_SIDE_EFFECTS (result) = 1; *************** ffecom_gen_sfuncdef_ (ffesymbol s, ffein *** 5423,5427 **** start_function (ffecom_get_identifier_ (ffesymbol_text (s)), ! type, 1, /* nested/inline */ 0); /* TREE_PUBLIC */ --- 5446,5450 ---- start_function (ffecom_get_identifier_ (ffesymbol_text (s)), ! build_function_type (type, NULL_TREE), 1, /* nested/inline */ 0); /* TREE_PUBLIC */ *************** ffecom_push_dummy_decls_ (ffebld dummy_l *** 6261,6271 **** /* ffecom_start_progunit_ -- Beginning of program unit - ffecom_start_progunit_(); - Does GNU back end stuff necessary to teach it about the start of its ! equivalent of a Fortran program unit. ! ! 27-Oct-91 JCB 1.1 ! Now a static function; evolving to handle character stuff. */ #if FFECOM_targetCURRENT == FFECOM_targetGCC --- 6284,6289 ---- /* ffecom_start_progunit_ -- Beginning of program unit Does GNU back end stuff necessary to teach it about the start of its ! equivalent of a Fortran program unit. */ #if FFECOM_targetCURRENT == FFECOM_targetGCC *************** ffecom_start_progunit_ () *** 6316,6320 **** bt = FFEINFO_basictypeNONE; kt = FFEINFO_kindtypeNONE; ! type = void_type_node; charfunc = FALSE; cmplxfunc = FALSE; --- 6334,6338 ---- bt = FFEINFO_basictypeNONE; kt = FFEINFO_kindtypeNONE; ! type = ffecom_tree_fun_type_void; charfunc = FALSE; cmplxfunc = FALSE; *************** ffecom_start_progunit_ () *** 6338,6342 **** charfunc = TRUE, cmplxfunc = FALSE; else if ((bt == FFEINFO_basictypeCOMPLEX) ! && ffesymbol_is_f2c (fn)) charfunc = FALSE, cmplxfunc = TRUE; else --- 6356,6361 ---- charfunc = TRUE, cmplxfunc = FALSE; else if ((bt == FFEINFO_basictypeCOMPLEX) ! && ffesymbol_is_f2c (fn) ! && !altentries) charfunc = FALSE, cmplxfunc = TRUE; else *************** ffecom_start_progunit_ () *** 6343,6357 **** charfunc = cmplxfunc = FALSE; ! if (charfunc ! || multi ! || (cmplxfunc && !altentries)) ! type = void_type_node; else ! { ! type = ffecom_tree_type[bt][kt]; ! if (type == NULL_TREE) ! type = integer_type_node; /* _sym_exec_transition reports ! error. */ ! } break; --- 6362,6375 ---- charfunc = cmplxfunc = FALSE; ! if (multi || charfunc) ! type = ffecom_tree_fun_type_void; ! else if (ffesymbol_is_f2c (fn) && !altentries) ! type = ffecom_tree_fun_type[bt][kt]; else ! type = build_function_type (ffecom_tree_type[bt][kt], NULL_TREE); ! ! if ((type == NULL_TREE) ! || (TREE_TYPE (type) == NULL_TREE)) ! type = ffecom_tree_fun_type_void; /* _sym_exec_transition. */ break; *************** ffecom_start_progunit_ () *** 6360,6366 **** kt = FFEINFO_kindtypeNONE; if (ffecom_is_altreturning_) ! type = integer_type_node; else ! type = void_type_node; charfunc = FALSE; cmplxfunc = FALSE; --- 6378,6384 ---- kt = FFEINFO_kindtypeNONE; if (ffecom_is_altreturning_) ! type = ffecom_tree_subr_type; else ! type = ffecom_tree_fun_type_void; charfunc = FALSE; cmplxfunc = FALSE; *************** ffecom_start_progunit_ () *** 6413,6418 **** if (charfunc ! || multi ! || (cmplxfunc && !altentries)) { /* Arg for result (return value). */ tree type; --- 6431,6436 ---- if (charfunc ! || cmplxfunc ! || multi) { /* Arg for result (return value). */ tree type; *************** ffecom_sym_transform_ (ffesymbol s) *** 6546,6551 **** yes = suspend_momentary (); ! t ! = build_decl (FUNCTION_DECL, ffecom_get_external_identifier_ (ffesymbol_text (s)), ffecom_tree_subr_type); /* Assume subr. */ --- 6564,6568 ---- yes = suspend_momentary (); ! t = build_decl (FUNCTION_DECL, ffecom_get_external_identifier_ (ffesymbol_text (s)), ffecom_tree_subr_type); /* Assume subr. */ *************** ffecom_init_0 () *** 9876,9879 **** --- 9893,9903 ---- if (i == FFEINFO_basictypeCOMPLEX) t = void_type_node; + /* For f2c compatibility, REAL functions are really + implemented as DOUBLE PRECISION. */ + else if ((i == FFEINFO_basictypeREAL) + && (j == FFEINFO_kindtypeREAL1)) + t = ffecom_tree_type + [FFEINFO_basictypeREAL][FFEINFO_kindtypeREAL2]; + t = ffecom_tree_fun_type[i][j] = build_function_type (t, NULL_TREE); *************** ffecom_init_0 () *** 9880,9888 **** ffecom_tree_ptr_to_fun_type[i][j] = build_pointer_type (t); } - else - { - ffecom_tree_fun_type[i][j] - = ffecom_tree_ptr_to_fun_type[i][j] = NULL_TREE; - } } --- 9904,9907 ---- *************** ffecom_init_0 () *** 9981,9989 **** ffecom_tree_subr_type ! = ffecom_tree_fun_type[FFEINFO_basictypeINTEGER] ! [FFEINFO_kindtypeINTEGER1]; ffecom_tree_ptr_to_subr_type ! = ffecom_tree_ptr_to_fun_type[FFEINFO_basictypeINTEGER] ! [FFEINFO_kindtypeINTEGER1]; ffecom_tree_blockdata_type = build_function_type (void_type_node, NULL_TREE); --- 10000,10006 ---- ffecom_tree_subr_type ! = build_function_type (integer_type_node, NULL_TREE); ffecom_tree_ptr_to_subr_type ! = build_pointer_type (ffecom_tree_subr_type); ffecom_tree_blockdata_type = build_function_type (void_type_node, NULL_TREE); *************** ffecom_push_tempvar (tree type, ffetarge *** 10754,10757 **** --- 10771,10776 ---- } + assert (ffecom_no_new_tempvars_ == 0); + /* Create a new temp. */ *************** start_function (tree name, tree type, in *** 12009,12013 **** decl1 = build_decl (FUNCTION_DECL, name, ! build_function_type (type, NULL_TREE)); TREE_PUBLIC (decl1) = public ? 1 : 0; if (nested) --- 12028,12032 ---- decl1 = build_decl (FUNCTION_DECL, name, ! type); TREE_PUBLIC (decl1) = public ? 1 : 0; if (nested) diff -rcp2N g77-0.5.14/f/expr.c g77-0.5.15/f/expr.c *** g77-0.5.14/f/expr.c Wed Apr 12 10:03:14 1995 --- g77-0.5.15/f/expr.c Fri May 19 11:17:30 1995 *************** ffeexpr_collapse_convert (ffebld expr, f *** 2951,2954 **** --- 2951,3007 ---- break; + case FFEINFO_basictypeLOGICAL: + switch (ffeinfo_kindtype (ffebld_info (l))) + { + #if FFETARGET_okLOGICAL1 + case FFEINFO_kindtypeLOGICAL1: + error + = ffetarget_convert_character1_logical1 + (ffebld_cu_ptr_character1 (u), + sz, + ffebld_constant_logical1 (ffebld_conter (l)), + ffebld_constant_character_pool ()); + break; + #endif + + #if FFETARGET_okLOGICAL2 + case FFEINFO_kindtypeLOGICAL2: + error + = ffetarget_convert_character1_logical2 + (ffebld_cu_ptr_character1 (u), + sz, + ffebld_constant_logical2 (ffebld_conter (l)), + ffebld_constant_character_pool ()); + break; + #endif + + #if FFETARGET_okLOGICAL3 + case FFEINFO_kindtypeLOGICAL3: + error + = ffetarget_convert_character1_logical3 + (ffebld_cu_ptr_character1 (u), + sz, + ffebld_constant_logical3 (ffebld_conter (l)), + ffebld_constant_character_pool ()); + break; + #endif + + #if FFETARGET_okLOGICAL4 + case FFEINFO_kindtypeLOGICAL4: + error + = ffetarget_convert_character1_logical4 + (ffebld_cu_ptr_character1 (u), + sz, + ffebld_constant_logical4 (ffebld_conter (l)), + ffebld_constant_character_pool ()); + break; + #endif + + default: + assert ("CHARACTER1/LOGICAL bad source kind type" == NULL); + break; + } + break; + case FFEINFO_basictypeHOLLERITH: error *************** ffeexpr_convert (ffebld source, ffelexTo *** 6961,6967 **** case FFEINFO_basictypeCHARACTER: ! bad = ffe_is_pedantic () ! || !(ffe_is_ugly_init () ! && (context == FFEEXPR_contextDATA)); break; --- 7014,7018 ---- case FFEINFO_basictypeCHARACTER: ! bad = TRUE; break; diff -rcp2N g77-0.5.14/f/lex.c g77-0.5.15/f/lex.c *** g77-0.5.14/f/lex.c Fri Apr 28 05:26:11 1995 --- g77-0.5.15/f/lex.c Tue May 9 03:38:53 1995 *************** static ffelexToken ffelex_token_new_ (vo *** 60,65 **** /* The card image itself, which grows as source lines get longer. It ! has room for ffelex_card_size_ characters, and the length of the ! current image is ffelex_card_length_. */ static char *ffelex_card_image_; static ffewhereColumnNumber ffelex_card_size_; --- 60,66 ---- /* The card image itself, which grows as source lines get longer. It ! has room for ffelex_card_size_ + 8 characters, and the length of the ! current image is ffelex_card_length_. (The + 8 characters are made ! available for easy handling of tabs and such.) */ static char *ffelex_card_image_; static ffewhereColumnNumber ffelex_card_size_; *************** ffelex_image_char_ (int c, ffewhereColum *** 680,683 **** --- 681,686 ---- { /* Overflowed column number. */ ffelex_bad_line_ = TRUE; + strcpy (&ffelex_card_image_[column], "..."); + ffelex_card_length_ = column + 3; ffelex_bad_1_ (FFEBAD_LINE_TOO_LONG, ffelex_linecount_current_, column + 1); *************** ffelex_image_char_ (int c, ffewhereColum *** 688,693 **** = malloc_resize_ksr (malloc_pool_image (), ffelex_card_image_, ! newmax + 1, ! ffelex_card_size_ + 1); ffelex_card_size_ = newmax; } --- 691,696 ---- = malloc_resize_ksr (malloc_pool_image (), ffelex_card_image_, ! newmax + 9, ! ffelex_card_size_ + 9); ffelex_card_size_ = newmax; } *************** ffelex_image_char_ (int c, ffewhereColum *** 709,712 **** --- 712,717 ---- { 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); *************** ffelex_send_token_ () *** 839,843 **** ffelex_backslash_ (EOF, 0); ! if (ffelex_token_->text != NULL) ffelex_token_->text[ffelex_token_->length] = '\0'; --- 844,856 ---- ffelex_backslash_ (EOF, 0); ! if (ffelex_token_->text == NULL) ! { ! if (ffelex_token_->type == FFELEX_typeCHARACTER) ! { ! ffelex_append_to_token_ ('\0'); ! ffelex_token_->length = 0; ! } ! } ! else ffelex_token_->text[ffelex_token_->length] = '\0'; *************** beginning_of_line_again: /* :::::::::::: *** 991,996 **** = malloc_resize_ks (malloc_pool_image (), ffelex_card_image_, ! FFELEX_columnINITIAL_SIZE_ + 1, ! ffelex_card_size_ + 1); ffelex_card_size_ = FFELEX_columnINITIAL_SIZE_; } --- 1004,1009 ---- = malloc_resize_ks (malloc_pool_image (), ffelex_card_image_, ! FFELEX_columnINITIAL_SIZE_ + 9, ! ffelex_card_size_ + 9); ffelex_card_size_ = FFELEX_columnINITIAL_SIZE_; } *************** beginning_of_line_again: /* :::::::::::: *** 1085,1091 **** if (c == EOF) goto end_of_file; /* :::::::::::::::::::: */ } /* while [c, first char, means comment] */ ! ffelex_saw_tab_ = (c == '&'); if (lextype == FFELEX_typeDEBUG) --- 1098,1108 ---- if (c == EOF) goto end_of_file; /* :::::::::::::::::::: */ + + ffelex_bad_line_ = FALSE; } /* while [c, first char, means comment] */ ! ffelex_saw_tab_ ! = (c == '&') ! || (ffelex_final_nontab_column_ == 0); if (lextype == FFELEX_typeDEBUG) *************** ffelex_init_1 () *** 3059,3067 **** unsigned int i; ! ffelex_final_nontab_column_ = 72; ffelex_card_size_ = FFELEX_columnINITIAL_SIZE_; ffelex_card_image_ = malloc_new_ksr (malloc_pool_image (), "FFELEX card image", ! FFELEX_columnINITIAL_SIZE_ + 1); ffelex_card_image_[0] = '\0'; --- 3076,3084 ---- unsigned int i; ! ffelex_final_nontab_column_ = ffe_fixed_line_length (); ffelex_card_size_ = FFELEX_columnINITIAL_SIZE_; ffelex_card_image_ = malloc_new_ksr (malloc_pool_image (), "FFELEX card image", ! FFELEX_columnINITIAL_SIZE_ + 9); ffelex_card_image_[0] = '\0'; diff -rcp2N g77-0.5.14/f/options-lang.h g77-0.5.15/f/options-lang.h *** g77-0.5.14/f/options-lang.h Fri Apr 28 05:26:11 1995 --- g77-0.5.15/f/options-lang.h Tue May 9 03:38:53 1995 *************** the Free Software Foundation, 675 Mass A *** 96,98 **** --- 96,100 ---- "-Wno-implicit", "-Wall", + /* Prefix options. */ "-I", + "-ffixed-line-length-", diff -rcp2N g77-0.5.14/f/runtime/ChangeLog g77-0.5.15/f/runtime/ChangeLog *** g77-0.5.14/f/runtime/ChangeLog Fri Apr 28 05:26:11 1995 --- g77-0.5.15/f/runtime/ChangeLog Fri May 19 11:47:28 1995 *************** *** 1,2 **** --- 1,8 ---- + Fri May 19 11:20:00 1995 Craig Burley (burley@gnu.ai.mit.edu) + + * configure.in: Incorporate change made by d.love, + + * configure: Regenerated. + Wed Apr 26 21:08:57 BST 1995 Dave Love diff -rcp2N g77-0.5.14/f/runtime/configure g77-0.5.15/f/runtime/configure *** g77-0.5.14/f/runtime/configure Fri Apr 28 05:50:49 1995 --- g77-0.5.15/f/runtime/configure Fri May 19 11:46:58 1995 *************** EOF *** 1277,1284 **** # We have to firkle with the info in hconfig.h to figure out suitable types ! # (via com.h). echo $ac_n "checking f2c integer type""... $ac_c" 1>&6 late_ac_cpp=$ac_cpp ! ac_cpp="$late_ac_cpp -I$srcdir/.. -I$srcdir/../.. -I$srcdir/../../config" if eval "test \"`echo '$''{'ac_cv_sys_f2cinteger'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1277,1285 ---- # We have to firkle with the info in hconfig.h to figure out suitable types ! # (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 late_ac_cpp=$ac_cpp ! ac_cpp="$late_ac_cpp -I$srcdir/.. -I../.. -I$srcdir/../../config" if eval "test \"`echo '$''{'ac_cv_sys_f2cinteger'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** if eval "test \"`echo '$''{'ac_cv_sys_f2 *** 1285,1289 **** else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <= sizeof (l1)) + { + l1 = l; + p = (char *) &l1; + size_of = sizeof (l1); + } + else if (size >= sizeof (l2)) + { + l2 = l; + p = (char *) &l2; + size_of = sizeof (l2); + l1 = l2; + } + else if (size >= sizeof (l3)) + { + l3 = l; + p = (char *) &l3; + size_of = sizeof (l3); + l1 = l3; + } + else if (size >= sizeof (l4)) + { + l4 = l; + p = (char *) &l4; + size_of = sizeof (l4); + l1 = l4; + } + else if (size >= sizeof (l5)) + { + l5 = l; + p = (char *) &l5; + size_of = sizeof (l5); + l1 = l5; + } + else + { + assert ("stumped by conversion from logical1!" == NULL); + abort (); + } + + res->length = size; + if (size == 0) + res->text = NULL; + else + { + res->text = malloc_new_kp (pool, "FFETARGET cvt char1", size); + if (size <= size_of) + { + int i = size_of - size; + + memcpy (res->text, p + i, size); + for (; i > 0; ++p, --i) + if (*p != 0) + return FFEBAD_TRUNCATING_NUMERIC; + } + else + { + int i = size - size_of; + + memset (res->text, 0, i); + memcpy (res->text + i, p, size_of); + } + } + + if (l1 != l) + return FFEBAD_TRUNCATING_NUMERIC; + return FFEBAD; + } + + #endif /* ffetarget_convert_character1_typeless -- Raw conversion. */ diff -rcp2N g77-0.5.14/f/target.h g77-0.5.15/f/target.h *** g77-0.5.14/f/target.h Wed Apr 12 10:03:28 1995 --- g77-0.5.15/f/target.h Fri May 19 11:17:32 1995 *************** the Free Software Foundation, 675 Mass A *** 122,125 **** --- 122,129 ---- #endif + #ifndef FFETARGET_defaultFIXED_LINE_LENGTH + #define FFETARGET_defaultFIXED_LINE_LENGTH 72 + #endif + /* 1 if external Fortran names ("FOO" in SUBROUTINE FOO, COMMON /FOO/, and even enforced/default-for-unnamed PROGRAM, blank-COMMON, and *************** ffebad ffetarget_convert_character1_inte *** 580,583 **** --- 584,591 ---- ffetargetCharacterSize res_size, ffetargetInteger1 l, + mallocPool pool); + ffebad ffetarget_convert_character1_logical1 (ffetargetCharacter1 *res, + ffetargetCharacterSize res_size, + ffetargetLogical1 l, mallocPool pool); ffebad ffetarget_convert_character1_typeless (ffetargetCharacter1 *res, diff -rcp2N g77-0.5.14/f/top.c g77-0.5.15/f/top.c *** g77-0.5.14/f/top.c Fri Apr 28 05:26:13 1995 --- g77-0.5.15/f/top.c Fri May 19 11:17:32 1995 *************** the Free Software Foundation, 675 Mass A *** 30,33 **** --- 30,34 ---- /* Include files. */ + #include #include "proj.h" #include "top.h" *************** ffeIntrinsicState ffe_intrinsic_state_f9 *** 88,91 **** --- 89,93 ---- ffeIntrinsicState ffe_intrinsic_state_mil_ = FFETARGET_defaultSTATE_MIL; ffeIntrinsicState ffe_intrinsic_state_vxt_ = FFETARGET_defaultSTATE_VXT; + int ffe_fixed_line_length_ = FFETARGET_defaultFIXED_LINE_LENGTH; mallocPool ffe_file_pool_ = NULL; mallocPool ffe_any_unit_pool_ = NULL; *************** bool ffe_in_4 = FALSE; *** 119,125 **** --- 121,139 ---- /* Static functions (internal). */ + static bool ffe_is_digit_string_ (char *s); /* Internal macros. */ + static bool + ffe_is_digit_string_ (char *s) + { + char *p; + + for (p = s; isdigit (*p); ++p) + ; + + return (p != s) && (*p == '\0'); + } + /* Handle command-line options. Returns 0 if unrecognized, 1 if recognized and handled. */ *************** ffe_decode_option (char *opt) *** 314,317 **** --- 328,343 ---- else if (strcmp (&opt[2], "vxt-intrinsics-enable") == 0) ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED); + else if (strncmp (&opt[2], "fixed-line-length-", + strlen ("fixed-line-length-")) == 0) + { + char *len = &opt[2] + strlen ("fixed-line-length-"); + + if (strcmp (len, "none") == 0) + ffe_set_fixed_line_length (0); + else if (ffe_is_digit_string_ (len)) + ffe_set_fixed_line_length (atol (len)); + else + return 0; + } else return 0; diff -rcp2N g77-0.5.14/f/top.h g77-0.5.15/f/top.h *** g77-0.5.14/f/top.h Fri Apr 28 05:26:13 1995 --- g77-0.5.15/f/top.h Tue May 9 03:38:54 1995 *************** extern ffeIntrinsicState ffe_intrinsic_s *** 105,108 **** --- 105,109 ---- extern ffeIntrinsicState ffe_intrinsic_state_mil_; extern ffeIntrinsicState ffe_intrinsic_state_vxt_; + extern int ffe_fixed_line_length_; extern mallocPool ffe_file_pool_; extern mallocPool ffe_any_unit_pool_; *************** void ffe_terminate_4 (void); *** 164,167 **** --- 165,169 ---- #define ffe_is_vxt_not_90() ffe_is_vxt_not_90_ #define ffe_is_warn_implicit() ffe_is_warn_implicit_ + #define ffe_fixed_line_length() ffe_fixed_line_length_ #define ffe_pool_file() (ffe_file_pool_) #define ffe_pool_any_unit() (ffe_any_unit_pool_) *************** void ffe_terminate_4 (void); *** 194,197 **** --- 196,200 ---- #define ffe_set_is_vxt_not_90(f) (ffe_is_vxt_not_90_ = (f)) #define ffe_set_is_warn_implicit(f) (ffe_is_warn_implicit_ = (f)) + #define ffe_set_fixed_line_length(l) (ffe_fixed_line_length_ = (l)) #define ffe_state_max(s1,s2) ((s1) > (s2) ? (s1) : (s2)) diff -rcp2N g77-0.5.14/f/zzz.c g77-0.5.15/f/zzz.c *** g77-0.5.14/f/zzz.c Fri Apr 28 05:26:14 1995 --- g77-0.5.15/f/zzz.c Fri May 19 11:17:32 1995 *************** the Free Software Foundation, 675 Mass A *** 36,40 **** /* Externals defined here. */ ! char *ffezzz_version_string = "0.5.14"; char *ffezzz_date = __DATE__; char *ffezzz_time = __TIME__; --- 36,40 ---- /* Externals defined here. */ ! char *ffezzz_version_string = "0.5.15"; char *ffezzz_date = __DATE__; char *ffezzz_time = __TIME__;