Commit e3b8749b by Richard Guenther Committed by Richard Biener

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
parent 00ffc97d
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> 2009-11-04 Jakub Jelinek <jakub@redhat.com>
* c-common.c (fold_offsetof_1): Use %wd instead of * c-common.c (fold_offsetof_1): Use %wd instead of
...@@ -1033,29 +1033,6 @@ c_common_post_options (const char **pfilename) ...@@ -1033,29 +1033,6 @@ c_common_post_options (const char **pfilename)
C_COMMON_OVERRIDE_OPTIONS; C_COMMON_OVERRIDE_OPTIONS;
#endif #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 /* Excess precision other than "fast" requires front-end
support. */ support. */
if (c_dialect_cxx ()) if (c_dialect_cxx ())
......
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> 2009-11-03 Tobias Burnus <burnus@net-b.de>
PR fortran/41907 PR fortran/41907
......
...@@ -242,27 +242,9 @@ gfc_post_options (const char **pfilename) ...@@ -242,27 +242,9 @@ gfc_post_options (const char **pfilename)
if (flag_whole_program) if (flag_whole_program)
gfc_option.flag_whole_file = 1; gfc_option.flag_whole_file = 1;
/* Enable whole-file mode if LTO is in effect. */
if (flag_lto || flag_whopr) 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; 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 */ /* -fbounds-check is equivalent to -fcheck=bounds */
if (flag_bounds_check) if (flag_bounds_check)
......
...@@ -1117,6 +1117,28 @@ decode_options (unsigned int argc, const char **argv) ...@@ -1117,6 +1117,28 @@ decode_options (unsigned int argc, const char **argv)
PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40; 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 #define LEFT_COLUMN 27
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment