This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO merge][7/15][RFA] Fortran front end
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 28 Sep 2009 18:41:22 -0700
- Subject: Re: [LTO merge][7/15][RFA] Fortran front end
- References: <20090929011931.GA13322@google.com>
On Mon, Sep 28, 2009 at 6:19 PM, Diego Novillo <dnovillo@google.com> wrote:
> 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");
Why is this mostly not done in a generic place, rather than a
front-end specific place? The only part which looks fortran specific
is the setting of gfc_option.flag_whole_file.
Thanks,
Andrew Pinski