diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-04-25 19:35:28 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2020-04-25 19:35:28 +0000 |
commit | 8b0c364e7dbc9f36cf350ffc3fb6ac477e79bd2e (patch) | |
tree | 5d49dd2c1cbdf205e7bae970271eaba9b8c22556 | |
parent | 4e83a9c50577264661bbb1e88d35a6bb5b7e8e23 (diff) | |
download | fpc-8b0c364e7dbc9f36cf350ffc3fb6ac477e79bd2e.tar.gz |
* correctly set register size
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@45076 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/x86/aoptx86.pas | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index 569aa86c23..e76697282f 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -5232,7 +5232,13 @@ unit aoptx86; if not(RegUsedAfterInstruction(taicpu(p).oper[1]^.reg,hp1,TmpUsedRegs)) then begin DebugMsg(SPeepholeOptimization + 'MovxMov2Movx',p); - taicpu(p).loadreg(1,taicpu(hp1).oper[1]^.reg); +{$ifdef x86_64} + if (taicpu(p).opsize in [S_BL,S_WL]) and + (taicpu(hp1).opsize=S_Q) then + taicpu(p).loadreg(1,newreg(R_INTREGISTER,getsupreg(taicpu(hp1).oper[1]^.reg),R_SUBD)) + else +{$endif x86_64} + taicpu(p).loadreg(1,taicpu(hp1).oper[1]^.reg); asml.remove(hp1); hp1.Free; end; |