aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/mcode
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-08-31 16:18:51 +0200
committerTristan Gingold <tgingold@free.fr>2015-08-31 16:18:51 +0200
commit4a5140cc1ebf57fbae15d268d5c553500e077dbe (patch)
tree0e52d2af078acac1e81f140dce7af21ec18e1fd1 /src/ortho/mcode
parent9ee4eb7cae2660b648105eb00486e561002ae1a7 (diff)
downloadghdl-4a5140cc1ebf57fbae15d268d5c553500e077dbe.tar.gz
ghdl-4a5140cc1ebf57fbae15d268d5c553500e077dbe.tar.bz2
ghdl-4a5140cc1ebf57fbae15d268d5c553500e077dbe.zip
mcode: fix crash wrt oe_shl.
Diffstat (limited to 'src/ortho/mcode')
-rw-r--r--src/ortho/mcode/ortho_code-x86-insns.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ortho/mcode/ortho_code-x86-insns.adb b/src/ortho/mcode/ortho_code-x86-insns.adb
index f96887436..c3d673041 100644
--- a/src/ortho/mcode/ortho_code-x86-insns.adb
+++ b/src/ortho/mcode/ortho_code-x86-insns.adb
@@ -1557,10 +1557,13 @@ package body Ortho_Code.X86.Insns is
and then Get_Expr_Kind (Right) = OE_Const
and then Get_Expr_Low (Right) in 0 .. 3
then
+ -- Becomes the index of the SIB.
Set_Expr_Reg (Stmt, R_I);
else
+ Reg_Res := Get_Expr_Reg (Left);
+ Set_Expr_Reg (Stmt, Reg_Res);
+ Renum_Reg (Reg_Res, Stmt, Pnum);
Link_Stmt (Stmt);
- Set_Expr_Reg (Stmt, Get_Expr_Reg (Left));
Free_Insn_Regs (Right);
end if;
return Stmt;