diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index b3fcfe4e279..98fdfd748e8 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,13 @@ +Mon Jun 1 19:37:42 1998 Craig Burley + + * com.c (ffecom_init_0): Fix setup of INTEGER(KIND=7) + pointer type. + * info.c (ffeinfo_type): Don't crash on null type. + * expr.c (ffeexpr_fulfill_call_): Don't special-case + %LOC(expr) or LOC(expr). + Delete FFEGLOBAL_argsummaryPTR. + * global.c, global.h: Delete FFEGLOBAL_argsummaryPTR. + Mon May 25 03:34:42 1998 Craig Burley * com.c (ffecom_expr_): Fix D**I and Z**I cases to @@ -9,7 +19,8 @@ Sat May 23 06:32:52 1998 Craig Burley * com.c (ffecom_finish_symbol_transform_): Don't transform statement (nested) functions, to avoid gcc compiling them and thus producing linker errors if they refer to undefined - exteral functions. But warn if they're unused and -Wunused. + external functions. But warn if they're unused and -Wunused. + * bad.def (FFEBAD_SFUNC_UNUSED): New diagnostic. Tue May 19 14:52:41 1998 Craig Burley diff --git a/gcc/f/com.c b/gcc/f/com.c index 286d0c7abd3..4f524288a0e 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -12351,10 +12351,11 @@ ffecom_init_0 () fatal ("no INTEGER type can hold a pointer on this configuration"); else if (0 && ffe_is_do_internal_checks ()) fprintf (stderr, "Pointer type kt=%d\n", ffecom_pointer_kind_); - type = ffetype_new (); ffetype_set_kind (ffeinfo_type (FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGERDEFAULT), - 7, type); + 7, + ffeinfo_type (FFEINFO_basictypeINTEGER, + ffecom_pointer_kind_)); if (ffe_is_ugly_assign ()) ffecom_label_kind_ = ffecom_pointer_kind_; /* Require ASSIGN etc to this. */ diff --git a/gcc/f/expr.c b/gcc/f/expr.c index 847904fccbf..e1187808a3b 100644 --- a/gcc/f/expr.c +++ b/gcc/f/expr.c @@ -9385,9 +9385,13 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t) as = FFEGLOBAL_argsummaryALTRTN; break; +#if 0 + /* No, %LOC(foo) is just like any INTEGER(KIND=7) + expression, so don't treat it specially. */ case FFEBLD_opPERCENT_LOC: as = FFEGLOBAL_argsummaryPTR; break; +#endif case FFEBLD_opPERCENT_VAL: as = FFEGLOBAL_argsummaryVAL; @@ -9402,6 +9406,9 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t) break; case FFEBLD_opFUNCREF: +#if 0 + /* No, LOC(foo) is just like any INTEGER(KIND=7) + expression, so don't treat it specially. */ if ((ffebld_op (ffebld_left (item)) == FFEBLD_opSYMTER) && (ffesymbol_specific (ffebld_symter (ffebld_left (item))) == FFEINTRIN_specLOC)) @@ -9409,6 +9416,7 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t) as = FFEGLOBAL_argsummaryPTR; break; } +#endif /* Fall through. */ default: if (ffebld_op (item) == FFEBLD_opSYMTER) diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi index dfd0c6b408b..3d36685aa07 100644 --- a/gcc/f/g77.texi +++ b/gcc/f/g77.texi @@ -5409,16 +5409,17 @@ arguments (those not passed using a construct such as @code{%VAL()}) by reference or descriptor, depending on the type of the actual argument. Thus, given @samp{INTEGER I}, @samp{CALL FOO(I)} would -seem to mean the same thing as @samp{CALL FOO(%LOC(I))}, and +seem to mean the same thing as @samp{CALL FOO(%VAL(%LOC(I)))}, and in fact might compile to identical code. -However, @samp{CALL FOO(%LOC(I))} emphatically means ``pass the -address of @samp{I} in memory''. +However, @samp{CALL FOO(%VAL(%LOC(I)))} emphatically means +``pass, by value, the address of @samp{I} in memory''. While @samp{CALL FOO(I)} might use that same approach in a particular version of @code{g77}, another version or compiler might choose a different implementation, such as copy-in/copy-out, to effect the desired behavior---and which will therefore not -necessarily compile to the same code as would @samp{CALL FOO(%LOC(I))} +necessarily compile to the same code as would +@samp{CALL FOO(%VAL(%LOC(I)))} using the same version or compiler. @xref{Debugging and Interfacing}, for detailed information on diff --git a/gcc/f/global.c b/gcc/f/global.c index a2251b7ecce..932a9d83387 100644 --- a/gcc/f/global.c +++ b/gcc/f/global.c @@ -616,9 +616,11 @@ ffeglobal_proc_def_arg (ffesymbol s, int argno, char *name, ffeglobalArgSummary defwhy = "an alternate-return label"; break; +#if 0 case FFEGLOBAL_argsummaryPTR: defwhy = "a pointer"; break; +#endif default: defwhy = "???"; @@ -868,6 +870,7 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as, } break; +#if 0 case FFEGLOBAL_argsummaryPTR: if ((ai->as != FFEGLOBAL_argsummaryPTR) && (ai->as != FFEGLOBAL_argsummaryNONE)) @@ -876,6 +879,7 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as, refwhy = "a pointer"; } break; +#endif default: break; @@ -919,9 +923,11 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as, defwhy = "an alternate-return label"; break; +#if 0 case FFEGLOBAL_argsummaryPTR: defwhy = "a pointer"; break; +#endif default: defwhy = "???"; diff --git a/gcc/f/global.h b/gcc/f/global.h index 70c704df0c5..d0ac871b71c 100644 --- a/gcc/f/global.h +++ b/gcc/f/global.h @@ -55,7 +55,6 @@ typedef enum FFEGLOBAL_argsummarySUBR, /* Subroutine (intrinsic, external). */ FFEGLOBAL_argsummaryFUNC, /* Function (intrinsic, external). */ FFEGLOBAL_argsummaryALTRTN, /* Alternate-return (label). */ - FFEGLOBAL_argsummaryPTR, /* Pointer (%LOC, LOC()). */ FFEGLOBAL_argsummaryANY, FFEGLOBAL_argsummary } ffeglobalArgSummary; diff --git a/gcc/f/info.c b/gcc/f/info.c index 399860e3953..05a6e26c016 100644 --- a/gcc/f/info.c +++ b/gcc/f/info.c @@ -256,7 +256,6 @@ ffeinfo_type (ffeinfoBasictype basictype, ffeinfoKindtype kindtype) { assert (basictype < FFEINFO_basictype); assert (kindtype < FFEINFO_kindtype); - assert (ffeinfo_types_[basictype][kindtype] != NULL); return ffeinfo_types_[basictype][kindtype]; } diff --git a/gcc/f/news.texi b/gcc/f/news.texi index 7dfa316cae5..753c861ea2f 100644 --- a/gcc/f/news.texi +++ b/gcc/f/news.texi @@ -46,6 +46,30 @@ Miscellany This order is not strict---for example, some items involve a combination of these elements. +@heading In 0.5.24: +@itemize @bullet +@item +@code{g77} no longer crashes when compiling code +containing specification statements such as +@samp{INTEGER(KIND=7) PTR}. + +@item +@code{g77} now treats @samp{%LOC(@var{expr})} and +@samp{LOC(@var{expr})} as ``ordinary'' expressions +when they are used as arguments in procedure calls. +This change applies only to global (filewide) analysis, +making it consistent with +how @code{g77} actually generates code +for these cases. + +Previously, @code{g77} treated these expressions +as denoting special ``pointer'' arguments +for the purposes of filewide analysis. + +@item +Improve documentation and indexing. +@end itemize + @heading In 0.5.23: @itemize @bullet @item