summaryrefslogtreecommitdiff
path: root/gcc/lto-wrapper.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-02-25 08:57:42 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-02-25 08:57:42 +0000
commit4094757e4be196c5a0f059e96ad149263c60555e (patch)
treef8e6f541c9aa135dc1f98fca81a46054249d5156 /gcc/lto-wrapper.c
parentadbdb8c76e9757634a688b093f6567d67b8b2498 (diff)
downloadgcc-4094757e4be196c5a0f059e96ad149263c60555e.tar.gz
re PR lto/60319 (wrong code (that hangs) by LTO at -Os and above on x86_64-linux-gnu)
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. From-SVN: r208112
Diffstat (limited to 'gcc/lto-wrapper.c')
-rw-r--r--gcc/lto-wrapper.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 5798a81f958..b17945a2ffe 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: