From 9eb9f4f2023d4d968c0cbc4a103ad47332b288ae Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 27 Dec 2013 04:15:02 +0100 Subject: mcode: fix register allocation for Oe_Neg_Ov --- ortho/mcode/ortho_code-exprs.adb | 2 +- ortho/mcode/ortho_code-x86-insns.adb | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ortho/mcode/ortho_code-exprs.adb b/ortho/mcode/ortho_code-exprs.adb index ecab782..b784059 100644 --- a/ortho/mcode/ortho_code-exprs.adb +++ b/ortho/mcode/ortho_code-exprs.adb @@ -1551,7 +1551,7 @@ package body Ortho_Code.Exprs is Disp_Mode (Get_Expr_Mode (N)); Put (" "); Put (OE_Kind'Image (Get_Expr_Kind (N))); - Set_Col (Indent + 26); + Set_Col (Indent + 28); -- Put (Abi.Image_Insn (Get_Expr_Insn (N))); -- Put (" "); Put (Abi.Image_Reg (Get_Expr_Reg (N))); diff --git a/ortho/mcode/ortho_code-x86-insns.adb b/ortho/mcode/ortho_code-x86-insns.adb index 9ef6385..309d8f2 100644 --- a/ortho/mcode/ortho_code-x86-insns.adb +++ b/ortho/mcode/ortho_code-x86-insns.adb @@ -1692,7 +1692,10 @@ package body Ortho_Code.X86.Insns is end if; Left := Gen_Insn (Left, R_Any_Cc, Pnum); Set_Expr_Operand (Stmt, Left); - Set_Expr_Reg (Stmt, Inverse_Cc (Get_Expr_Reg (Left))); + Reg_Res := Inverse_Cc (Get_Expr_Reg (Left)); + Free_Cc; + Set_Expr_Reg (Stmt, Reg_Res); + Alloc_Cc (Stmt, Pnum); return Stmt; when R_Irm | R_Rm @@ -1703,7 +1706,9 @@ package body Ortho_Code.X86.Insns is end case; Left := Gen_Insn (Left, Reg_Res, Pnum); Set_Expr_Operand (Stmt, Left); - Set_Expr_Reg (Stmt, Get_Expr_Reg (Left)); + Reg_Res := Get_Expr_Reg (Left); + Free_Insn_Regs (Left); + Set_Expr_Reg (Stmt, Alloc_Reg (Reg_Res, Stmt, Pnum)); Link_Stmt (Stmt); return Stmt; when OE_Conv => -- cgit