aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/lto-opts.c12
-rw-r--r--gcc/lto-wrapper.c21
3 files changed, 40 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 385179b..a7efc65 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-25 Richard Biener <rguenther@suse.de>
+
+ PR lto/60319
+ * lto-opts.c (lto_write_options): Output non-explicit conservative
+ -fwrapv, -fno-trapv and -fno-strict-overflow.
+ * lto-wrapper.c (merge_and_complain): Handle merging those options.
+ (run_gcc): And pass them through.
+
2014-02-25 Andrey Belevantsev <abel@ispras.ru>
* sel-sched.c (calculate_new_fences): New parameter ptime.
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 3f67572..06796d6 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -117,6 +117,18 @@ lto_write_options (void)
default:
gcc_unreachable ();
}
+ /* We need to merge -f[no-]strict-overflow, -f[no-]wrapv and -f[no-]trapv
+ conservatively, so stream out their defaults. */
+ if (!global_options_set.x_flag_wrapv
+ && global_options.x_flag_wrapv)
+ append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fwrapv");
+ if (!global_options_set.x_flag_trapv
+ && !global_options.x_flag_trapv)
+ append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fno-trapv");
+ if (!global_options_set.x_flag_strict_overflow
+ && !global_options.x_flag_strict_overflow)
+ append_to_collect_gcc_options (&temporary_obstack, &first_p,
+ "-fno-strict-overflow");
/* 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 5798a81..b17945a 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -422,6 +422,8 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
append_option (decoded_options, decoded_options_count, foption);
break;
+ case OPT_ftrapv:
+ case OPT_fstrict_overflow:
case OPT_ffp_contract_:
/* For selected options we can merge conservatively. */
for (j = 0; j < *decoded_options_count; ++j)
@@ -429,11 +431,25 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
break;
if (j == *decoded_options_count)
append_option (decoded_options, decoded_options_count, foption);
- /* FP_CONTRACT_OFF < FP_CONTRACT_ON < FP_CONTRACT_FAST. */
+ /* FP_CONTRACT_OFF < FP_CONTRACT_ON < FP_CONTRACT_FAST,
+ -fno-trapv < -ftrapv,
+ -fno-strict-overflow < -fstrict-overflow */
else if (foption->value < (*decoded_options)[j].value)
(*decoded_options)[j] = *foption;
break;
+ case OPT_fwrapv:
+ /* 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);
+ /* -fwrapv > -fno-wrapv. */
+ 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)
@@ -591,6 +607,9 @@ run_gcc (unsigned argc, char *argv[])
case OPT_freg_struct_return:
case OPT_fpcc_struct_return:
case OPT_ffp_contract_:
+ case OPT_fwrapv:
+ case OPT_ftrapv:
+ case OPT_fstrict_overflow:
break;
default: