diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-06 15:30:06 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-06 15:30:06 +0000 |
commit | 3e12b42be93c14a599df9c96e58ba66cd864bf77 (patch) | |
tree | 4d375844ea14bdf771954d9e232206931c69405e /gcc/go/gofrontend/expressions.h | |
parent | 3ca8e91f0e4452f618dbdc82090ecf47d1bd984c (diff) | |
download | gcc-3e12b42be93c14a599df9c96e58ba66cd864bf77.zip gcc-3e12b42be93c14a599df9c96e58ba66cd864bf77.tar.gz gcc-3e12b42be93c14a599df9c96e58ba66cd864bf77.tar.bz2 |
compiler: avoid negative zero in float constants
Check for negative numbers with very small magnitudes that will round
to negative zero, and force them to positive zero instead.
This implements the spec clarification in https://golang.org/cl/14727.
The test is in https://golang.org/cl/91895.
Fixes golang/go#12621
Reviewed-on: https://go-review.googlesource.com/92175
From-SVN: r257415
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index d16a284..a58c79c 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -4220,6 +4220,9 @@ class Numeric_constant bool check_complex_type(Complex_type*, bool, Location); + static bool + is_float_neg_zero(const mpfr_t, int bits); + // The kinds of constants. enum Classification { |