diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2016-11-23 17:23:12 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2016-11-23 17:23:12 +0000 |
commit | 56d8ffc170912cb1dee5900799acaf5d4857fde9 (patch) | |
tree | b2e05c11d31890a7a8ef669c3474d40a7843da1c /gcc/toplev.c | |
parent | 04f0fcf7bdfa1b4d153ca37df8843c44ed8c4d93 (diff) | |
download | gcc-56d8ffc170912cb1dee5900799acaf5d4857fde9.zip gcc-56d8ffc170912cb1dee5900799acaf5d4857fde9.tar.gz gcc-56d8ffc170912cb1dee5900799acaf5d4857fde9.tar.bz2 |
[Patch 6/17] Migrate excess precision logic to use TARGET_EXCESS_PRECISION
gcc/
* toplev.c (init_excess_precision): Delete most logic.
* tree.c (excess_precision_type): Rewrite to use
TARGET_EXCESS_PRECISION.
* doc/invoke.texi (-fexcess-precision): Document behaviour in a
more generic fashion.
* ginclude/float.h: Wrap definition of FLT_EVAL_METHOD in
__STDC_WANT_IEC_60559_TYPES_EXT__.
gcc/c-family/
* c-common.c (excess_precision_mode_join): New.
(c_ts18661_flt_eval_method): New.
(c_c11_flt_eval_method): Likewise.
(c_flt_eval_method): Likewise.
* c-common.h (excess_precision_mode_join): New.
(c_flt_eval_method): Likewise.
* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): New.
(cpp_iec_559_value): Call it.
(c_cpp_builtins): Modify logic for __LIBGCC_*_EXCESS_PRECISION__,
call c_flt_eval_method to set __FLT_EVAL_METHOD__ and
__FLT_EVAL_METHOD_TS_18661_3__.
gcc/testsuite/
* gcc.dg/fpermitted-flt-eval-methods_3.c: New.
* gcc.dg/fpermitted-flt-eval-methods_4.c: Likewise.
From-SVN: r242776
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index d43234a..5af02ea 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1680,41 +1680,17 @@ backend_init (void) init_regs (); } -/* Initialize excess precision settings. */ +/* 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) { - /* Adjust excess precision handling based on the target options. If - the front end cannot handle it, flag_excess_precision_cmdline - will already have been set accordingly in the post_options - hook. */ gcc_assert (flag_excess_precision_cmdline != EXCESS_PRECISION_DEFAULT); flag_excess_precision = flag_excess_precision_cmdline; - if (flag_unsafe_math_optimizations) - flag_excess_precision = EXCESS_PRECISION_FAST; - if (flag_excess_precision == EXCESS_PRECISION_STANDARD) - { - int flt_eval_method = TARGET_FLT_EVAL_METHOD; - switch (flt_eval_method) - { - case -1: - case 0: - /* Either the target acts unpredictably (-1) or has all the - operations required not to have excess precision (0). */ - flag_excess_precision = EXCESS_PRECISION_FAST; - break; - case 1: - case 2: - /* In these cases, predictable excess precision makes - sense. */ - break; - default: - /* Any other implementation-defined FLT_EVAL_METHOD values - require the compiler to handle the associated excess - precision rules in excess_precision_type. */ - gcc_unreachable (); - } - } } /* Initialize things that are both lang-dependent and target-dependent. |