From a23eec13d926c33de97b5b93e866a7524a8bcd1f Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Wed, 3 May 2006 21:24:11 +0000 Subject: [PATCH] re PR fortran/26896 (Description of implementation of -Wtabs/-Wno-tabs reversed) 2006-03-30 Steven G. Kargl PR fortran/26896 * lang.opt: Fix -Wtab description PR fortran/20248 * lang.opt: New flag -fall-intrinsics. * invoke.texi: Document option. * gfortran.h (options_t): New member flag_all_intrinsics. * options.c (gfc_init_options, gfc_handle_option): Set new option. sort nearby misplaced options. * intrinsic.c (add_sym, make_generic, make_alias): Use it. 2006-03-30 Steven G. Kargl * gfortran.dg/iargc.f90: New test. From-SVN: r113502 --- gcc/fortran/ChangeLog | 13 +++++++++++++ gcc/fortran/gfortran.h | 1 + gcc/fortran/intrinsic.c | 9 ++++++--- gcc/fortran/invoke.texi | 8 +++++++- gcc/fortran/lang.opt | 6 +++++- gcc/fortran/options.c | 21 +++++++++++++-------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/iargc.f90 | 6 ++++++ 8 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/iargc.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index abc6c4a9178..93020992f35 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,16 @@ +2006-05-02 Steven G. Kargl + + PR fortran/26896 + * lang.opt: Fix -Wtab description + + PR fortran/20248 + * lang.opt: New flag -fall-intrinsics. + * invoke.texi: Document option. + * gfortran.h (options_t): New member flag_all_intrinsics. + * options.c (gfc_init_options, gfc_handle_option): Set new option. + sort nearby misplaced options. + * intrinsic.c (add_sym, make_generic, make_alias): Use it. + 2006-05-02 Paul Thomas PR fortran/27269 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a7b84b1a2e3..b345910e47f 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1614,6 +1614,7 @@ typedef struct int warn_underflow; int warn_unused_labels; + int flag_all_intrinsics; int flag_default_double; int flag_default_integer; int flag_default_real; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 78289227d7d..e0763b8d777 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -224,7 +224,8 @@ add_sym (const char *name, int elemental, int actual_ok ATTRIBUTE_UNUSED, /* First check that the intrinsic belongs to the selected standard. If not, don't add it to the symbol list. */ - if (!(gfc_option.allow_std & standard)) + if (!(gfc_option.allow_std & standard) + && gfc_option.flag_all_intrinsics == 0) return; switch (sizing) @@ -782,7 +783,8 @@ make_generic (const char *name, gfc_generic_isym_id generic_id, int standard) { gfc_intrinsic_sym *g; - if (!(gfc_option.allow_std & standard)) + if (!(gfc_option.allow_std & standard) + && gfc_option.flag_all_intrinsics == 0) return; if (sizing != SZ_NOTHING) @@ -824,7 +826,8 @@ make_alias (const char *name, int standard) /* First check that the intrinsic belongs to the selected standard. If not, don't add it to the symbol list. */ - if (!(gfc_option.allow_std & standard)) + if (!(gfc_option.allow_std & standard) + && gfc_option.flag_all_intrinsics == 0) return; switch (sizing) diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index e95b32b70ac..867e18adb04 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -116,7 +116,7 @@ by type. Explanations are in the following sections. @item Fortran Language Options @xref{Fortran Dialect Options,,Options Controlling Fortran Dialect}. @gccoptlist{ --ffree-form -fno-fixed-form @gol +-fall-intrinsics -ffree-form -fno-fixed-form @gol -fdollar-ok -fimplicit-none -fmax-identifier-length @gol -std=@var{std} -fd-lines-as-code -fd-lines-as-comments @gol -ffixed-line-length-@var{n} -ffixed-line-length-none @gol @@ -191,6 +191,12 @@ Specify the layout used by the source file. The free form layout was introduced in Fortran 90. Fixed form was traditionally used in older Fortran programs. +@cindex -fall-intrinsics +@item -fall-intrinsics +Accept all of the intrinsic procedures provided in libgfortran +without regard to the setting of @option{-std}. In particular, +this option can be quite useful with @option{-std=f95}. + @cindex option, -fd-lines-as-code @cindex -fd-lines-as-code, option @cindex option, -fd-lines-as-comments diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index 853653abfeb..439eb029636 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -67,7 +67,7 @@ Warn about \"suspicious\" constructs Wtabs Fortran -Warn about nonconforming uses of the tab character +Permit nonconforming uses of the tab character Wunderflow Fortran @@ -77,6 +77,10 @@ Wunused-labels Fortran Warn when a label is unused +fall-intrinsics +Fortran RejectNegative +All intrinsics procedures are available regardless of selected standard + fautomatic Fortran Do not treat local variables and COMMON blocks as if they were named in SAVE statements diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 18d56c560b0..ff3719e54d9 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -61,6 +61,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.warn_underflow = 1; gfc_option.warn_unused_labels = 0; + gfc_option.flag_all_intrinsics = 0; gfc_option.flag_default_double = 0; gfc_option.flag_default_integer = 0; gfc_option.flag_default_real = 0; @@ -424,6 +425,18 @@ gfc_handle_option (size_t scode, const char *arg, int value) case OPT_Wunused_labels: gfc_option.warn_unused_labels = value; break; + + case OPT_fall_intrinsics: + gfc_option.flag_all_intrinsics = 1; + break; + + case OPT_fautomatic: + gfc_option.flag_automatic = value; + break; + + case OPT_fbackslash: + gfc_option.flag_backslash = value; + break; case OPT_fcray_pointer: gfc_option.flag_cray_pointer = value; @@ -437,14 +450,6 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.flag_dollar_ok = value; break; - case OPT_fautomatic: - gfc_option.flag_automatic = value; - break; - - case OPT_fbackslash: - gfc_option.flag_backslash = value; - break; - case OPT_fd_lines_as_code: gfc_option.flag_d_lines = 1; break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a439ad29fd6..399b36dab16 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-02 Steven G. Kargl + + PR fortran/20248 + * gfortran.dg/iargc.f90: New test. + 2006-05-02 Mark Mitchell PR c++/27102 diff --git a/gcc/testsuite/gfortran.dg/iargc.f90 b/gcc/testsuite/gfortran.dg/iargc.f90 new file mode 100644 index 00000000000..a91e9003ac6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/iargc.f90 @@ -0,0 +1,6 @@ +! { dg-do compile } +! { dg-options "-fall-intrinsics -std=f95" } +! PR fortran/20248 +program z + if (iargc() /= 0) call abort +end program z