diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-08-23 13:37:29 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-08-23 13:37:29 +0200 |
commit | df375b0321f9a5360fd04435ee5832c253aa4175 (patch) | |
tree | e93a027408faacfc6ec67b5f8767cad3774480cf /gcc | |
parent | 19566bdda5762ddc769fc848dcad5e1e4abf8d0d (diff) | |
download | gcc-df375b0321f9a5360fd04435ee5832c253aa4175.zip gcc-df375b0321f9a5360fd04435ee5832c253aa4175.tar.gz gcc-df375b0321f9a5360fd04435ee5832c253aa4175.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 4 | ||||
-rw-r--r-- | gcc/brig/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/brig/brig-lang.c | 4 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 2 | ||||
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 2 | ||||
-rw-r--r-- | gcc/c-family/c-opts.c | 11 | ||||
-rw-r--r-- | gcc/common.opt | 2 | ||||
-rw-r--r-- | gcc/d/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/d/d-lang.cc | 4 | ||||
-rw-r--r-- | gcc/flags.h | 9 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/options.c | 4 | ||||
-rw-r--r-- | gcc/go/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/go/go-lang.c | 4 | ||||
-rw-r--r-- | gcc/langhooks.c | 2 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto-lang.c | 3 | ||||
-rw-r--r-- | gcc/opts.c | 8 | ||||
-rw-r--r-- | gcc/toplev.c | 16 |
22 files changed, 88 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df4d621..62aebf2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 53ecd1a..b5c0b1f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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 diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index c5822f6..a576b7e 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -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; diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog index a5c3b9b..462cbab 100644 --- a/gcc/brig/ChangeLog +++ b/gcc/brig/ChangeLog @@ -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__" diff --git a/gcc/brig/brig-lang.c b/gcc/brig/brig-lang.c index 1c3a3b0..96c6c57 100644 --- a/gcc/brig/brig-lang.c +++ b/gcc/brig/brig-lang.c @@ -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 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a1a864a..b8920f1c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 0aaa246..d516dea 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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); diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index d389f8c..6006e95b 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -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); diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 2d4af63..da783e4 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -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 diff --git a/gcc/common.opt b/gcc/common.opt index c160538..f2214ed 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -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 diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index a7821c2..1013c08 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -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 diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index db0db0e..5cdb896 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -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; diff --git a/gcc/flags.h b/gcc/flags.h index 0b9cd12..5bf9b49 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -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. */ diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ea81f10..e454bd2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 146be2f..771c10e 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -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. */ diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 9413c20..47400e2 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -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. diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 94f2cb2..a6bda93 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -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) diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 22ace13..89fb5bc 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -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; } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 2467d78..4e68fbf 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -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 diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index cc44afc..414eaf2 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -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 @@ -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 diff --git a/gcc/toplev.c b/gcc/toplev.c index ddbb8b4..d741a66 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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. */ |