Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo/arm64: math.Log2(1) != 0 #7074

Closed
mwhudson opened this issue Jan 7, 2014 · 2 comments
Closed

gccgo/arm64: math.Log2(1) != 0 #7074

mwhudson opened this issue Jan 7, 2014 · 2 comments

Comments

@mwhudson
Copy link
Contributor

mwhudson commented Jan 7, 2014

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Set up the preview go environment described here:
https://groups.google.com/d/msg/golang-dev/zHkWq3D92-4/5CI0bzTGO1sJ
2. Put this file on the model:

package main

import "math"

func main() {
    println(math.Log2(1))
}


3. go run log2.go

What is the expected output?

+0.000000e+000

What do you see instead?

+4.756597e-017

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo.

Which operating system are you using?

Ubuntu Trusty.


Which version are you using?  (run 'go version')

4.8, 4.9.

Please provide any additional information below.

This is because gccgo uses a fused multiply add instruction in its compilation of
math.Log2.  Probably all of math (or even all of libgo) should be compiled with
-ffp-contract=off.
@davecheney
Copy link
Contributor

Comment 1:

Labels changed: added repo-gccgo.

@ianlancetaylor
Copy link
Contributor

Comment 3:

Fixed on tip.
https://code.google.com/p/gofrontend/source/detail?r=fab30412b3c4983e1e6c866bfa3af1f90015c249

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants