diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas
index 8cfe74f1ce..805bb0a4d3 100644
--- a/compiler/cgobj.pas
+++ b/compiler/cgobj.pas
@@ -417,8 +417,6 @@ unit cgobj;
              @param(usedinproc Registers which are used in the code of this routine)
           }
           procedure g_restore_standard_registers(list:Taasmoutput);virtual;abstract;
-          procedure g_save_all_registers(list : taasmoutput);virtual;abstract;
-          procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:TCGPara);virtual;abstract;
        end;
 
 {$ifndef cpu64bit}
@@ -1417,8 +1415,6 @@ implementation
          paraloc2.init;
          paramanager.getintparaloc(pocall_default,1,paraloc1);
          paramanager.getintparaloc(pocall_default,2,paraloc2);
-         { These functions should not change the registers (they use
-           the saveregister proc directive }
          if is_interfacecom(t) then
           incrfunc:='FPC_INTF_INCR_REF'
          else if is_ansistring(t) then
@@ -2031,7 +2027,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.180  2004-10-24 11:44:28  peter
+  Revision 1.181  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.180  2004/10/24 11:44:28  peter
     * small regvar fixes
     * loadref parameter removed from concatcopy,incrrefcount,etc
 
diff --git a/compiler/i386/cgcpu.pas b/compiler/i386/cgcpu.pas
index 0ca7886508..a426e1978b 100644
--- a/compiler/i386/cgcpu.pas
+++ b/compiler/i386/cgcpu.pas
@@ -43,8 +43,6 @@ unit cgcpu;
         procedure a_param_ref(list : taasmoutput;size : tcgsize;const r : treference;const cgpara : tcgpara);override;
         procedure a_paramaddr_ref(list : taasmoutput;const r : treference;const cgpara : tcgpara);override;
 
-        procedure g_save_all_registers(list : taasmoutput);override;
-        procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);override;
         procedure g_proc_exit(list : taasmoutput;parasize:longint;nostackframe:boolean);override;
         procedure g_copyvaluepara_openarray(list : taasmoutput;const ref:treference;const lenloc:tlocation;elesize:aint;destreg:tregister);override;
 
@@ -184,42 +182,6 @@ unit cgcpu;
       end;
 
 
-    procedure tcg386.g_save_all_registers(list : taasmoutput);
-      begin
-        list.concat(Taicpu.Op_none(A_PUSHA,S_L));
-        tg.GetTemp(list,sizeof(aint),tt_noreuse,current_procinfo.save_regs_ref);
-        a_load_reg_ref(list,OS_ADDR,OS_ADDR,NR_STACK_POINTER_REG,current_procinfo.save_regs_ref);
-      end;
-
-
-    procedure tcg386.g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);
-      var
-        href : treference;
-      begin
-        a_load_ref_reg(list,OS_ADDR,OS_ADDR,current_procinfo.save_regs_ref,NR_STACK_POINTER_REG);
-        tg.UnGetTemp(list,current_procinfo.save_regs_ref);
-        if assigned(funcretparaloc.location) and
-           (funcretparaloc.location^.loc=LOC_REGISTER) then
-          begin
-            if funcretparaloc.size in [OS_64,OS_S64] then
-              begin
-                reference_reset_base(href,NR_STACK_POINTER_REG,20);
-                a_load_reg_ref(list,OS_32,OS_32,NR_FUNCTION_RETURN64_HIGH_REG,href);
-                reference_reset_base(href,NR_STACK_POINTER_REG,28);
-                a_load_reg_ref(list,OS_32,OS_32,NR_FUNCTION_RETURN64_LOW_REG,href);
-              end
-            else
-              begin
-                reference_reset_base(href,NR_STACK_POINTER_REG,28);
-                a_load_reg_ref(list,OS_32,OS_32,NR_FUNCTION_RETURN_REG,href);
-              end;
-          end;
-        list.concat(Taicpu.Op_none(A_POPA,S_L));
-        { We add a NOP because of the 386DX CPU bugs with POPAD }
-        list.concat(taicpu.op_none(A_NOP,S_L));
-      end;
-
-
     procedure tcg386.g_proc_exit(list : taasmoutput;parasize:longint;nostackframe:boolean);
       var
         stacksize : longint;
@@ -558,7 +520,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.58  2004-10-24 11:44:28  peter
+  Revision 1.59  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.58  2004/10/24 11:44:28  peter
     * small regvar fixes
     * loadref parameter removed from concatcopy,incrrefcount,etc
 
diff --git a/compiler/i386/n386obj.pas b/compiler/i386/n386obj.pas
index e71f381fff..4e8e514d7c 100644
--- a/compiler/i386/n386obj.pas
+++ b/compiler/i386/n386obj.pas
@@ -47,9 +47,9 @@ uses
 
 {
 possible calling conventions:
-              default stdcall cdecl pascal register saveregisters
-default(0):      OK     OK    OK(1)  OK       OK          OK
-virtual(2):      OK     OK    OK(3)  OK       OK          OK(4)
+              default stdcall cdecl pascal register
+default(0):      OK     OK    OK(1)  OK       OK
+virtual(2):      OK     OK    OK(3)  OK       OK
 
 (0):
     set self parameter to correct value
@@ -196,8 +196,7 @@ begin
     end
   else if po_virtualmethod in procdef.procoptions then
     begin
-      if (procdef.proccalloption=pocall_register) or
-         (po_saveregisters in procdef.procoptions) then
+      if (procdef.proccalloption=pocall_register) then
         begin
           { case 4 }
           emit_reg(A_PUSH,S_L,NR_EBX); { allocate space for address}
@@ -239,7 +238,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.34  2004-06-20 08:55:31  florian
+  Revision 1.35  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.34  2004/06/20 08:55:31  florian
     * logs truncated
 
   Revision 1.33  2004/06/16 20:07:10  florian
diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas
index 626a580f47..cedd6fc327 100644
--- a/compiler/ncgcal.pas
+++ b/compiler/ncgcal.pas
@@ -883,10 +883,11 @@ implementation
                    { Load parameters that are in temporary registers in the
                      correct parameter register }
                    if assigned(left) then
-                     pushparas;
-
-                   { free the resources allocated for the parameters }
-                   freeparas;
+                     begin
+                       pushparas;
+                       { free the resources allocated for the parameters }
+                       freeparas;
+                     end;
 
                    cg.alloccpuregisters(exprasmlist,R_INTREGISTER,regs_to_save_int);
                    if cg.uses_registers(R_FPUREGISTER) then
@@ -903,10 +904,11 @@ implementation
                   { Load parameters that are in temporary registers in the
                     correct parameter register }
                   if assigned(left) then
-                    pushparas;
-
-                  { free the resources allocated for the parameters }
-                  freeparas;
+                    begin
+                      pushparas;
+                      { free the resources allocated for the parameters }
+                      freeparas;
+                    end;
 
                   cg.alloccpuregisters(exprasmlist,R_INTREGISTER,regs_to_save_int);
                   if cg.uses_registers(R_FPUREGISTER) then
@@ -943,10 +945,11 @@ implementation
               { Load parameters that are in temporary registers in the
                 correct parameter register }
               if assigned(left) then
-                pushparas;
-
-              { free the resources allocated for the parameters }
-              freeparas;
+                begin
+                  pushparas;
+                  { free the resources allocated for the parameters }
+                  freeparas;
+                end;
 
               cg.alloccpuregisters(exprasmlist,R_INTREGISTER,regs_to_save_int);
               if cg.uses_registers(R_FPUREGISTER) then
@@ -1062,7 +1065,7 @@ implementation
          { Allocate parameters and locals }
          gen_alloc_inline_parast(exprasmlist,tprocdef(procdefinition));
          gen_alloc_inline_funcret(exprasmlist,tprocdef(procdefinition));
-         gen_alloc_symtable(exprasmlist,tlocalsymtable(tprocdef(procdefinition).localst));
+         gen_alloc_symtable(exprasmlist,tprocdef(procdefinition).localst);
 
          { if we allocate the temp. location for ansi- or widestrings }
          { already here, we avoid later a push/pop                    }
@@ -1128,7 +1131,8 @@ implementation
 
          gen_load_para_value(inlineentrycode);
          { now that we've loaded the para's, free them }
-         freeparas;
+         if assigned(left) then
+           freeparas;
          gen_initialize_code(inlineentrycode);
          if po_assembler in current_procinfo.procdef.procoptions then
            inlineentrycode.insert(Tai_marker.Create(asmblockstart));
@@ -1243,7 +1247,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.180  2004-10-24 11:53:45  peter
+  Revision 1.181  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.180  2004/10/24 11:53:45  peter
     * fixed compilation with removed loadref
 
   Revision 1.179  2004/10/24 11:44:28  peter
diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas
index 4c907a40fb..aa06e3411f 100644
--- a/compiler/ncgutil.pas
+++ b/compiler/ncgutil.pas
@@ -59,6 +59,7 @@ interface
     procedure gen_proc_symbol_end(list:Taasmoutput);
     procedure gen_proc_entry_code(list:Taasmoutput);
     procedure gen_proc_exit_code(list:Taasmoutput);
+    procedure gen_stack_check_code(list:Taasmoutput);
     procedure gen_save_used_regs(list:TAAsmoutput);
     procedure gen_restore_used_regs(list:TAAsmoutput;const funcretparaloc:tcgpara);
     procedure gen_initialize_code(list:TAAsmoutput);
@@ -1677,32 +1678,11 @@ implementation
     procedure gen_proc_entry_code(list:Taasmoutput);
       var
         hitemp,
-        lotemp,
-        stackframe : longint;
-        check      : boolean;
-        paraloc1   : tcgpara;
-        href       : treference;
+        lotemp : longint;
       begin
-        paraloc1.init;
-
         { generate call frame marker for dwarf call frame info }
         dwarfcfi.start_frame(list);
 
-        { allocate temp for saving the argument used when
-          stack checking uses a register for pushing the stackframe size }
-        check:=(cs_check_stack in aktlocalswitches) and (current_procinfo.procdef.proctypeoption<>potype_proginit);
-        if check then
-          begin
-            { Allocate tempspace to store register parameter than
-              is destroyed when calling stackchecking code }
-            paramanager.getintparaloc(pocall_default,1,paraloc1);
-            if paraloc1.location^.loc=LOC_REGISTER then
-              tg.GetTemp(list,sizeof(aint),tt_normal,href);
-          end;
-
-        { Calculate size of stackframe }
-        stackframe:=current_procinfo.calc_stackframe_size;
-
         { All temps are know, write offsets used for information }
         if (cs_asm_source in aktglobalswitches) then
           begin
@@ -1721,29 +1701,7 @@ implementation
           end;
 
          { generate target specific proc entry code }
-         cg.g_proc_entry(list,stackframe,(po_nostackframe in current_procinfo.procdef.procoptions));
-
-         { Add stack checking code? }
-         if check then
-           begin
-             { The tempspace to store original register is already
-               allocated above before the stackframe size is calculated. }
-             if paraloc1.location^.loc=LOC_REGISTER then
-               cg.a_load_reg_ref(list,OS_INT,OS_INT,paraloc1.location^.register,href);
-             paramanager.allocparaloc(list,paraloc1);
-             cg.a_param_const(list,OS_INT,stackframe,paraloc1);
-             paramanager.freeparaloc(list,paraloc1);
-             cg.alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-             cg.a_call_name(list,'FPC_STACKCHECK');
-             cg.dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-             if paraloc1.location^.loc=LOC_REGISTER then
-               begin
-                 cg.a_load_ref_reg(list,OS_INT,OS_INT,href,paraloc1.location^.register);
-                 tg.UnGetTemp(list,href);
-               end;
-           end;
-
-        paraloc1.done;
+         cg.g_proc_entry(list,current_procinfo.calc_stackframe_size,(po_nostackframe in current_procinfo.procdef.procoptions));
       end;
 
 
@@ -1773,19 +1731,31 @@ implementation
       end;
 
 
+    procedure gen_stack_check_code(list:Taasmoutput);
+      var
+        paraloc1   : tcgpara;
+      begin
+        paraloc1.init;
+        paramanager.getintparaloc(pocall_default,1,paraloc1);
+        paramanager.allocparaloc(list,paraloc1);
+        cg.a_param_const(list,OS_INT,current_procinfo.calc_stackframe_size,paraloc1);
+        paramanager.freeparaloc(list,paraloc1);
+        cg.alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
+        cg.a_call_name(list,'FPC_STACKCHECK');
+        cg.dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
+        paraloc1.done;
+      end;
+
+
     procedure gen_save_used_regs(list:TAAsmoutput);
       begin
         { Pure assembler routines need to save the registers themselves }
         if (po_assembler in current_procinfo.procdef.procoptions) then
           exit;
 
-        { for the save all registers we can simply use a pusha,popa which
-          push edi,esi,ebp,esp(ignored),ebx,edx,ecx,eax }
-        if (po_saveregisters in current_procinfo.procdef.procoptions) then
-          cg.g_save_all_registers(list)
-        else
-          if current_procinfo.procdef.proccalloption in savestdregs_pocalls then
-            cg.g_save_standard_registers(list);
+        { oldfpccall expects all registers to be destroyed }
+        if current_procinfo.procdef.proccalloption<>pocall_oldfpccall then
+          cg.g_save_standard_registers(list);
       end;
 
 
@@ -1795,13 +1765,9 @@ implementation
         if (po_assembler in current_procinfo.procdef.procoptions) then
           exit;
 
-        { for the save all registers we can simply use a pusha,popa which
-          push edi,esi,ebp,esp(ignored),ebx,edx,ecx,eax }
-        if (po_saveregisters in current_procinfo.procdef.procoptions) then
-          cg.g_restore_all_registers(list,funcretparaloc)
-        else
-          if current_procinfo.procdef.proccalloption in savestdregs_pocalls then
-            cg.g_restore_standard_registers(list);
+        { oldfpccall expects all registers to be destroyed }
+        if current_procinfo.procdef.proccalloption<>pocall_oldfpccall then
+          cg.g_restore_standard_registers(list);
       end;
 
 
@@ -2237,7 +2203,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.230  2004-10-24 11:44:28  peter
+  Revision 1.231  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.230  2004/10/24 11:44:28  peter
     * small regvar fixes
     * loadref parameter removed from concatcopy,incrrefcount,etc
 
diff --git a/compiler/options.pas b/compiler/options.pas
index 966cab6d51..7fec14528c 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -1746,6 +1746,7 @@ begin
   def_symbol('DECRREFNOTNIL');
   def_symbol('HAS_INTERNAL_INTTYPES');
   def_symbol('STR_USES_VALINT');
+  def_symbol('NOSAVEREGISTERS');
 
 { using a case is pretty useless here (FK) }
 { some stuff for TP compatibility }
@@ -2112,7 +2113,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.147  2004-10-15 09:14:17  mazen
+  Revision 1.148  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.147  2004/10/15 09:14:17  mazen
   - remove $IFDEF DELPHI and related code
   - remove $IFDEF FPCPROCVAR and related code
 
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas
index 066b3c6e91..edcc69e863 100644
--- a/compiler/pdecsub.pas
+++ b/compiler/pdecsub.pas
@@ -1276,7 +1276,7 @@ type
    end;
 const
   {Should contain the number of procedure directives we support.}
-  num_proc_directives=37;
+  num_proc_directives=36;
   proc_direcdata:array[1..num_proc_directives] of proc_dir_rec=
    (
     (
@@ -1532,15 +1532,6 @@ const
       mutexclpocall : [];
       mutexclpotype : [potype_constructor,potype_destructor];
       mutexclpo     : [po_external]
-    ),(
-      idtok:_SAVEREGISTERS;
-      pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar,pd_notobjintf];
-      handler  : nil;
-      pocall   : pocall_none;
-      pooption : [po_saveregisters];
-      mutexclpocall : [pocall_internproc];
-      mutexclpotype : [potype_constructor,potype_destructor];
-      mutexclpo     : [po_external]
     ),(
       idtok:_SOFTFLOAT;
       pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
@@ -2268,7 +2259,10 @@ const
 end.
 {
   $Log$
-  Revision 1.196  2004-10-24 13:48:50  peter
+  Revision 1.197  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.196  2004/10/24 13:48:50  peter
     * don't give warning for property as unknwon proc directive
 
   Revision 1.195  2004/10/24 11:44:28  peter
diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas
index bfca3c4dd9..3e8b3b6fc9 100644
--- a/compiler/powerpc/cgcpu.pas
+++ b/compiler/powerpc/cgcpu.pas
@@ -93,11 +93,6 @@ unit cgcpu;
         { that's the case, we can use rlwinm to do an AND operation        }
         function get_rlwi_const(a: aint; var l1, l2: longint): boolean;
 
-        procedure g_save_standard_registers(list:Taasmoutput);override;
-        procedure g_restore_standard_registers(list:Taasmoutput);override;
-        procedure g_save_all_registers(list : taasmoutput);override;
-        procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);override;
-
         procedure a_jmp_cond(list : taasmoutput;cond : TOpCmp;l: tasmlabel);
 
       private
@@ -852,26 +847,6 @@ const
         end;
 
 
-     procedure tcgppc.g_save_standard_registers(list:Taasmoutput);
-       begin
-         {$warning FIX ME}
-       end;
-
-     procedure tcgppc.g_restore_standard_registers(list:Taasmoutput);
-       begin
-         {$warning FIX ME}
-       end;
-
-     procedure tcgppc.g_save_all_registers(list : taasmoutput);
-       begin
-         {$warning FIX ME}
-       end;
-
-     procedure tcgppc.g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);
-       begin
-         {$warning FIX ME}
-       end;
-
      procedure tcgppc.a_jmp_cond(list : taasmoutput;cond : TOpCmp;l: tasmlabel);
 
        begin
@@ -2366,7 +2341,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.181  2004-10-24 11:53:45  peter
+  Revision 1.182  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.181  2004/10/24 11:53:45  peter
     * fixed compilation with removed loadref
 
   Revision 1.180  2004/10/20 07:32:42  jonas
diff --git a/compiler/psub.pas b/compiler/psub.pas
index ccec7aaee5..266695fcca 100644
--- a/compiler/psub.pas
+++ b/compiler/psub.pas
@@ -43,6 +43,7 @@ interface
         entry_asmnode,
         loadpara_asmnode,
         exitlabel_asmnode,
+        stackcheck_asmnode,
         init_asmnode,
         final_asmnode : tasmnode;
         { list to store the procinfo's of the nested procedures }
@@ -534,6 +535,7 @@ implementation
         aktfilepos:=entrypos;
         entry_asmnode:=casmnode.create_get_position;
         loadpara_asmnode:=casmnode.create_get_position;
+        stackcheck_asmnode:=casmnode.create_get_position;
         init_asmnode:=casmnode.create_get_position;
         bodyentrycode:=generate_bodyentry_block;
         { Generate code/locations used at end of proc }
@@ -561,6 +563,7 @@ implementation
             addstatement(codestatement,final_asmnode);
             { Initialize before try...finally...end frame }
             addstatement(newstatement,loadpara_asmnode);
+            addstatement(newstatement,stackcheck_asmnode);
             addstatement(newstatement,entry_asmnode);
             addstatement(newstatement,init_asmnode);
             addstatement(newstatement,bodyentrycode);
@@ -576,6 +579,7 @@ implementation
         else
           begin
             addstatement(newstatement,loadpara_asmnode);
+            addstatement(newstatement,stackcheck_asmnode);
             addstatement(newstatement,entry_asmnode);
             addstatement(newstatement,init_asmnode);
             addstatement(newstatement,bodyentrycode);
@@ -678,8 +682,8 @@ implementation
 
             { Allocate space in temp/registers for parast and localst }
             aktfilepos:=entrypos;
-            gen_alloc_symtable(aktproccode,tparasymtable(procdef.parast));
-            gen_alloc_symtable(aktproccode,tlocalsymtable(procdef.localst));
+            gen_alloc_symtable(aktproccode,procdef.parast);
+            gen_alloc_symtable(aktproccode,procdef.localst);
 
             { Store temp offset for information about 'real' temps }
             tempstart:=tg.lasttemp;
@@ -786,6 +790,15 @@ implementation
             aktproccode.insertlistafter(headertai,templist);
             aktfilepos:=exitpos;
             gen_restore_used_regs(aktproccode,procdef.funcret_paraloc[calleeside]);
+            { Add stack checking code }
+            if (cs_check_stack in entryswitches) and
+               not(po_assembler in procdef.procoptions) and
+               (current_procinfo.procdef.proctypeoption<>potype_proginit) then
+              begin
+                aktfilepos:=entrypos;
+                gen_stack_check_code(templist);
+                aktproccode.insertlistafter(stackcheck_asmnode.currenttai,templist)
+              end;
             { Add entry code (stack allocation) after header }
             aktfilepos:=entrypos;
             gen_proc_entry_code(templist);
@@ -1391,7 +1404,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.209  2004-10-15 09:14:17  mazen
+  Revision 1.210  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.209  2004/10/15 09:14:17  mazen
   - remove $IFDEF DELPHI and related code
   - remove $IFDEF FPCPROCVAR and related code
 
diff --git a/compiler/sparc/cgcpu.pas b/compiler/sparc/cgcpu.pas
index 1d96d93c2b..468f024906 100644
--- a/compiler/sparc/cgcpu.pas
+++ b/compiler/sparc/cgcpu.pas
@@ -84,9 +84,7 @@ interface
         procedure g_overflowCheck_loc(List:TAasmOutput;const Loc:TLocation;def:TDef;ovloc : tlocation);override;
         procedure g_proc_entry(list : taasmoutput;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_exit(list : taasmoutput;parasize:longint;nostackframe:boolean);override;
-        procedure g_restore_all_registers(list:TAasmOutput;const funcretparaloc:TCGPara);override;
         procedure g_restore_standard_registers(list:taasmoutput);override;
-        procedure g_save_all_registers(list : taasmoutput);override;
         procedure g_save_standard_registers(list : taasmoutput);override;
         procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);override;
         procedure g_concatcopy_unaligned(list : taasmoutput;const source,dest : treference;len : aint);override;
@@ -945,12 +943,6 @@ implementation
       end;
 
 
-    procedure TCgSparc.g_restore_all_registers(list:TaasmOutput;const funcretparaloc:TCGPara);
-      begin
-        { The sparc port uses the sparc standard calling convetions so this function has no used }
-      end;
-
-
     procedure TCgSparc.g_restore_standard_registers(list:taasmoutput);
       begin
         { The sparc port uses the sparc standard calling convetions so this function has no used }
@@ -975,12 +967,6 @@ implementation
       end;
 
 
-    procedure TCgSparc.g_save_all_registers(list : taasmoutput);
-      begin
-        { The sparc port uses the sparc standard calling convetions so this function has no used }
-      end;
-
-
     procedure TCgSparc.g_save_standard_registers(list : taasmoutput);
       begin
         { The sparc port uses the sparc standard calling convetions so this function has no used }
@@ -1259,7 +1245,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.96  2004-10-24 11:53:45  peter
+  Revision 1.97  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.96  2004/10/24 11:53:45  peter
     * fixed compilation with removed loadref
 
   Revision 1.95  2004/10/10 20:51:46  peter
diff --git a/compiler/symconst.pas b/compiler/symconst.pas
index 8eab94d865..830a63fa12 100644
--- a/compiler/symconst.pas
+++ b/compiler/symconst.pas
@@ -219,7 +219,6 @@ type
     po_msgint,            { method for int message handling }
     po_exports,           { Procedure has export directive (needed for OS/2) }
     po_external,          { Procedure is external (in other object or lib)}
-    po_saveregisters,     { save all registers }
     po_overload,          { procedure is declared with overload directive }
     po_varargs,           { printf like arguments }
     po_internconst,       { procedure has constant evaluator intern }
@@ -376,12 +375,6 @@ const
 
 
 const
-   savestdregs_pocalls = [
-     pocall_cdecl,pocall_cppdecl,pocall_syscall,
-     pocall_stdcall,pocall_safecall,pocall_compilerproc,
-     pocall_register,pocall_softfloat
-   ];
-
    clearstack_pocalls = [
      pocall_cdecl,pocall_cppdecl,pocall_syscall
    ];
@@ -415,7 +408,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.89  2004-10-08 17:09:43  peter
+  Revision 1.90  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.89  2004/10/08 17:09:43  peter
     * tvarsym.varregable added, split vo_regable from varoptions
 
   Revision 1.88  2004/09/13 20:30:22  peter
diff --git a/compiler/tokens.pas b/compiler/tokens.pas
index 5c729f9d72..113cea90cc 100644
--- a/compiler/tokens.pas
+++ b/compiler/tokens.pas
@@ -223,7 +223,6 @@ type
     _FINALIZATION,
     _NOSTACKFRAME,
     _DISPINTERFACE,
-    _SAVEREGISTERS,
     _UNIMPLEMENTED,
     _IMPLEMENTATION,
     _INITIALIZATION,
@@ -453,7 +452,6 @@ const
       (str:'FINALIZATION'  ;special:false;keyword:m_initfinal;op:NOTOKEN),
       (str:'NOSTACKFRAME'  ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'DISPINTERFACE' ;special:false;keyword:m_class;op:NOTOKEN),
-      (str:'SAVEREGISTERS' ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'UNIMPLEMENTED' ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'IMPLEMENTATION';special:false;keyword:m_all;op:NOTOKEN),
       (str:'INITIALIZATION';special:false;keyword:m_initfinal;op:NOTOKEN),
@@ -518,7 +516,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.31  2004-07-05 23:25:34  olle
+  Revision 1.32  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.31  2004/07/05 23:25:34  olle
     + adding operators "|" and "&" for macpas
 
   Revision 1.30  2004/06/20 08:55:30  florian
diff --git a/compiler/x86_64/cgcpu.pas b/compiler/x86_64/cgcpu.pas
index 345420b6da..0bbe16b65e 100644
--- a/compiler/x86_64/cgcpu.pas
+++ b/compiler/x86_64/cgcpu.pas
@@ -35,8 +35,6 @@ unit cgcpu;
     type
       tcgx86_64 = class(tcgx86)
         procedure init_register_allocators;override;
-        procedure g_save_all_registers(list : taasmoutput);override;
-        procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);override;
         procedure g_proc_exit(list : taasmoutput;parasize:longint;nostackframe:boolean);override;
       end;
 
@@ -64,18 +62,6 @@ unit cgcpu;
       end;
 
 
-    procedure tcgx86_64.g_save_all_registers(list : taasmoutput);
-      begin
-        {$warning todo tcgx86_64.g_save_all_registers}
-      end;
-
-
-    procedure tcgx86_64.g_restore_all_registers(list : taasmoutput;const funcretparaloc:tcgpara);
-      begin
-        {$warning todo tcgx86_64.g_restore_all_registers}
-      end;
-
-
     procedure tcgx86_64.g_proc_exit(list : taasmoutput;parasize:longint;nostackframe:boolean);
       var
         stacksize : longint;
@@ -109,7 +95,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.17  2004-10-05 20:41:02  peter
+  Revision 1.18  2004-10-24 20:01:08  peter
+    * remove saveregister calling convention
+
+  Revision 1.17  2004/10/05 20:41:02  peter
     * more spilling rewrites
 
   Revision 1.16  2004/09/21 17:25:13  peter