-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
compiletime evaluation of int32 values is not correct #9572
Comments
Here is the You want to fix it? |
No, thats not something I am able to fix. And it is likely that some other parts of Nim depend on this current dubious silent promotion of int32s in the VM. Things like Line 53 in 9c6620e
Line 61 in 9c6620e
@LemonBoy tried a fix in PR #9409, but this attempt failed at a much earlier stage than the lines quoted above. |
My attempt to sort an int32-array at compiletime on a 32bit system does raise an exception originating from Without using |
@skilchen I am pretty sure I fixed this bug, can you please verify? |
I can confirm it works now, unfortunately the CIs don't really support 32 bits. |
Example
Current Output
using a 64bit compilation, executing
nim c --verbosity:0 -r test.nim
produces:using 32bit compilation the same command produces:
Expected Output
on both 64bit and 32bit systems this should produce:
Additional Information
The failing sort of some numbers at compiletime on a 32bit system is the same as reported (among others) in issue #9138. It is a consequence of the silent promotion of the result of
xor
to some larger value thanhigh(int32)
.The text was updated successfully, but these errors were encountered: