mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 01:50:48 +08:00
c4fa3728ab
This patch implements the following set of changes: 1. If a component flag of -ffast-math (or -funsafe-math-optimizations) is explicitly set (or reset) on the command line, this should override any implicit change due to -f(no-)fast-math, no matter in which order the flags come on the command line. This change affects all flags. 2. Any component flag modified from its default by -ffast-math should be reset to the default by -fno-fast-math. This was previously not done for the following flags: -fcx-limited-range -fexcess-precision= 3. Once -ffinite-math-only is true, the -f(no-)signaling-nans flag has no meaning (if we have no NaNs at all, it does not matter whether there is a difference between quiet and signaling NaNs). Therefore, it does not make sense for -ffast-math to imply -fno-signaling-nans. (This is also a documentation change.) 4. -ffast-math is documented to imply -fno-rounding-math, however the latter setting is the default anyway; therefore it does not make sense to try to modify it from its default setting. 5. The __FAST_MATH__ preprocessor macro should be defined if and only if all the component flags of -ffast-math are set to the value that is documented as the effect of -ffast-math. The following flags were currently *not* so tested: -fcx-limited-range -fassociative-math -freciprocal-math -frounding-math (Note that we should still *test* for -fno-rounding-math here even though it is not set as to 4. -ffast-math -frounding-math should not set the __FAST_MATH__ macro.) This is also a documentation change. 2020-11-24 Ulrich Weigand <uweigand@de.ibm.com> gcc/ * doc/invoke.texi (-ffast-math): Remove mention of -fno-signaling-nans. Clarify conditions when __FAST_MATH__ preprocessor macro is defined. * opts.c (common_handle_option): Pass OPTS_SET to set_fast_math_flags and set_unsafe_math_optimizations_flags. (set_fast_math_flags): Add OPTS_SET argument, and use it to avoid setting flags already explicitly set on the command line. In the !set case, also reset x_flag_cx_limited_range and x_flag_excess_precision. Never reset x_flag_signaling_nans or x_flag_rounding_math. (set_unsafe_math_optimizations_flags): Add OPTS_SET argument, and use it to avoid setting flags already explicitly set on the command line. (fast_math_flags_set_p): Also test x_flag_cx_limited_range, x_flag_associative_math, x_flag_reciprocal_math, and x_flag_rounding_math.
…
…
…
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C++
31.9%
C
31.3%
Ada
12%
D
6.5%
Go
6.4%
Other
11.5%