re PR middle-end/91283 (gcc.dg/torture/c99-contract-1.c FAILs)
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Aug 2019 11:37:29 +0000 (13:37 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 23 Aug 2019 11:37:29 +0000 (13:37 +0200)
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

22 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/misc.c
gcc/brig/ChangeLog
gcc/brig/brig-lang.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-cppbuiltin.c
gcc/c-family/c-opts.c
gcc/common.opt
gcc/d/ChangeLog
gcc/d/d-lang.cc
gcc/flags.h
gcc/fortran/ChangeLog
gcc/fortran/options.c
gcc/go/ChangeLog
gcc/go/go-lang.c
gcc/langhooks.c
gcc/lto/ChangeLog
gcc/lto/lto-lang.c
gcc/opts.c
gcc/toplev.c

index df4d621f641bb484699dc569b2fa810d22aaddfe..62aebf25ddce0d40784526318344dbad5d15ffee 100644 (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
index 53ecd1a0ecb8e40e52b682ddffc5151f12af131b..b5c0b1ff2d77857ca365b08c15e20242ab6d91fd 100644 (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
index c5822f6cb7b6351c014c297e4ac3f4f6430fd0f0..a576b7e5a0160b0388fac24da920dc1d8a0d993f 100644 (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;
index a5c3b9b500e3e3ce6386e3df88ee7bb6e33dcbcd..462cbab05af536c4beaa5282807740e73f8cd19c 100644 (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__"
index 1c3a3b00c4123b7abc241ff01b1112867462e664..96c6c572e94a6be308535126acf7a5a5dee0f366 100644 (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
index a1a864a8e976afd89de1f35cb6fae937806121ed..b8920f1c18dac287df5349f84486e5fe4f63b71b 100644 (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
index 0aaa246d3ccd73afedff60c5e9c7380ba06877e7..d516deaf24cc83a5b0294927323762232495a0c0 100644 (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);
 
index d389f8ca4a02651ee899185fcd3bdfdf4d0393b2..6006e95b0684f35ff5a4aa73f1616377b2bb1034 100644 (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);
 
index 2d4af63cde4a3213e77588ff93fcdc12e37fdb29..da783e4990c54120cb5097fbb0f1d8c77de28f27 100644 (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
index c16053857122d63d1d4c339789b69e13f21e2e14..f2214ed93ad857775e092d8baf61ffc2aabff7b7 100644 (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
index a7821c28d4650a35ac9567aa6effa71162662839..1013c08d12b9cd5960d19819613caacdc14d90c2 100644 (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
index db0db0e71dc75aa728438ff81754e950898244ec..5cdb896323334fca0bdc5f9159b1bc4bea158ece 100644 (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;
index 0b9cd12e6cc057a39e3787f28ebe6251562fee91..5bf9b49c2b60f78ca6103c36d1357f623c649808 100644 (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.  */
 
index ea81f1058883ba40bdd4eec4f8d225443701bd31..e454bd264d92ea33cbc6f15e5861f38301aad238 100644 (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 
index 146be2f1420a723e91ac18942df1d740573b8b24..771c10e4985d00b5d0c3abcfb510a73e9737035d 100644 (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.  */
index 9413c20ed99d21395fd53f5724c3bc0923625802..47400e25a45ba900c8a2dc1576b896b832031c6b 100644 (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.
index 94f2cb25df3fdd306749add65fa4b3413d6ccb83..a6bda936ed7675ffb10428eff58e81b1099d2388 100644 (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)
index 22ace130a627aa02d5eb6dd104cee9c64f1bde62..89fb5bc3ad80b8922a0e7bbead5fde2a23022371 100644 (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;
 }
 
index 2467d78f2a26bd5fc322921c1b7af736be68232c..4e68fbf28548afc1fa46cabbeb464d7ed7487b0c 100644 (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
index cc44afc048cf5d5b007cb06d84f9dc2f942021f2..414eaf2075addaa3692fa3ebac32d3f935190a57 100644 (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
index bb0d8b5e7dbc64bb20c3fb393fc0c63ab695529b..1417dba8e4ca1eac5730ad8a15cc3dde20e38bf9 100644 (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
index ddbb8b4943687e8d371fc97b2f65524988b9aeb9..d741a66f3857a60bcdb6f5c1b60e781ff311aad4 100644 (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.  */