diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-20 10:31:24 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-20 10:31:24 +0000 |
| commit | 5a91aea7365878f8686c3f6663e4dabae433dc79 (patch) | |
| tree | e3cdaaeaa9d8ca6484fca76ec6770b667d08d60f | |
| parent | c40bb434516d8260e7b4df0e8ed46e7db55e612f (diff) | |
| download | ppe42-gcc-5a91aea7365878f8686c3f6663e4dabae433dc79.tar.gz ppe42-gcc-5a91aea7365878f8686c3f6663e4dabae433dc79.zip | |
2013-11-20 Richard Biener <rguenther@suse.de>
PR lto/59035
* lto-opts.c (lto_write_options): Write defaults only if
they were not explicitely specified. Also write
-ffp-contract default.
* lto-wrapper.c (merge_and_complain): Merge -ffp-contract
conservatively.
(run_gcc): Pass through -ffp-contract.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205096 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 10 | ||||
| -rw-r--r-- | gcc/lto-opts.c | 25 | ||||
| -rw-r--r-- | gcc/lto-wrapper.c | 13 |
3 files changed, 46 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e36c825fb3b..2bd67d0ef49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-11-20 Richard Biener <rguenther@suse.de> + + PR lto/59035 + * lto-opts.c (lto_write_options): Write defaults only if + they were not explicitely specified. Also write + -ffp-contract default. + * lto-wrapper.c (merge_and_complain): Merge -ffp-contract + conservatively. + (run_gcc): Pass through -ffp-contract. + 2013-11-20 Jan-Benedict Glaw <jbglaw@lug-owl.de> * config/mips/mips.c (r10k_simplify_address): Eliminate macro usage. diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c index c9d4e03d00c..2cb536bfc55 100644 --- a/gcc/lto-opts.c +++ b/gcc/lto-opts.c @@ -85,14 +85,35 @@ lto_write_options (void) function rather than per compilation unit. */ /* -fexceptions causes the EH machinery to be initialized, enabling generation of unwind data so that explicit throw() calls work. */ - if (global_options.x_flag_exceptions) + if (!global_options_set.x_flag_exceptions + && global_options.x_flag_exceptions) append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fexceptions"); /* -fnon-call-exceptions changes the generation of exception regions. It is enabled implicitly by the Go frontend. */ - if (global_options.x_flag_non_call_exceptions) + if (!global_options_set.x_flag_non_call_exceptions + && global_options.x_flag_non_call_exceptions) append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fnon-call-exceptions"); + /* The default -ffp-contract changes depending on the language + standard. Pass thru conservative standard settings. */ + if (!global_options_set.x_flag_fp_contract_mode) + switch (global_options.x_flag_fp_contract_mode) + { + case FP_CONTRACT_OFF: + append_to_collect_gcc_options (&temporary_obstack, &first_p, + "-ffp-contract=off"); + break; + case FP_CONTRACT_ON: + append_to_collect_gcc_options (&temporary_obstack, &first_p, + "-ffp-contract=on"); + break; + case FP_CONTRACT_FAST: + /* Nothing. That merges conservatively and is the default for LTO. */ + break; + default: + gcc_unreachable (); + } /* Output explicitly passed options. */ for (i = 1; i < save_decoded_options_count; ++i) diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 57978c883d4..335ec8fd01a 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -422,6 +422,18 @@ merge_and_complain (struct cl_decoded_option **decoded_options, append_option (decoded_options, decoded_options_count, foption); break; + case OPT_ffp_contract_: + /* For selected options we can merge conservatively. */ + for (j = 0; j < *decoded_options_count; ++j) + if ((*decoded_options)[j].opt_index == foption->opt_index) + break; + if (j == *decoded_options_count) + append_option (decoded_options, decoded_options_count, foption); + /* FP_CONTRACT_OFF < FP_CONTRACT_ON < FP_CONTRACT_FAST. */ + else if (foption->value < (*decoded_options)[j].value) + (*decoded_options)[j] = *foption; + break; + case OPT_freg_struct_return: case OPT_fpcc_struct_return: for (j = 0; j < *decoded_options_count; ++j) @@ -578,6 +590,7 @@ run_gcc (unsigned argc, char *argv[]) case OPT_fgnu_tm: case OPT_freg_struct_return: case OPT_fpcc_struct_return: + case OPT_ffp_contract_: break; default: |

