From 52842a094ad0d1efb7477f5ee14c1fa623a3e163 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 12 Dec 2022 18:14:31 +0300 Subject: [PATCH] Require temporary register for passing argument through stack --- ir_aarch64.dasc | 2 ++ ir_x86.dasc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ir_aarch64.dasc b/ir_aarch64.dasc index 7b3033e..7dd2411 100644 --- a/ir_aarch64.dasc +++ b/ir_aarch64.dasc @@ -286,6 +286,8 @@ static bool ir_call_needs_tmp_int_reg(ir_ctx *ctx, ir_insn *insn) if (int_param > 0) { return 1; /* for swap */ } + } else { + return 1; /* for mem -> stack copy */ } int_param++; } diff --git a/ir_x86.dasc b/ir_x86.dasc index 96c6fbb..c17e189 100644 --- a/ir_x86.dasc +++ b/ir_x86.dasc @@ -561,6 +561,8 @@ static bool ir_call_needs_tmp_int_reg(ir_ctx *ctx, ir_insn *insn) if (int_param > 0) { return 1; /* for swap */ } + } else { + return 1; /* for mem -> stack copy */ } } int_param++;