This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[LTO merge][7/15][RFA] Fortran front end
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 28 Sep 2009 21:19:31 -0400
- Subject: [LTO merge][7/15][RFA] Fortran front end
This patch adds support for -flto/-fwhopr in the Fortran FE.
It has been tested on x86_64 together with the the other 14
patches in this merge.
See http://gcc.gnu.org/ml/gcc/2009-09/msg00578.html for a
description of the whole set.
Thanks. Diego.
2009-09-28 Richard Guenther <rguenther@suse.de>
* options.c (gfc_post_options): Handle -flto and -fwhopr.
diff -rdupN --exclude=.svn --exclude=.git --exclude='*.diff*' --exclude='autom4te*' --exclude=tags --exclude=ChangeLog.lto --exclude=configure /usr/local/google/homedirs/dnovillo/gcc/trunk/gcc/fortran/options.c /usr/local/google/homedirs/dnovillo/gcc/trunk.lto/gcc/fortran/options.c
--- /usr/local/google/homedirs/dnovillo/gcc/trunk/gcc/fortran/options.c 2009-09-23 12:44:48.000000000 -0400
+++ /usr/local/google/homedirs/dnovillo/gcc/trunk.lto/gcc/fortran/options.c 2009-09-23 11:14:53.000000000 -0400
@@ -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;