-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
LLVM checked arithmetic for 128-bit ints is broken #4905
Comments
Oh, also 8-bit checked multiplies are also broken. Tracking that upstream bug here too. |
It would be nice to have the upstream bug url here, if one has been filed. |
I have not filed one. @loladiro has generally been our go-to guy for that interaction with the LLVM community. |
I'll verify against trunk and file a bug report, no problem. |
Thanks, Keno! |
Also broken for 64-bit ints on a 32-bit platform. |
Fixed upstream by llvm-mirror/llvm@0bedfa4 |
Mentioning |
What's the status of this? Are the other cases ( |
Just checked on Ubuntu 14.04, 32-bit, with LLVM 3.7: |
The codegen bug is fixed for all cases, but as mentioned there may still be missing run-time functions. |
This has been monkey-patched by #14362. Should we close this or wait for the run-time functions? |
#14362 didn't change anything for Julia users -- the work-around were already there before. |
compiler-rt support will be fixed by #17344 allowing fixing of the underlying issue here |
Fixed: julia> a = rand(Int128)
168787286807142666394438386944935173819
julia> b = rand(Int128)
20332519185114748867952745427073576754
julia> a + b
-151162560928681048200983475059759460883
julia> Base.Checked.checked_add(a, b)
ERROR: OverflowError: 168787286807142666394438386944935173819 + 20332519185114748867952745427073576754 overflowed for type Int128
Stacktrace:
[1] throw_overflowerr_binaryop(::Symbol, ::Int128, ::Int128) at ./checked.jl:154
[2] checked_add(::Int128, ::Int128) at ./checked.jl:166
[3] top-level scope at REPL[13]:1 I also checked UInt128 to be sure. |
@StefanKarpinski since this is fixed, can Line 43 in 8e3e970
|
I dunno, I guess see if you can revert and it still works. |
This is largely an upstream bug tracking issue.
The text was updated successfully, but these errors were encountered: