Commit a4c54bf2 by Jerry DeLisle

re PR fortran/69520 (Implement reversal of -fcheck options)

2016-03-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Harold Anlauf  <anlauf@gmx.de>

	PR fortran/69520
	* invoke.texi: Explain use of the 'no-' construct within the
	-fcheck= option.
	* options.c (gfc_handle_runtime_check_option): Enable use of
	'no-' prefix for the various options with -fcheck= to allow
	negating previously enabled check options.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>

From-SVN: r234167
parent 4d4d5abe
2016-03-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Harold Anlauf <anlauf@gmx.de>
PR fortran/69520
* invoke.texi: Explain use of the 'no-' construct within the
-fcheck= option.
* options.c (gfc_handle_runtime_check_option): Enable use of
'no-' prefix for the various options with -fcheck= to allow
negating previously enabled check options.
2016-03-12 Paul Thomas <pault@gcc.gnu.org> 2016-03-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/70031 PR fortran/70031
......
...@@ -1398,7 +1398,8 @@ library needs to be linked. ...@@ -1398,7 +1398,8 @@ library needs to be linked.
@cindex checking array temporaries @cindex checking array temporaries
Enable the generation of run-time checks; the argument shall be Enable the generation of run-time checks; the argument shall be
a comma-delimited list of the following keywords. a comma-delimited list of the following keywords. Prefixing a check with
@option{no-} disables it if it was activated by a previous specification.
@table @asis @table @asis
@item @samp{all} @item @samp{all}
...@@ -1444,6 +1445,13 @@ Note: This check does not work for OpenMP programs and is disabled if used ...@@ -1444,6 +1445,13 @@ Note: This check does not work for OpenMP programs and is disabled if used
together with @option{-frecursive} and @option{-fopenmp}. together with @option{-frecursive} and @option{-fopenmp}.
@end table @end table
Example: Assuming you have a file @file{foo.f90}, the command
@smallexample
gfortran -fcheck=all,no-array-temps foo.f90
@end smallexample
will compile the file with all checks enabled as specified above except
warnings for generated array temporaries.
@item -fbounds-check @item -fbounds-check
@opindex @code{fbounds-check} @opindex @code{fbounds-check}
......
...@@ -515,6 +515,15 @@ gfc_handle_runtime_check_option (const char *arg) ...@@ -515,6 +515,15 @@ gfc_handle_runtime_check_option (const char *arg)
result = 1; result = 1;
break; break;
} }
else if (optname[n] && pos > 3 && strncmp ("no-", arg, 3) == 0
&& strncmp (optname[n], arg+3, pos-3) == 0)
{
gfc_option.rtcheck &= ~optmask[n];
arg += pos;
pos = 0;
result = 1;
break;
}
} }
if (!result) if (!result)
gfc_fatal_error ("Argument to %<-fcheck%> is not valid: %s", arg); gfc_fatal_error ("Argument to %<-fcheck%> is not valid: %s", arg);
......
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