diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-03 21:10:11 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-03 21:10:11 +0000 |
commit | 7bfefa9d2c82e804ef4e59772f4060ac325bf99a (patch) | |
tree | 3a9882bd235e5026410e5397a5e46a97ece50b48 /gcc/fortran/options.c | |
parent | 7271d48ec9cd1a9aa3893d1d95e1d4a1c5882c37 (diff) | |
download | gcc-7bfefa9d2c82e804ef4e59772f4060ac325bf99a.tar.gz |
Merge lto branch into trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r-- | gcc/fortran/options.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 3e20f8e45d4..d2c6d9ba849 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -242,6 +242,28 @@ gfc_post_options (const char **pfilename) if (flag_whole_program) gfc_option.flag_whole_file = 1; + 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"); + /* -fbounds-check is equivalent to -fcheck=bounds */ if (flag_bounds_check) gfc_option.rtcheck |= GFC_RTCHECK_BOUNDS; |