소스 검색

Do not modify $sp inside function body for mipscpu

git-svn-id: trunk@21536 -
pierre 13 년 전
부모
커밋
4d8ebe5d1e
1개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 9 5
      compiler/mips/ncpucall.pas

+ 9 - 5
compiler/mips/ncpucall.pas

@@ -45,15 +45,19 @@ uses
 
 procedure tMIPSELcallnode.extra_call_code;
 begin
-  if pushedparasize > 0 then
-    current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_ADDIU, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, -pushedparasize));
+  { MIPS functions should never modify the stack pointer
+    after the prologue.
+    Enough space must be allocated inside the prologue, not after.  }
+  //  if pushedparasize > 0 then
+  //  current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_ADDIU, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, -pushedparasize));
 end;
 
 procedure tMIPSELcallnode.extra_post_call_code;
 begin
-  if pushedparasize > 0 then
-    current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_ADDIU, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, pushedparasize));
-
+  { MIPS functions should never modify the stack pointer
+    after the prologue.
+   // if pushedparasize > 0 then
+   // current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_ADDIU, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, pushedparasize));
 end;