summaryrefslogtreecommitdiff
path: root/gcc/opts-global.c
diff options
context:
space:
mode:
authorsinghai <singhai@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-01 05:43:06 +0000
committersinghai <singhai@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-01 05:43:06 +0000
commit7bd765d4ede65c5e4895dfd9ea458b3f35b8483a (patch)
tree525ba5cb84f1f7d04874c56225d38fe09fea8455 /gcc/opts-global.c
parent769bf18a20ee2540ca7601cdafabd62b18b9751b (diff)
downloadgcc-7bd765d4ede65c5e4895dfd9ea458b3f35b8483a.tar.gz
2012-09-30 Sharad Singhai <singhai@google.com>
* doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191883 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts-global.c')
-rw-r--r--gcc/opts-global.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index b93d56fcd8d..ccbfeef247f 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -233,6 +233,40 @@ read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set,
}
}
+/* Handle -ftree-vectorizer-verbose=ARG by remapping it to -fopt-info.
+ It remaps the old verbosity values as following:
+
+ REPORT_NONE ==> No dump is output
+ REPORT_VECTORIZED_LOCATIONS ==> "-optimized"
+ REPORT_UNVECTORIZED_LOCATIONS ==> "-missed"
+
+ Any higher verbosity levels get mapped to "-optall" flags. */
+
+static void
+dump_remap_tree_vectorizer_verbose (const char *arg)
+{
+ int value = atoi (arg);
+ const char *remapped_opt_info = NULL;
+
+ switch (value)
+ {
+ case 0:
+ break;
+ case 1:
+ remapped_opt_info = "optimized";
+ break;
+ case 2:
+ remapped_opt_info = "missed";
+ break;
+ default:
+ remapped_opt_info = "optall";
+ break;
+ }
+
+ if (remapped_opt_info)
+ opt_info_switch_p (remapped_opt_info);
+}
+
/* Language mask determined at initialization. */
static unsigned int initial_lang_mask;
@@ -322,6 +356,9 @@ handle_common_deferred_options (void)
if (flag_dump_all_passed)
enable_rtl_dump_file ();
+ if (flag_opt_info)
+ opt_info_switch_p (NULL);
+
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
{
switch (opt->opt_index)
@@ -351,6 +388,12 @@ handle_common_deferred_options (void)
error ("unrecognized command line option %<-fdump-%s%>", opt->arg);
break;
+ case OPT_fopt_info_:
+ if (!opt_info_switch_p (opt->arg))
+ error ("unrecognized command line option %<-fopt-info%s%>",
+ opt->arg);
+ break;
+
case OPT_fenable_:
case OPT_fdisable_:
if (opt->opt_index == OPT_fenable_)
@@ -410,6 +453,10 @@ handle_common_deferred_options (void)
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg));
break;
+ case OPT_ftree_vectorizer_verbose_:
+ dump_remap_tree_vectorizer_verbose (opt->arg);
+ break;
+
default:
gcc_unreachable ();
}