Browse Source

* 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 years ago
parent
commit
ad7c3d9a09
1 changed files with 5 additions and 3 deletions
  1. 5 3
      compiler/x86/aoptx86.pas

+ 5 - 3
compiler/x86/aoptx86.pas

@@ -1788,14 +1788,16 @@ unit aoptx86;
           InternalError(2020072501);
           InternalError(2020072501);
 
 
         { do not mess with the stack point as adjusting it by lea is recommend, except if we optimize for size }
         { 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
            not(cs_opt_size in current_settings.optimizerswitches) then
            exit;
            exit;
 
 
          with p.oper[0]^.ref^ do
          with p.oper[0]^.ref^ do
           begin
           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;
             l:=offset;
             if (l=1) and UseIncDec then
             if (l=1) and UseIncDec then