aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-11-03 14:46:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-11-03 14:46:26 +0000
commit52a35ef729f3eae64eb9ba8213fd840e4c71df84 (patch)
tree9b93ef15724edc35794595b3bb53fc4cb6c6ae89 /gcc/lto
parentfa66fc02ec785e63a40ab808b7e8bf47ceb7770b (diff)
downloadgcc-52a35ef729f3eae64eb9ba8213fd840e4c71df84.zip
gcc-52a35ef729f3eae64eb9ba8213fd840e4c71df84.tar.gz
gcc-52a35ef729f3eae64eb9ba8213fd840e4c71df84.tar.bz2
re PR lto/44965 (lto option code breaks file format with each added option)
2011-11-03 Richard Guenther <rguenther@suse.de> PR lto/44965 * lto-opts.c: Re-implement. * lto-streamer.h (lto_register_user_option): Remove. (lto_read_file_options): Likewise. (lto_reissue_options): Likewise. (lto_clear_user_options): Likewise. (lto_clear_file_options): Likewise. * opts-global.c (post_handling_callback): Remove. (set_default_handlers): Do not set post_handling_callback. (decode_options): Remove LTO specific code. * lto-wrapper.c (merge_and_complain): New function. (run_gcc): Read all input file options and prepend a merged set before the linker driver options. * gcc.c (driver_post_handling_callback): Remove. (set_option_handlers): Do not set post_handling_callback. * opts-common.c (handle_option): Do not call post_handling_callback. * opts.h (struct cl_option_handlers): Remove post_handling_callback. lto/ * lto-lang.c (lto_post_options): Do not read file options. * lto.c (lto_read_all_file_options): Remove. (lto_init): Call lto_set_in_hooks here. From-SVN: r180827
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto-lang.c2
-rw-r--r--gcc/lto/lto.c55
3 files changed, 8 insertions, 56 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 5de85dd..d8bbd9c 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR lto/44965
+ * lto-lang.c (lto_post_options): Do not read file options.
+ * lto.c (lto_read_all_file_options): Remove.
+ (lto_init): Call lto_set_in_hooks here.
+
2011-10-09 Jan Hubicka <jh@suse.cz>
* lto.c (node_cmp, varpool_node_cmp): New functions.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 4a5f6fe..c702b9a 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -692,8 +692,6 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
support. */
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
- lto_read_all_file_options ();
-
/* Initialize the compiler back end. */
return false;
}
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c50a97e..3b35604 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2494,60 +2494,6 @@ lto_fixup_decls (struct lto_file_decl_data **files)
}
}
-/* Read the options saved from each file in the command line. Called
- from lang_hooks.post_options which is called by process_options
- right before all the options are used to initialize the compiler.
- This assumes that decode_options has already run, so the
- num_in_fnames and in_fnames are properly set.
-
- Note that this assumes that all the files had been compiled with
- the same options, which is not a good assumption. In general,
- options ought to be read from all the files in the set and merged.
- However, it is still unclear what the merge rules should be. */
-
-void
-lto_read_all_file_options (void)
-{
- size_t i;
-
- /* Clear any file options currently saved. */
- lto_clear_file_options ();
-
- /* Set the hooks to read ELF sections. */
- lto_set_in_hooks (NULL, get_section_data, free_section_data);
- if (!quiet_flag)
- fprintf (stderr, "Reading command line options:");
-
- for (i = 0; i < num_in_fnames; i++)
- {
- struct lto_file_decl_data *file_data;
- lto_file *file = lto_obj_file_open (in_fnames[i], false);
- if (!file)
- break;
- if (!quiet_flag)
- {
- fprintf (stderr, " %s", in_fnames[i]);
- fflush (stderr);
- }
-
- file_data = XCNEW (struct lto_file_decl_data);
- file_data->file_name = file->filename;
- file_data->section_hash_table = lto_obj_build_section_table (file, NULL);
-
- lto_read_file_options (file_data);
-
- lto_obj_file_close (file);
- htab_delete (file_data->section_hash_table);
- free (file_data);
- }
-
- if (!quiet_flag)
- fprintf (stderr, "\n");
-
- /* Apply globally the options read from all the files. */
- lto_reissue_options ();
-}
-
static GTY((length ("lto_stats.num_input_files + 1"))) struct lto_file_decl_data **all_file_decl_data;
/* Turn file datas for sub files into a single array, so that they look
@@ -2921,6 +2867,7 @@ lto_init (void)
lto_process_name ();
lto_streamer_hooks_init ();
lto_reader_init ();
+ lto_set_in_hooks (NULL, get_section_data, free_section_data);
memset (&lto_stats, 0, sizeof (lto_stats));
bitmap_obstack_initialize (NULL);
gimple_register_cfg_hooks ();