Commit db02da79 by Roger Sayle Committed by Roger Sayle

common.opt (fsigned-zeros): New command line option.


	* common.opt (fsigned-zeros): New command line option.
	* flags.h (HONOR_SIGNED_ZEROS): Control via flag_signed_zeros instead
	of flag_unsafe_math_optimizations.
	* opts.c (set_fast_math_flags): The -ffast-math command line option
	implies -fno-signed-zeros.
	(fast_math_flags_set_p): Likewise.

	* doc/invoke.texi: Document new -fno-signed-zeros option, and update
	the documentation of -ffast-math appropriately.  Wrap long lines.

	* gcc.dg/pr30172-1.c: Specify the -fno-signed-zeros command line
	option instead of -funsafe-math-optimizations.

From-SVN: r120978
parent d88c6456
2007-01-19 Roger Sayle <roger@eyesopen.com>
* common.opt (fsigned-zeros): New command line option.
* flags.h (HONOR_SIGNED_ZEROS): Control via flag_signed_zeros instead
of flag_unsafe_math_optimizations.
* opts.c (set_fast_math_flags): The -ffast-math command line option
implies -fno-signed-zeros.
(fast_math_flags_set_p): Likewise.
* doc/invoke.texi: Document new -fno-signed-zeros option, and update
the documentation of -ffast-math appropriately. Wrap long lines.
2007-01-19 Steve Ellcey <sje@cup.hp.com> 2007-01-19 Steve Ellcey <sje@cup.hp.com>
* system.h (ASM_MAKE_LABEL_LINKONCE): Poison. * system.h (ASM_MAKE_LABEL_LINKONCE): Poison.
......
...@@ -845,6 +845,10 @@ fsignaling-nans ...@@ -845,6 +845,10 @@ fsignaling-nans
Common Report Var(flag_signaling_nans) Common Report Var(flag_signaling_nans)
Disable optimizations observable by IEEE signaling NaNs Disable optimizations observable by IEEE signaling NaNs
fsigned-zeros
Common Report Var(flag_signed_zeros) Init(1)
Disable floating point optimizations that ignore the IEEE signedness of zero
fsingle-precision-constant fsingle-precision-constant
Common Report Var(flag_single_precision_constant) Common Report Var(flag_single_precision_constant)
Convert floating point constants to single precision constants Convert floating point constants to single precision constants
......
...@@ -323,7 +323,8 @@ Objective-C and Objective-C++ Dialects}. ...@@ -323,7 +323,8 @@ Objective-C and Objective-C++ Dialects}.
-fno-default-inline -fno-defer-pop -fmove-loop-invariants @gol -fno-default-inline -fno-defer-pop -fmove-loop-invariants @gol
-fno-function-cse -fno-guess-branch-probability @gol -fno-function-cse -fno-guess-branch-probability @gol
-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
-funsafe-math-optimizations -funsafe-loop-optimizations -ffinite-math-only @gol -funsafe-math-optimizations -funsafe-loop-optimizations @gol
-ffinite-math-only -fno-signed-zeros @gol
-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
-fomit-frame-pointer -foptimize-register-move @gol -fomit-frame-pointer -foptimize-register-move @gol
-foptimize-sibling-calls -fprefetch-loop-arrays @gol -foptimize-sibling-calls -fprefetch-loop-arrays @gol
...@@ -5631,8 +5632,8 @@ them to store all pertinent intermediate computations into variables. ...@@ -5631,8 +5632,8 @@ them to store all pertinent intermediate computations into variables.
@opindex ffast-math @opindex ffast-math
Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @* Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
@option{-fno-trapping-math}, @option{-ffinite-math-only}, @option{-fno-trapping-math}, @option{-ffinite-math-only},
@option{-fno-rounding-math}, @option{-fno-signaling-nans} @option{-fno-rounding-math}, @option{-fno-signaling-nans},
and @option{fcx-limited-range}. @option{-fno-signed-zeros} and @option{fcx-limited-range}.
This option causes the preprocessor macro @code{__FAST_MATH__} to be defined. This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
...@@ -5655,9 +5656,9 @@ math functions. ...@@ -5655,9 +5656,9 @@ math functions.
The default is @option{-fmath-errno}. The default is @option{-fmath-errno}.
On Darwin systems, the math library never sets @code{errno}. There is therefore On Darwin systems, the math library never sets @code{errno}. There is
no reason for the compiler to consider the possibility that it might, therefore no reason for the compiler to consider the possibility that
and @option{-fno-math-errno} is the default. it might, and @option{-fno-math-errno} is the default.
@item -funsafe-math-optimizations @item -funsafe-math-optimizations
@opindex funsafe-math-optimizations @opindex funsafe-math-optimizations
...@@ -5685,6 +5686,16 @@ an exact implementation of IEEE or ISO rules/specifications. ...@@ -5685,6 +5686,16 @@ an exact implementation of IEEE or ISO rules/specifications.
The default is @option{-fno-finite-math-only}. The default is @option{-fno-finite-math-only}.
@item -fno-signed-zeros
@opindex fno-signed-zeros
Allow optimizations for floating point arithmetic that ignore the
signedness of zero. IEEE arithmetic specifies the behavior of
distinct +0.0 and -0.0 values, which then prohibits simplification
of expressions such as x+0.0 or 0.0*x (even with @option{-ffinte-math-only}).
This option implies that the sign of a zero result isn't significant.
The default is @option{-fsigned-zeros}.
@item -fno-trapping-math @item -fno-trapping-math
@opindex fno-trapping-math @opindex fno-trapping-math
Compile code assuming that floating-point operations cannot generate Compile code assuming that floating-point operations cannot generate
......
...@@ -281,7 +281,7 @@ extern const char *flag_random_seed; ...@@ -281,7 +281,7 @@ extern const char *flag_random_seed;
/* Like HONOR_NANS, but true if the given mode distinguishes between /* Like HONOR_NANS, but true if the given mode distinguishes between
positive and negative zero, and the sign of zero is important. */ positive and negative zero, and the sign of zero is important. */
#define HONOR_SIGNED_ZEROS(MODE) \ #define HONOR_SIGNED_ZEROS(MODE) \
(MODE_HAS_SIGNED_ZEROS (MODE) && !flag_unsafe_math_optimizations) (MODE_HAS_SIGNED_ZEROS (MODE) && flag_signed_zeros)
/* Like HONOR_NANS, but true if given mode supports sign-dependent rounding, /* Like HONOR_NANS, but true if given mode supports sign-dependent rounding,
and the rounding mode is important. */ and the rounding mode is important. */
......
...@@ -1076,6 +1076,7 @@ set_fast_math_flags (int set) ...@@ -1076,6 +1076,7 @@ set_fast_math_flags (int set)
flag_trapping_math = !set; flag_trapping_math = !set;
flag_unsafe_math_optimizations = set; flag_unsafe_math_optimizations = set;
flag_finite_math_only = set; flag_finite_math_only = set;
flag_signed_zeros = !set;
flag_errno_math = !set; flag_errno_math = !set;
if (set) if (set)
{ {
...@@ -1092,6 +1093,7 @@ fast_math_flags_set_p (void) ...@@ -1092,6 +1093,7 @@ fast_math_flags_set_p (void)
return (!flag_trapping_math return (!flag_trapping_math
&& flag_unsafe_math_optimizations && flag_unsafe_math_optimizations
&& flag_finite_math_only && flag_finite_math_only
&& !flag_signed_zeros
&& !flag_errno_math); && !flag_errno_math);
} }
......
2007-01-19 Roger Sayle <roger@eyesopen.com>
* gcc.dg/pr30172-1.c: Specify the -fno-signed-zeros command line
option instead of -funsafe-math-optimizations.
2007-01-19 Tomas Bily <tbily@suse.cz> 2007-01-19 Tomas Bily <tbily@suse.cz>
gcc.dg/tree-prof/indir-call-prof.c: New. gcc.dg/tree-prof/indir-call-prof.c: New.
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-funsafe-math-optimizations -ffinite-math-only -fdump-tree-gimple" } */ /* { dg-options "-fno-signed-zeros -ffinite-math-only -fdump-tree-gimple" } */
_Complex double test1 (double x) { return x + 1.i; } _Complex double test1 (double x) { return x + 1.i; }
_Complex double test2 (double x) { return 1 + x * 1.i; } _Complex double test2 (double x) { return 1 + x * 1.i; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment