Răsfoiți Sursa

* don't convert lea to add/inc/dec/sub if there's a symbol in the reference
o fixes make cycle on Darwin/i386

git-svn-id: trunk@46448 -

Jonas Maebe 5 ani în urmă
părinte
comite
ad7c3d9a09
1 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 5 3
      compiler/x86/aoptx86.pas

+ 5 - 3
compiler/x86/aoptx86.pas

@@ -1788,14 +1788,16 @@ unit aoptx86;
           InternalError(2020072501);
 
         { do not mess with the stack point as adjusting it by lea is recommend, except if we optimize for size }
-         if (taicpu(p).oper[1]^.reg=NR_STACK_POINTER_REG) and
+         if (p.oper[1]^.reg=NR_STACK_POINTER_REG) and
            not(cs_opt_size in current_settings.optimizerswitches) then
            exit;
 
          with p.oper[0]^.ref^ do
           begin
-            if (base <> p.oper[1]^.reg) or (index <> NR_NO) then
-              Exit(False);
+            if (base <> p.oper[1]^.reg) or
+               (index <> NR_NO) or
+               assigned(symbol) then
+              exit;
 
             l:=offset;
             if (l=1) and UseIncDec then