diff --git a/compiler/alpha/cpuinfo.pas b/compiler/alpha/cpuinfo.pas index acacf46423..2171fcc9fc 100644 --- a/compiler/alpha/cpuinfo.pas +++ b/compiler/alpha/cpuinfo.pas @@ -63,11 +63,6 @@ Const { target cpu string (used by compiler options) } target_cpu_string = 'alpha'; - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - jmp_buf_size = 24; Implementation diff --git a/compiler/arm/cpuinfo.pas b/compiler/arm/cpuinfo.pas index 96ce916b64..b99020fc77 100644 --- a/compiler/arm/cpuinfo.pas +++ b/compiler/arm/cpuinfo.pas @@ -55,12 +55,6 @@ Const mmreg_size = 16; { target cpu string (used by compiler options) } target_cpu_string = 'arm'; - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - { for linux: } - jmp_buf_size = 220; { according to sizeof(jmp_buf) on my Zaurus (FK) } { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ @@ -97,7 +91,10 @@ Implementation end. { $Log$ - Revision 1.10 2004-07-04 15:22:34 florian + Revision 1.11 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.10 2004/07/04 15:22:34 florian * fixed float spilling to use sfm/lfm instead of stf/ldf Revision 1.9 2004/06/20 08:55:31 florian diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas index 6ba457b7e2..b75b1d3fcc 100644 --- a/compiler/cgobj.pas +++ b/compiler/cgobj.pas @@ -1527,9 +1527,6 @@ implementation a_call_name(list,'FPC_DECREF'); dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default)); end; - { Temp locations need always to be reset to 0 } - if tg.istemp(ref) then - a_load_const_ref(list,OS_ADDR,0,ref); cgpara2.done; cgpara1.done; end; @@ -2048,7 +2045,10 @@ finalization end. { $Log$ - Revision 1.188 2005-01-18 22:19:20 peter + Revision 1.189 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.188 2005/01/18 22:19:20 peter * multiple location support for i386 a_param_ref * remove a_param_copy_ref for i386 diff --git a/compiler/globals.pas b/compiler/globals.pas index 4a55b43154..b1d5471ca6 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -236,7 +236,8 @@ interface { Memory sizes } heapsize, - stacksize : longint; + stacksize, + jmp_buf_size : longint; {$Ifdef EXTDEBUG} { parameter switches } @@ -2170,6 +2171,8 @@ end; { memory sizes, will be overriden by parameter or default for target in options or init_parser } stacksize:=0; + { not initialized yet } + jmp_buf_size:=-1; apptype:=app_cui; end; @@ -2177,7 +2180,10 @@ end; end. { $Log$ - Revision 1.160 2005-01-09 20:24:43 olle + Revision 1.161 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.160 2005/01/09 20:24:43 olle * rework of macro subsystem + exportable macros for mode macpas diff --git a/compiler/i386/cpubase.inc b/compiler/i386/cpubase.inc index c64dba4305..18b5a6d8bd 100644 --- a/compiler/i386/cpubase.inc +++ b/compiler/i386/cpubase.inc @@ -167,16 +167,13 @@ } std_param_align = 4; - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - jmp_buf_size = 24; - { $Log$ - Revision 1.16 2004-12-12 10:50:34 florian + Revision 1.17 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.16 2004/12/12 10:50:34 florian * fixed operand size calculation for sse operands + all nasm assembler targets to help page output added diff --git a/compiler/m68k/cpubase.pas b/compiler/m68k/cpubase.pas index 4e2cd2fc4d..0ed332d55e 100644 --- a/compiler/m68k/cpubase.pas +++ b/compiler/m68k/cpubase.pas @@ -311,11 +311,6 @@ unit cpubase; } std_param_align = 4; { for 32-bit version only } - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - jmp_buf_size = 28; {***************************************************************************** CPU Dependent Constants @@ -467,7 +462,10 @@ implementation end. { $Log$ - Revision 1.34 2005-01-08 04:10:36 karoly + Revision 1.35 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.34 2005/01/08 04:10:36 karoly * made m68k to compile again Revision 1.33 2004/11/09 22:32:59 peter diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index b26b39321d..6e002c1c39 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -315,9 +315,16 @@ implementation *****************************************************************************} procedure get_exception_temps(list:taasmoutput;var t:texceptiontemps); + var + sym : ttypesym; begin + if jmp_buf_size=-1 then + begin + searchsystype('JMP_BUF',sym); + jmp_buf_size:=sym.restype.def.size; + end; tg.GetTemp(list,EXCEPT_BUF_SIZE,tt_persistent,t.envbuf); - tg.GetTemp(list,JMP_BUF_SIZE,tt_persistent,t.jmpbuf); + tg.GetTemp(list,jmp_buf_size,tt_persistent,t.jmpbuf); tg.GetTemp(list,sizeof(aint),tt_persistent,t.reasonbuf); end; @@ -2357,7 +2364,10 @@ implementation end. { $Log$ - Revision 1.255 2005-01-19 20:04:46 florian + Revision 1.256 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.255 2005/01/19 20:04:46 florian * init./final code isn't created for pure assembler procedures anymore Revision 1.254 2005/01/18 22:19:20 peter diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index 5d0419e6fd..e9599d4e30 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -149,6 +149,7 @@ implementation orgname : stringid; tt : ttype; sym : tsym; + dummysymoptions : tsymoptions; storetokenpos,filepos : tfileposinfo; old_block_type : tblock_type; skipequal : boolean; @@ -166,9 +167,14 @@ implementation begin consume(_EQUAL); sym:=readconstant(orgname,filepos); + { Support hint directives } + dummysymoptions:=[]; + try_consume_hintdirective(dummysymoptions); if assigned(sym) then - symtablestack.insert(sym); - try_consume_hintdirective(sym.symoptions); + begin + sym.symoptions:=sym.symoptions+dummysymoptions; + symtablestack.insert(sym); + end; consume(_SEMICOLON); end; @@ -595,9 +601,11 @@ implementation var orgname : stringid; p : tnode; + dummysymoptions : tsymoptions; storetokenpos,filepos : tfileposinfo; old_block_type : tblock_type; sp : pchar; + sym : tsym; begin consume(_RESOURCESTRING); if not(symtablestack.symtabletype in [staticsymtable,globalsymtable]) then @@ -615,6 +623,7 @@ implementation p:=comp_expr(true); storetokenpos:=akttokenpos; akttokenpos:=filepos; + sym:=nil; case p.nodetype of ordconstn: begin @@ -623,7 +632,7 @@ implementation getmem(sp,2); sp[0]:=chr(tordconstnode(p).value); sp[1]:=#0; - symtablestack.insert(tconstsym.create_string(orgname,constresourcestring,sp,1)); + sym:=tconstsym.create_string(orgname,constresourcestring,sp,1); end else Message(parser_e_illegal_expression); @@ -633,12 +642,20 @@ implementation begin getmem(sp,len+1); move(value_str^,sp^,len+1); - symtablestack.insert(tconstsym.create_string(orgname,constresourcestring,sp,len)); + sym:=tconstsym.create_string(orgname,constresourcestring,sp,len); end; else Message(parser_e_illegal_expression); end; akttokenpos:=storetokenpos; + { Support hint directives } + dummysymoptions:=[]; + try_consume_hintdirective(dummysymoptions); + if assigned(sym) then + begin + sym.symoptions:=sym.symoptions+dummysymoptions; + symtablestack.insert(sym); + end; consume(_SEMICOLON); p.free; end; @@ -651,7 +668,10 @@ implementation end. { $Log$ - Revision 1.92 2004-11-16 20:32:40 peter + Revision 1.93 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.92 2004/11/16 20:32:40 peter * fixes for win32 mangledname Revision 1.91 2004/11/15 23:35:31 peter diff --git a/compiler/powerpc/cpubase.pas b/compiler/powerpc/cpubase.pas index 8b279646f2..1f1afd8089 100644 --- a/compiler/powerpc/cpubase.pas +++ b/compiler/powerpc/cpubase.pas @@ -356,12 +356,6 @@ uses } std_param_align = 4; { for 32-bit version only } - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - { for linux: } - jmp_buf_size = 232; {***************************************************************************** CPU Dependent Constants @@ -550,7 +544,10 @@ implementation end. { $Log$ - Revision 1.94 2005-01-10 21:48:45 jonas + Revision 1.95 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.94 2005/01/10 21:48:45 jonas - removed deprecated constants Revision 1.93 2004/12/28 02:25:43 olle diff --git a/compiler/sparc/cpubase.pas b/compiler/sparc/cpubase.pas index 0daa7d58ac..eb02eb2e10 100644 --- a/compiler/sparc/cpubase.pas +++ b/compiler/sparc/cpubase.pas @@ -320,11 +320,6 @@ uses } std_param_align = 4; { for 32-bit version only } - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file } - JMP_BUF_SIZE = 12+16; - {***************************************************************************** CPU Dependent Constants @@ -454,7 +449,10 @@ implementation end. { $Log$ - Revision 1.75 2004-10-31 21:45:04 peter + Revision 1.76 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.75 2004/10/31 21:45:04 peter * generic tlocation * move tlocation to cgutils diff --git a/compiler/symtable.pas b/compiler/symtable.pas index 724ffa2504..404860b75c 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -667,7 +667,7 @@ implementation if assigned(current_module) and (symtabletype=globalsymtable) then begin - if tglobalsymtable(self).moduleid>current_module.unitmapsize then + if tglobalsymtable(self).moduleid>=current_module.unitmapsize then internalerror(200501152); inc(current_module.unitmap[tglobalsymtable(self).moduleid].refs); end; @@ -2463,7 +2463,10 @@ implementation end. { $Log$ - Revision 1.169 2005-01-19 22:19:41 peter + Revision 1.170 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.169 2005/01/19 22:19:41 peter * unit mapping rewrite * new derefmap added diff --git a/compiler/vis/cpuinfo.pas b/compiler/vis/cpuinfo.pas index 5d9d0c43d7..ff8d77a879 100644 --- a/compiler/vis/cpuinfo.pas +++ b/compiler/vis/cpuinfo.pas @@ -51,19 +51,16 @@ Const mmreg_size = 8; { target cpu string (used by compiler options) } target_cpu_string = 'vis'; - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } -{$warning setjmp buf_size unknown!} - jmp_buf_size = 0; Implementation end. { $Log$ - Revision 1.3 2004-06-20 08:55:32 florian + Revision 1.4 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.3 2004/06/20 08:55:32 florian * logs truncated Revision 1.2 2004/06/16 20:07:11 florian diff --git a/compiler/x86_64/cpuinfo.pas b/compiler/x86_64/cpuinfo.pas index cce507eb07..82092ac43e 100644 --- a/compiler/x86_64/cpuinfo.pas +++ b/compiler/x86_64/cpuinfo.pas @@ -56,12 +56,6 @@ Const mmreg_size = 16; { target cpu string (used by compiler options) } target_cpu_string = 'x86_64'; - { size of the buffer used for setjump/longjmp - the size of this buffer is deduced from the - jmp_buf structure in setjumph.inc file - } - jmp_buf_size = 64; - { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ @@ -91,7 +85,10 @@ Implementation end. { $Log$ - Revision 1.14 2004-06-20 08:55:32 florian + Revision 1.15 2005-01-20 16:38:45 peter + * load jmp_buf_size from system unit + + Revision 1.14 2004/06/20 08:55:32 florian * logs truncated Revision 1.13 2004/06/16 20:07:11 florian