diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-05 15:28:59 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-05 15:28:59 +0000 |
commit | 354bbdb6bac8630e8f3e14d85ce9451eca8cf2a8 (patch) | |
tree | b35c958fa28f08c28032e35dd056af7d988acc37 /gcc/go/gofrontend/expressions.h | |
parent | 5f25b464a8e3935b9b1bd47e6b652e79d4824102 (diff) | |
download | gcc-354bbdb6bac8630e8f3e14d85ce9451eca8cf2a8.zip gcc-354bbdb6bac8630e8f3e14d85ce9451eca8cf2a8.tar.gz gcc-354bbdb6bac8630e8f3e14d85ce9451eca8cf2a8.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/91915
From-SVN: r257390
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..3acaeb2 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_zero(const mpfr_t, int bits); + // The kinds of constants. enum Classification { |