diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-02 20:01:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-02 20:01:37 +0000 |
commit | 501699af1603287b1b47ac450fd6eeb826aa76b1 (patch) | |
tree | 3eeb8918d39d675108073c8b76d6dd10586a608c /libgo/go/strconv | |
parent | 34c5f21a387dc461042bafc3052ce6e1af786a77 (diff) | |
download | gcc-501699af1603287b1b47ac450fd6eeb826aa76b1.zip gcc-501699af1603287b1b47ac450fd6eeb826aa76b1.tar.gz gcc-501699af1603287b1b47ac450fd6eeb826aa76b1.tar.bz2 |
libgo: Update to weekly.2012-02-22 release.
From-SVN: r184819
Diffstat (limited to 'libgo/go/strconv')
-rw-r--r-- | libgo/go/strconv/atof.go | 6 | ||||
-rw-r--r-- | libgo/go/strconv/itoa_test.go | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/strconv/atof.go b/libgo/go/strconv/atof.go index cd3031b..d99117b 100644 --- a/libgo/go/strconv/atof.go +++ b/libgo/go/strconv/atof.go @@ -13,6 +13,7 @@ package strconv // 3) Multiply by 2^precision and round to get mantissa. import "math" +import "runtime" var optimize = true // can change for testing @@ -300,6 +301,11 @@ func (d *decimal) atof64() (f float64, ok bool) { if d.nd > 15 { return } + // gccgo gets this wrong on 32-bit i386 when not using -msse. + // See TestRoundTrip in atof_test.go for a test case. + if runtime.GOARCH == "386" { + return + } switch { case d.dp == d.nd: // int f := d.atof64int() diff --git a/libgo/go/strconv/itoa_test.go b/libgo/go/strconv/itoa_test.go index bac23e6..63d2fa4 100644 --- a/libgo/go/strconv/itoa_test.go +++ b/libgo/go/strconv/itoa_test.go @@ -127,6 +127,7 @@ func TestUitoa(t *testing.T) { } func numAllocations(f func()) int { + runtime.GC() memstats := new(runtime.MemStats) runtime.ReadMemStats(memstats) n0 := memstats.Mallocs |