Fix wrong register typing in float (and boxed int) unboxing#2083
Fix wrong register typing in float (and boxed int) unboxing#2083trefis merged 9 commits intoocaml:trunkfrom
Conversation
|
I'd be in favor of backporting to the 4.07 branch and make an rc2. |
|
Suggested by @lpw25 and yours truly. The patch looks correct to me. |
Apologies :) |
|
check_typo was unhappy, I pushed a fix as well as a changelog entry; all the other tests passed. |
|
I see the same header-ignoring logic in the third case of the |
|
Well spotted. I think that code is wrong as well but won't actually cause a failure at present (because the types of registers used to hold unboxed integers and arbitrary values are compatible with respect to "join" in |
|
I've pushed a fix for |
|
@chambart Could you please look at this? |
|
@damiendoligez Do you want to backport this to 4.07? It is needed to avoid a failure when compiling Owl, so I understand. |
|
Looks good to me. You could be a bit more aggressive in that case: It would be sensible to produce some kind of trap (like the Uunreachable case). |
|
@chambart Agreed. However, I think that would involve adding cases that explicitly match the ill-typed cases, in addition to the well-typed cases that are picked out at the moment. I'm not sure if it's worth doing this. In the back of my mind I have that the next version of Flambda should have eliminated these branches (or replaced them with traps) by the time we get here. How strongly do you feel about this? |
|
@chambart Ping (we should make sure this goes into 4.08) |
|
Note: unless @chambart speaks up, I will rebase and merge this on Tuesday. |
|
@trefis Pierre is away for a while. I think it's ok to merge this in its current form, and if needs be it can be improved upon later. |
$ ocamlrun ocamlopt -I %{root}/runtime -nostdlib -I %{root}/stdlib -o unbox_under_switch.opt unbox_under_switch.ml
Fatal error: exception File "asmcomp/cmm.ml", line 83, characters 4-10: Assertion failed
Raised at file "asmcomp/cmm.ml", line 83, characters 4-16
Called from file "asmcomp/selectgen.ml", line 152, characters 13-51
Called from file "asmcomp/selectgen.ml", line 777, characters 18-42
Called from file "asmcomp/selectgen.ml", line 679, characters 18-39
Called from file "asmcomp/selectgen.ml", line 1108, characters 18-39
Called from file "asmcomp/selectgen.ml", line 1214, characters 2-35
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "asmcomp/asmgen.ml", line 106, characters 2-75
Called from file "list.ml", line 107, characters 12-15
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "asmcomp/asmgen.ml", line 176, characters 2-140
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "asmcomp/asmgen.ml", line 155, characters 7-231
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "driver/optcompile.ml", line 68, characters 7-198
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "driver/compile_common.ml", line 123, characters 6-68
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "utils/misc.ml", line 31, characters 8-15
Re-raised at file "utils/misc.ml", line 45, characters 40-48
Called from file "driver/compenv.ml", line 588, characters 6-57
Called from file "list.ml", line 107, characters 12-15
Called from file "driver/compenv.ml", line 664, characters 2-61
Called from file "driver/optmain.ml", line 270, characters 6-163
Re-raised at file "parsing/location.ml", line 633, characters 22-25
Called from file "driver/optmain.ml", line 336, characters 6-37
Called from file "driver/optmain.ml", line 340, characters 2-9
… boxed integer cases too
This was initially noticed when building Owl with
-inline 20, which caused that call to Ctypes.(!@) to be inlined.The bug is also present (and was noticed) on 4.07.
The fix was suggested by @lpw25.