Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bb2d88e

Browse files
committedMar 5, 2025·
reverted changes to mixed block alloc
1 parent cc5f5eb commit bb2d88e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
 

‎backend/cmm_helpers.ml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1751,16 +1751,20 @@ let alloc_generic_set_fn block ofs newval memory_chunk dbg =
17511751
addr_array_initialize block ofs newval dbg
17521752
| Word_int -> generic_case ()
17531753
(* Generic cases that may differ under big endian archs *)
1754-
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed | Single _
1755-
| Double | Thirtytwo_unsigned | Thirtytwo_signed | Onetwentyeight_unaligned
1756-
| Onetwentyeight_aligned ->
1754+
| Single _ | Double | Thirtytwo_unsigned | Thirtytwo_signed
1755+
| Onetwentyeight_unaligned | Onetwentyeight_aligned ->
17571756
if Arch.big_endian
17581757
then
17591758
Misc.fatal_errorf
17601759
"Fields with memory_chunk %s are not supported on big-endian \
17611760
architectures"
17621761
(Printcmm.chunk memory_chunk);
17631762
generic_case ()
1763+
(* Forbidden cases *)
1764+
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed ->
1765+
Misc.fatal_errorf
1766+
"Fields with memory_chunk %s are not supported in generic allocations"
1767+
(Printcmm.chunk memory_chunk)
17641768

17651769
let make_alloc_generic ~block_kind ~mode ~alloc_block_kind dbg tag wordsize args
17661770
args_memory_chunks =
@@ -1860,17 +1864,19 @@ let make_mixed_alloc ~mode dbg ~tag ~value_prefix_size args args_memory_chunks =
18601864
(* regular scanned part of a block *)
18611865
match memory_chunk with
18621866
| Word_int | Word_val -> ok ()
1863-
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
1867+
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed ->
1868+
error "mixed blocks"
18641869
| Thirtytwo_unsigned | Thirtytwo_signed | Single _ | Double
18651870
| Onetwentyeight_unaligned | Onetwentyeight_aligned ->
18661871
error "the value prefix of a mixed block"
18671872
else
18681873
(* flat suffix part of the block *)
18691874
match memory_chunk with
18701875
| Word_int | Thirtytwo_unsigned | Thirtytwo_signed | Double
1871-
| Onetwentyeight_unaligned | Onetwentyeight_aligned | Single _
1872-
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed ->
1876+
| Onetwentyeight_unaligned | Onetwentyeight_aligned | Single _ ->
18731877
ok ()
1878+
| Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed ->
1879+
error "mixed blocks"
18741880
| Word_val -> error "the flat suffix of a mixed block")
18751881
0 args_memory_chunks
18761882
in

0 commit comments

Comments
 (0)
Please sign in to comment.