aboutsummaryrefslogtreecommitdiffstats
path: root/ortho/mcode/ortho_code-x86-insns.adb
diff options
context:
space:
mode:
Diffstat (limited to 'ortho/mcode/ortho_code-x86-insns.adb')
-rw-r--r--ortho/mcode/ortho_code-x86-insns.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/ortho/mcode/ortho_code-x86-insns.adb b/ortho/mcode/ortho_code-x86-insns.adb
index 09dfdd7a4..4278bdc02 100644
--- a/ortho/mcode/ortho_code-x86-insns.adb
+++ b/ortho/mcode/ortho_code-x86-insns.adb
@@ -412,11 +412,11 @@ package body Ortho_Code.X86.Insns is
Mode : Mode_Type;
Reg_Orig : O_Reg;
begin
- Orig := Regs (Reg).Stmt;
- if Orig = O_Enode_Null then
+ if Regs (Reg).Num = O_Free then
-- This register was not allocated.
raise Program_Error;
end if;
+ Orig := Regs (Reg).Stmt;
-- Add a spill statement.
Mode := Get_Expr_Mode (Orig);
@@ -638,7 +638,9 @@ package body Ortho_Code.X86.Insns is
return Expr;
end if;
Free_R32 (Reg);
- return Insert_Move (Expr, Alloc_Reg (Dest, Expr, Num));
+ Spill := Insert_Move (Expr, Dest);
+ Alloc_R32 (Dest, Spill, Num);
+ return Spill;
when others =>
Error_Reg ("reload: unhandled dest in R32", Expr, Dest);
end case;
@@ -850,6 +852,7 @@ package body Ortho_Code.X86.Insns is
return N;
end Insert_Intrinsic;
+ -- REG is mandatory: the result of STMT must satisfy the REG constraint.
function Gen_Insn (Stmt : O_Enode; Reg : O_Reg; Pnum : O_Inum)
return O_Enode;