aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-11-04 09:40:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-11-04 09:40:15 +0000
commite3b8749b11ce6763e1b413958b15955095ffd099 (patch)
tree4e0f40347c54926e23c511d26a4a282449a2ee8c /gcc
parent00ffc97dfaff36299281e8f6641c137c86ba1b42 (diff)
downloadgcc-e3b8749b11ce6763e1b413958b15955095ffd099.zip
gcc-e3b8749b11ce6763e1b413958b15955095ffd099.tar.gz
gcc-e3b8749b11ce6763e1b413958b15955095ffd099.tar.bz2
c-opts.c (c_common_post_options): Move LTO option processing code ...
2009-11-04 Richard Guenther <rguenther@suse.de> * c-opts.c (c_common_post_options): Move LTO option processing code ... * opts.c (decode_options): ... here. fortran/ * options.c (gfc_post_options): Rely on common code processing LTO options. Only enable -fwhole-file here. From-SVN: r153889
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-opts.c23
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/options.c22
-rw-r--r--gcc/opts.c22
5 files changed, 35 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f82e1e..00d9025 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ * c-opts.c (c_common_post_options): Move LTO option processing
+ code ...
+ * opts.c (decode_options): ... here.
+
2009-11-04 Jakub Jelinek <jakub@redhat.com>
* c-common.c (fold_offsetof_1): Use %wd instead of
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 6c2f5a5..e026fd9 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -1033,29 +1033,6 @@ c_common_post_options (const char **pfilename)
C_COMMON_OVERRIDE_OPTIONS;
#endif
- if (flag_lto || flag_whopr)
- {
-#ifdef ENABLE_LTO
- flag_generate_lto = 1;
-
- /* When generating IL, do not operate in whole-program mode.
- Otherwise, symbols will be privatized too early, causing link
- errors later. */
- flag_whole_program = 0;
-
- /* FIXME lto. Disable var-tracking until debug information
- is properly handled in free_lang_data. */
- flag_var_tracking = 0;
-#else
- error ("LTO support has not been enabled in this configuration");
-#endif
- }
-
- /* Reconcile -flto and -fwhopr. Set additional flags as appropriate and
- check option consistency. */
- if (flag_lto && flag_whopr)
- error ("-flto and -fwhopr are mutually exclusive");
-
/* Excess precision other than "fast" requires front-end
support. */
if (c_dialect_cxx ())
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8fc1175..47cfead 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-04 Richard Guenther <rguenther@suse.de>
+
+ * options.c (gfc_post_options): Rely on common code processing
+ LTO options. Only enable -fwhole-file here.
+
2009-11-03 Tobias Burnus <burnus@net-b.de>
PR fortran/41907
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index d2c6d9b..3742add 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -242,27 +242,9 @@ gfc_post_options (const char **pfilename)
if (flag_whole_program)
gfc_option.flag_whole_file = 1;
+ /* Enable whole-file mode if LTO is in effect. */
if (flag_lto || flag_whopr)
- {
-#ifdef ENABLE_LTO
- flag_generate_lto = 1;
-
- /* When generating IL, do not operate in whole-program mode.
- Otherwise, symbols will be privatized too early, causing link
- errors later. */
- flag_whole_program = 0;
-
- /* But do enable whole-file mode. */
- gfc_option.flag_whole_file = 1;
-#else
- error ("LTO support has not been enabled in this configuration");
-#endif
- }
-
- /* Reconcile -flto and -fwhopr. Set additional flags as appropriate and
- check option consistency. */
- if (flag_lto && flag_whopr)
- error ("-flto and -fwhopr are mutually exclusive");
+ gfc_option.flag_whole_file = 1;
/* -fbounds-check is equivalent to -fcheck=bounds */
if (flag_bounds_check)
diff --git a/gcc/opts.c b/gcc/opts.c
index 72411b6..b2b6c44 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1117,6 +1117,28 @@ decode_options (unsigned int argc, const char **argv)
PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40;
}
+ if (flag_lto || flag_whopr)
+ {
+#ifdef ENABLE_LTO
+ flag_generate_lto = 1;
+
+ /* When generating IL, do not operate in whole-program mode.
+ Otherwise, symbols will be privatized too early, causing link
+ errors later. */
+ flag_whole_program = 0;
+
+ /* FIXME lto. Disable var-tracking until debug information
+ is properly handled in free_lang_data. */
+ flag_var_tracking = 0;
+#else
+ error ("LTO support has not been enabled in this configuration");
+#endif
+ }
+
+ /* Reconcile -flto and -fwhopr. Set additional flags as appropriate and
+ check option consistency. */
+ if (flag_lto && flag_whopr)
+ error ("-flto and -fwhopr are mutually exclusive");
}
#define LEFT_COLUMN 27