Skip to content

Commit 8c64754

Browse files
authored
Fix make_check_all_arches (#54)
1 parent b50cd45 commit 8c64754

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

asmcomp/arm/emit.mlp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ let emit_instr i =
638638
| Double_u -> "fstd"
639639
| _ (* 32-bit quantities *) -> "str" in
640640
` {emit_string instr} {emit_reg r}, {emit_addressing addr i.arg 1}\n`; 1
641-
| Lop(Ialloc { bytes = n; dbginfo }) ->
641+
| Lop(Ialloc { bytes = n; dbginfo; mode = Alloc_heap }) ->
642642
let lbl_frame =
643643
record_frame_label i.live (Dbg_alloc dbginfo)
644644
in
@@ -672,6 +672,8 @@ let emit_instr i =
672672
`{emit_label lbl_frame}: add {emit_reg i.res.(0)}, alloc_ptr, #4\n`;
673673
1 + ninstr
674674
end
675+
| Lop(Ialloc { mode = Alloc_local } | Ibeginregion | Iendregion) ->
676+
Misc.fatal_error "Local allocations not supported on this architecture"
675677
| Lop(Iintop(Icomp cmp)) ->
676678
` cmp {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`;
677679
1 + emit_set_condition cmp i.res.(0)

asmcomp/arm64/emit.mlp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ module BR = Branch_relaxation.Make (struct
514514
| 16 | 24 | 32 -> 1
515515
| _ -> 1 + num_instructions_for_intconst (Nativeint.of_int num_bytes)
516516
end
517+
| Lop (Ibeginregion | Iendregion) ->
518+
Misc.fatal_error "Local allocations not supported on this architecture"
517519
| Lop (Iintop (Icomp _)) -> 2
518520
| Lop (Iintop_imm (Icomp _, _)) -> 2
519521
| Lop (Iintop (Icheckbound)) -> 2
@@ -769,10 +771,12 @@ let emit_instr i =
769771
| Word_int | Word_val | Double | Double_u ->
770772
` str {emit_reg src}, {emit_addressing addr base}\n`
771773
end
772-
| Lop(Ialloc { bytes = n; dbginfo }) ->
774+
| Lop(Ialloc { bytes = n; dbginfo; mode = Alloc_heap }) ->
773775
assembly_code_for_allocation i ~n ~far:false ~dbginfo
774776
| Lop(Ispecific (Ifar_alloc { bytes = n; dbginfo })) ->
775777
assembly_code_for_allocation i ~n ~far:true ~dbginfo
778+
| Lop(Ialloc { mode = Alloc_local } | Ibeginregion | Iendregion) ->
779+
Misc.fatal_error "Local allocations not supported on this architecture"
776780
| Lop(Iintop_imm(Iadd, n)) ->
777781
emit_addimm i.res.(0) i.arg.(0) n
778782
| Lop(Iintop_imm(Isub, n)) ->

asmcomp/power/emit.mlp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ module BR = Branch_relaxation.Make (struct
487487
else load_store_size addr
488488
| Lop(Istore(_chunk, addr, _)) -> load_store_size addr
489489
| Lop(Ialloc _) -> 4
490+
| Lop(Ibeginregion | Iendregion) ->
491+
Misc.fatal_error "Local allocations not supported on this architecture"
490492
| Lop(Ispecific(Ialloc_far _)) -> 5
491493
| Lop(Iintop Imod) -> 3
492494
| Lop(Iintop(Icomp _)) -> 4
@@ -754,13 +756,15 @@ let emit_instr i =
754756
| Single -> "stfs"
755757
| Double | Double_u -> "stfd" in
756758
emit_load_store storeinstr addr i.arg 1 i.arg.(0)
757-
| Lop(Ialloc { bytes = n; dbginfo }) ->
759+
| Lop(Ialloc { bytes = n; dbginfo; mode = Alloc_heap }) ->
758760
if !call_gc_label = 0 then call_gc_label := new_label ();
759761
` addi 31, 31, {emit_int(-n)}\n`;
760762
` {emit_string cmplg} 31, 30\n`;
761763
` bltl {emit_label !call_gc_label}\n`;
762764
record_frame i.live (Dbg_alloc dbginfo);
763765
` addi {emit_reg i.res.(0)}, 31, {emit_int size_addr}\n`;
766+
| Lop(Ialloc { mode = Alloc_local } | Ibeginregion | Iendregion) ->
767+
Misc.fatal_error "Local allocations not supported on this architecture"
764768
| Lop(Ispecific(Ialloc_far { bytes = n; dbginfo })) ->
765769
if !call_gc_label = 0 then call_gc_label := new_label ();
766770
let lbl = new_label() in

asmcomp/riscv/emit.mlp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ let emit_instr i =
369369
| Double | Double_u -> "fsd"
370370
in
371371
` {emit_string instr} {emit_reg i.arg.(0)}, {emit_int ofs}({emit_reg i.arg.(1)})\n`
372-
| Lop(Ialloc {bytes; dbginfo}) ->
372+
| Lop(Ialloc {bytes; dbginfo; mode = Alloc_heap}) ->
373373
let lbl_frame_lbl = record_frame_label i.live (Dbg_alloc dbginfo) in
374374
let lbl_after_alloc = new_label () in
375375
let lbl_call_gc = new_label () in
@@ -387,6 +387,8 @@ let emit_instr i =
387387
{ gc_lbl = lbl_call_gc;
388388
gc_return_lbl = lbl_after_alloc;
389389
gc_frame_lbl = lbl_frame_lbl } :: !call_gc_sites
390+
| Lop(Ialloc { mode = Alloc_local } | Ibeginregion | Iendregion) ->
391+
Misc.fatal_error "Local allocations not supported on this architecture"
390392
| Lop(Iintop(Icomp cmp)) ->
391393
begin match cmp with
392394
| Isigned Clt ->

asmcomp/s390x/emit.mlp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ let emit_instr i =
420420
| Double | Double_u -> "stdy" in
421421
emit_load_store storeinstr addr i.arg 1 i.arg.(0)
422422

423-
| Lop(Ialloc { bytes = n; dbginfo }) ->
423+
| Lop(Ialloc { bytes = n; dbginfo; mode = Alloc_heap }) ->
424424
let lbl_after_alloc = new_label() in
425425
let lbl_call_gc = new_label() in
426426
let lbl_frame =
@@ -437,6 +437,9 @@ let emit_instr i =
437437
`{emit_label lbl_after_alloc}:`;
438438
` la {emit_reg i.res.(0)}, 8(%r11)\n`
439439

440+
| Lop(Ialloc { mode = Alloc_local } | Ibeginregion | Iendregion) ->
441+
Misc.fatal_error "Local allocations not supported on this architecture"
442+
440443
| Lop(Iintop Imulh) ->
441444
(* Hacker's Delight section 8.3:
442445
mul-high-signed(a, b) = mul-high-unsigned(a, b)

0 commit comments

Comments
 (0)