(* Add a preference from one reg to another.
Do not add anything if the two registers conflict,
- or if the source register already has a location. *)
+ or if the source register already has a location,
+ or if the two registers belong to different classes.
+ (The last case can occur e.g. on Sparc when passing
+ float arguments in integer registers, PR#6227.) *)
let add_pref weight r1 r2 =
if weight > 0 then begin
let i = r1.stamp and j = r2.stamp in
if i <> j
&& r1.loc = Unknown
+ && Proc.register_class r1 = Proc.register_class r2
&& (let p = if i < j then (i, j) else (j, i) in
not (IntPairSet.mem p !mat))
then r1.prefer <- (r2, weight) :: r1.prefer
if Config.system = "sunos" then "_" else ""
let emit_symbol s =
- if String.length s >= 1 & s.[0] = '.'
+ if String.length s >= 1 && s.[0] = '.'
then emit_string s
else begin emit_string symbol_prefix; Emitaux.emit_symbol '$' s end
i.arg.(0).typ <> Float && i.res.(0).typ <> Float
| Iconst_int n -> is_native_immediate n
| Istackoffset _ -> true
- | Iload(_, Iindexed n) -> i.res.(0).typ <> Float & is_immediate n
- | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float & is_immediate n
+ | Iload(_, Iindexed n) -> i.res.(0).typ <> Float && is_immediate n
+ | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float && is_immediate n
| Iintop(op) -> is_one_instr_op op
| Iintop_imm(op, _) -> is_one_instr_op op
| Iaddf | Isubf | Imulf | Idivf -> true
emit_instr i.next (Some i);
emit_all i.next.next
| {next = {desc = Lop(Itailcall_imm s)}}
- when s = !function_name & is_one_instr i ->
+ when s = !function_name && is_one_instr i ->
emit_instr i.next (Some i);
emit_all i.next.next
| {next = {desc = Lop(Icall_ind)}}
- when is_one_instr i & no_interference i.res i.next.arg ->
+ when is_one_instr i && no_interference i.res i.next.arg ->
emit_instr i.next (Some i);
emit_all i.next.next
| {next = {desc = Lcondbranch(_, _)}}
- when is_one_instr i & no_interference i.res i.next.arg ->
+ when is_one_instr i && no_interference i.res i.next.arg ->
emit_instr i.next (Some i);
emit_all i.next.next
| _ ->