Commit f6d17ecd by Fritz Reese Committed by Fritz Reese

Cleanup -fdec.

	gcc/fortran/
	* invoke.texi, gfortran.texi: Touch up documentation of -fdec.
	* gfortran.h (gfc_option): Move flag_dec_structure out of gfc_option.
	* decl.c (match_record_decl, gfc_match_decl_type_spec,
	gfc_match_structure_decl): Ditto.
	* match.c (gfc_match_member_sep): Ditto.
	* options.c (gfc_handle_option): Ditto.
	* lang.opt (fdec-structure): Use Fortran Var for flag_dec_structure.
	* lang.opt (fdec): Use Fortran Var to create flag_dec.
	* options.c (set_dec_flags): With -fdec enable -fcray-pointer,
	-fd-lines-as-comments (default), -fdollar-ok, and legacy std flags.

From-SVN: r241516
parent 6ddefaa7
2016-10-25 Fritz Reese <fritzoreese@gmail.com>
* invoke.texi, gfortran.texi: Touch up documentation of -fdec.
* gfortran.h (gfc_option): Move flag_dec_structure out of gfc_option.
* decl.c (match_record_decl, gfc_match_decl_type_spec,
gfc_match_structure_decl): Ditto.
* match.c (gfc_match_member_sep): Ditto.
* options.c (gfc_handle_option): Ditto.
* lang.opt (fdec-structure): Use Fortran Var for flag_dec_structure.
* lang.opt (fdec): Use Fortran Var to create flag_dec.
* options.c (set_dec_flags): With -fdec enable -fcray-pointer,
-fd-lines-as-comments (default), -fdollar-ok, and legacy std flags.
2016-10-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2016-10-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/77828 PR fortran/77828
......
...@@ -2929,7 +2929,7 @@ match_record_decl (char *name) ...@@ -2929,7 +2929,7 @@ match_record_decl (char *name)
m = gfc_match (" record /"); m = gfc_match (" record /");
if (m == MATCH_YES) if (m == MATCH_YES)
{ {
if (!gfc_option.flag_dec_structure) if (!flag_dec_structure)
{ {
gfc_current_locus = old_loc; gfc_current_locus = old_loc;
gfc_error ("RECORD at %C is an extension, enable it with " gfc_error ("RECORD at %C is an extension, enable it with "
...@@ -2942,7 +2942,7 @@ match_record_decl (char *name) ...@@ -2942,7 +2942,7 @@ match_record_decl (char *name)
} }
gfc_current_locus = old_loc; gfc_current_locus = old_loc;
if (gfc_option.flag_dec_structure if (flag_dec_structure
&& (gfc_match (" record% ") == MATCH_YES && (gfc_match (" record% ") == MATCH_YES
|| gfc_match (" record%t") == MATCH_YES)) || gfc_match (" record%t") == MATCH_YES))
gfc_error ("Structure name expected after RECORD at %C"); gfc_error ("Structure name expected after RECORD at %C");
...@@ -3145,7 +3145,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) ...@@ -3145,7 +3145,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
{ {
/* Match nested STRUCTURE declarations; only valid within another /* Match nested STRUCTURE declarations; only valid within another
structure declaration. */ structure declaration. */
if (gfc_option.flag_dec_structure if (flag_dec_structure
&& (gfc_current_state () == COMP_STRUCTURE && (gfc_current_state () == COMP_STRUCTURE
|| gfc_current_state () == COMP_MAP)) || gfc_current_state () == COMP_MAP))
{ {
...@@ -8654,7 +8654,7 @@ gfc_match_structure_decl (void) ...@@ -8654,7 +8654,7 @@ gfc_match_structure_decl (void)
match m; match m;
locus where; locus where;
if(!gfc_option.flag_dec_structure) if(!flag_dec_structure)
{ {
gfc_error ("STRUCTURE at %C is a DEC extension, enable with " gfc_error ("STRUCTURE at %C is a DEC extension, enable with "
"-fdec-structure"); "-fdec-structure");
......
...@@ -2549,8 +2549,6 @@ typedef struct ...@@ -2549,8 +2549,6 @@ typedef struct
int flag_init_character; int flag_init_character;
char flag_init_character_value; char flag_init_character_value;
int flag_dec_structure;
int fpe; int fpe;
int fpe_summary; int fpe_summary;
int rtcheck; int rtcheck;
......
...@@ -1437,7 +1437,8 @@ purely for backward compatibility with legacy compilers. By default, ...@@ -1437,7 +1437,8 @@ purely for backward compatibility with legacy compilers. By default,
extensions, but to warn about the use of the latter. Specifying extensions, but to warn about the use of the latter. Specifying
either @option{-std=f95}, @option{-std=f2003} or @option{-std=f2008} either @option{-std=f95}, @option{-std=f2003} or @option{-std=f2008}
disables both types of extensions, and @option{-std=legacy} allows both disables both types of extensions, and @option{-std=legacy} allows both
without warning. without warning. The special compile flag @option{-fdec} enables additional
compatibility extensions along with those enabled by @option{-std=legacy}.
@menu @menu
* Old-style kind specifications:: * Old-style kind specifications::
......
...@@ -236,12 +236,15 @@ comment lines. ...@@ -236,12 +236,15 @@ comment lines.
DEC compatibility mode. Enables extensions and other features that mimic DEC compatibility mode. Enables extensions and other features that mimic
the default behavior of older compilers (such as DEC). the default behavior of older compilers (such as DEC).
These features are non-standard and should be avoided at all costs. These features are non-standard and should be avoided at all costs.
For details on GNU Fortran's implementation of these extensions see the For details on GNU Fortran's implementation of these extensions see the
full documentation. full documentation.
Other flags enabled by this switch are: Other flags enabled by this switch are:
@option{-fdollar-ok} @option{-fcray-pointer} @option{-fdec-structure} @option{-fdollar-ok} @option{-fcray-pointer} @option{-fdec-structure}
@option{-fdec-intrinsic-ints} @option{-fdec-static} @option{-fdec-intrinsic-ints} @option{-fdec-static} @option{-fdec-math}
If @option{-fd-lines-as-code}/@option{-fd-lines-as-comments} are unset, then
@option{-fdec} also sets @option{-fd-lines-as-comments}.
@item -fdec-structure @item -fdec-structure
@opindex @code{fdec-structure} @opindex @code{fdec-structure}
......
...@@ -421,7 +421,7 @@ Fortran RejectNegative ...@@ -421,7 +421,7 @@ Fortran RejectNegative
Treat lines with 'D' in column one as comments. Treat lines with 'D' in column one as comments.
fdec fdec
Fortran Fortran Var(flag_dec)
Enable all DEC language extensions. Enable all DEC language extensions.
fdec-intrinsic-ints fdec-intrinsic-ints
...@@ -433,7 +433,7 @@ Fortran Var(flag_dec_math) ...@@ -433,7 +433,7 @@ Fortran Var(flag_dec_math)
Enable legacy math intrinsics for compatibility. Enable legacy math intrinsics for compatibility.
fdec-structure fdec-structure
Fortran Fortran Var(flag_dec_structure)
Enable support for DEC STRUCTURE/RECORD. Enable support for DEC STRUCTURE/RECORD.
fdec-static fdec-static
......
...@@ -159,7 +159,7 @@ gfc_match_member_sep(gfc_symbol *sym) ...@@ -159,7 +159,7 @@ gfc_match_member_sep(gfc_symbol *sym)
return MATCH_YES; return MATCH_YES;
/* Beware ye who enter here. */ /* Beware ye who enter here. */
if (!gfc_option.flag_dec_structure || !sym) if (!flag_dec_structure || !sym)
return MATCH_NO; return MATCH_NO;
tsym = NULL; tsym = NULL;
......
...@@ -47,15 +47,27 @@ set_default_std_flags (void) ...@@ -47,15 +47,27 @@ set_default_std_flags (void)
} }
/* Set all the DEC extension flags. */ /* Set all the DEC extension flags. */
static void static void
set_dec_flags (int value) set_dec_flags (int value)
{ {
gfc_option.flag_dec_structure = value; /* Allow legacy code without warnings. */
flag_dec_intrinsic_ints = value; gfc_option.allow_std |= GFC_STD_F95_OBS | GFC_STD_F95_DEL
flag_dec_static = value; | GFC_STD_GNU | GFC_STD_LEGACY;
flag_dec_math = value; gfc_option.warn_std &= ~(GFC_STD_LEGACY | GFC_STD_F95_DEL);
/* Set -fd-lines-as-comments by default. */
if (value && gfc_current_form != FORM_FREE && gfc_option.flag_d_lines == -1)
gfc_option.flag_d_lines = 0;
/* Set other DEC compatibility extensions. */
flag_dollar_ok |= value;
flag_cray_pointer |= value;
flag_dec_structure |= value;
flag_dec_intrinsic_ints |= value;
flag_dec_static |= value;
flag_dec_math |= value;
} }
...@@ -729,7 +741,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -729,7 +741,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
break; break;
case OPT_fdec_structure: case OPT_fdec_structure:
gfc_option.flag_dec_structure = 1; flag_dec_structure = 1;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment