re PR middle-end/91283 (gcc.dg/torture/c99-contract-1.c FAILs)

PR middle-end/91283
	* common.opt (fexcess-precision=): Add Optimization flag.  Use
	flag_excess_precision variable instead of
	flag_excess_precision_cmdline.
	* flags.h (class target_flag_state): Remove x_flag_excess_precision
	member.
	(flag_excess_precision): Don't define.
	* langhooks.c (lhd_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.
	* opts.c (set_fast_math_flags): Use frontend_set_flag_excess_precision
	and x_flag_excess_precision instead of
	frontend_set_flag_excess_precision_cmdline and
	x_flag_excess_precision_cmdline.
	(fast_math_flags_set_p): Use x_flag_excess_precision instead of
	x_flag_excess_precision_cmdline.
	* toplev.c (init_excess_precision): Remove.
	(lang_dependent_init_target): Don't call it.
ada/
	* gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
brig/
	* brig-lang.c (brig_langhook_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
c-family/
	* c-common.c (c_ts18661_flt_eval_method): Use flag_excess_precision
	instead of flag_excess_precision_cmdline.
	* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): Likewise.
	* c-opts.c (c_common_post_options): Likewise.
d/
	* d-lang.cc (d_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.
fortran/
	* options.c (gfc_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.
go/
	* go-lang.c (go_langhook_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
lto/
	* lto-lang.c (lto_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.

From-SVN: r274850
This commit is contained in:
Jakub Jelinek 2019-08-23 13:37:29 +02:00 committed by Jakub Jelinek
parent 19566bdda5
commit df375b0321
22 changed files with 88 additions and 51 deletions

View File

@ -1,3 +1,23 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* common.opt (fexcess-precision=): Add Optimization flag. Use
flag_excess_precision variable instead of
flag_excess_precision_cmdline.
* flags.h (class target_flag_state): Remove x_flag_excess_precision
member.
(flag_excess_precision): Don't define.
* langhooks.c (lhd_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
* opts.c (set_fast_math_flags): Use frontend_set_flag_excess_precision
and x_flag_excess_precision instead of
frontend_set_flag_excess_precision_cmdline and
x_flag_excess_precision_cmdline.
(fast_math_flags_set_p): Use x_flag_excess_precision instead of
x_flag_excess_precision_cmdline.
* toplev.c (init_excess_precision): Remove.
(lang_dependent_init_target): Don't call it.
2019-08-23 Martin Liska <mliska@suse.cz>
* lto-wrapper.c (run_gcc): When setting jobserver

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
2019-08-21 Vadim Godunko <godunko@adacore.com>
* libgnat/g-expect.adb (Expect_Internal): Attempt to read

View File

@ -256,9 +256,9 @@ static bool
gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
{
/* Excess precision other than "fast" requires front-end support. */
if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD)
if (flag_excess_precision == EXCESS_PRECISION_STANDARD)
sorry ("%<-fexcess-precision=standard%> for Ada");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
flag_excess_precision = EXCESS_PRECISION_FAST;
/* No psABI change warnings for Ada. */
warn_psabi = 0;

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* brig-lang.c (brig_langhook_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* brig-lang.c (brig_build_c_type_nodes): Accept "__intN__"

View File

@ -166,8 +166,8 @@ brig_langhook_handle_option
static bool
brig_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
{
if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
flag_excess_precision = EXCESS_PRECISION_STANDARD;
/* gccbrig casts pointers around like crazy, TBAA might produce broken
code if not disabling it by default. Some PRM conformance tests such

View File

@ -1,3 +1,11 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* c-common.c (c_ts18661_flt_eval_method): Use flag_excess_precision
instead of flag_excess_precision_cmdline.
* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): Likewise.
* c-opts.c (c_common_post_options): Likewise.
2019-08-22 Martin Sebor <msebor@redhat.com>
PR middle-end/91490

View File

@ -8345,7 +8345,7 @@ c_ts18661_flt_eval_method (void)
= targetm.c.excess_precision (EXCESS_PRECISION_TYPE_IMPLICIT);
enum excess_precision_type flag_type
= (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
= (flag_excess_precision == EXCESS_PRECISION_STANDARD
? EXCESS_PRECISION_TYPE_STANDARD
: EXCESS_PRECISION_TYPE_FAST);

View File

@ -746,7 +746,7 @@ static bool
c_cpp_flt_eval_method_iec_559 (void)
{
enum excess_precision_type front_end_ept
= (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
= (flag_excess_precision == EXCESS_PRECISION_STANDARD
? EXCESS_PRECISION_TYPE_STANDARD
: EXCESS_PRECISION_TYPE_FAST);

View File

@ -800,14 +800,13 @@ c_common_post_options (const char **pfilename)
support. */
if (c_dialect_cxx ())
{
if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD)
if (flag_excess_precision == EXCESS_PRECISION_STANDARD)
sorry ("%<-fexcess-precision=standard%> for C++");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
flag_excess_precision = EXCESS_PRECISION_FAST;
}
else if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = (flag_iso
? EXCESS_PRECISION_STANDARD
: EXCESS_PRECISION_FAST);
else if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
flag_excess_precision = (flag_iso ? EXCESS_PRECISION_STANDARD
: EXCESS_PRECISION_FAST);
/* ISO C restricts floating-point expression contraction to within
source-language expressions (-ffp-contract=on, currently an alias

View File

@ -1399,7 +1399,7 @@ Common Report Var(flag_expensive_optimizations) Optimization
Perform a number of minor, expensive optimizations.
fexcess-precision=
Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision_cmdline) Init(EXCESS_PRECISION_DEFAULT) SetByCombined
Common Joined RejectNegative Enum(excess_precision) Var(flag_excess_precision) Init(EXCESS_PRECISION_DEFAULT) Optimization SetByCombined
-fexcess-precision=[fast|standard] Specify handling of excess floating-point precision.
Enum

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* d-lang.cc (d_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline.
2019-08-20 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/88722

View File

@ -772,8 +772,8 @@ d_post_options (const char ** fn)
if (global_options_set.x_flag_max_errors)
global.errorLimit = flag_max_errors;
if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
flag_excess_precision = EXCESS_PRECISION_STANDARD;
if (global.params.useUnitTests)
global.params.useAssert = true;

View File

@ -51,9 +51,6 @@ public:
align_flags x_align_jumps;
align_flags x_align_labels;
align_flags x_align_functions;
/* The excess precision currently in effect. */
enum excess_precision x_flag_excess_precision;
};
extern class target_flag_state default_target_flag_state;
@ -68,12 +65,6 @@ extern class target_flag_state *this_target_flag_state;
#define align_labels (this_target_flag_state->x_align_labels)
#define align_functions (this_target_flag_state->x_align_functions)
/* String representaions of the above options are available in
const char *str_align_foo. NULL if not set. */
#define flag_excess_precision \
(this_target_flag_state->x_flag_excess_precision)
/* Returns TRUE if generated code should match ABI version N or
greater is in use. */

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* options.c (gfc_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
2019-08-23 Mark Eggleston <mark.eggleston@codethink.com>
* intrinsics.text: Removed empty sections. The order of

View File

@ -264,9 +264,9 @@ gfc_post_options (const char **pfilename)
/* Excess precision other than "fast" requires front-end
support. */
if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD)
if (flag_excess_precision == EXCESS_PRECISION_STANDARD)
sorry ("%<-fexcess-precision=standard%> for Fortran");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
flag_excess_precision = EXCESS_PRECISION_FAST;
/* Fortran allows associative math - but we cannot reassociate if
we want traps or signed zeros. Cf. also flag_protect_parens. */

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* go-lang.c (go_langhook_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
2019-07-02 Cherry Zhang <cherryyz@google.com>
* go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_memset.

View File

@ -293,8 +293,8 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
go_add_search_path (dir);
go_search_dirs.release ();
if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
flag_excess_precision = EXCESS_PRECISION_STANDARD;
/* Tail call optimizations can confuse uses of runtime.Callers. */
if (!global_options_set.x_flag_optimize_sibling_calls)

View File

@ -97,7 +97,7 @@ lhd_post_options (const char ** ARG_UNUSED (pfilename))
{
/* Excess precision other than "fast" requires front-end
support. */
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
flag_excess_precision = EXCESS_PRECISION_FAST;
return false;
}

View File

@ -1,3 +1,9 @@
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* lto-lang.c (lto_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91421

View File

@ -927,7 +927,8 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* Excess precision other than "fast" requires front-end
support. */
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
flag_excess_precision = EXCESS_PRECISION_FAST;
/* When partitioning, we can tear appart STRING_CSTs uses from the same
TU into multiple partitions. Without constant merging the constants

View File

@ -2971,9 +2971,8 @@ set_fast_math_flags (struct gcc_options *opts, int set)
opts->x_flag_errno_math = !set;
if (set)
{
if (opts->frontend_set_flag_excess_precision_cmdline
== EXCESS_PRECISION_DEFAULT)
opts->x_flag_excess_precision_cmdline
if (opts->frontend_set_flag_excess_precision == EXCESS_PRECISION_DEFAULT)
opts->x_flag_excess_precision
= set ? EXCESS_PRECISION_FAST : EXCESS_PRECISION_DEFAULT;
if (!opts->frontend_set_flag_signaling_nans)
opts->x_flag_signaling_nans = 0;
@ -3008,8 +3007,7 @@ fast_math_flags_set_p (const struct gcc_options *opts)
&& opts->x_flag_finite_math_only
&& !opts->x_flag_signed_zeros
&& !opts->x_flag_errno_math
&& opts->x_flag_excess_precision_cmdline
== EXCESS_PRECISION_FAST);
&& opts->x_flag_excess_precision == EXCESS_PRECISION_FAST);
}
/* Return true iff flags are set as if -ffast-math but using the flags stored

View File

@ -1841,27 +1841,11 @@ backend_init (void)
init_regs ();
}
/* Initialize excess precision settings.
We have no need to modify anything here, just keep track of what the
user requested. We'll figure out any appropriate relaxations
later. */
static void
init_excess_precision (void)
{
gcc_assert (flag_excess_precision_cmdline != EXCESS_PRECISION_DEFAULT);
flag_excess_precision = flag_excess_precision_cmdline;
}
/* Initialize things that are both lang-dependent and target-dependent.
This function can be called more than once if target parameters change. */
static void
lang_dependent_init_target (void)
{
/* This determines excess precision settings. */
init_excess_precision ();
/* This creates various _DECL nodes, so needs to be called after the
front end is initialized. It also depends on the HAVE_xxx macros
generated from the target machine description. */