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
This commit is contained in:
Richard Biener 2014-02-25 08:57:42 +00:00 committed by Richard Biener
parent adbdb8c76e
commit 4094757e4b
3 changed files with 40 additions and 1 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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: