===================================================================
@@ -2179,6 +2179,7 @@ typedef struct
int max_continue_free;
int max_identifier_length;
int dump_parse_tree;
+ int dump_optimized_tree;
int warn_aliasing;
int warn_ampersand;
===================================================================
@@ -362,6 +362,10 @@ fdump-parse-tree
Fortran
Display the code tree after parsing
+fdump-optimized-tree
+Fortran
+Display the code tree after front end optimization
+
fexternal-blas
Fortran
Specify that an external BLAS library should be used for matmul calls on large-size arrays
===================================================================
@@ -143,8 +143,8 @@ and warnings}.
@item Debugging Options
@xref{Debugging Options,,Options for debugging your program or GNU Fortran}.
-@gccoptlist{-fdump-parse-tree -ffpe-trap=@var{list} @gol
--fdump-core -fbacktrace}
+@gccoptlist{-fdump-parse-tree -fdump-optimized-tree @gol
+-ffpe-trap=@var{list} -fdump-core -fbacktrace}
@item Directory Options
@xref{Directory Options,,Options for directory search}.
@@ -881,9 +881,15 @@ either your program or the GNU Fortran compiler.
@table @gcctabopt
@item -fdump-parse-tree
@opindex @code{fdump-parse-tree}
-Output the internal parse tree before starting code generation. Only
-really useful for debugging the GNU Fortran compiler itself.
+Output the internal parse tree after translating the source program
+into internal representation. Only really useful for debugging the
+GNU Fortran compiler itself.
+@item -fdump-optimized-tree
+@opindex @code{fdump-optimized-tree}
+Output the parse tree after front-end optimization. Only really
+useful for debugging the GNU Fortran compiler itself.
+
@item -ffpe-trap=@var{list}
@opindex @code{ffpe-trap=}@var{list}
Specify a list of IEEE exceptions when a Floating Point Exception
===================================================================
@@ -42,7 +42,11 @@ void
gfc_run_passes (gfc_namespace *ns)
{
if (optimize)
- optimize_namespace (ns);
+ {
+ optimize_namespace (ns);
+ if (gfc_option.dump_optimized_tree)
+ gfc_dump_parse_tree (ns, stdout);
+ }
}
/* Callback for each gfc_code node invoked through gfc_code_walker
===================================================================
@@ -91,6 +91,7 @@ gfc_init_options (unsigned int decoded_options_cou
gfc_option.convert = GFC_CONVERT_NATIVE;
gfc_option.record_marker = 0;
gfc_option.dump_parse_tree = 0;
+ gfc_option.dump_optimized_tree = 0;
gfc_option.warn_aliasing = 0;
gfc_option.warn_ampersand = 0;
@@ -690,6 +691,10 @@ gfc_handle_option (size_t scode, const char *arg,
gfc_option.dump_parse_tree = value;
break;
+ case OPT_fdump_optimized_tree:
+ gfc_option.dump_optimized_tree = value;
+ break;
+
case OPT_ffixed_form:
gfc_option.source_form = FORM_FIXED;
break;