Browse Source

* be carefully with references using RIP when doing LeaOp2Op optimizations

git-svn-id: trunk@43460 -
florian 5 years ago
parent
commit
6bed497c7c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      compiler/x86/aoptx86.pas

+ 3 - 0
compiler/x86/aoptx86.pas

@@ -2450,6 +2450,9 @@ unit aoptx86;
                   (taicpu(p).oper[0]^.ref^.segment=NR_NO) and (taicpu(hp1).oper[ref]^.ref^.segment=NR_NO)
 {$ifdef x86_64}
                   and (abs(taicpu(hp1).oper[ref]^.ref^.offset+taicpu(p).oper[0]^.ref^.offset)<=$7fffffff)
+                  and (((taicpu(p).oper[0]^.ref^.base<>NR_RIP) and (taicpu(p).oper[0]^.ref^.index<>NR_RIP)) or
+                       ((taicpu(hp1).oper[ref]^.ref^.base=NR_NO) and (taicpu(hp1).oper[ref]^.ref^.index=NR_NO))
+                      )
 {$endif x86_64}
                   then
                   begin