Skip to content

Commit e3b1ba3

Browse files
authored
Fix 32-bit build (#138)
1 parent c9591dc commit e3b1ba3

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

backend/i386/selection.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ let rec float_needs = function
8989
let n1 = float_needs arg1 in
9090
let n2 = float_needs arg2 in
9191
if n1 = n2 then 1 + n1 else if n1 > n2 then n1 else n2
92-
| Cop(Cextcall { name = fn }, args, _dbg)
92+
| Cop(Cextcall { func = fn }, args, _dbg)
9393
when !fast_math && List.mem fn inline_float_ops ->
9494
begin match args with
9595
[arg] -> float_needs arg
@@ -168,7 +168,7 @@ method is_immediate_test _cmp _n = true
168168

169169
method! is_simple_expr e =
170170
match e with
171-
| Cop(Cextcall { name = fn; }, args, _)
171+
| Cop(Cextcall { func = fn; }, args, _)
172172
when !fast_math && List.mem fn inline_float_ops ->
173173
(* inlined float ops are simple if their arguments are *)
174174
List.for_all self#is_simple_expr args
@@ -177,7 +177,7 @@ method! is_simple_expr e =
177177

178178
method! effects_of e =
179179
match e with
180-
| Cop(Cextcall { name = fn; }, args, _)
180+
| Cop(Cextcall { func = fn; }, args, _)
181181
when !fast_math && List.mem fn inline_float_ops ->
182182
Selectgen.Effect_and_coeffect.join_list_map args self#effects_of
183183
| _ ->
@@ -239,7 +239,7 @@ method! select_operation op args dbg =
239239
super#select_operation op args dbg
240240
end
241241
(* Recognize inlined floating point operations *)
242-
| Cextcall { name = fn; alloc = false; _ }
242+
| Cextcall { func = fn; alloc = false; _ }
243243
when !fast_math && List.mem fn inline_float_ops ->
244244
(Ispecific(Ifloatspecial fn), args)
245245
(* Default *)

middle_end/flambda2/naming/name_occurrences.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ end = struct
108108
t land 0xfffff
109109

110110
let num_occurrences_in_types t =
111-
(t land 0xfffff_00000) lsr 20
111+
(* The constant is computed to avoid problems when the host system
112+
is 32 bit. *)
113+
(t land (0xfffff lsl 20)) lsr 20
112114

113115
let num_occurrences_phantom t =
114-
(t land 0xfffff_00000_00000) lsr 40
116+
(t land (0xfffff lsl 40)) lsr 40
115117

116118
let encode_normal_occurrences num =
117119
assert (num >= 0 && num <= 0xfffff); (* CR mshinwell: proper error *)
@@ -129,10 +131,10 @@ end = struct
129131
num land (lnot 0xfffff)
130132

131133
let without_in_types_occurrences num =
132-
num land (lnot 0xfffff_00000)
134+
num land (lnot (0xfffff lsl 20))
133135

134136
let without_phantom_occurrences num =
135-
num land (lnot 0xfffff_00000_00000)
137+
num land (lnot (0xfffff lsl 40))
136138

137139
let to_map t =
138140
Kind.Map.empty

0 commit comments

Comments
 (0)