forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 22
Floating point comparison miscompilation #41
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
Comments
Hi @aykevl ! This problem corrected in xtensa_release_11.0.0 branch, please check it |
Thank you! I have tested this and it is indeed fixed with the LLVM 11 branch. |
aykevl
added a commit
to tinygo-org/tinygo
that referenced
this issue
Dec 3, 2020
This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see espressif/llvm-project#41).
aykevl
added a commit
to tinygo-org/tinygo
that referenced
this issue
Dec 10, 2020
This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see espressif/llvm-project#41).
deadprogram
pushed a commit
to tinygo-org/tinygo
that referenced
this issue
Dec 11, 2020
This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see espressif/llvm-project#41).
deadprogram
pushed a commit
to tinygo-org/tinygo
that referenced
this issue
Dec 11, 2020
This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see espressif/llvm-project#41).
premek
pushed a commit
to premek/tinygo
that referenced
this issue
Dec 15, 2020
This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see espressif/llvm-project#41).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following C code:
When I call this with
identify(20)
(where 20 is the floating point value with bits 0x41a00000, see here) the function will return 5. This is clearly incorrect, asv
is 20 which is bigger than 0. Note thatsideeffect
doesn't do anything, but without some external call the misbehavior appears to be optimized away.I have seen the same issue with other positive integers, I don't think the actual number matters.
I found the issue originally in TinyGo (runtime.printfloat32) but managed to reduce it and convert it to C while still maintaining the incorrect behavior.
This issue might be a duplicate of #20.
The text was updated successfully, but these errors were encountered: