Browse Source

* continue to use lea to adjust the stack pointer, it is the recommended way

git-svn-id: trunk@25903 -
florian 11 years ago
parent
commit
440cb33e80
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/i386/popt386.pas

+ 5 - 2
compiler/i386/popt386.pas

@@ -1036,7 +1036,10 @@ begin
                             p := hp1;
                             p := hp1;
                             continue;
                             continue;
                           end
                           end
-                        else
+                        { continue to use lea to adjust the stack pointer,
+                          it is the recommended way, but only if not optimizing for size }
+                        else if (taicpu(p).oper[1]^.reg<>NR_STACK_POINTER_REG) or
+                          (cs_opt_size in current_settings.optimizerswitches) then
                           with taicpu(p).oper[0]^.ref^ do
                           with taicpu(p).oper[0]^.ref^ do
                             if (base = taicpu(p).oper[1]^.reg) then
                             if (base = taicpu(p).oper[1]^.reg) then
                               begin
                               begin
@@ -1055,7 +1058,7 @@ begin
                                   end
                                   end
                                 else
                                 else
                                   begin
                                   begin
-                                    if (l<0) and (l<>$80000000) then
+                                    if (l<0) and (l<>-2147483648) then
                                       begin
                                       begin
                                         taicpu(p).opcode := A_SUB;
                                         taicpu(p).opcode := A_SUB;
                                         taicpu(p).loadConst(0,-l);
                                         taicpu(p).loadConst(0,-l);