Skip to content
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

Fix miscompilation in comballoc for local allocations #829

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/comballoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ let rec combine i allocstate =
let newnext = combine_restart i.next in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext,
allocstate)
| Iop(Ibeginregion|Iendregion) -> begin
match allocstate with
| Pending_alloc { mode = Alloc_local; _ } ->
let newnext = combine_restart i.next in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, allocstate)
| No_alloc | Pending_alloc { mode = Alloc_heap; _ } ->
let newnext, s' = combine i.next allocstate in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')
end
| Iop _ ->
mshinwell marked this conversation as resolved.
Show resolved Hide resolved
let (newnext, s') = combine i.next allocstate in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')
Expand Down