diff --git a/compiler/fpcdefs.inc b/compiler/fpcdefs.inc index f14e4079f4..21c5c7284d 100644 --- a/compiler/fpcdefs.inc +++ b/compiler/fpcdefs.inc @@ -126,7 +126,6 @@ {$define cpumm} {$define cpurox} {$define cpurefshaveindexreg} - {$define fpc_compiler_has_fixup_jmps} {$endif powerpc} {$ifdef powerpc64} @@ -137,7 +136,6 @@ {$define cpumm} {$define cpurox} {$define cpurefshaveindexreg} - {$define fpc_compiler_has_fixup_jmps} {$define cpuno32bitops} {$endif powerpc64} @@ -222,7 +220,6 @@ {$define cpurequiresproperalignment} { define cpumm} {$define cpurefshaveindexreg} - {$define fpc_compiler_has_fixup_jmps} {$define SUPPORT_GET_FRAME} {$define SUPPORT_SAFECALL} {$endif mips} diff --git a/compiler/mips/cpupi.pas b/compiler/mips/cpupi.pas index 9f8b22bb11..00ec533b1b 100644 --- a/compiler/mips/cpupi.pas +++ b/compiler/mips/cpupi.pas @@ -49,6 +49,7 @@ interface function calc_stackframe_size:longint;override; procedure set_first_temp_offset;override; procedure allocate_got_register(list:tasmlist);override; + procedure postprocess_code;override; end; { Used by Stabs debug info generator } @@ -60,7 +61,7 @@ implementation uses systems,globals,verbose, cpubase,cgbase,cgobj, - tgobj,paramgr,symconst,symcpu; + tgobj,paramgr,symconst,symcpu,aasmcpu; constructor TMIPSProcInfo.create(aparent: tprocinfo); begin @@ -149,6 +150,13 @@ implementation Comment(V_Error,'TMIPSProcInfo.calc_stackframe_size result changed'); end; + + procedure TMIPSProcInfo.postprocess_code; + begin + fixup_jmps(aktproccode); + end; + + function mips_extra_offset(procdef : tprocdef) : longint; begin if procdef=nil then diff --git a/compiler/powerpc/cpupi.pas b/compiler/powerpc/cpupi.pas index 3efec0189a..73f6f4dca2 100644 --- a/compiler/powerpc/cpupi.pas +++ b/compiler/powerpc/cpupi.pas @@ -51,7 +51,7 @@ unit cpupi; property get_first_save_int_reg: tsuperregister read first_save_int_reg; property get_first_save_fpu_reg: tsuperregister read first_save_fpu_reg; - + procedure postprocess_code;override; end; @@ -63,7 +63,8 @@ unit cpupi; aasmtai, tgobj,cgobj, symconst,symsym,paramgr,symutil,symtable, - verbose; + verbose, + aasmcpu; constructor tppcprocinfo.create(aparent:tprocinfo); @@ -201,6 +202,12 @@ unit cpupi; end; + procedure tppcprocinfo.postprocess_code; + begin + fixup_jmps(aktproccode); + end; + + begin cprocinfo:=tppcprocinfo; end. diff --git a/compiler/powerpc64/cpupi.pas b/compiler/powerpc64/cpupi.pas index b5be0df730..c6da36bd4c 100644 --- a/compiler/powerpc64/cpupi.pas +++ b/compiler/powerpc64/cpupi.pas @@ -46,6 +46,7 @@ type function calc_stackframe_size(numgpr, numfpr : longint): longint; procedure allocate_got_register(list: TAsmList); override; + procedure postprocess_code;override; end; implementation @@ -56,7 +57,8 @@ uses aasmtai, tgobj,cgobj, symconst, symsym, paramgr, symutil, symtable, - verbose; + verbose, + aasmcpu; constructor tppcprocinfo.create(aparent: tprocinfo); @@ -124,6 +126,13 @@ procedure tppcprocinfo.allocate_got_register(list: TAsmList); end; end; + +procedure tppcprocinfo.postprocess_code; + begin + fixup_jmps(aktproccode); + end; + + begin cprocinfo := tppcprocinfo; end. diff --git a/compiler/psub.pas b/compiler/psub.pas index 9465c2a4bc..b1acf1191c 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -119,9 +119,6 @@ implementation optloop, optconstprop, optdeadstore -{$if defined(arm) or defined(avr) or defined(fpc_compiler_has_fixup_jmps)} - ,aasmcpu -{$endif arm} {$if defined(arm)} ,cpuinfo {$endif arm} @@ -1613,9 +1610,7 @@ implementation current_filepos:=exitpos; hlcg.gen_proc_symbol_end(templist); aktproccode.concatlist(templist); -{$ifdef fpc_compiler_has_fixup_jmps} - fixup_jmps(aktproccode); -{$endif} + { insert line debuginfo } if (cs_debuginfo in current_settings.moduleswitches) or (cs_use_lineinfo in current_settings.globalswitches) then