-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Image test failure on linux/darwin amd64 with -o:speed on LLVM 17 & 18 #3480
Comments
Found the issue, bottom line is we hit undefined behaviour. During the blend of PNG images we have this part of the code: which overflows, ok, that can still be as designed, Odin should not have undefined behaviour so should be fine. But then: package main
import "core:fmt"
main :: proc() {
oh := f32(65535)
no := u8(oh)
fmt.println(no) // 255 on -o:none, 0 on -o:speed
} This all took me way way too long to get to the bottom of for it to be so simple |
I've also replicated it on Windows and Linux on other optimization levels:
|
Fixed via 8fcfd8c |
Context
While trying to verify #3308 by running all tests with optimisations turned on, I found this test failure that has been there for a while already. I couldn't figure it out in reasonable time there, so I am making this issue.
Reproduced on Linux and Darwin amd64, with
-o:speed
on LLVM 17 and 18.There is even a comment by @Kelimion in the test file mentioning failure
Odin/tests/core/image/test_core_image.odin
Line 1494 in c72a269
Steps to Reproduce
odin run tests/core/image -o:speed
The text was updated successfully, but these errors were encountered: