Parcourir la source

Merged revisions 9068,9074,9076-9082,9084,9086,9088-9090,9096,9106,9108,9114,9128,9132-9133,9149,9185,9211,9236-9238,9260,9262,9266,9269-9272,9276-9281,9293,9295,9307-9308,9310,9322,9331,9336-9337,9340-9341,9343-9344,9349,9357,9359,9373-9375,9387,9396,9399,9401-9402,9409,9418,9428,9434,9436-9437,9450-9456,9459-9466,9468-9469,9472-9473,9476-9477,9480,9484,9486,9491-9492,9520-9529,9534,9536,9538,9540,9550,9566-9568,9571,9573,9576-9577,9579,9583,9587,9594 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r9068 | peter | 2007-11-02 22:21:56 +0100 (Fri, 02 Nov 2007) | 2 lines

* remove obsolete scripts
........
r9106 | florian | 2007-11-03 17:07:18 +0100 (Sat, 03 Nov 2007) | 2 lines

* store character constants converted to shortstrings unaligned
........
r9128 | peter | 2007-11-04 15:24:36 +0100 (Sun, 04 Nov 2007) | 3 lines

* check register type also for registers in references so we are
not mixing addressregisters and intregisters on m68k
........
r9149 | sekelsenmat | 2007-11-07 20:42:55 +0100 (Wed, 07 Nov 2007) | 1 line

Added symbian target to the compiler messages
........
r9279 | jonas | 2007-11-18 10:56:25 +0100 (Sun, 18 Nov 2007) | 3 lines

* prefer write({short,ansi,wide}string) over write(chararray) for
constant strings
........
r9280 | peter | 2007-11-18 13:53:55 +0100 (Sun, 18 Nov 2007) | 2 lines

* make call by value stdcall for records and arrays delphi compatible
........
r9281 | jonas | 2007-11-18 15:29:19 +0100 (Sun, 18 Nov 2007) | 4 lines

* do not inline functions/procedures called with things like "nil^"
(that can be passed to a const-by-reference or var parameter,
but leads to errors when inlining)
........
r9293 | peter | 2007-11-18 23:10:10 +0100 (Sun, 18 Nov 2007) | 4 lines

* remove duplicate temp allocation for register saving
* cleanup register saving code by using a procinfo flag if registers
were saved on the stack
........
r9331 | peter | 2007-11-25 17:46:19 +0100 (Sun, 25 Nov 2007) | 6 lines

- garbage was being output sometimes instead of source lines when compiling with -al. This is because lastfileinfo and lastinfile were never initialized for MASM writer. This is true for TPPCMPWAssembler, too.
- long lines were not wrapped.
- constants of type ait_comp_64bit output incorrectly.
- at end of file, current segment was not closed.
patch from Sergei Gorelkin
........
r9336 | jonas | 2007-11-26 12:14:07 +0100 (Mon, 26 Nov 2007) | 2 lines

* fixed powerpc32 compilation after r9331
........
r9341 | yury | 2007-11-28 00:58:53 +0100 (Wed, 28 Nov 2007) | 1 line

* Added support of HIGH() function in {$IF } preprocessor directive. Delphi 7 supports HIGH() there.
........
r9349 | peter | 2007-11-29 22:15:08 +0100 (Thu, 29 Nov 2007) | 2 lines

* typecast fix
........
r9357 | jonas | 2007-11-30 18:55:20 +0100 (Fri, 30 Nov 2007) | 3 lines

* perform 32x32 to 64 multiplication in two more situations (u8bit and
u16bit can be converted to s32bit without any problems)
........
r9409 | jonas | 2007-12-07 14:29:16 +0100 (Fri, 07 Dec 2007) | 4 lines

* don't substitute the result variable of an inlined function with
a regable variable, because this result variable of the inlined
function may not be regable + test (mantis #10371)
........
r9418 | jonas | 2007-12-08 17:41:28 +0100 (Sat, 08 Dec 2007) | 2 lines

* optimize intvar*(-1) to -intvar
........
r9428 | peter | 2007-12-11 20:39:05 +0100 (Tue, 11 Dec 2007) | 5 lines

* increase the temp requirements for saving MM registers with the full
size of an OS_VECTOR so that we can do the alignment based on the offset
after the allocation is done. Using the size is not possible because the
temp alignment can be smaller than the OS_VECTOR requirement
........
r9436 | florian | 2007-12-12 22:07:47 +0100 (Wed, 12 Dec 2007) | 1 line

* allow application of as operator only to interfaces having a guid, resolves #6797
........
r9437 | florian | 2007-12-12 23:35:00 +0100 (Wed, 12 Dec 2007) | 2 lines

* moved
........
r9464 | jonas | 2007-12-15 20:27:24 +0100 (Sat, 15 Dec 2007) | 2 lines

* fixed location.size for length node and x86_64 mul node
........
r9465 | jonas | 2007-12-15 23:30:23 +0100 (Sat, 15 Dec 2007) | 4 lines

* enabled operand size checking (don't know why it was disabled,
but enabling it lets the compiler catch the error in tbf/tb0037
and causes no regressions)
........
r9484 | jonas | 2007-12-16 23:22:11 +0100 (Sun, 16 Dec 2007) | 10 lines

+ new cpo_openequalisexact parameter comparison option which
treats equal open arrays, open strings and arrays of const
(implicitly also open) as exactly matching (since you
cannot declare such types on their own, so they will
never match exactly)
* require that forward declared procedures match the
implementation exactly for both the parameters (with
the above modification) and result type (mantis
#10425 and the related webtbf/tw10425a.pp)
........
r9486 | jonas | 2007-12-17 14:36:30 +0100 (Mon, 17 Dec 2007) | 3 lines

* fixed uses of custom-length string types in function/property
result types
........
r9520 | peter | 2007-12-23 21:57:59 +0100 (Sun, 23 Dec 2007) | 3 lines

* don't give illegal expression for errorn statements. The error is already given
or can be ignored during a generic template parsing
........
r9521 | peter | 2007-12-23 21:58:28 +0100 (Sun, 23 Dec 2007) | 2 lines

* support (expr[,expr]) recovery for postfixoperators
........
r9522 | jonas | 2007-12-23 22:18:59 +0100 (Sun, 23 Dec 2007) | 2 lines

+ new test for overflow checking qword multiplication with high(qword)
........
r9523 | jonas | 2007-12-26 00:39:28 +0100 (Wed, 26 Dec 2007) | 2 lines

* fixed memory corruption in trgobj.add_to_movelist on 64 bit platforms
........
r9524 | jonas | 2007-12-26 00:43:07 +0100 (Wed, 26 Dec 2007) | 4 lines

* fixed resulttype of unaryminusn for qwords on 32 bit platforms (was
qword, now is int64)
* simplified currency checking in unaryminusn pass_typecheck
........
r9525 | jonas | 2007-12-26 00:45:21 +0100 (Wed, 26 Dec 2007) | 6 lines

* fixed some memory leaks
* transform directories to their dwarf format name while registering
them so that e.g. "./" gets properly mapped to "." already at that
point
* fixed wrong (but harmless) typecast in self checking
........
r9526 | jonas | 2007-12-26 00:46:30 +0100 (Wed, 26 Dec 2007) | 4 lines

* don't call DoneDebugInfo twice in tmodule.reset
* call DoneDebugInfo in tmodule.destroy (fixes all remaining dwarf
memory leaks)
........
r9527 | jonas | 2007-12-26 00:47:44 +0100 (Wed, 26 Dec 2007) | 3 lines

* free saved_standard_registers and saved_mm_registers in
done_register_allocators
........
r9528 | jonas | 2007-12-26 00:52:09 +0100 (Wed, 26 Dec 2007) | 4 lines

* fixed/added overflow checking in generic unarminusn code + test
+ added support for OP_NEG/OP_NOT in tcg64f386.a_op64_ref_reg (needed
for the above)
........
r9534 | jonas | 2007-12-26 16:21:18 +0100 (Wed, 26 Dec 2007) | 3 lines

* catch duplicate field declarations in a single class in Delphi mode
(mantis #10457)
........
r9538 | yury | 2007-12-26 17:30:45 +0100 (Wed, 26 Dec 2007) | 1 line

* Don't issue "Local variable is assigned but never used" warning for external variables.
........
r9540 | yury | 2007-12-26 18:47:40 +0100 (Wed, 26 Dec 2007) | 1 line

* Prevent warning about automatic type conversion when using VAL with COMP type on x86.
........
r9594 | michael | 2007-12-30 22:35:04 +0100 (Sun, 30 Dec 2007) | 1 line

* Fixed bug #10511
........

git-svn-id: branches/fixes_2_2@9840 -

peter il y a 17 ans
Parent
commit
34ff7931e5
67 fichiers modifiés avec 1342 ajouts et 547 suppressions
  1. 9 5
      .gitattributes
  2. 8 16
      compiler/aggas.pas
  3. 4 4
      compiler/arm/cgcpu.pas
  4. 4 0
      compiler/arm/cpubase.pas
  5. 11 1
      compiler/assemble.pas
  6. 55 13
      compiler/cgobj.pas
  7. 10 0
      compiler/cgutils.pas
  8. 16 5
      compiler/dbgdwarf.pas
  9. 12 2
      compiler/defcmp.pas
  10. 6 1
      compiler/globals.pas
  11. 3 1
      compiler/globtype.pas
  12. 0 13
      compiler/i386/ag386nsm.pas
  13. 14 6
      compiler/i386/cgcpu.pas
  14. 2 0
      compiler/i386/cpubase.inc
  15. 5 15
      compiler/i386/cpupara.pas
  16. 4 4
      compiler/m68k/cgcpu.pas
  17. 3 0
      compiler/m68k/cpubase.pas
  18. 0 65
      compiler/make_old.cmd
  19. 0 2
      compiler/mdppc386.bat
  20. 4 0
      compiler/mips/cpubase.pas
  21. 0 6
      compiler/mppc386.bat
  22. 0 2
      compiler/mppc68k.bat
  23. 0 42
      compiler/mppcsparc
  24. 4 0
      compiler/msg/errore.msg
  25. 3 2
      compiler/msgidx.inc
  26. 204 200
      compiler/msgtxt.inc
  27. 19 3
      compiler/nadd.pas
  28. 62 40
      compiler/ncal.pas
  29. 2 2
      compiler/ncginl.pas
  30. 2 2
      compiler/ncgld.pas
  31. 31 5
      compiler/ncgmat.pas
  32. 2 2
      compiler/ncgutil.pas
  33. 7 1
      compiler/ncnv.pas
  34. 38 4
      compiler/ninl.pas
  35. 6 5
      compiler/nmat.pas
  36. 4 2
      compiler/ogbase.pas
  37. 1 0
      compiler/pdecobj.pas
  38. 6 13
      compiler/pdecsub.pas
  39. 7 0
      compiler/pexpr.pas
  40. 8 12
      compiler/powerpc/agppcmpw.pas
  41. 4 4
      compiler/powerpc/cgcpu.pas
  42. 3 0
      compiler/powerpc/cpubase.pas
  43. 4 4
      compiler/powerpc64/cgcpu.pas
  44. 3 0
      compiler/powerpc64/cpubase.pas
  45. 5 3
      compiler/ppcgen/agppcgas.pas
  46. 1 1
      compiler/pstatmnt.pas
  47. 10 5
      compiler/rgobj.pas
  48. 71 1
      compiler/scanner.pas
  49. 4 4
      compiler/sparc/cgcpu.pas
  50. 3 0
      compiler/sparc/cpubase.pas
  51. 2 1
      compiler/symconst.pas
  52. 27 10
      compiler/symtable.pas
  53. 10 9
      compiler/x86/agx86int.pas
  54. 14 4
      compiler/x86_64/cgcpu.pas
  55. 1 2
      compiler/x86_64/cpubase.inc
  56. 2 1
      compiler/x86_64/nx64add.pas
  57. 0 2
      compiler/x86_64/rax64att.pas
  58. 280 0
      tests/test/cg/tumin.pp
  59. 9 0
      tests/test/tint644.pp
  60. 27 0
      tests/webtbf/tw10425a.pp
  61. 17 0
      tests/webtbf/tw10457.pp
  62. 50 0
      tests/webtbf/tw6797a.pp
  63. 47 0
      tests/webtbf/tw6797b.pp
  64. 59 0
      tests/webtbs/tw10203.pp
  65. 46 0
      tests/webtbs/tw10371.pp
  66. 66 0
      tests/webtbs/tw10425.pp
  67. 1 0
      tests/webtbs/tw7281.pp

+ 9 - 5
.gitattributes

@@ -201,8 +201,6 @@ compiler/m68k/r68ksup.inc svneol=native#text/plain
 compiler/m68k/ra68k.pas svneol=native#text/plain
 compiler/m68k/ra68kmot.pas svneol=native#text/plain
 compiler/m68k/rgcpu.pas svneol=native#text/plain
-compiler/make_old.cmd -text
-compiler/mdppc386.bat -text
 compiler/mips/aasmcpu.pas svneol=native#text/plain
 compiler/mips/cpubase.pas svneol=native#text/plain
 compiler/mips/cpuinfo.pas svneol=native#text/plain
@@ -221,9 +219,6 @@ compiler/mips/rmipssri.inc svneol=native#text/plain
 compiler/mips/rmipssta.inc svneol=native#text/plain
 compiler/mips/rmipsstd.inc svneol=native#text/plain
 compiler/mips/rmipssup.inc svneol=native#text/plain
-compiler/mppc386.bat -text
-compiler/mppc68k.bat -text
-compiler/mppcsparc -text
 compiler/msg/errorct.msg svneol=native#text/plain
 compiler/msg/errord.msg svneol=native#text/plain
 compiler/msg/errorda.msg svneol=native#text/plain
@@ -6886,6 +6881,7 @@ tests/test/cg/ttryfin1.pp svneol=native#text/plain
 tests/test/cg/ttryfin2.pp svneol=native#text/plain
 tests/test/cg/ttryfin3.pp svneol=native#text/plain
 tests/test/cg/ttryfin4.pp svneol=native#text/plain
+tests/test/cg/tumin.pp svneol=native#text/plain
 tests/test/cg/tvec.pp svneol=native#text/plain
 tests/test/cg/uprintf3.pp svneol=native#text/plain
 tests/test/cg/variants/ivarol10.pp svneol=native#text/plain
@@ -7182,6 +7178,7 @@ tests/test/tint2str2.pp svneol=native#text/plain
 tests/test/tint641.pp svneol=native#text/plain
 tests/test/tint642.pp svneol=native#text/plain
 tests/test/tint643.pp svneol=native#text/plain
+tests/test/tint644.pp svneol=native#text/plain
 tests/test/tinterface1.pp svneol=native#text/plain
 tests/test/tinterface2.pp svneol=native#text/plain
 tests/test/tinterface3.pp svneol=native#text/plain
@@ -7494,6 +7491,8 @@ tests/webtbf/tw0890a.pp svneol=native#text/plain
 tests/webtbf/tw0893.pp svneol=native#text/plain
 tests/webtbf/tw0896.pp svneol=native#text/plain
 tests/webtbf/tw0896a.pp svneol=native#text/plain
+tests/webtbf/tw10425a.pp svneol=native#text/plain
+tests/webtbf/tw10457.pp svneol=native#text/plain
 tests/webtbf/tw1157a.pp svneol=native#text/plain
 tests/webtbf/tw1238.pp svneol=native#text/plain
 tests/webtbf/tw1251a.pp svneol=native#text/plain
@@ -7655,6 +7654,8 @@ tests/webtbf/tw6420.pp svneol=native#text/plain
 tests/webtbf/tw6631.pp svneol=native#text/plain
 tests/webtbf/tw6686.pp svneol=native#text/plain
 tests/webtbf/tw6796.pp svneol=native#text/plain
+tests/webtbf/tw6797a.pp svneol=native#text/plain
+tests/webtbf/tw6797b.pp svneol=native#text/plain
 tests/webtbf/tw6922.pp svneol=native#text/plain
 tests/webtbf/tw6957.pp -text
 tests/webtbf/tw6970.pp svneol=native#text/plain
@@ -7802,11 +7803,14 @@ tests/webtbs/tw10002.pp svneol=native#text/plain
 tests/webtbs/tw10009.pp svneol=native#text/plain
 tests/webtbs/tw10013.pp svneol=native#text/plain
 tests/webtbs/tw10072.pp svneol=native#text/plain
+tests/webtbs/tw10203.pp svneol=native#text/plain
 tests/webtbs/tw1021.pp svneol=native#text/plain
 tests/webtbs/tw1023.pp svneol=native#text/plain
 tests/webtbs/tw10320.pp svneol=native#text/plain
 tests/webtbs/tw10350.pp svneol=native#text/plain
+tests/webtbs/tw10371.pp svneol=native#text/plain
 tests/webtbs/tw1041.pp svneol=native#text/plain
+tests/webtbs/tw10425.pp svneol=native#text/plain
 tests/webtbs/tw1044.pp svneol=native#text/plain
 tests/webtbs/tw10454.pp svneol=native#text/plain
 tests/webtbs/tw1046.pp svneol=native#text/plain

+ 8 - 16
compiler/aggas.pas

@@ -100,10 +100,6 @@ implementation
       line_length = 70;
 
     var
-      CurrSecType  : TAsmSectiontype; { last section type written }
-      lastfileinfo : tfileposinfo;
-      infile,
-      lastinfile   : tinputfile;
       symendcount  : longint;
 
     type
@@ -388,7 +384,7 @@ implementation
             end;
         end;
         AsmLn;
-        CurrSecType:=atype;
+        LastSecType:=atype;
       end;
 
 
@@ -571,7 +567,7 @@ implementation
                          AsmWrite(','+tostr(tai_align_abstract(hp).fillop))
 {$ifdef x86}
                        { force NOP as alignment op code }
-                       else if CurrSecType=sec_code then
+                       else if LastSecType=sec_code then
                          AsmWrite(',0x90');
 {$endif x86}
                      end
@@ -618,8 +614,8 @@ implementation
                        asmwrite('.zerofill __DATA, __common, ');
                        asmwrite(tai_datablock(hp).sym.name);
                        asmwriteln(', '+tostr(tai_datablock(hp).size)+','+tostr(last_align));
-                       if not(CurrSecType in [sec_data,sec_none]) then
-                         writesection(CurrSecType,'',secorder_default);
+                       if not(LastSecType in [sec_data,sec_none]) then
+                         writesection(LastSecType,'',secorder_default);
                      end
                    else
                      begin
@@ -737,7 +733,7 @@ implementation
                            { Values with symbols are written on a single line to improve
                              reading of the .s file (PFV) }
                            if assigned(tai_const(hp).sym) or
-                              not(CurrSecType in [sec_data,sec_rodata,sec_rodata_norel]) or
+                              not(LastSecType in [sec_data,sec_rodata,sec_rodata_norel]) or
                               (l>line_length) or
                               (hp.next=nil) or
                               (tai(hp.next).typ<>ait_const) or
@@ -997,11 +993,11 @@ implementation
                   while assigned(hp.next) and (tai(hp.next).typ in [ait_cutobject,ait_section,ait_comment]) do
                    begin
                      if tai(hp.next).typ=ait_section then
-                       CurrSecType:=tai_section(hp.next).sectype;
+                       LastSecType:=tai_section(hp.next).sectype;
                      hp:=tai(hp.next);
                    end;
-                  if CurrSecType<>sec_none then
-                    WriteSection(CurrSecType,'',secorder_default);
+                  if LastSecType<>sec_none then
+                    WriteSection(LastSecType,'',secorder_default);
                   AsmStartSize:=AsmSize;
                 end;
              end;
@@ -1049,10 +1045,6 @@ implementation
        Comment(V_Debug,'Start writing gas-styled assembler output for '+current_module.mainsource^);
 {$endif}
 
-      CurrSecType:=sec_none;
-      FillChar(lastfileinfo,sizeof(lastfileinfo),0);
-      LastInfile:=nil;
-
       if assigned(current_module.mainsource) then
         n:=ExtractFileName(current_module.mainsource^)
       else

+ 4 - 4
compiler/arm/cgcpu.pas

@@ -98,8 +98,8 @@ unit cgcpu;
         procedure g_overflowcheck(list: TAsmList; const l: tlocation; def: tdef); override;
         procedure g_overflowCheck_loc(List:TAsmList;const Loc:TLocation;def:TDef;ovloc : tlocation);override;
 
-        procedure g_save_standard_registers(list : TAsmList);override;
-        procedure g_restore_standard_registers(list : TAsmList);override;
+        procedure g_save_registers(list : TAsmList);override;
+        procedure g_restore_registers(list : TAsmList);override;
 
         procedure a_jmp_cond(list : TAsmList;cond : TOpCmp;l: tasmlabel);
         procedure fixref(list : TAsmList;var ref : treference);
@@ -1823,13 +1823,13 @@ unit cgcpu;
       end;
 
 
-    procedure tcgarm.g_save_standard_registers(list : TAsmList);
+    procedure tcgarm.g_save_registers(list : TAsmList);
       begin
         { this work is done in g_proc_entry }
       end;
 
 
-    procedure tcgarm.g_restore_standard_registers(list : TAsmList);
+    procedure tcgarm.g_restore_registers(list : TAsmList);
       begin
         { this work is done in g_proc_exit }
       end;

+ 4 - 0
compiler/arm/cpubase.pas

@@ -339,6 +339,10 @@ unit cpubase;
       }
       saved_standard_registers : array[0..6] of tsuperregister =
         (RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,RS_R9,RS_R10);
+
+      { this is only for the generic code which is not used for this architecture }
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);
+
       { Required parameter alignment when calling a routine declared as
         stdcall and cdecl. The alignment value should be the one defined
         by GCC or the target ABI.

+ 11 - 1
compiler/assemble.pas

@@ -33,7 +33,7 @@ interface
 
     uses
       SysUtils,
-      systems,globtype,globals,aasmbase,aasmtai,aasmdata,ogbase;
+      systems,globtype,globals,aasmbase,aasmtai,aasmdata,ogbase,finput;
 
     const
        { maximum of aasmoutput lists there will be }
@@ -75,6 +75,12 @@ interface
         outbuf   : array[0..AsmOutSize-1] of char;
         outfile  : file;
         ioerror : boolean;
+      {input source info}
+        lastfileinfo : tfileposinfo;
+        infile,
+        lastinfile   : tinputfile;
+      {last section type written}
+        lastsectype : TAsmSectionType;
       public
         {# Returns the complete path and executable name of the assembler
            program.
@@ -606,6 +612,10 @@ Implementation
     procedure TExternalAssembler.MakeObject;
       begin
         AsmCreate(cut_normal);
+        FillChar(lastfileinfo, sizeof(lastfileinfo), 0);
+        lastfileinfo.line := -1;
+        lastinfile := nil;
+        lastsectype := sec_none;
         WriteAsmList;
         AsmClose;
         if not(ioerror) then

+ 55 - 13
compiler/cgobj.pas

@@ -39,7 +39,7 @@ unit cgobj;
        cclasses,globtype,
        cpubase,cgbase,cgutils,parabase,
        aasmbase,aasmtai,aasmdata,aasmcpu,
-       symconst,symbase,symtype,symdef,symtable,rgobj
+       symconst,symtype,symdef,rgobj
        ;
 
     type
@@ -462,24 +462,24 @@ unit cgobj;
 
              @param(usedinproc Registers which are used in the code of this routine)
           }
-          procedure g_save_standard_registers(list:TAsmList);virtual;
+          procedure g_save_registers(list:TAsmList);virtual;
           {# This routine is called when generating the code for the exit point
              of a routine. It should restore all registers which were previously
              saved in @var(g_save_standard_registers).
 
              @param(usedinproc Registers which are used in the code of this routine)
           }
-          procedure g_restore_standard_registers(list:TAsmList);virtual;
+          procedure g_restore_registers(list:TAsmList);virtual;
           procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint);virtual;abstract;
           procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: aint);virtual;
 
           function g_indirect_sym_load(list:TAsmList;const symname: string): tregister;virtual;
-          { generate a stub which only purpose is to pass control the given external method, 
+          { generate a stub which only purpose is to pass control the given external method,
           setting up any additional environment before doing so (if required).
 
           The default implementation issues a jump instruction to the external name. }
           procedure g_external_wrapper(list : TAsmList; procdef: tprocdef; const externalname: string); virtual;
-          
+
           { initialize the pic/got register }
           procedure g_maybe_got_init(list: TAsmList); virtual;
         protected
@@ -3594,7 +3594,7 @@ implementation
       end;
 
 
-    procedure tcg.g_save_standard_registers(list:TAsmList);
+    procedure tcg.g_save_registers(list:TAsmList);
       var
         href : treference;
         size : longint;
@@ -3605,12 +3605,27 @@ implementation
         for r:=low(saved_standard_registers) to high(saved_standard_registers) do
           if saved_standard_registers[r] in rg[R_INTREGISTER].used_in_proc then
             inc(size,sizeof(aint));
+
+        { mm registers }
+        if uses_registers(R_MMREGISTER) then
+          begin
+            { Make sure we reserve enough space to do the alignment based on the offset
+              later on. We can't use the size for this, because the alignment of the start
+              of the temp is smaller than needed for an OS_VECTOR }
+            inc(size,tcgsize2size[OS_VECTOR]);
+
+            for r:=low(saved_mm_registers) to high(saved_mm_registers) do
+              if saved_mm_registers[r] in rg[R_MMREGISTER].used_in_proc then
+                inc(size,tcgsize2size[OS_VECTOR]);
+          end;
+
         if size>0 then
           begin
             tg.GetTemp(list,size,tt_noreuse,current_procinfo.save_regs_ref);
+            include(current_procinfo.flags,pi_has_saved_regs);
+
             { Copy registers to temp }
             href:=current_procinfo.save_regs_ref;
-
             for r:=low(saved_standard_registers) to high(saved_standard_registers) do
               begin
                 if saved_standard_registers[r] in rg[R_INTREGISTER].used_in_proc then
@@ -3620,19 +3635,30 @@ implementation
                   end;
                 include(rg[R_INTREGISTER].preserved_by_proc,saved_standard_registers[r]);
               end;
+
+            if uses_registers(R_MMREGISTER) then
+              for r:=low(saved_mm_registers) to high(saved_mm_registers) do
+                begin
+                  if saved_mm_registers[r] in rg[R_MMREGISTER].used_in_proc then
+                    begin
+                      a_loadmm_reg_ref(list,OS_VECTOR,OS_VECTOR,newreg(R_MMREGISTER,saved_mm_registers[r],R_SUBNONE),href,nil);
+                      inc(href.offset,tcgsize2size[OS_VECTOR]);
+                    end;
+                  include(rg[R_MMREGISTER].preserved_by_proc,saved_mm_registers[r]);
+                end;
           end;
       end;
 
 
-    procedure tcg.g_restore_standard_registers(list:TAsmList);
+    procedure tcg.g_restore_registers(list:TAsmList);
       var
         href     : treference;
         r        : integer;
         hreg     : tregister;
-        freetemp : boolean;
       begin
+        if not(pi_has_saved_regs in current_procinfo.flags) then
+          exit;
         { Copy registers from temp }
-        freetemp:=false;
         href:=current_procinfo.save_regs_ref;
         for r:=low(saved_standard_registers) to high(saved_standard_registers) do
           if saved_standard_registers[r] in rg[R_INTREGISTER].used_in_proc then
@@ -3642,10 +3668,26 @@ implementation
               a_reg_alloc(list,hreg);
               a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,hreg);
               inc(href.offset,sizeof(aint));
-              freetemp:=true;
             end;
-        if freetemp then
-          tg.UnGetTemp(list,current_procinfo.save_regs_ref);
+
+        if uses_registers(R_MMREGISTER) then
+          begin
+            if (href.offset mod tcgsize2size[OS_VECTOR])<>0 then
+              inc(href.offset,tcgsize2size[OS_VECTOR]-(href.offset mod tcgsize2size[OS_VECTOR]));
+
+            for r:=low(saved_mm_registers) to high(saved_mm_registers) do
+              begin
+                if saved_mm_registers[r] in rg[R_MMREGISTER].used_in_proc then
+                  begin
+                    hreg:=newreg(R_MMREGISTER,saved_mm_registers[r],R_SUBNONE);
+                    { Allocate register so the optimizer does not remove the load }
+                    a_reg_alloc(list,hreg);
+                    a_loadmm_ref_reg(list,OS_VECTOR,OS_VECTOR,href,hreg,nil);
+                    inc(href.offset,tcgsize2size[OS_VECTOR]);
+                  end;
+              end;
+          end;
+        tg.UnGetTemp(list,current_procinfo.save_regs_ref);
       end;
 
 

+ 10 - 0
compiler/cgutils.pas

@@ -139,6 +139,9 @@ unit cgutils;
     { allocate room for parameters on the stack in the entry code? }
     function use_fixed_stack: boolean;
 
+    { returns r with the given alignment }
+    function setalignment(const r : treference;b : byte) : treference;
+
 implementation
 
 uses
@@ -179,6 +182,13 @@ uses
       end;
 
 
+    { returns r with the given alignment }
+    function setalignment(const r : treference;b : byte) : treference;
+      begin
+        result:=r;
+        result.alignment:=b;
+      end;
+
 {****************************************************************************
                                   TLocation
 ****************************************************************************}

+ 16 - 5
compiler/dbgdwarf.pas

@@ -224,7 +224,7 @@ interface
         function def_dwarf_class_struct_lab(def:tobjectdef) : tasmsymbol;
         function get_file_index(afile: tinputfile): Integer;
         procedure write_symtable_syms(st:TSymtable);
-	function relative_dwarf_path(const s:tcmdstr):tcmdstr;
+        function relative_dwarf_path(const s:tcmdstr):tcmdstr;
       protected
         // set if we should use 64bit headers (dwarf3 and up)
         _use_64bit_headers: Boolean;
@@ -753,6 +753,8 @@ implementation
       begin
         dirlist.Free;
         dirlist := nil;
+        asmline.free;
+        asmline:=nil;
         loclist.Free;
         loclist := nil;
         inherited Destroy;
@@ -780,7 +782,13 @@ implementation
         if afile.path^ = '' then
           dirname := '.'
         else
-          dirname := afile.path^;
+          begin
+            { add the canonical form here already to avoid problems with }
+            { paths such as './' etc                                     }
+            dirname := relative_dwarf_path(afile.path^);
+            if dirname = '' then
+              dirname := '.';
+          end;
         diritem := TDirIndexItem(dirlist.Find(dirname));
         if diritem = nil then
           diritem := TDirIndexItem.Create(dirlist,dirname, dirlist.Count);
@@ -2331,8 +2339,9 @@ implementation
             ditem := TDirIndexItem(dirlist[n]);
             if ditem.Name = '.' then
               Continue;
-            { Write without trailing path delimiter and also don't prefix with ./ for current dir }
-            linelist.concat(tai_string.create(relative_dwarf_path(ditem.Name)+#0));
+            { Write without trailing path delimiter and also don't prefix with ./ for current dir (already done while adding to dirlist }
+            
+            linelist.concat(tai_string.create(ditem.Name+#0));
           end;
         linelist.concat(tai_const.create_8bit(0));
 
@@ -2361,6 +2370,8 @@ implementation
 
         { end of debug line table }
         linelist.concat(tai_symbol.createname(target_asm.labelprefix+'edebug_line0',AT_DATA,0));
+        
+        flist.free;
       end;
 
 
@@ -2539,7 +2550,7 @@ implementation
     function TDebugInfoDwarf.symname(sym: tsym): String;
       begin
         if (sym.typ=paravarsym) and
-           (vo_is_self in tlocalvarsym(sym).varoptions) then
+           (vo_is_self in tparavarsym(sym).varoptions) then
           result:='this'
         else
           result := sym.Name;

+ 12 - 2
compiler/defcmp.pas

@@ -34,7 +34,7 @@ interface
      type
        { if acp is cp_all the var const or nothing are considered equal }
        tcompare_paras_type = ( cp_none, cp_value_equal_const, cp_all,cp_procvar);
-       tcompare_paras_option = (cpo_allowdefaults,cpo_ignorehidden,cpo_allowconvert,cpo_comparedefaultvalue);
+       tcompare_paras_option = (cpo_allowdefaults,cpo_ignorehidden,cpo_allowconvert,cpo_comparedefaultvalue,cpo_openequalisexact);
        tcompare_paras_options = set of tcompare_paras_option;
 
        tcompare_defs_option = (cdo_internal,cdo_explicit,cdo_check_operator,cdo_allow_variant,cdo_parameter);
@@ -1509,7 +1509,7 @@ implementation
                 { both must be hidden }
                 if (vo_is_hidden_para in currpara1.varoptions)<>(vo_is_hidden_para in currpara2.varoptions) then
                   exit;
-                eq:=te_equal;
+                eq:=te_exact;
                 if not(vo_is_self in currpara1.varoptions) and
                    not(vo_is_self in currpara2.varoptions) then
                  begin
@@ -1558,6 +1558,16 @@ implementation
               { check type }
               if eq=te_incompatible then
                 exit;
+              { open arrays can never match exactly, since you cannot define }
+              { a separate "open array" type -> we have to be able to        }
+              { consider those as exact when resolving forward definitions.  }
+              { The same goes for openstrings and array of const             }
+              if (is_open_array(currpara1.vardef) or
+                  is_array_of_const(currpara1.vardef) or
+                  is_open_string(currpara1.vardef)) and
+                 (eq=te_equal) and
+                 (cpo_openequalisexact in cpoptions) then
+                eq:=te_exact;
               if eq<lowesteq then
                 lowesteq:=eq;
               { also check default value if both have it declared }

+ 6 - 1
compiler/globals.pas

@@ -802,7 +802,12 @@ implementation
             GUID.D4[i]:=byte(hexstr2longint(copy(s,22+i*2,2)));
           string2guid:=true;
         end
-        else
+        else if (length(s)=0) then
+          begin
+          FillChar(GUID,SizeOf(GUID),0);
+          string2guid:=true;
+          end
+        else  
           string2guid:=false;
       end;
 

+ 3 - 1
compiler/globtype.pas

@@ -337,7 +337,9 @@ interface
          { calls itself recursive }
          pi_is_recursive,
          { stack frame optimization not possible (only on x86 probably) }
-         pi_needs_stackframe
+         pi_needs_stackframe,
+         { set if the procedure has at least one register saved on the stack }
+         pi_has_saved_regs
        );
        tprocinfoflags=set of tprocinfoflag;
 

+ 0 - 13
compiler/i386/ag386nsm.pas

@@ -66,11 +66,6 @@ interface
         {$i r386nasm.inc}
       );
 
-    var
-      lastfileinfo : tfileposinfo;
-      infile,
-      lastinfile   : tinputfile;
-
     function nasm_regname(r:Tregister):string;
       var
         p : tregisterindex;
@@ -387,9 +382,6 @@ interface
       end;
 
 
-    var
-      LastSecType : TAsmSectiontype;
-
     const
       ait_const2str : array[aitconst_128bit..aitconst_indirect_symbol] of string[20]=(
         #9'FIXME_128BIT'#9,#9'FIXME_64BIT'#9,#9'DD'#9,#9'DW'#9,#9'DB'#9,
@@ -958,14 +950,9 @@ interface
       if assigned(current_module.mainsource) then
        comment(v_info,'Start writing nasm-styled assembler output for '+current_module.mainsource^);
 {$endif}
-      LasTSecType:=sec_none;
       AsmWriteLn('BITS 32');
       AsmLn;
 
-      lastfileinfo.line:=-1;
-      lastfileinfo.fileindex:=0;
-      lastinfile:=nil;
-
       WriteExternals;
 
       for hal:=low(TasmlistType) to high(TasmlistType) do

+ 14 - 6
compiler/i386/cgcpu.pas

@@ -742,12 +742,20 @@ unit cgcpu;
         op1,op2 : TAsmOp;
         tempref : treference;
       begin
-        get_64bit_ops(op,op1,op2);
-        tempref:=ref;
-        tcgx86(cg).make_simple_ref(list,tempref);
-        list.concat(taicpu.op_ref_reg(op1,S_L,tempref,reg.reglo));
-        inc(tempref.offset,4);
-        list.concat(taicpu.op_ref_reg(op2,S_L,tempref,reg.reghi));
+        if not(op in [OP_NEG,OP_NOT]) then
+          begin
+            get_64bit_ops(op,op1,op2);
+            tempref:=ref;
+            tcgx86(cg).make_simple_ref(list,tempref);
+            list.concat(taicpu.op_ref_reg(op1,S_L,tempref,reg.reglo));
+            inc(tempref.offset,4);
+            list.concat(taicpu.op_ref_reg(op2,S_L,tempref,reg.reghi));
+          end
+        else
+          begin
+            a_load64_ref_reg(list,ref,reg);
+            a_op64_reg_reg(list,op,size,reg,reg);
+          end;
       end;
 
 

+ 2 - 0
compiler/i386/cpubase.inc

@@ -159,6 +159,8 @@
          GCC source.
       }
       saved_standard_registers : array[0..2] of tsuperregister = (RS_EBX,RS_ESI,RS_EDI);
+
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_INVALID);
       {# Required parameter alignment when calling a routine declared as
          stdcall and cdecl. The alignment value should be the one defined
          by GCC or the target ABI.

+ 5 - 15
compiler/i386/cpupara.pas

@@ -173,12 +173,10 @@ unit cpupara;
             result:=true;
           recorddef :
             begin
-              { Win32 stdcall passes small records on the stack for call by
-                value }
+              { Delphi stdcall passes records on the stack for call by value }
               if (target_info.system=system_i386_win32) and
                  (calloption=pocall_stdcall) and
-                 (varspez=vs_value) and
-                 (def.size<=16) then
+                 (varspez=vs_value) then
                 result:=false
               else
                 result:=
@@ -189,19 +187,11 @@ unit cpupara;
             end;
           arraydef :
             begin
-              { Win32 stdcall passes arrays on the stack for call by
-                value }
-              if (target_info.system=system_i386_win32) and
-                 (calloption=pocall_stdcall) and
-                 (varspez=vs_value) and
-                 (tarraydef(def).highrange>=tarraydef(def).lowrange) then
-                result:=false
-              else
               { array of const values are pushed on the stack as
                 well as dyn. arrays }
-                if (calloption in [pocall_cdecl,pocall_cppdecl]) then
-                  result:=not(is_array_of_const(def) or
-                    is_dynamic_array(def))
+              if (calloption in [pocall_cdecl,pocall_cppdecl]) then
+                result:=not(is_array_of_const(def) or
+                        is_dynamic_array(def))
               else
                 begin
                   result:=(

+ 4 - 4
compiler/m68k/cgcpu.pas

@@ -90,8 +90,8 @@ unit cgcpu;
 
 //        procedure g_restore_frame_pointer(list : TAsmList);override;
 //        procedure g_return_from_proc(list : TAsmList;parasize : aint);override;
-        procedure g_restore_standard_registers(list:TAsmList);override;
-        procedure g_save_standard_registers(list:TAsmList);override;
+        procedure g_restore_registers(list:TAsmList);override;
+        procedure g_save_registers(list:TAsmList);override;
 
 //        procedure g_save_all_registers(list : TAsmList);override;
 //        procedure g_restore_all_registers(list : TAsmList;const funcretparaloc:TCGPara);override;
@@ -1439,7 +1439,7 @@ unit cgcpu;
       end;
 
 
-    procedure Tcg68k.g_save_standard_registers(list:TAsmList);
+    procedure Tcg68k.g_save_registers(list:TAsmList);
       var
         tosave : tcpuregisterset;
         ref : treference;
@@ -1456,7 +1456,7 @@ unit cgcpu;
       end;
 
 
-    procedure Tcg68k.g_restore_standard_registers(list:TAsmList);
+    procedure Tcg68k.g_restore_registers(list:TAsmList);
       var
         torestore : tcpuregisterset;
         r:Tregister;

+ 3 - 0
compiler/m68k/cpubase.pas

@@ -301,6 +301,9 @@ unit cpubase;
       }
       saved_standard_registers : array[0..5] of tsuperregister = (RS_D2,RS_D3,RS_D4,RS_D5,RS_D6,RS_D7);
       saved_standard_address_registers : array[0..3] of tsuperregister = (RS_A2,RS_A3,RS_A4,RS_A5);
+      
+      { this is only for the generic code which is not used for this architecture }
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);
 
       {# Required parameter alignment when calling a routine declared as
          stdcall and cdecl. The alignment value should be the one defined

+ 0 - 65
compiler/make_old.cmd

@@ -1,65 +0,0 @@
-@echo off
-rem $id: make.cmd,v $
-rem
-rem ************************Make batchfile for OS/2****************************
-rem * Purpose:      The makefile contains a lot of Unix commands. While it is *
-rem *               possible to install for example a bash shell under OS/2   *
-rem *               a batch file is much easier.                              *
-rem *                                                                         *
-rem * Copyright (c) 1998-2000 by Daniel Mantione, developer of Free Pascal         *
-rem ***************************************************************************
-
-goto %1
-
-:clean
-pushd
-\pp\rtl\
-del /s *.ppo *.so2 *.oo2 *.ppu *.s *.o *.pp1 *.s1 *.o1>&dev\nul
-popd
-del *.ppo *.so2 *.oo2 *.ppu *.s *.o *.pp1 *.s1 *.o1>&dev\nul
-goto eind
-
-:prtx
-pushd
-\pp\rtl\os2\
-iff not exist prt0.oo2 then
-  as -o prt0.oo2 prt0.as
-endiff
-iff not exist prt1.oo2 then
-  as -o prt1.oo2 prt1.as
-endiff
-iff not exist code2.oo2 then
-  as -o code2.oo2 code2.as
-endiff
-iff not exist code3.oo2 then
-  as -o code3.oo2 code3.as
-endiff
-popd
-goto eind
-
-:compiler
-call make prtx
-iff "%2"=="" then
-    ppos2 pp.pas
-else
-    %2 pp.pas
-endiff
-goto eind
-
-:remake
-call make clean
-call make compiler %2
-goto eind
-
-:cycle
-call make remake %2
-move pp.exe pp1.exe
-call make remake pp1.exe
-move pp.exe pp2.exe
-call make remake pp2.exe
-move pp.exe pp3.exe
-goto eind
-
-$log: make.cmd,v$
-
-:eind

+ 0 - 2
compiler/mdppc386.bat

@@ -1,2 +0,0 @@
-dcc32 -Di386 -DGDB -Ddelphi -CC -Ui386 -Utargets -E. -N. -$O- ppc.dpr %1 %2 %3 %4 %5 %6 %7 %8 %9
-

+ 4 - 0
compiler/mips/cpubase.pas

@@ -353,6 +353,10 @@ unit cpubase;
       }
       saved_standard_registers : array[0..8] of tsuperregister =
         (RS_R16,RS_R17,RS_R18,RS_R19,RS_R20,RS_R21,RS_R22,RS_R23,RS_R30);
+        
+      { this is only for the generic code which is not used for this architecture }
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);
+      
       { Required parameter alignment when calling a routine declared as
         stdcall and cdecl. The alignment value should be the one defined
         by GCC or the target ABI.

+ 0 - 6
compiler/mppc386.bat

@@ -1,6 +0,0 @@
-ppc386 -O3p3 -Ch8000000 -FE. -Fui386 -dI386 -dGDB -dBROWSERLOG -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel 0 goto success
-goto failed
-:success
-copy pp.exe ppc386.exe
-:failed

+ 0 - 2
compiler/mppc68k.bat

@@ -1,2 +0,0 @@
-ppc386 -Ch8000000 -uSUPPORT_MMX -ui386 -dm68k -dGDB -a -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
-copy pp.exe ppc68k.exe

+ 0 - 42
compiler/mppcsparc

@@ -1,42 +0,0 @@
-#!/bin/bash
-cd "`dirname "$0"`/.."
-FPC_SRC_DIR="$PWD"
-COMP_DIR="$FPC_SRC_DIR/compiler"
-RTL_DIR="$FPC_SRC_DIR/rtl"
-SPARC_BINUTILS_DIR="/usr/local/bin/sparc-linux"
-INCLUDE_PATH=`echo -Fi"$RTL_DIR/"{unix,linux,sparc,inc,linux/sparc,objpas/sysutils}`
-UNITS_PATH=`echo -Fu"$RTL_DIR/"{unix,linux,sparc,inc,linux/sparc,objpas,inc}`
-SRC_DIR=`echo "$COMP_DIR/"{,sparc,systems}:`
-TEST_DIR="$FPC_SRC_DIR/tests/test"
-if [[ "$1" == "-V1.0" ]] || [[ "$#" == 0 ]]
-then
-  if [[ "$1" == "-V1.1" ]]
-  then
-    cd "$COMP_DIR"
-    ~/FPC/bin/fpc -XD -gl -oppcsparc -dExtDebug -Fu"sparc;systems" -FE"sparc" -dSPARC -dGDB -dNewRA pp.pas
-  else
-    cd "$COMP_DIR"
-    fpc -XD -gl -oppcsparc -dExtDebug -Fu"sparc;systems" -FE"sparc" -dSPARC -dGDB -dNewRA pp.pas
-  fi
-fi
-if [[ "$#" -gt "0" ]] && ( [[ "$1" != "-B" ]] || [[ "$#" -gt "1" ]] )
-then
-  cd "$TEST_DIR"
-  COMPILE_COMMAND='"$COMP_DIR/sparc/ppcsparc" -g -artl $UNITS_PATH -FD"$SPARC_BINUTILS_DIR" $INCLUDE_PATH  "-FE$TEST_DIR" -dSPARC'
-  if [[ "$1" == "-gdb" ]]
-  then
-    shift 1
-    eval gdb -d \"$SRC_DIR\" --args $COMPILE_COMMAND "$@"
-  else
-    FILES_LIST=`ls $1`
-    shift 1
-    for FileName in $FILES_LIST
-    do
-      eval "$COMPILE_COMMAND" "$FileName" "$@"
-      if [[ $? != 0 ]]
-      then
-        break;
-      fi
-    done
-  fi
-fi

+ 4 - 0
compiler/msg/errore.msg

@@ -1412,6 +1412,9 @@ type_w_pointer_to_signed=04082_W_Converting pointers to signed integers may resu
 % allocate memory above \$80000000, for example both Windows and Linux allow pointers in the range \$0000000 to \$bfffffff.
 % If you convert pointers to signed types, this can cause overflow and range check errors, but also \$80000000 < \$7fffffff.
 % This can cause random errors in code like "if p>q".
+type_interface_has_no_guid=04084_E_Interface type $1 has no valid GUID
+% When applying the as-operator to an interface or class, the desired interface, i.e. the right operand of the
+% as-operator must have a valid GUID
 % \end{description}
 #
 # Symtable
@@ -2621,6 +2624,7 @@ S*2Aas_Assemble using GNU AS
 3*2Topenbsd_OpenBSD
 3*2Tos2_OS/2 / eComStation
 3*2Tsunos_SunOS/Solaris
+3*2Tsymbian_Symbian OS
 3*2Twatcom_Watcom compatible DOS extender
 3*2Twdosx_WDOSX DOS extender
 3*2Twin32_Windows 32 Bit

+ 3 - 2
compiler/msgidx.inc

@@ -397,6 +397,7 @@ const
   type_h_convert_sub_operands_to_prevent_overflow=04080;
   type_h_convert_mul_operands_to_prevent_overflow=04081;
   type_w_pointer_to_signed=04082;
+  type_interface_has_no_guid=04084;
   sym_e_id_not_found=05000;
   sym_f_internal_error_in_symtablestack=05001;
   sym_e_duplicate_id=05002;
@@ -733,9 +734,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 45413;
+  MsgTxtSize = 45480;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,86,238,83,63,50,108,22,135,60,
+    24,86,238,85,63,50,108,22,135,60,
     42,1,1,1,1,1,1,1,1,1
   );

+ 204 - 200
compiler/msgtxt.inc

@@ -456,259 +456,260 @@ const msgtxt : array[0..000189,1..240] of char=(
   'd prevent overflow errors.'#000+
   '04082_W_Converting pointers to signed integers may result in wrong com'+
   'p','arison results and range errors, use an unsigned type instead.'#000+
+  '04084_E_Interface type $1 has no valid GUID'#000+
   '05000_E_Identifier not found "$1"'#000+
   '05001_F_Internal Error in SymTableStack()'#000+
   '05002_E_Duplicate identifier "$1"'#000+
-  '05003_H_Identifier already defined in $1 at line $2'#000+
-  '05004_E_Unknown',' identifier "$1"'#000+
+  '05003_H_Identifier alre','ady defined in $1 at line $2'#000+
+  '05004_E_Unknown identifier "$1"'#000+
   '05005_E_Forward declaration not solved "$1"'#000+
   '05007_E_Error in type definition'#000+
   '05009_E_Forward type not resolved "$1"'#000+
-  '05010_E_Only static variables can be used in static methods or outside'+
-  ' methods'#000+
-  '05012_F_record or class type',' expected'#000+
+  '05010_E_Only static variables can be used in static methods or ','outsi'+
+  'de methods'#000+
+  '05012_F_record or class type expected'#000+
   '05013_E_Instances of classes or objects with an abstract method are no'+
   't allowed'#000+
   '05014_W_Label not defined "$1"'#000+
   '05015_E_Label used but not defined "$1"'#000+
   '05016_E_Illegal label declaration'#000+
-  '05017_E_GOTO and LABEL are not supported (use',' switch -Sg)'#000+
+  '0','5017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+
   '05018_E_Label not found'#000+
   '05019_E_identifier isn'#039't a label'#000+
   '05020_E_label already defined'#000+
   '05021_E_illegal type declaration of set elements'#000+
-  '05022_E_Forward class definition not resolved "$1"'#000+
+  '05022_E_Forward class definition not resolved "','$1"'#000+
   '05023_H_Unit "$1" not used in $2'#000+
-  '05024_H','_Parameter "$1" not used'#000+
+  '05024_H_Parameter "$1" not used'#000+
   '05025_N_Local variable "$1" not used'#000+
   '05026_H_Value parameter "$1" is assigned but never used'#000+
   '05027_N_Local variable "$1" is assigned but never used'#000+
-  '05028_H_Local $1 "$2" is not used'#000+
-  '05029_N_Private field "$1.$2" is ','never used'#000+
+  '05028_H_Local $1 "$2" i','s not used'#000+
+  '05029_N_Private field "$1.$2" is never used'#000+
   '05030_N_Private field "$1.$2" is assigned but never used'#000+
   '05031_N_Private method "$1.$2" never used'#000+
   '05032_E_Set type expected'#000+
   '05033_W_Function result does not seem to be set'#000+
-  '05034_W_Type "$1" is not aligned correctly in current re','cord for C'#000+
+  '05034_W_Type',' "$1" is not aligned correctly in current record for C'#000+
   '05035_E_Unknown record field identifier "$1"'#000+
   '05036_W_Local variable "$1" does not seem to be initialized'#000+
   '05037_W_Variable "$1" does not seem to be initialized'#000+
-  '05038_E_identifier idents no member "$1"'#000+
-  '05039_H_Found declaration: $1',#000+
+  '05038_E_identifier idents ','no member "$1"'#000+
+  '05039_H_Found declaration: $1'#000+
   '05040_E_Data element too large'#000+
   '05042_E_No matching implementation for interface method "$1" found'#000+
   '05043_W_Symbol "$1" is deprecated'#000+
   '05044_W_Symbol "$1" is not portable'#000+
-  '05055_W_Symbol "$1" is not implemented'#000+
-  '05056_E_Can'#039't create unique type',' from this type'#000+
+  '05055_W_Symbol "$1" is not ','implemented'#000+
+  '05056_E_Can'#039't create unique type from this type'#000+
   '05057_H_Local variable "$1" does not seem to be initialized'#000+
   '05058_H_Variable "$1" does not seem to be initialized'#000+
   '05059_W_Function result variable does not seem to initialized'#000+
-  '05060_H_Function result variable does not seem t','o be initialized'#000+
+  '0506','0_H_Function result variable does not seem to be initialized'#000+
   '05061_W_Variable "$1" read but nowhere assigned'#000+
   '05062_H_Found abstract method: $1'#000+
   '06009_E_Parameter list size exceeds 65535 bytes'#000+
   '06012_E_File types must be var parameters'#000+
-  '06013_E_The use of a far pointer isn'#039't allowed ther','e'#000+
+  '06013_E','_The use of a far pointer isn'#039't allowed there'#000+
   '06015_E_EXPORT declared functions can'#039't be called'#000+
   '06016_W_Possible illegal call of constructor or destructor'#000+
   '06017_N_Inefficient code'#000+
   '06018_W_unreachable code'#000+
-  '06020_E_Abstract methods can'#039't be called directly'#000+
-  '06027_DL_Register $1 weight $','2 $3'#000+
+  '06020_E_Abstract methods can'#039't be c','alled directly'#000+
+  '06027_DL_Register $1 weight $2 $3'#000+
   '06029_DL_Stack frame is omitted'#000+
   '06031_E_Object or class methods can'#039't be inline.'#000+
   '06032_E_Procvar calls cannot be inline.'#000+
   '06033_E_No code for inline procedure stored'#000+
-  '06035_E_Element zero of an ansi/wide- or longstring can'#039't be acces'+
-  'sed,',' use (set)length instead'#000+
+  '06035_E_Element zero of an',' ansi/wide- or longstring can'#039't be acc'+
+  'essed, use (set)length instead'#000+
   '06037_E_Constructors or destructors can not be called inside a '#039'wi'+
   'th'#039' clause'#000+
   '06038_E_Cannot call message handler methods directly'#000+
-  '06039_E_Jump in or outside of an exception block'#000+
-  '06040_E_Control flow statements aren',#039't allowed in a finally block'#000+
+  '06039_E_Jump in or outside of an exceptio','n block'#000+
+  '06040_E_Control flow statements aren'#039't allowed in a finally block'#000+
   '06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+
   '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+
-  '06043_E_Local variables size exceeds supported limit'#000+
+  '06043_E_Local variables size exceeds supported limi','t'#000+
   '06044_E_BREAK not allowed'#000+
-  '06045_E_CONTINUE',' not allowed'#000+
+  '06045_E_CONTINUE not allowed'#000+
   '06046_F_Unknown compilerproc "$1". Check if you use the correct run ti'+
   'me library.'#000+
   '06047_F_Cannot find system type "$1". Check if you use the correct run'+
   ' time library.'#000+
-  '06048_H_Inherited call to abstract method ignored'#000+
-  '06049_E_Go','to label "$1" not defined or optimized away'#000+
+  '06048_H_Inherite','d call to abstract method ignored'#000+
+  '06049_E_Goto label "$1" not defined or optimized away'#000+
   '07000_DL_Starting $1 styled assembler parsing'#000+
   '07001_DL_Finished $1 styled assembler parsing'#000+
   '07002_E_Non-label pattern contains @'#000+
-  '07004_E_Error building record offset'#000+
-  '07005_E_OFFSET used without id','entifier'#000+
+  '07004_E_Error building ','record offset'#000+
+  '07005_E_OFFSET used without identifier'#000+
   '07006_E_TYPE used without identifier'#000+
   '07007_E_Cannot use local variable or parameters here'#000+
   '07008_E_need to use OFFSET here'#000+
   '07009_E_need to use $ here'#000+
-  '07010_E_Cannot use multiple relocatable symbols'#000+
-  '07011_E_Relocatable symbol can onl','y be added'#000+
+  '07010_E_Cannot use multiple relocatabl','e symbols'#000+
+  '07011_E_Relocatable symbol can only be added'#000+
   '07012_E_Invalid constant expression'#000+
   '07013_E_Relocatable symbol is not allowed'#000+
   '07014_E_Invalid reference syntax'#000+
   '07015_E_You can not reach $1 from that code'#000+
-  '07016_E_Local symbols/labels aren'#039't allowed as references'#000+
-  '07017_E_Invalid ','base and index register usage'#000+
+  '07016_E_Local symbols/labels a','ren'#039't allowed as references'#000+
+  '07017_E_Invalid base and index register usage'#000+
   '07018_W_Possible error in object field handling'#000+
   '07019_E_Wrong scale factor specified'#000+
   '07020_E_Multiple index register usage'#000+
   '07021_E_Invalid operand type'#000+
-  '07022_E_Invalid string as opcode operand: $1'#000+
-  '07023_W_@CODE',' and @DATA not supported'#000+
+  '07022_E_Invali','d string as opcode operand: $1'#000+
+  '07023_W_@CODE and @DATA not supported'#000+
   '07024_E_Null label references are not allowed'#000+
   '07025_E_Divide by zero in asm evaluator'#000+
   '07026_E_Illegal expression'#000+
   '07027_E_escape sequence ignored: $1'#000+
-  '07028_E_Invalid symbol reference'#000+
-  '07029_W_Fwait can cause emulation',' problems with emu387'#000+
+  '07028_E_Invalid symbol',' reference'#000+
+  '07029_W_Fwait can cause emulation problems with emu387'#000+
   '07030_W_$1 without operand translated into $1P'#000+
   '07031_W_ENTER instruction is not supported by Linux kernel'#000+
   '07032_W_Calling an overload function in assembler'#000+
-  '07033_E_Unsupported symbol type for operand'#000+
-  '07034_E_Constant v','alue out of bounds'#000+
+  '07033_E_Unsupporte','d symbol type for operand'#000+
+  '07034_E_Constant value out of bounds'#000+
   '07035_E_Error converting decimal $1'#000+
   '07036_E_Error converting octal $1'#000+
   '07037_E_Error converting binary $1'#000+
   '07038_E_Error converting hexadecimal $1'#000+
   '07039_H_$1 translated to $2'#000+
-  '07040_W_$1 is associated to an overloaded functi','on'#000+
+  '0704','0_W_$1 is associated to an overloaded function'#000+
   '07041_E_Cannot use SELF outside a method'#000+
   '07042_E_Cannot use OLDEBP outside a nested procedure'#000+
   '07043_W_Procedures can'#039't return any value in asm code'#000+
   '07044_E_SEG not supported'#000+
-  '07045_E_Size suffix and destination or source size do not match',#000+
+  '07045_E_Size suffix',' and destination or source size do not match'#000+
   '07046_W_Size suffix and destination or source size do not match'#000+
   '07047_E_Assembler syntax error'#000+
   '07048_E_Invalid combination of opcode and operands'#000+
   '07049_E_Assembler syntax error in operand'#000+
-  '07050_E_Assembler syntax error in constant'#000+
-  '07051_E_','Invalid String expression'#000+
+  '07050_E','_Assembler syntax error in constant'#000+
+  '07051_E_Invalid String expression'#000+
   '07052_W_constant with symbol $1 for address which is not on a pointer'#000+
   '07053_E_Unrecognized opcode $1'#000+
   '07054_E_Invalid or missing opcode'#000+
-  '07055_E_Invalid combination of prefix and opcode: $1'#000+
-  '07056_E_Invalid combinatio','n of override and opcode: $1'#000+
+  '07055_E_Invalid combination of pref','ix and opcode: $1'#000+
+  '07056_E_Invalid combination of override and opcode: $1'#000+
   '07057_E_Too many operands on line'#000+
   '07058_W_NEAR ignored'#000+
   '07059_W_FAR ignored'#000+
   '07060_E_Duplicate local symbol $1'#000+
   '07061_E_Undefined local symbol $1'#000+
-  '07062_E_Unknown label identifier $1'#000+
+  '07062_E_Unknown label id','entifier $1'#000+
   '07063_E_Invalid register name'#000+
-  '07','064_E_Invalid floating point register name'#000+
+  '07064_E_Invalid floating point register name'#000+
   '07066_W_Modulo not supported'#000+
   '07067_E_Invalid floating point constant $1'#000+
   '07068_E_Invalid floating point expression'#000+
   '07069_E_Wrong symbol type'#000+
-  '07070_E_Cannot index a local var or parameter with a regi','ster'#000+
+  '07070_E_Canno','t index a local var or parameter with a register'#000+
   '07071_E_Invalid segment override expression'#000+
   '07072_W_Identifier $1 supposed external'#000+
   '07073_E_Strings not allowed as constants'#000+
   '07074_No type of variable specified'#000+
-  '07075_E_assembler code not returned to text section'#000+
-  '07076_E_Not a directiv','e or local symbol $1'#000+
+  '07075_E_assembler code not ret','urned to text section'#000+
+  '07076_E_Not a directive or local symbol $1'#000+
   '07077_E_Using a defined name as a local label'#000+
   '07078_E_Dollar token is used without an identifier'#000+
   '07079_W_32bit constant created for address'#000+
-  '07080_N_.align is target specific, use .balign or .p2align'#000+
-  '07081_E_Can'#039't access',' fields directly for parameters'#000+
+  '07080_N_.align is target specific, ','use .balign or .p2align'#000+
+  '07081_E_Can'#039't access fields directly for parameters'#000+
   '07082_E_Can'#039't access fields of objects/classes directly'#000+
   '07083_E_No size specified and unable to determine the size of the oper'+
   'ands'#000+
-  '07084_E_Cannot use RESULT in this function'#000+
-  '07086_W_"$1" without operand trans','lated into "$1 %st,%st(1)"'#000+
+  '07084_E_Cannot use RESULT in this',' function'#000+
+  '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+
   '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+
   '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+
   '07089_E_Char < not allowed here'#000+
   '07090_E_Char > not allowed here'#000+
-  '07093_W_ALIGN not supported'#000+
-  '07094_E_Inc and D','ec cannot be together'#000+
+  '0','7093_W_ALIGN not supported'#000+
+  '07094_E_Inc and Dec cannot be together'#000+
   '07095_E_Invalid reglist for movem'#000+
   '07096_E_Reglist invalid for opcode'#000+
   '07097_E_Higher cpu mode required ($1)'#000+
-  '07098_W_No size specified and unable to determine the size of the oper'+
-  'ands, using DWORD as default'#000+
-  '07099_E_Synt','ax error while trying to parse a shifter operand'#000+
+  '07098_W_No size specified and unable to determine the size of the o','p'+
+  'erands, using DWORD as default'#000+
+  '07099_E_Syntax error while trying to parse a shifter operand'#000+
   '07100_E_Address of packed component is not at a byte boundary'#000+
   '07101_W_No size specified and unable to determine the size of the oper'+
-  'ands, using BYTE as default'#000+
-  '07102_W_Use of +offset(%ebp) fo','r parameters invalid here'#000+
+  'ands, using BYT','E as default'#000+
+  '07102_W_Use of +offset(%ebp) for parameters invalid here'#000+
   '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+
   #000+
   '07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+
   'ess'#000+
-  '07105_W_Use of -offset(%esp), access may cause a crash or value may b',
-  'e lost'#000+
+  '07105_W_Use of -offset(%e','sp), access may cause a crash or value may '+
+  'be lost'#000+
   '07106_E_VMTOffset must be used in combination with a virtual method, a'+
   'nd "$1" is not virtual'#000+
   '07107_E_Generating PIC, but reference is not PIC-safe'#000+
   '08000_F_Too many assembler files'#000+
-  '08001_F_Selected assembler output not supported'#000+
-  '08002','_F_Comp not supported'#000+
+  '08001_F_S','elected assembler output not supported'#000+
+  '08002_F_Comp not supported'#000+
   '08003_F_Direct not support for binary writers'#000+
   '08004_E_Allocating of data is only allowed in bss section'#000+
   '08005_F_No binary writer selected'#000+
-  '08006_E_Asm: Opcode $1 not in table'#000+
-  '08007_E_Asm: $1 invalid combination of opcod','e and operands'#000+
+  '08006_E_Asm: Opcode $1 not in table'#000,
+  '08007_E_Asm: $1 invalid combination of opcode and operands'#000+
   '08008_E_Asm: 16 Bit references not supported'#000+
   '08009_E_Asm: Invalid effective address'#000+
   '08010_E_Asm: Immediate or reference expected'#000+
   '08011_E_Asm: $1 value exceeds bounds $2'#000+
-  '08012_E_Asm: Short jump is out of range $1'#000+
-  '08013_E_Asm: ','Undefined label $1'#000+
+  '08012_E_Asm:',' Short jump is out of range $1'#000+
+  '08013_E_Asm: Undefined label $1'#000+
   '08014_E_Asm: Comp type not supported for this target'#000+
   '08015_E_Asm: Extended type not supported for this target'#000+
   '08016_E_Asm: Duplicate label $1'#000+
   '08017_E_Asm: Redefined label $1'#000+
-  '08018_E_Asm: First defined here'#000+
-  '08019_E_Asm: In','valid register $1'#000+
+  '080','18_E_Asm: First defined here'#000+
+  '08019_E_Asm: Invalid register $1'#000+
   '08020_E_Asm: 16 or 32 Bit references not supported'#000+
   '08021_E_Asm: 64 Bit operands not supported'#000+
   '09000_W_Source operating system redefined'#000+
   '09001_I_Assembling (pipe) $1'#000+
-  '09002_E_Can'#039't create assembler file: $1'#000+
-  '09003_E_Can'#039't cre','ate object file: $1'#000+
+  '09002_E_Can'#039't',' create assembler file: $1'#000+
+  '09003_E_Can'#039't create object file: $1'#000+
   '09004_E_Can'#039't create archive file: $1'#000+
   '09005_E_Assembler $1 not found, switching to external assembling'#000+
   '09006_T_Using assembler: $1'#000+
   '09007_E_Error while assembling exitcode $1'#000+
-  '09008_E_Can'#039't call the assembler, error $1 swi','tching to external'+
+  '09','008_E_Can'#039't call the assembler, error $1 switching to external'+
   ' assembling'#000+
   '09009_I_Assembling $1'#000+
   '09010_I_Assembling with smartlinking $1'#000+
   '09011_W_Object $1 not found, Linking may fail !'#000+
   '09012_W_Library $1 not found, Linking may fail !'#000+
-  '09013_E_Error while linking'#000+
-  '09014_E_Can'#039't call the ','linker, switching to external linking'#000+
+  '09013_E','_Error while linking'#000+
+  '09014_E_Can'#039't call the linker, switching to external linking'#000+
   '09015_I_Linking $1'#000+
   '09016_E_Util $1 not found, switching to external linking'#000+
   '09017_T_Using util $1'#000+
   '09018_E_Creation of Executables not supported'#000+
-  '09019_E_Creation of Dynamic/Shared Libraries not supported',#000+
+  '09019_E_Creati','on of Dynamic/Shared Libraries not supported'#000+
   '09020_I_Closing script $1'#000+
   '09021_E_resource compiler not found, switching to external mode'#000+
   '09022_I_Compiling resource $1'#000+
   '09023_T_unit $1 can'#039't be statically linked, switching to smart lin'+
   'king'#000+
-  '09024_T_unit $1 can'#039't be smart linked, switching',' to static linki'+
+  '0902','4_T_unit $1 can'#039't be smart linked, switching to static linki'+
   'ng'#000+
   '09025_T_unit $1 can'#039't be shared linked, switching to static linkin'+
   'g'#000+
   '09026_E_unit $1 can'#039't be smart or static linked'#000+
   '09027_E_unit $1 can'#039't be shared or static linked'#000+
-  '09028_D_Calling resource compiler "$1" with "$2" as comm','and line'#000+
+  '09028_D_Call','ing resource compiler "$1" with "$2" as command line'#000+
   '09128_F_Can'#039't post process executable $1'#000+
   '09129_F_Can'#039't open executable $1'#000+
   '09130_X_Size of Code: $1 bytes'#000+
   '09131_X_Size of initialized data: $1 bytes'#000+
-  '09132_X_Size of uninitialized data: $1 bytes'#000+
-  '09133_X_Stack space reserved: $1 bytes',#000+
+  '09132_X_Size of uninitialized data: $1 ','bytes'#000+
+  '09133_X_Stack space reserved: $1 bytes'#000+
   '09134_X_Stack space committed: $1 bytes'#000+
   '10000_T_Unitsearch: $1'#000+
   '10001_T_PPU Loading $1'#000+
@@ -716,109 +717,109 @@ const msgtxt : array[0..000189,1..240] of char=(
   '10003_U_PPU Flags: $1'#000+
   '10004_U_PPU Crc: $1'#000+
   '10005_U_PPU Time: $1'#000+
-  '10006_U_PPU File too short'#000+
-  '10007_U_PPU Invalid Header (no PPU at the ','begin)'#000+
+  '10006_U_PPU File too shor','t'#000+
+  '10007_U_PPU Invalid Header (no PPU at the begin)'#000+
   '10008_U_PPU Invalid Version $1'#000+
   '10009_U_PPU is compiled for another processor'#000+
   '10010_U_PPU is compiled for an other target'#000+
   '10011_U_PPU Source: $1'#000+
   '10012_U_Writing $1'#000+
-  '10013_F_Can'#039't Write PPU-File'#000+
+  '10013_F_Can'#039't Write PPU-Fi','le'#000+
   '10014_F_Error reading PPU-File'#000+
-  '10015_F_un','expected end of PPU-File'#000+
+  '10015_F_unexpected end of PPU-File'#000+
   '10016_F_Invalid PPU-File entry: $1'#000+
   '10017_F_PPU Dbx count problem'#000+
   '10018_E_Illegal unit name: $1'#000+
   '10019_F_Too much units'#000+
   '10020_F_Circular unit reference between $1 and $2'#000+
-  '10021_F_Can'#039't compile unit $1, no sources avail','able'#000+
+  '100','21_F_Can'#039't compile unit $1, no sources available'#000+
   '10022_F_Can'#039't find unit $1 used by $2'#000+
   '10023_W_Unit $1 was not found but $2 exists'#000+
   '10024_F_Unit $1 searched but $2 found'#000+
   '10025_W_Compiling the system unit requires the -Us switch'#000+
-  '10026_F_There were $1 errors compiling module, stopping'#000+
-  '1','0027_U_Load from $1 ($2) unit $3'#000+
+  '10026_F_There',' were $1 errors compiling module, stopping'#000+
+  '10027_U_Load from $1 ($2) unit $3'#000+
   '10028_U_Recompiling $1, checksum changed for $2'#000+
   '10029_U_Recompiling $1, source found only'#000+
   '10030_U_Recompiling unit, static lib is older than ppufile'#000+
-  '10031_U_Recompiling unit, shared lib is older than ppufile',#000+
+  '10031_U_Recomp','iling unit, shared lib is older than ppufile'#000+
   '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+
   '10033_U_Recompiling unit, obj is older than asm'#000+
   '10034_U_Parsing interface of $1'#000+
   '10035_U_Parsing implementation of $1'#000+
-  '10036_U_Second load for unit $1'#000+
-  '10037_U_PPU Check file $1 tim','e $2'#000+
+  '10036_U_Second lo','ad for unit $1'#000+
+  '10037_U_PPU Check file $1 time $2'#000+
   '10040_W_Can'#039't recompile unit $1, but found modifed include files'#000+
   '10041_U_File $1 is newer than PPU file $2'#000+
   '10042_U_Trying to use a unit which was compiled with a different FPU m'+
   'ode'#000+
-  '10043_U_Loading interface units from $1'#000+
-  '10044_U_Loadin','g implementation units from $1'#000+
+  '10043_U_Lo','ading interface units from $1'#000+
+  '10044_U_Loading implementation units from $1'#000+
   '10045_U_Interface CRC changed for unit $1'#000+
   '10046_U_Implementation CRC changed for unit $1'#000+
   '10047_U_Finished compiling unit $1'#000+
   '10048_U_Add dependency of $1 to $2'#000+
-  '10049_U_No reload, is caller: $1'#000+
-  '10050_U_No reload',', already in second compile: $1'#000+
+  '10049_','U_No reload, is caller: $1'#000+
+  '10050_U_No reload, already in second compile: $1'#000+
   '10051_U_Flag for reload: $1'#000+
   '10052_U_Forced reloading'#000+
   '10053_U_Previous state of $1: $2'#000+
   '10054_U_Already compiling $1, setting second compile'#000+
   '10055_U_Loading unit $1'#000+
-  '10056_U_Finished loading unit $1'#000+
-  '10057_U_Regi','stering new unit $1'#000+
+  '1','0056_U_Finished loading unit $1'#000+
+  '10057_U_Registering new unit $1'#000+
   '10058_U_Re-resolving unit $1'#000+
   '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
   '11000_O_$1 [options] <inputfile> [options]'#000+
   '11001_W_Only one source file supported'#000+
-  '11002_W_DEF file can be created only for OS/2',#000+
+  '1','1002_W_DEF file can be created only for OS/2'#000+
   '11003_E_nested response files are not supported'#000+
   '11004_F_No source file name in command line'#000+
   '11005_N_No option inside $1 config file'#000+
   '11006_E_Illegal parameter: $1'#000+
   '11007_H_-? writes help pages'#000+
-  '11008_F_Too many config files nested'#000+
-  '11009_F_Una','ble to open file $1'#000+
+  '1100','8_F_Too many config files nested'#000+
+  '11009_F_Unable to open file $1'#000+
   '11010_D_Reading further options from $1'#000+
   '11011_W_Target is already set to: $1'#000+
   '11012_W_Shared libs not supported on DOS platform, reverting to static'+
   #000+
   '11013_F_too many IF(N)DEFs'#000+
-  '11014_F_too many ENDIFs'#000+
-  '11015_F_open conditio','nal at the end of the file'#000+
+  '1','1014_F_too many ENDIFs'#000+
+  '11015_F_open conditional at the end of the file'#000+
   '11016_W_Debug information generation is not supported by this executab'+
   'le'#000+
   '11017_H_Try recompiling with -dGDB'#000+
   '11018_W_You are using the obsolete switch $1'#000+
-  '11019_W_You are using the obsolete switch $1, please use $2'#000,
+  '11019_W_You are ','using the obsolete switch $1, please use $2'#000+
   '11020_N_Switching assembler to default source writing assembler'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
   '11022_W_"$1" assembler use forced'#000+
-  '11026_T_Reading options from file $1'#000+
-  '11027_T_Reading options from environme','nt $1'#000+
+  '11026_T_Reading options from fi','le $1'#000+
+  '11027_T_Reading options from environment $1'#000+
   '11028_D_Handling option "$1"'#000+
   '11029__*** press enter ***'#000+
   '11030_H_Start of reading config file $1'#000+
   '11031_H_End of reading config file $1'#000+
   '11032_D_interpreting option "$1"'#000+
-  '11036_D_interpreting firstpass option "$1"'#000+
-  '11033_D_interpreting fil','e option "$1"'#000+
+  '11036_D_interpreting fi','rstpass option "$1"'#000+
+  '11033_D_interpreting file option "$1"'#000+
   '11034_D_Reading config file "$1"'#000+
   '11035_D_found source file name "$1"'#000+
   '11039_E_Unknown code page'#000+
   '11040_F_Config file $1 is a directory'#000+
-  '11041_W_Assembler output selected "$1" cannot generate debug info, deb'+
-  'ugging disabled'#000+
-  '11023_F','ree Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $F'+
-  'PCCPU'#010+
+  '11041_W_Assembler output selected "$1" cannot gen','erate debug info, d'+
+  'ebugging disabled'#000+
+  '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
+  'CPU'#010+
   'Copyright (c) 1993-2007 by Florian Klaempfl'#000+
   '11024_Free Pascal Compiler version $FPCVERSION'#010+
   #010+
   'Compiler Date      : $FPCDATE'#010+
-  'Compiler CPU Target: $FPCCPU'#010+
+  'Compile','r CPU Target: $FPCCPU'#010+
   #010+
   'Supported targets:'#010+
-  '  ','$OSTARGETS'#010+
+  '  $OSTARGETS'#010+
   #010+
   'Supported CPU instruction sets:'#010+
   '  $INSTRUCTIONSETS'#010+
@@ -829,260 +830,263 @@ const msgtxt : array[0..000189,1..240] of char=(
   'Supported Optimizations:'#010+
   '  $OPTIMIZATIONS'#010+
   #010+
-  'This program comes under the GNU General Public Licence'#010+
-  'For more information r','ead COPYING.FPC'#010+
+  'This program comes under the GNU G','eneral Public Licence'#010+
+  'For more information read COPYING.FPC'#010+
   #010+
   'Report bugs,suggestions etc to:'#010+
   '                 [email protected]'#000+
   '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
   'ble it'#010+
-  '**1a_The compiler doesn'#039't delete the generated assembler file'#010+
-  '**2al_List sour','cecode lines in assembler file'#010+
+  '**1a_The compiler doesn'#039't delete ','the generated assembler file'#010+
+  '**2al_List sourcecode lines in assembler file'#010+
   '**2an_List node info in assembler file'#010+
   '*L2ap_Use pipes instead of creating temporary assembler files'#010+
   '**2ar_List register allocation/release info in assembler file'#010+
-  '**2at_List temp allocation/release info in ass','embler file'#010+
+  '**','2at_List temp allocation/release info in assembler file'#010+
   '**1A<x>_Output format:'#010+
   '**2Adefault_Use default assembler'#010+
   '3*2Aas_Assemble using GNU AS'#010+
   '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
   '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
-  '3*2Anasmwin32_Win32 object file using Nasm'#010+
-  '3*2Anasmwdosx_','Win32/WDOSX object file using Nasm'#010+
+  '3*2Anasmwin32','_Win32 object file using Nasm'#010+
+  '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
   '3*2Awasm_Obj file using Wasm (Watcom)'#010+
   '3*2Anasmobj_Obj file using Nasm'#010+
   '3*2Amasm_Obj file using Masm (Microsoft)'#010+
   '3*2Atasm_Obj file using Tasm (Borland)'#010+
-  '3*2Aelf_ELF (Linux) using internal writer'#010+
-  '3*2Acoff_COFF',' (Go32v2) using internal writer'#010+
+  '3*2Aelf_ELF',' (Linux) using internal writer'#010+
+  '3*2Acoff_COFF (Go32v2) using internal writer'#010+
   '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
   '4*2Aas_Assemble using GNU AS'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Agas_GNU Motorola assembler'#010+
-  '6*2Amit_MIT Syntax (old GAS)'#010+
+  '6*2Amit_MIT Syntax (old',' GAS)'#010+
   '6*2Amot_Standard Motorola assembler'#010+
-  'A*','2Aas_Assemble using GNU AS'#010+
+  'A*2Aas_Assemble using GNU AS'#010+
   'P*2Aas_Assemble using GNU AS'#010+
   'S*2Aas_Assemble using GNU AS'#010+
   '**1b_Generate browser info'#010+
   '**2bl_Generate local symbol info'#010+
   '**1B_Build all modules'#010+
-  '**1C<x>_Code generation options:'#010+
-  '**2Cc<x>_Set default calling convention',' to <x>'#010+
+  '**1C<x>_Code generation opti','ons:'#010+
+  '**2Cc<x>_Set default calling convention to <x>'#010+
   '**2CD_Create also dynamic library (not supported)'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
   '**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible va'+
   'lues'#010+
-  '**2CF<x>_Minimal floating point constant precision (','default, 32, 64)'+
+  '**2CF<x>','_Minimal floating point constant precision (default, 32, 64)'+
   #010+
   '**2Cg_Generate PIC code'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ci_IO-checking'#010+
   '**2Cn_Omit linking stage'#010+
   '**2Co_Check overflow of integer operations'#010+
-  '**2CO_Check for possible overflow of integer operations'#010+
-  '**2Cp','<x>_Select instruction set, see fpc -i for possible values'#010+
+  '**2CO_Check for p','ossible overflow of integer operations'#010+
+  '**2Cp<x>_Select instruction set, see fpc -i for possible values'#010+
   '**2CP<x>=<y>_ packing settings'#010+
   '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
   'and 8'#010+
   '**2Cr_Range checking'#010+
-  '**2CR_Verify object method call validity'#010+
-  '**2Cs<n>_Set',' stack size to <n>'#010+
+  '**2CR_Ver','ify object method call validity'#010+
+  '**2Cs<n>_Set stack size to <n>'#010+
   '**2Ct_Stack checking'#010+
   '**2CX_Create also smartlinked library'#010+
   '**1d<x>_Defines the symbol <x>'#010+
   '**1D_Generate a DEF file'#010+
   '**2Dd<x>_Set description to <x>'#010+
-  '**2Dv<x>_Set DLL version to <x>'#010+
+  '**2Dv<x>_Set DLL version to <x','>'#010+
   '*O2Dw_PM application'#010+
-  '**1e<x>_Set path to e','xecutable'#010+
+  '**1e<x>_Set path to executable'#010+
   '**1E_Same as -Cn'#010+
   '**1fPIC_Same as -Cg'#010+
   '**1F<x>_Set file names and paths:'#010+
   '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
   'sed'#010+
   '**2Fc<x>_Set input codepage to <x>'#010+
-  '**2FC<x>_Set RC compiler binary name to <x>'#010+
-  '**2FD<','x>_Set the directory where to search for compiler utilities'#010+
+  '**2FC<','x>_Set RC compiler binary name to <x>'#010+
+  '**2FD<x>_Set the directory where to search for compiler utilities'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
   '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
-  '**2Fi<x>_Add <x> to include path'#010+
-  '**2Fl<x>_Add <x> to',' library path'#010+
+  '**2Fi<x>','_Add <x> to include path'#010+
+  '**2Fl<x>_Add <x> to library path'#010+
   '**2FL<x>_Use <x> as dynamic linker'#010+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   'r'#010+
   '**2Fo<x>_Add <x> to object path'#010+
   '**2Fr<x>_Load error message file <x>'#010+
-  '**2FR<x>_Set resource (.res) linker to <x>'#010+
-  '**2Fu<x','>_Add <x> to unit path'#010+
+  '**2FR<','x>_Set resource (.res) linker to <x>'#010+
+  '**2Fu<x>_Add <x> to unit path'#010+
   '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
   '*g1g_Generate debug information (default format for target)'#010+
   '*g2gc_Generate checks for pointers'#010+
-  '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
-  '*g2gl_','Use line info unit (show more info with backtraces)'#010+
+  '*g2gh_Use heaptrace unit (','for memory leak/corruption debugging)'#010+
+  '*g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2go<x>_Set debug information options'#010+
   '*g3godwarfsets_ Enable Dwarf set debug information (breaks gdb < 6.5)'#010+
-  '*g2gp_Preserve case in stabs symbol names'#010+
-  '*g2gs_Generate stabs debug informatio','n'#010+
+  '*g2gp_Preserve case in stabs symbol',' names'#010+
+  '*g2gs_Generate stabs debug information'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
   '*g2gv_Generates programs traceable with valgrind'#010+
   '*g2gw_Generate dwarf-2 debug information (same as -gw2)'#010+
-  '*g2gw2_Generate dwarf-2 debug information'#010+
-  '*g2gw3_Generate dwarf-3 debug in','formation'#010+
+  '*g2gw2_Generate dwarf-2 debug ','information'#010+
+  '*g2gw3_Generate dwarf-3 debug information'#010+
   '**1i_Information'#010+
   '**2iD_Return compiler date'#010+
   '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
   '**2iSO_Return compiler OS'#010+
   '**2iSP_Return compiler host processor'#010+
-  '**2iTO_Return target OS'#010+
-  '**2iTP_Return target proces','sor'#010+
+  '**2iTO_','Return target OS'#010+
+  '**2iTP_Return target processor'#010+
   '**1I<x>_Add <x> to include path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x>'#010+
   '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Mobjfpc_FPC mode with Object Pascal support'#010+
-  '**2Mdelphi_Delphi 7 compatibility mode'#010,
+  '**2Mobjfpc_FPC mode with Object Pascal sup','port'#010+
+  '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mtp_TP/BP 7.0 compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**1n_Do not read the default config files'#010+
   '**1N<x>_Node tree optimizations'#010+
   '**2Nu_Unroll loops'#010+
-  '**1o<x>_Change the name of the executable produced to <','x>'#010+
+  '**1o<x>_Cha','nge the name of the executable produced to <x>'#010+
   '**1O<x>_Optimizations:'#010+
   '**2O-_Disable optimizations'#010+
   '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
   '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
-  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
-  '**2Oa<x>=<y>_Set ','alignment'#010+
+  '**2O3_Level 3 optimizations ','(-O2 + slow optimizations)'#010+
+  '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
   'values'#010+
   '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
   #010+
-  '**2Os_Optimize for size rather than speed'#010+
-  '**1pg_Generate profile code for gprof (d','efines FPC_PROFILE)'#010+
+  '**2Os_Optimize for size rather than sp','eed'#010+
+  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
   '**1R<x>_Assembler reading style:'#010+
   '**2Rdefault_Use default assembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
-  '6*2RMOT_Read motorola style assembler'#010+
+  '6*2RMOT_Read motorola style',' assembler'#010+
   '**1S<x>_Syntax options:'#010+
-  '**2S2_Sam','e as -Mobjfpc'#010+
+  '**2S2_Same as -Mobjfpc'#010+
   '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
-  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
-  '**3*','_w : Compiler also halts after warnings'#010+
+  '**3*_<n> : Compiler ha','lts after the <n> errors (default is 1)'#010+
+  '**3*_w : Compiler also halts after warnings'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
-  '**2Sh_Use ansistrings by default instead of shortstrings'#010+
-  '**','2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
+  '**2Sh_Use ansis','trings by default instead of shortstrings'#010+
+  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**3SIcom_COM compatible interface (default)'#010+
-  '**3SIcorba_CORBA compatible interface'#010+
-  '**2Sm_Support macros like C (glo','bal)'#010+
+  '**3SIcorba_CORBA compatibl','e interface'#010+
+  '**2Sm_Support macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2St_Allow static keyword in objects'#010+
   '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
-  '**1s_Do not call assembler and linker'#010+
-  '**2sh_Generat','e script to link on host'#010+
+  '**1s_Do',' not call assembler and linker'#010+
+  '**2sh_Generate script to link on host'#010+
   '**2st_Generate script to link on target'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**1T<x>_Target operating system:'#010+
-  '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
+  '3*2Temx_OS/2 via EMX (including EMX/RSX exten','der)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Version ','2 of DJ Delorie DOS extender'#010+
+  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
   '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
-  '3*2Tsunos_SunOS/Solaris'#010+
-  '3*2Twatcom_Watcom compa','tible DOS extender'#010+
+  '3*2','Tsunos_SunOS/Solaris'#010+
+  '3*2Tsymbian_Symbian OS'#010+
+  '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
   '3*2Twince_Windows CE'#010+
   '4*2Tlinux_Linux'#010+
   '6*2Tamiga_Commodore Amiga'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
-  '6*2Tlinux_Linux/m68k'#010+
+  '6*2Tlinux_L','inux/m68k'#010+
   '6*2Tmacos_Macintosh m68k (not supported)'#010+
-  '6*2Tpalmos_PalmO','S'#010+
+  '6*2Tpalmos_PalmOS'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Twince_Windows CE'#010+
   'P*2Tamiga_AmigaOS on PowerPC'#010+
   'P*2Tdarwin_Darwin and Mac OS X on PowerPC'#010+
   'P*2Tlinux_Linux on PowerPC'#010+
-  'P*2Tmacos_Mac OS (classic) on PowerPC'#010+
+  'P*2Tmacos_Mac OS (classic) on PowerP','C'#010+
   'P*2Tmorphos_MorphOS'#010+
   'S*2Tlinux_Linux'#010+
-  '**1u<x>_Undefines the symbol ','<x>'#010+
+  '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**2Un_Do not check where the unit name matches the file name'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
-  '**2Us_Compile a system unit'#010+
-  '**1v<x>_Be verbose. <x> is a combination of the following let','ters:'#010+
+  '**2Us_Compile a system',' unit'#010+
+  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**2*_e : Show errors (default)       0 : Show nothing (except errors)'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
-  '**2*_n : Show notes                  t : Show tried/used files'#010+
-  '**2*_h : Show hints                  c : Show',' conditionals'#010+
+  '**2*_n : Show notes                  t : ','Show tried/used files'#010+
+  '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_i : Show general info           d : Show debug info'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
-  '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
-  '**2*_b : Write file names mes','sages with full path'#010+
+  '**2*_a : Show everything        ','     x : Executable info (Win32 only'+
+  ')'#010+
+  '**2*_b : Write file names messages with full path'#010+
   '**2*_v : Write fpcdebug.txt with     p : Write tree.log with parse tre'+
   'e'#010+
   '**2*_    lots of debugging info'#010+
   '3*1W<x>_Target-specific options (targets)'#010+
-  'A*1W<x>_Target-specific options (targets)'#010+
-  'P*1W<x>_Target-specific options',' (targets)'#010+
+  'A*1W<x','>_Target-specific options (targets)'#010+
+  'P*1W<x>_Target-specific options (targets)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '3*2WB_Create a relocatable image (Windows)'#010+
-  'A*2WB_Create a relocatable ima','ge (Windows, Symbian)'#010+
+  '3*2WB_','Create a relocatable image (Windows)'#010+
+  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
-  'P*2WC_Specify console type application (Classic Mac OS)'#010+
-  '3*2WD_Use DEFFILE to export functions of DLL or EXE (','Windows)'#010+
+  'P*2WC_Specify console type application (Cl','assic Mac OS)'#010+
+  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
-  '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
+  '3*2WG_Specify graphic type application (EMX, OS','/2, Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG','_Specify graphic type application (Classic Mac OS)'#010+
+  'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
+  'A*2WN_Do not generate relocation code, needed for de','bugging (Windows'+
+  ')'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
-  'A*2WR_Ge','nerate relocation code (Windows)'#010+
+  'A*2WR_Generate relocation code (Windows)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**1X_Executable options:'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
-  'ux)'#010+
-  '**2Xd_Do not use standard library search path (need','ed for cross comp'+
-  'ile)'#010+
+  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, ','FreeBSD, L'+
+  'inux)'#010+
+  '**2Xd_Do not use standard library search path (needed for cross compil'+
+  'e)'#010+
   '**2Xe_Use external linker'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xm_Generate link map'#010+
-  '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
-  's '#039'main'#039')'#010+
-  '**','2XP<x>_Prepend the binutils names with the prefix <x>'#010+
+  '**2XM<x','>_Set the name of the '#039'main'#039' program routine (default'+
+  ' is '#039'main'#039')'#010+
+  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
   '**2Xr<x>_Set library search path to <x> (needed for cross compile) (Be'+
   'OS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
-  '**2Xs_Str','ip all symbols from executable'#010+
+  '**2XR<x>_Prepend <x> to all linker sea','rch paths (BeOS, Darwin, FreeB'+
+  'SD, Linux, Mac OS, Solaris)'#010+
+  '**2Xs_Strip all symbols from executable'#010+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
+  '**2XX_Try',' to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
-  '**1?','_Show this help'#010+
+  '**1?_Show this help'#010+
   '**1h_Shows this help without waiting'#000
 );

+ 19 - 3
compiler/nadd.pas

@@ -479,7 +479,7 @@ implementation
                 end
             end;
 
-        { Add,Sub,Mul with constant 0 or 1?  }
+        { Add,Sub,Mul with constant 0, 1 or -1?  }
         if is_constintnode(right) and is_integer(left.resultdef) then
           begin
             if tordconstnode(right).value = 0 then
@@ -497,6 +497,13 @@ implementation
                   muln:
                    result := left.getcopy;
                 end;
+              end
+            else if tordconstnode(right).value = -1 then
+              begin
+                case nodetype of
+                  muln:
+                   result := cunaryminusnode.create(left.getcopy);
+                end;
               end;
             if assigned(result) then
               exit;
@@ -520,6 +527,13 @@ implementation
                   muln:
                    result := right.getcopy;
                 end;
+              end
+            else if tordconstnode(left).value = -1 then
+              begin
+                case nodetype of
+                  muln:
+                   result := cunaryminusnode.create(right.getcopy);
+                end;
               end;
             if assigned(result) then
               exit;
@@ -2157,8 +2171,10 @@ implementation
             ((right.nodetype = typeconvn) and
              is_integer(ttypeconvnode(right).left.resultdef) and
              not(torddef(ttypeconvnode(right).left.resultdef).ordtype in [u64bit,s64bit])) and
-             (is_signed(ttypeconvnode(left).left.resultdef) =
-              is_signed(ttypeconvnode(right).left.resultdef)))) then
+             ((is_signed(ttypeconvnode(left).left.resultdef) =
+               is_signed(ttypeconvnode(right).left.resultdef)) or
+              (is_signed(ttypeconvnode(left).left.resultdef) and
+               (torddef(ttypeconvnode(right).left.resultdef).ordtype in [u8bit,u16bit]))))) then
           begin
             temp := ttypeconvnode(left).left;
             ttypeconvnode(left).left := nil;

+ 62 - 40
compiler/ncal.pas

@@ -39,6 +39,7 @@ interface
        tcallnodeflag = (
          cnf_typedefset,
          cnf_return_value_used,
+         cnf_do_inline,
          cnf_inherited,
          cnf_anon_inherited,
          cnf_new_call,
@@ -47,6 +48,7 @@ interface
          cnf_uses_varargs,       { varargs are used in the declaration }
          cnf_create_failed       { exception thrown in constructor -> don't call beforedestruction }
        );
+
        tcallnodeflags = set of tcallnodeflag;
 
        tcallnode = class(tbinarynode)
@@ -70,6 +72,7 @@ interface
           procedure createinlineparas(var createstatement, deletestatement: tstatementnode);
           function  replaceparaload(var n: tnode; arg: pointer): foreachnoderesult;
           procedure createlocaltemps(p:TObject;arg:pointer);
+          procedure check_inlining;
           function  pass1_inline:tnode;
           function  getfuncretassignment(inlineblock: tblocknode): tnode;
        protected
@@ -169,7 +172,7 @@ interface
           procedure printnodetree(var t:text);override;
           { returns whether a parameter contains a type conversion from }
           { a refcounted into a non-refcounted type                     }
-          function contains_unsafe_typeconversion: boolean;
+          function can_be_inlined: boolean;
 
           property value : tnode read left write left;
           property nextpara : tnode read right write right;
@@ -1103,11 +1106,12 @@ implementation
       end;
 
 
-    function tcallparanode.contains_unsafe_typeconversion: boolean;
+    function tcallparanode.can_be_inlined: boolean;
       var
         n: tnode;
       begin
         n:=left;
+        result:=false;
         while assigned(n) and
               (n.nodetype=typeconvn) do
           begin
@@ -1117,13 +1121,21 @@ implementation
                 is_class(n.resultdef)) and
                (ttypeconvnode(n).left.resultdef.needs_inittable and
                 not is_class(ttypeconvnode(n).left.resultdef)) then
-              begin
-                result:=true;
-                exit;
-              end;
+              exit;
             n:=ttypeconvnode(n).left;
           end;
-        result:=false;
+        { also check for dereferencing constant pointers, like }
+        { tsomerecord(nil^) passed to a const r: tsomerecord   }
+        { parameter                                           }
+        if (n.nodetype=derefn) then
+          begin
+            repeat
+              n:=tunarynode(n).left;
+            until (n.nodetype<>typeconvn);
+            if (n.nodetype in [niln,pointerconstn]) then
+              exit
+          end;
+        result:=true;
       end;
 
 
@@ -2797,7 +2809,7 @@ implementation
         if not(assigned(hp)) or
            (hp.left.nodetype <> tempdeleten) then
           exit;
-        
+
         { the function result once more }
         hp:=tstatementnode(hp.right);
         if not(assigned(hp)) or
@@ -2902,46 +2914,56 @@ implementation
       end;
 
 
+    procedure tcallnode.check_inlining;
+      var
+        st   : tsymtable;
+        para : tcallparanode;
+      begin
+        { Can we inline the procedure? }
+        if ([po_inline,po_has_inlininginfo] <= procdefinition.procoptions) then
+          begin
+             include(callnodeflags,cnf_do_inline);
+            { Check if we can inline the procedure when it references proc/var that
+              are not in the globally available }
+            st:=procdefinition.owner;
+            if (st.symtabletype=ObjectSymtable) then
+              st:=st.defowner.owner;
+            if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and
+               (st.symtabletype=globalsymtable) and
+               (not st.iscurrentunit) then
+              begin
+                Comment(V_lineinfo+V_Debug,'Not inlining "'+tprocdef(procdefinition).procsym.realname+'", references static symtable');
+                exclude(callnodeflags,cnf_do_inline);
+              end;
+            para:=tcallparanode(parameters);
+            while assigned(para) do
+              begin
+                if not para.can_be_inlined then
+                  begin
+                    Comment(V_lineinfo+V_Debug,'Not inlining "'+tprocdef(procdefinition).procsym.realname+'", invocation parameter contains an unsafe/unsupported construct');
+                    exclude(callnodeflags,cnf_do_inline);
+                    break;
+                  end;
+                para:=tcallparanode(para.nextpara);
+              end;
+          end;
+      end;
+
+
     function tcallnode.pass_1 : tnode;
       var
         st : TSymtable;
         n: tcallparanode;
-        do_inline: boolean;
       begin
          result:=nil;
 
-         { Can we inline the procedure? }
-         if ([po_inline,po_has_inlininginfo] <= procdefinition.procoptions) then
+         { Check if the call can be inlined, sets the cnf_do_inline flag }
+         check_inlining;
+
+         if cnf_do_inline in callnodeflags then
            begin
-             { Check if we can inline the procedure when it references proc/var that
-               are not in the globally available }
-             st:=procdefinition.owner;
-             if (st.symtabletype=ObjectSymtable) then
-               st:=st.defowner.owner;
-             do_inline:=true;
-             if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and
-                (st.symtabletype=globalsymtable) and
-                (not st.iscurrentunit) then
-               begin
-                 Comment(V_lineinfo+V_Debug,'Not inlining "'+tprocdef(procdefinition).procsym.realname+'", references static symtable');
-                 do_inline:=false;
-               end;
-             n:=tcallparanode(parameters);
-             while assigned(n) do
-               begin
-                 if n.contains_unsafe_typeconversion then
-                   begin
-                     Comment(V_lineinfo+V_Debug,'Not inlining "'+tprocdef(procdefinition).procsym.realname+'", invocation parameter contains unsafe type conversion');
-                     do_inline:=false;
-                     break;
-                   end;
-                 n:=tcallparanode(n.nextpara);
-               end;
-             if do_inline then
-               begin
-                 result:=pass1_inline;
-                 exit;
-               end;
+             result:=pass1_inline;
+             exit;
            end;
 
          { calculate the parameter info for the procdef }

+ 2 - 2
compiler/ncginl.pas

@@ -243,7 +243,7 @@ implementation
          hregister : tregister;
       begin
         if inlinenumber=in_sizeof_x then
-          location_reset(location,LOC_REGISTER,OS_INT)
+          location_reset(location,LOC_REGISTER,def_cgsize(resultdef))
         else
           location_reset(location,LOC_REGISTER,OS_ADDR);
         { for both cases load vmt }
@@ -346,7 +346,7 @@ implementation
            if is_widestring(left.resultdef) then
              cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SHR,OS_INT,1,hregister);
            cg.a_label(current_asmdata.CurrAsmList,lengthlab);
-           location_reset(location,LOC_REGISTER,OS_INT);
+           location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
            location.register:=hregister;
          end;
       end;

+ 2 - 2
compiler/ncgld.pas

@@ -504,10 +504,10 @@ implementation
                   begin
                     if (target_info.endian = endian_little) then
                       cg.a_load_const_ref(current_asmdata.CurrAsmList,OS_16,(tordconstnode(right).value shl 8) or 1,
-                          left.location.reference)
+                          setalignment(left.location.reference,1))
                     else
                       cg.a_load_const_ref(current_asmdata.CurrAsmList,OS_16,tordconstnode(right).value or (1 shl 8),
-                          left.location.reference);
+                          setalignment(left.location.reference,1));
                   end
                 else
                   begin

+ 31 - 5
compiler/ncgmat.pas

@@ -173,13 +173,29 @@ implementation
 
 {$ifndef cpu64bit}
     procedure tcgunaryminusnode.second_64bit;
+      var
+        tr: tregister;
+        hl: tasmlabel;
       begin
         secondpass(left);
-        { load left operator in a register }
-        location_copy(location,left.location);
-        location_force_reg(current_asmdata.CurrAsmList,location,OS_64,false);
-        cg64.a_op64_loc_reg(current_asmdata.CurrAsmList,OP_NEG,OS_64,
-           location,joinreg64(location.register64.reglo,location.register64.reghi));
+        location_reset(location,LOC_REGISTER,left.location.size);
+        location.register64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+        location.register64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+        cg64.a_op64_loc_reg(current_asmdata.CurrAsmList,OP_NEG,OS_S64,
+          left.location,joinreg64(location.register64.reglo,location.register64.reghi));
+        { there's only overflow in case left was low(int64) -> -left = left }
+        if (cs_check_overflow in current_settings.localswitches) then
+          begin
+            tr:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+            cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_INT,
+              aint($80000000),location.register64.reghi,tr);
+            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_INT,
+              location.register64.reglo,tr);
+            current_asmdata.getjumplabel(hl);
+            cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_INT,OC_NE,0,tr,hl);
+            cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW');
+            cg.a_label(current_asmdata.CurrAsmList,hl);
+          end;
       end;
 {$endif cpu64bit}
 
@@ -215,12 +231,22 @@ implementation
 
 
     procedure tcgunaryminusnode.second_integer;
+      var
+        hl: tasmlabel;
       begin
         secondpass(left);
         { load left operator in a register }
         location_copy(location,left.location);
         location_force_reg(current_asmdata.CurrAsmList,location,OS_SINT,false);
         cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_SINT,location.register,location.register);
+        
+        if (cs_check_overflow in current_settings.localswitches) then
+          begin
+            current_asmdata.getjumplabel(hl);
+            cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_SINT,OC_NE,low(aint),location.register,hl);
+            cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW');
+            cg.a_label(current_asmdata.CurrAsmList,hl);
+          end;
       end;
 
 

+ 2 - 2
compiler/ncgutil.pas

@@ -2138,7 +2138,7 @@ implementation
 
         { oldfpccall expects all registers to be destroyed }
         if current_procinfo.procdef.proccalloption<>pocall_oldfpccall then
-          cg.g_save_standard_registers(list);
+            cg.g_save_registers(list);
       end;
 
 
@@ -2150,7 +2150,7 @@ implementation
 
         { oldfpccall expects all registers to be destroyed }
         if current_procinfo.procdef.proccalloption<>pocall_oldfpccall then
-          cg.g_restore_standard_registers(list);
+          cg.g_restore_registers(list);
       end;
 
 

+ 7 - 1
compiler/ncnv.pas

@@ -1341,7 +1341,11 @@ implementation
     function ttypeconvnode.typecheck_interface_to_guid : tnode;
       begin
         if assigned(tobjectdef(left.resultdef).iidguid) then
-          result:=cguidconstnode.create(tobjectdef(left.resultdef).iidguid^);
+          begin
+            if not(oo_has_valid_guid in tobjectdef(left.resultdef).objectoptions) then
+              CGMessage1(type_interface_has_no_guid,tobjectdef(left.resultdef).typename);
+            result:=cguidconstnode.create(tobjectdef(left.resultdef).iidguid^);
+          end;
       end;
 
 
@@ -3135,6 +3139,8 @@ implementation
              begin
                if assigned(tobjectdef(right.resultdef).iidguid) then
                  begin
+                   if not(oo_has_valid_guid in tobjectdef(right.resultdef).objectoptions) then
+                     CGMessage1(type_interface_has_no_guid,tobjectdef(right.resultdef).typename);
                    hp:=cguidconstnode.create(tobjectdef(right.resultdef).iidguid^);
                    right.free;
                    right:=hp;

+ 38 - 4
compiler/ninl.pas

@@ -130,7 +130,7 @@ implementation
       end;
 
 
-      function tinlinenode.handle_str : tnode;
+    function tinlinenode.handle_str : tnode;
       var
         lenpara,
         fracpara,
@@ -313,6 +313,23 @@ implementation
       end;
 
 
+    procedure maybe_convert_to_string(var n: tnode);
+      begin
+        { stringconstnodes are arrays of char. It's much more }
+        { efficient to write a constant string, so convert    }
+        { either to shortstring or ansistring depending on    }
+        { length                                              }
+        if (n.nodetype=stringconstn) then
+          if is_chararray(n.resultdef) then
+            if (tstringconstnode(n).len<=255) then
+              inserttypeconv(n,cshortstringtype)
+            else
+              inserttypeconv(n,cansistringtype)
+          else if is_widechararray(n.resultdef) then
+            inserttypeconv(n,cwidestringtype);
+      end;
+
+
     function tinlinenode.handle_read_write: tnode;
 
       const
@@ -602,6 +619,10 @@ implementation
                     para.left:=p1;
                   end;
 
+                if inlinenumber in [in_write_x,in_writeln_x] then
+                  { prefer strings to chararrays }
+                  maybe_convert_to_string(para.left);
+
                 if is_currency(para.left.resultdef) then
                   begin
                     is_real:=true;
@@ -911,7 +932,7 @@ implementation
         codepara,
         sizepara,
         newparas      : tcallparanode;
-        orgcode       : tnode;
+        orgcode,tc    : tnode;
         newstatement  : tstatementnode;
         newblock      : tblocknode;
         tempcode      : ttempcreatenode;
@@ -1070,9 +1091,22 @@ implementation
           Use a trick to prevent a type size mismatch warning to be generated by the
           assignment node. First convert implicitly to the resultdef. This will insert
           the range check. The Second conversion is done explicitly to hide the implicit conversion
-          for the assignment node and therefor preventing the warning (PFV) }
+          for the assignment node and therefor preventing the warning (PFV)
+
+          The implicit conversion is avoided for enums because implicit conversion between
+          longint (which is what fpc_val_enum_shortstr returns) and enumerations is not
+          possible. (DM).
+
+          The implicit conversion is also avoided for COMP type if it is handled by FPU (x86)
+          to prevent warning about automatic type conversion. }
+        if (destpara.resultdef.typ=enumdef) or
+           ((destpara.resultdef.typ=floatdef) and (tfloatdef(destpara.resultdef).floattype=s64comp))
+          then
+            tc:=ccallnode.createintern(procname,newparas)
+        else
+          tc:=ctypeconvnode.create(ccallnode.createintern(procname,newparas),destpara.left.resultdef);
         addstatement(newstatement,cassignmentnode.create(
-          destpara.left,ctypeconvnode.create_internal(ctypeconvnode.create(ccallnode.createintern(procname,newparas),destpara.left.resultdef),destpara.left.resultdef)));
+          destpara.left,ctypeconvnode.create_internal(tc,destpara.left.resultdef)));
 
         { dispose of the enclosing paranode of the destination }
         destpara.left := nil;

+ 6 - 5
compiler/nmat.pas

@@ -634,7 +634,8 @@ implementation
            exit;
 
          resultdef:=left.resultdef;
-         if (left.resultdef.typ=floatdef) then
+         if (left.resultdef.typ=floatdef) or
+            is_currency(left.resultdef) then
            begin
            end
 {$ifdef SUPPORT_MMX}
@@ -653,14 +654,14 @@ implementation
 {$ifndef cpu64bit}
          else if is_64bit(left.resultdef) then
            begin
+             inserttypeconv(left,s64inttype);
+             resultdef:=left.resultdef
            end
 {$endif cpu64bit}
          else if (left.resultdef.typ=orddef) then
            begin
-              if (torddef(left.resultdef).ordtype <> scurrency) then begin
-                inserttypeconv(left,sinttype);
-                resultdef:=left.resultdef;
-              end;
+             inserttypeconv(left,sinttype);
+             resultdef:=left.resultdef
            end
          else
            begin

+ 4 - 2
compiler/ogbase.pas

@@ -208,9 +208,11 @@ interface
      end;
      TObjSectionClass = class of TObjSection;
 
+     TString80 = string[80];
+
      TObjData = class(TLinkedListItem)
      private
-       FName       : string[80];
+       FName       : TString80;
        FCurrObjSec : TObjSection;
        FObjSectionList  : TFPHashObjectList;
        FCObjSection     : TObjSectionClass;
@@ -256,7 +258,7 @@ interface
        procedure afteralloc;virtual;
        procedure afterwrite;virtual;
        procedure resetsections;
-       property Name:string[80] read FName;
+       property Name:TString80 read FName;
        property CurrObjSec:TObjSection read FCurrObjSec;
        property ObjSymbolList:TFPHashObjectList read FObjSymbolList;
        property ObjSectionList:TFPHashObjectList read FObjSectionList;

+ 1 - 0
compiler/pdecobj.pas

@@ -368,6 +368,7 @@ implementation
               valid:=string2guid(aktobjectdef.iidstr^,aktobjectdef.iidguid^);
               if (classtype in [odt_interfacecom,odt_dispinterface]) and not assigned(aktobjectdef.iidguid) and not valid then
                 Message(parser_e_improper_guid_syntax);
+              include(aktobjectdef.objectoptions,oo_has_valid_guid);
             end
           else
             begin

+ 6 - 13
compiler/pdecsub.pas

@@ -2480,15 +2480,8 @@ const
               { check arguments, we need to check only the user visible parameters. The hidden parameters
                 can be in a different location because of the calling convention, eg. L-R vs. R-L order (PFV) }
               (
-               (compare_paras(currpd.paras,fwpd.paras,cp_none,[cpo_comparedefaultvalue,cpo_ignorehidden])>=te_equal) and
-               { for operators equal_paras is not enough !! }
-               ((currpd.proctypeoption<>potype_operator) or (optoken<>_ASSIGNMENT) or
-                { be careful here, equal_defs doesn't take care of unique }
-                (fwpd.returndef=currpd.returndef) or
-                (equal_defs(fwpd.returndef,currpd.returndef) and
-                 not(df_unique in fwpd.returndef.defoptions) and not(df_unique in currpd.returndef.defoptions)
-                )
-               )
+               (compare_paras(currpd.paras,fwpd.paras,cp_none,[cpo_comparedefaultvalue,cpo_ignorehidden,cpo_openequalisexact])=te_exact) and
+               (fwpd.returndef=currpd.returndef)
               ) then
              begin
                { Check if we've found the forwarddef, if found then
@@ -2500,9 +2493,9 @@ const
 
                    if not(m_repeat_forward in current_settings.modeswitches) and
                       (fwpd.proccalloption<>currpd.proccalloption) then
-                     paracompopt:=[cpo_ignorehidden,cpo_comparedefaultvalue]
+                     paracompopt:=[cpo_ignorehidden,cpo_comparedefaultvalue,cpo_openequalisexact]
                    else
-                     paracompopt:=[cpo_comparedefaultvalue];
+                     paracompopt:=[cpo_comparedefaultvalue,cpo_openequalisexact];
 
                    { Check calling convention }
                    if (fwpd.proccalloption<>currpd.proccalloption) then
@@ -2539,8 +2532,8 @@ const
                      also the parameters must match also with the type }
                    if ((m_repeat_forward in current_settings.modeswitches) or
                        not is_bareprocdef(currpd)) and
-                      ((compare_paras(currpd.paras,fwpd.paras,cp_all,paracompopt)<te_equal) or
-                       (not equal_defs(fwpd.returndef,currpd.returndef))) then
+                      ((compare_paras(currpd.paras,fwpd.paras,cp_all,paracompopt)<>te_exact) or
+                       (fwpd.returndef<>currpd.returndef)) then
                      begin
                        MessagePos1(currpd.fileinfo,parser_e_header_dont_match_forward,
                                    fwpd.fullprocname(false));

+ 7 - 0
compiler/pexpr.pas

@@ -1785,6 +1785,13 @@ implementation
                     until not try_to_consume(_COMMA);
                     consume(_RECKKLAMMER);
                   end
+                else if try_to_consume(_LKLAMMER) then
+                  begin
+                    repeat
+                      comp_expr(true);
+                    until not try_to_consume(_COMMA);
+                    consume(_RKLAMMER);
+                  end
                 else
                   break;
             until false;

+ 8 - 12
compiler/powerpc/agppcmpw.pas

@@ -238,8 +238,11 @@ interface
       end;
     end;
 
-    function branchmode(o: tasmop): string[4];
-      var tempstr: string[4];
+    type
+      topstr = string[4];
+
+    function branchmode(o: tasmop): topstr;
+      var tempstr: topstr;
       begin
         tempstr := '';
         case o of
@@ -663,12 +666,6 @@ interface
       AsmLn;
     end;
 
-    var
-      LasTSec : TAsmSectiontype;
-      lastfileinfo : tfileposinfo;
-      infile,
-      lastinfile   : tinputfile;
-
     const
       ait_const2str:array[aitconst_32bit..aitconst_8bit] of string[8]=
         (#9'dc.l'#9,#9'dc.w'#9,#9'dc.b'#9);
@@ -765,8 +762,8 @@ interface
               ;
             ait_section:
               begin
-                 {if LasTSec<>sec_none then
-                  AsmWriteLn('_'+target_asm.secnames[LasTSec]+#9#9'ENDS');}
+                 {if LastSecType<>sec_none then
+                  AsmWriteLn('_'+target_asm.secnames[LastSecType]+#9#9'ENDS');}
 
                  if tai_section(hp).sectype<>sec_none then
                   begin
@@ -786,7 +783,7 @@ interface
                     AsmLn;
                     AsmWriteLn(#9+secnames[tai_section(hp).sectype]+' '+cur_CSECT_name+cur_CSECT_class);
                   end;
-                 LasTSec:=tai_section(hp).sectype;
+                 LastSecType:=tai_section(hp).sectype;
                end;
             ait_align:
               begin
@@ -1231,7 +1228,6 @@ interface
       if assigned(current_module.mainsource) then
        comment(v_info,'Start writing MPW-styled assembler output for '+current_module.mainsource^);
 {$endif}
-      LasTSec:=sec_none;
 
       WriteAsmFileHeader;
       WriteExternals;

+ 4 - 4
compiler/powerpc/cgcpu.pas

@@ -78,8 +78,8 @@ unit cgcpu;
 
         procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_exit(list : TAsmList;parasize : longint;nostackframe:boolean); override;
-        procedure g_save_standard_registers(list:TAsmList); override;
-        procedure g_restore_standard_registers(list:TAsmList); override;
+        procedure g_save_registers(list:TAsmList); override;
+        procedure g_restore_registers(list:TAsmList); override;
 
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : aint);override;
 
@@ -857,13 +857,13 @@ const
 
 { *********** entry/exit code and address loading ************ }
 
-    procedure tcgppc.g_save_standard_registers(list:TAsmList);
+    procedure tcgppc.g_save_registers(list:TAsmList);
       begin
         { this work is done in g_proc_entry }
       end;
 
 
-    procedure tcgppc.g_restore_standard_registers(list:TAsmList);
+    procedure tcgppc.g_restore_registers(list:TAsmList);
       begin
         { this work is done in g_proc_exit }
       end;

+ 3 - 0
compiler/powerpc/cpubase.pas

@@ -348,6 +348,9 @@ uses
         RS_R30,RS_R31
       );
 
+      { this is only for the generic code which is not used for this architecture }
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);
+
       {# Required parameter alignment when calling a routine declared as
          stdcall and cdecl. The alignment value should be the one defined
          by GCC or the target ABI.

+ 4 - 4
compiler/powerpc64/cgcpu.pas

@@ -90,8 +90,8 @@ type
       boolean); override;
     procedure g_proc_exit(list: TAsmList; parasize: longint; nostackframe:
       boolean); override;
-    procedure g_save_standard_registers(list: TAsmList); override;
-    procedure g_restore_standard_registers(list: TAsmList); override;
+    procedure g_save_registers(list: TAsmList); override;
+    procedure g_restore_registers(list: TAsmList); override;
 
     procedure a_loadaddr_ref_reg(list: TAsmList; const ref: treference; r:
       tregister); override;
@@ -1278,13 +1278,13 @@ end;
 
 { *********** entry/exit code and address loading ************ }
 
-procedure tcgppc.g_save_standard_registers(list: TAsmList);
+procedure tcgppc.g_save_registers(list: TAsmList);
 begin
   { this work is done in g_proc_entry; additionally it is not safe
   to use it because it is called at some weird time }
 end;
 
-procedure tcgppc.g_restore_standard_registers(list: TAsmList);
+procedure tcgppc.g_restore_registers(list: TAsmList);
 begin
   { this work is done in g_proc_exit; mainly because it is not safe to
   put the register restore code here because it is called at some weird time }

+ 3 - 0
compiler/powerpc64/cpubase.pas

@@ -348,6 +348,9 @@ const
     RS_R26, RS_R27, RS_R28, RS_R29, RS_R30, RS_R31
     );
 
+  { this is only for the generic code which is not used for this architecture }
+  saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);  
+  
   {# Required parameter alignment when calling a routine declared as
      stdcall and cdecl. The alignment value should be the one defined
      by GCC or the target ABI.

+ 5 - 3
compiler/ppcgen/agppcgas.pas

@@ -52,10 +52,12 @@ unit agppcgas;
       function MakeCmdLine: TCmdStr; override;
     end;
 
+    topstr = string[4];
+
     function getreferencestring(var ref : treference) : string;
     function getopstr_jmp(const o:toper) : string;
     function getopstr(const o:toper) : string;
-    function branchmode(o: tasmop): string[4];
+    function branchmode(o: tasmop): topstr;
     function cond2str(op: tasmop; c: tasmcond): string;  
 
   implementation
@@ -209,8 +211,8 @@ unit agppcgas;
     end;
 
 
-    function branchmode(o: tasmop): string[4];
-      var tempstr: string[4];
+    function branchmode(o: tasmop): topstr;
+      var tempstr: topstr;
       begin
         tempstr := '';
         case o of

+ 1 - 1
compiler/pstatmnt.pas

@@ -1079,7 +1079,7 @@ implementation
              { blockn support because a read/write is changed into a blocknode }
              { with a separate statement for each read/write operation (JM)    }
              { the same is true for val() if the third parameter is not 32 bit }
-             if not(p.nodetype in [nothingn,calln,ifn,assignn,breakn,inlinen,
+             if not(p.nodetype in [nothingn,errorn,calln,ifn,assignn,breakn,inlinen,
                                    continuen,labeln,blockn,exitn]) or
                 ((p.nodetype=inlinen) and
                  not is_void(p.resultdef)) then

+ 10 - 5
compiler/rgobj.pas

@@ -660,7 +660,8 @@ unit rgobj;
         begin
           if movelist=nil then
             begin
-              getmem(movelist,sizeof(tmovelistheader)+60*sizeof(pointer));
+              { don't use sizeof(tmovelistheader), because that ignores alignment }
+              getmem(movelist,ptrint(@movelist^.data)-ptrint(movelist)+60*sizeof(pointer));
               movelist^.header.maxcount:=60;
               movelist^.header.count:=0;
               movelist^.header.sorted_until:=0;
@@ -670,7 +671,8 @@ unit rgobj;
               if movelist^.header.count>=movelist^.header.maxcount then
                 begin
                   movelist^.header.maxcount:=movelist^.header.maxcount*2;
-                  reallocmem(movelist,sizeof(tmovelistheader)+movelist^.header.maxcount*sizeof(pointer));
+                  { don't use sizeof(tmovelistheader), because that ignores alignment }
+                  reallocmem(movelist,ptrint(@movelist^.data)-ptrint(movelist)+movelist^.header.maxcount*sizeof(pointer));
                 end;
             end;
           movelist^.data[movelist^.header.count]:=data;
@@ -1657,9 +1659,11 @@ unit rgobj;
                               if regtype in [R_INTREGISTER,R_ADDRESSREGISTER] then
                                 with ref^ do
                                   begin
-                                    if base<>NR_NO then
+                                    if (base<>NR_NO) and
+                                       (getregtype(base)=regtype) then
                                       setsupreg(base,reginfo[getsupreg(base)].colour);
-                                    if index<>NR_NO then
+                                    if (index<>NR_NO) and
+                                       (getregtype(index)=regtype) then
                                       setsupreg(index,reginfo[getsupreg(index)].colour);
                                   end;
                             end;
@@ -1669,7 +1673,8 @@ unit rgobj;
                               if regtype=R_INTREGISTER then
                                 begin
                                   so:=shifterop;
-                                  if so^.rs<>NR_NO then
+                                  if (so^.rs<>NR_NO) and
+                                     (getregtype(so^.rs)=regtype) then
                                     setsupreg(so^.rs,reginfo[getsupreg(so^.rs)].colour);
                                 end;
                             end;

+ 71 - 1
compiler/scanner.pas

@@ -282,7 +282,7 @@ implementation
           current_settings.modeswitches:=objfpcmodeswitches;
           { TODO: enable this for 2.3/2.9 }
           //  include(current_settings.localswitches, cs_typed_addresses);
-        end 
+        end
 {$ifdef gpc_mode}
         else if s='GPC' then
           current_settings.modeswitches:=gpcmodeswitches
@@ -724,6 +724,7 @@ In case not, the value returned can be arbitrary.
            mac: tmacro;
            srsym : tsym;
            srsymtable : TSymtable;
+           hdef : TDef;
            l : longint;
            w : integer;
            hasKlammer: Boolean;
@@ -874,6 +875,75 @@ In case not, the value returned can be arbitrary.
                       Message(scan_e_preproc_syntax_error);
                   end
                 else
+                if current_scanner.preproc_pattern='HIGH' then
+                  begin
+                    factorType:= [ctetInteger];
+                    preproc_consume(_ID);
+                    current_scanner.skipspace;
+                    if current_scanner.preproc_token =_LKLAMMER then
+                      begin
+                        preproc_consume(_LKLAMMER);
+                        current_scanner.skipspace;
+                      end
+                    else
+                      Message(scan_e_preproc_syntax_error);
+
+                    if eval then
+                      if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
+                        begin
+                          hdef:=nil;
+                          hs:='';
+                          l:=0;
+                          case srsym.typ of
+                            staticvarsym,
+                            localvarsym,
+                            paravarsym :
+                              hdef:=tabstractvarsym(srsym).vardef;
+                            typesym:
+                              hdef:=ttypesym(srsym).typedef;
+                            else
+                              Message(scan_e_error_in_preproc_expr);
+                          end;
+                          if hdef<>nil then
+                            begin
+                              if hdef.typ=setdef then
+                                hdef:=tsetdef(hdef).elementdef;
+                              case hdef.typ of
+                                orddef:
+                                  str(torddef(hdef).high,hs);
+                                enumdef:
+                                  l:=tenumdef(hdef).maxval;
+                                arraydef:
+                                  if is_open_array(hdef) or is_array_of_const(hdef) or is_dynamic_array(hdef) then
+                                    Message(type_e_mismatch)
+                                  else
+                                    l:=tarraydef(hdef).highrange;
+                                stringdef:
+                                  if is_open_string(hdef) or is_ansistring(hdef) or is_widestring(hdef) then
+                                    Message(type_e_mismatch)
+                                  else
+                                    l:=tstringdef(hdef).len;
+                                else
+                                  Message(type_e_mismatch);
+                              end;
+                            end;
+                          if hs='' then
+                            str(l,read_factor)
+                          else
+                            read_factor:=hs;
+                        end
+                      else
+                        Message1(sym_e_id_not_found,current_scanner.preproc_pattern);
+
+                    preproc_consume(_ID);
+                    current_scanner.skipspace;
+
+                    if current_scanner.preproc_token =_RKLAMMER then
+                      preproc_consume(_RKLAMMER)
+                    else
+                      Message(scan_e_preproc_syntax_error);
+                  end
+                else
                 if current_scanner.preproc_pattern='DECLARED' then
                   begin
                     factorType:= [ctetBoolean];

+ 4 - 4
compiler/sparc/cgcpu.pas

@@ -84,8 +84,8 @@ interface
         procedure g_overflowCheck_loc(List:TAsmList;const Loc:TLocation;def:TDef;ovloc : tlocation);override;
         procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean);override;
-        procedure g_restore_standard_registers(list:TAsmList);override;
-        procedure g_save_standard_registers(list : TAsmList);override;
+        procedure g_restore_registers(list:TAsmList);override;
+        procedure g_save_registers(list : TAsmList);override;
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : aint);override;
         procedure g_concatcopy_unaligned(list : TAsmList;const source,dest : treference;len : aint);override;
         procedure g_concatcopy_move(list : TAsmList;const source,dest : treference;len : aint);
@@ -1065,7 +1065,7 @@ implementation
       end;
 
 
-    procedure TCgSparc.g_restore_standard_registers(list:TAsmList);
+    procedure TCgSparc.g_restore_registers(list:TAsmList);
       begin
         { The sparc port uses the sparc standard calling convetions so this function has no used }
       end;
@@ -1114,7 +1114,7 @@ implementation
       end;
 
 
-    procedure TCgSparc.g_save_standard_registers(list : TAsmList);
+    procedure TCgSparc.g_save_registers(list : TAsmList);
       begin
         { The sparc port uses the sparc standard calling convetions so this function has no used }
       end;

+ 3 - 0
compiler/sparc/cpubase.pas

@@ -304,6 +304,9 @@ uses
       }
       saved_standard_registers : array[0..0] of tsuperregister = (RS_NO);
 
+      { this is only for the generic code which is not used for this architecture }
+      saved_mm_registers : array[0..0] of tsuperregister = (RS_NO);
+      
       {# Required parameter alignment when calling a routine declared as
          stdcall and cdecl. The alignment value should be the one defined
          by GCC or the target ABI.

+ 2 - 1
compiler/symconst.pas

@@ -303,7 +303,8 @@ type
     oo_has_msgstr,
     oo_has_msgint,
     oo_can_have_published,{ the class has rtti, i.e. you can publish properties }
-    oo_has_default_property
+    oo_has_default_property,
+    oo_has_valid_guid
   );
   tobjectoptions=set of tobjectoption;
 

+ 27 - 10
compiler/symtable.pas

@@ -581,8 +581,7 @@ implementation
                   end
                 else if (tsym(sym).owner.symtabletype=ObjectSymtable) then
                   MessagePos2(tsym(sym).fileinfo,sym_n_private_identifier_only_set,tsym(sym).owner.realname^,tsym(sym).realname)
-                else if not(vo_is_public in tabstractvarsym(sym).varoptions) and
-                        not(vo_is_funcret in tabstractvarsym(sym).varoptions) then
+                else if tabstractvarsym(sym).varoptions*[vo_is_funcret,vo_is_public,vo_is_external]=[] then
                   MessagePos1(tsym(sym).fileinfo,sym_n_local_identifier_only_set,tsym(sym).realname);
              end
            else if (tabstractvarsym(sym).varstate = vs_read_not_warned) and
@@ -1041,16 +1040,26 @@ implementation
          { procsym and propertysym have special code
            to override values in inherited classes. For other
            symbols check for duplicates }
-         if not(sym.typ in [procsym,propertysym]) and
-            (
-             not(m_delphi in current_settings.modeswitches) or
-             is_object(tdef(defowner))
-            ) then
+         if not(sym.typ in [procsym,propertysym]) then
            begin
               { but private ids can be reused }
               hsym:=search_class_member(tobjectdef(defowner),hashedid.id);
               if assigned(hsym) and
-                 tsym(hsym).is_visible_for_object(tobjectdef(defowner),tobjectdef(defowner)) then
+                 (
+                  (not(m_delphi in current_settings.modeswitches) and
+                   tsym(hsym).is_visible_for_object(tobjectdef(defowner),tobjectdef(defowner))
+                  ) or
+                  (
+                   { In Delphi, you can repeat members of a parent class. You can't }
+                   { do this for objects however, and you (obviouly) can't          }
+                   { declare two fields with the same name in a single class        }
+                   (m_delphi in current_settings.modeswitches) and
+                   (
+                    is_object(tdef(defowner)) or
+                    (hsym.owner = self)
+                   )
+                  )
+                 ) then
                 begin
                   DuplicateSym(hashedid,sym,hsym);
                   result:=true;
@@ -1168,7 +1177,11 @@ implementation
         if not is_funcret_sym(sym) and
            (defowner.typ=procdef) and
            assigned(tprocdef(defowner)._class) and
-           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) then
+           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) and
+           (
+            not(m_delphi in current_settings.modeswitches) or
+            is_object(tprocdef(defowner)._class)
+           ) then
           result:=tprocdef(defowner)._class.symtable.checkduplicate(hashedid,sym);
       end;
 
@@ -1194,7 +1207,11 @@ implementation
         if not(m_duplicate_names in current_settings.modeswitches) and
            (defowner.typ=procdef) and
            assigned(tprocdef(defowner)._class) and
-           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) then
+           (tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) and
+           (
+            not(m_delphi in current_settings.modeswitches) or
+            is_object(tprocdef(defowner)._class)
+           ) then
           result:=tprocdef(defowner)._class.symtable.checkduplicate(hashedid,sym);
       end;
 

+ 10 - 9
compiler/x86/agx86int.pas

@@ -342,13 +342,6 @@ implementation
       end;
     end;
 
-
-    var
-      LasTSectype : TAsmSectiontype;
-      lastfileinfo : tfileposinfo;
-      infile,
-      lastinfile   : tinputfile;
-
     const
       ait_const2str : array[aitconst_128bit..aitconst_indirect_symbol] of string[20]=(
         #9''#9,#9'DQ'#9,#9'DD'#9,#9'DW'#9,#9'DB'#9,
@@ -547,6 +540,7 @@ implementation
                        else
                          s:=tostr(tai_const(hp).value);
                        AsmWrite(s);
+                       inc(l,length(s));
                        if (l>line_length) or
                           (hp.next=nil) or
                           (tai(hp.next).typ<>ait_const) or
@@ -569,7 +563,7 @@ implementation
            ait_real_80bit :
              AsmWriteLn(#9#9'DT'#9+extended2str(tai_real_80bit(hp).value));
            ait_comp_64bit :
-             AsmWriteLn(#9#9'DQ'#9+comp2str(tai_real_80bit(hp).value));
+             AsmWriteLn(#9#9'DQ'#9+extended2str(tai_comp_64bit(hp).value));
            ait_string :
              begin
                counter := 0;
@@ -883,7 +877,6 @@ implementation
       if assigned(current_module.mainsource) then
        comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource^);
 {$endif}
-      LasTSecType:=sec_none;
       if target_asm.id<>as_x86_64_masm then
         begin
           AsmWriteLn(#9'.386p');
@@ -906,6 +899,14 @@ implementation
           AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]);
         end;
 
+      { better do this at end of WriteTree, but then there comes a trouble with
+        al_const which does not have leading ait_section and thus goes out of segment }
+        
+      { TODO: probably ml64 needs 'closing' last section, too }
+      if LastSecType <> sec_none then
+        AsmWriteLn('_'+secnames[LasTSecType]+#9#9'ENDS');
+      LastSecType := sec_none;
+
       AsmWriteLn(#9'END');
       AsmLn;
 

+ 14 - 4
compiler/x86_64/cgcpu.pas

@@ -35,6 +35,8 @@ unit cgcpu;
     type
       tcgx86_64 = class(tcgx86)
         procedure init_register_allocators;override;
+        procedure done_register_allocators;override;
+
         procedure g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean);override;
         procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint);override;
 
@@ -65,24 +67,24 @@ unit cgcpu;
         if target_info.system=system_x86_64_win64 then
           begin
             SetLength(saved_standard_registers,Length(win64_saved_std_regs));
-            SetLength(saved_xmm_registers,Length(win64_saved_xmm_regs));
+            SetLength(saved_mm_registers,Length(win64_saved_xmm_regs));
 
             for i:=low(win64_saved_std_regs) to high(win64_saved_std_regs) do
               saved_standard_registers[i]:=win64_saved_std_regs[i];
 
             for i:=low(win64_saved_xmm_regs) to high(win64_saved_xmm_regs) do
-              saved_xmm_registers[i]:=win64_saved_xmm_regs[i];
+              saved_mm_registers[i]:=win64_saved_xmm_regs[i];
           end
         else
           begin
             SetLength(saved_standard_registers,Length(others_saved_std_regs));
-            SetLength(saved_xmm_registers,0);
+            SetLength(saved_mm_registers,0);
 
             for i:=low(others_saved_std_regs) to high(others_saved_std_regs) do
               saved_standard_registers[i]:=others_saved_std_regs[i];
           end;
         if assigned(current_procinfo) then
-          framepointer:=getsupreg(current_procinfo.framepointer) 
+          framepointer:=getsupreg(current_procinfo.framepointer)
         else
           { in intf. wrapper code generation }
           framepointer:=RS_FRAME_POINTER_REG;
@@ -94,6 +96,14 @@ unit cgcpu;
       end;
 
 
+    procedure Tcgx86_64.done_register_allocators;
+      begin
+        inherited done_register_allocators;
+        setlength(saved_standard_registers,0);
+        setlength(saved_mm_registers,0);
+      end;
+
+
     procedure tcgx86_64.a_param_ref(list : TAsmList;size : tcgsize;const r : treference;const paraloc : TCGPara);
       var
         tmpref, ref: treference;

+ 1 - 2
compiler/x86_64/cpubase.inc

@@ -123,7 +123,7 @@ const
     const
       { these arrays differ between unix and win64 }
       saved_standard_registers : array of tsuperregister = nil;
-      saved_xmm_registers : array of tsuperregister = nil;
+      saved_mm_registers : array of tsuperregister = nil;
       { Required parameter alignment when calling a routine declared as
         stdcall and cdecl. The alignment value should be the one defined
         by GCC or the target ABI.
@@ -132,4 +132,3 @@ const
          PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
       }
       std_param_align = 8;
-

+ 2 - 1
compiler/x86_64/nx64add.pas

@@ -38,6 +38,7 @@ interface
     uses
       globtype,globals,
       aasmbase,aasmtai,aasmdata,
+      defutil,
       cgbase,cgutils,cga,cgobj,
       tgobj;
 
@@ -56,7 +57,7 @@ interface
       pass_left_right;
 
       { The location.register will be filled in later (JM) }
-      location_reset(location,LOC_REGISTER,OS_INT);
+      location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
       { Mul supports registers and references, so if not register/reference,
         load the location into a register}
       use_ref:=false;

+ 0 - 2
compiler/x86_64/rax64att.pas

@@ -48,9 +48,7 @@ Unit rax64att;
         BuildOpcode(instr);
         instr.AddReferenceSizes;
         instr.SetInstructionOpsize;
-        {
         instr.CheckOperandSizes;
-        }
         instr.ConcatInstruction(curlist);
         instr.Free;
       end;

+ 280 - 0
tests/test/cg/tumin.pp

@@ -0,0 +1,280 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondunaryminus()                               }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{****************************************************************}
+{ DEFINES:   VERBOSE = Write test information to screen          }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS:                                                       }
+{                                                                }
+{                                                                }
+{                                                                }
+{****************************************************************}
+{$mode objfpc}
+
+Program tumin;
+
+{----------------------------------------------------}
+{ Cases to test:                                     }
+{   CURRENT NODE (result)                            }
+{     - LOC_REGISTER                                 }
+{     - LOC_FLAGS                                    }
+{   LEFT NODE (value to complement)                  }
+{     possible cases : int64,byte,word,longint       }
+{                      boolean                       }
+{     - LOC_CREGISTER                                }
+{     - LOC_REFERENCE / LOC_MEM                      }
+{     - LOC_REGISTER                                 }
+{     - LOC_FLAGS                                    }
+{     - LOC_JUMP                                     }
+{----------------------------------------------------}
+
+uses
+  SysUtils;
+
+{$IFNDEF FPC}
+type  smallint = integer;
+{$ENDIF}
+
+function getintres : smallint;
+begin
+ getintres := $7F7F;
+end;
+
+function getbyteboolval : boolean;
+begin
+  getbyteboolval := TRUE;
+end;
+
+procedure test(value, required: longint);
+begin
+  if value <> required then
+    begin
+      writeln('Got ',value,' instead of ',required);
+      halt(1);
+    end
+  else
+    writeln('Passed!');
+end;
+
+
+{$Q+}
+{$R+}
+
+var
+ caught: boolean;
+ longres :  longint;
+ cardres : cardinal;
+ intres : smallint;
+ byteboolval : bytebool;
+ wordboolval : wordbool;
+ longboolval : longbool;
+ byteboolres : bytebool;
+ wordboolres : wordbool;
+ longboolres : longbool;
+{$ifdef fpc}
+ int64res : int64;
+ qwordres : qword;
+{$endif}
+Begin
+   WriteLn('------------------------------ LONGINT --------------------------------');
+   { CURRENT NODE: REGISTER }
+   { LEFT NODE : REFERENCE  }
+   WriteLn('(current) : LOC_REGISTER; (left) : LOC_REFERENCE');
+   longres := $7F7F7F7F;
+   longres := -longres;
+   Write('Value should be $80808081...');
+
+   { the following test give range check errors }
+   test(longres,longint($80808081));
+
+   { CURRENT NODE : REGISTER }
+   { LEFT NODE : REGISTER    }
+   WriteLn('(current) : LOC_REGISTER; (left) : LOC_REGISTER');
+   longres := - getintres;
+   Write('Value should be $FFFF8081...');
+   test(longres, longint($FFFF8081));
+
+
+   Writeln('Overflow tests');
+   Write('-0...');
+   longres:=0;
+   longres:=-longres;
+   test(longres,0);
+   longres:=high(longint);
+   longres:=-longres;
+   Write('-',high(longint),'...');
+   test(longres,longint($80000001));
+
+   Write('-(',low(longint),')...');
+   longres:=low(longint);
+   caught:=false;
+   try
+     longres:=-longres;
+   except
+{$ifdef cpu64}
+     on erangeerror do
+{$else cpu64}
+     on eintoverflow do
+{$endif cpu64}
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Overflow -$80000000 not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+
+
+   WriteLn('------------------------------  CARDINAL  ----------------------------------');
+
+   Writeln('Overflow/Rangecheck tests');
+   Write('-0...');
+   cardres:=0;
+   longres:=-cardres;
+   test(longres,0);
+   cardres:=high(longint);
+   longres:=-cardres;
+   Write('-',high(longint),'...');
+   test(longres,longint($80000001));
+
+   Write('-',high(cardinal),'...');
+   cardres:=high(cardinal);
+   caught:=false;
+   try
+     longres:=-cardres;
+   except
+     on erangeerror do
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Rangecheck -high(cardinal) not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+
+{$ifndef cpu64}
+   { this is calculated in 64 bit on 64 bit cpus -> no range error }
+
+   Write('-',cardinal($80000000),'...');
+   cardres:=cardinal($80000000);
+   caught:=false;
+   try
+     longres:=-cardres;
+   except
+     on erangeerror do
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Rangecheck -cardinal($80000000) not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+{$endif cpu64}
+
+{$IFDEF FPC}
+   WriteLn('------------------------------  INT64  ----------------------------------');
+   { CURRENT NODE: REGISTER }
+   { LEFT NODE : REFERENCE  }
+   WriteLn('(current) : LOC_REGISTER; (left) : LOC_REFERENCE');
+   int64res := $7F7F7F7F;
+   int64res := - int64res;
+   Write('Value should be $80808081...');
+   test(longint(int64res and $FFFFFFFF),longint($80808081));
+
+   { CURRENT NODE : REGISTER }
+   { LEFT NODE : REGISTER    }
+   WriteLn('(current) : LOC_REGISTER; (left) : LOC_REGISTER');
+   int64res := - (word(getintres));
+   Write('Value should be $8081...');
+   test(longint(int64res and $FFFFFFFF),longint($FFFF8081));
+
+   Writeln('Overflow tests');
+   Write('-0...');
+   int64res:=0;
+   int64res:=-int64res;
+   test(hi(int64res) or lo(int64res),0);
+   int64res:=high(int64);
+   int64res:=-int64res;
+   Write('-',high(int64),'... (2 tests)');
+   test(longint(hi(int64res)),longint($80000000));
+   test(longint(lo(int64res)),1);
+
+   Writeln('-(',low(int64),')...');
+   int64res:=low(int64);
+   caught:=false;
+   try
+     int64res:=-int64res;
+   except
+     on eintoverflow do
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Overflow -$8000000000000000 not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+
+
+   WriteLn('------------------------------  QWORD  ----------------------------------');
+
+   Writeln('Overflow/Rangecheck tests');
+   Write('-0...');
+   qwordres:=0;
+   int64res:=-qwordres;
+   test(hi(int64res) or lo(int64res),0);
+   qwordres:=high(int64);
+   int64res:=-qwordres;
+   Write('-',high(int64),'... (2 tests)');
+   test(longint(hi(int64res)),longint($80000000));
+   test(longint(lo(int64res)),1);
+
+   Write('-',high(qword),'...');
+   qwordres:=high(qword);
+   caught:=false;
+   try
+     int64res:=-qwordres;
+   except
+     on erangeerror do
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Rangecheck -high(qword) not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+
+   Write('-',qword($8000000000000000),'...');
+   qwordres:=qword($8000000000000000);
+   caught:=false;
+   try
+     int64res:=-qwordres;
+   except
+     on erangeerror do
+       caught:=true;
+   end;
+   if not caught then
+     begin
+       Writeln('Rangecheck -qword($8000000000000000) not caught');
+       halt(1);
+     end
+   else
+     writeln('Passed!');
+{$ENDIF}
+
+
+end.

+ 9 - 0
tests/test/tint644.pp

@@ -0,0 +1,9 @@
+{ %result=215 }
+
+{$q+}
+var
+  c: qword;
+begin
+  c:=2;
+  c:=c*qword($ffffffffffffffff);
+end.

+ 27 - 0
tests/webtbf/tw10425a.pp

@@ -0,0 +1,27 @@
+{ %norun }
+{ %fail }
+
+unit tw10425a;
+
+{$mode delphi}
+
+interface
+
+type
+  TFloat      = double;
+  TPoint2D    = record x,y:TFloat; end;
+  TRectangle  = array [1..2] of TPoint2D;
+
+  TPoint2DArray  = array of TPoint2D;
+  TPolygon2D     = array of TPoint2D;
+  
+  function AABB:TPoint2DArray; overload;
+
+implementation
+
+function AABB:TPolygon2D;
+begin
+end;
+
+end.
+

+ 17 - 0
tests/webtbf/tw10457.pp

@@ -0,0 +1,17 @@
+{ %fail }
+
+{$ifdef fpc}
+{$mode delphi}
+{$endif}
+
+uses SysUtils, Classes;
+
+Type
+  Tdatamodule1 = class(Tobject)
+    rrr: Tobject;
+    rrr: Tobject;
+   end;
+
+begin
+end.
+

+ 50 - 0
tests/webtbf/tw6797a.pp

@@ -0,0 +1,50 @@
+{ %fail }
+program intfbug2;
+{$ifdef fpc}
+{$mode objfpc} {$H+}
+{$endif fpc}
+
+uses
+  Classes, SysUtils;
+
+type
+  IMyCom1 = interface
+    procedure A1;
+  end;
+  IMyCom2 = interface
+    procedure A2;
+  end;
+
+  TMyComCorba = class(TInterfacedObject, IMyCom1, IMyCom2)
+    procedure A1;
+    procedure A2;
+    procedure B;
+  end;
+
+procedure TMyComCorba.A1;
+begin
+  WriteLN('Com1');
+end;
+
+procedure TMyComCorba.A2;
+begin
+  WriteLN('Com2');
+end;
+
+procedure TMyComCorba.B;
+begin
+  WriteLN('Corba');
+end;
+
+var
+  I: IUnknown;
+  A1: IMyCom1;
+  A2: IMyCom2;
+
+begin
+  I := TMyComCorba.Create;
+  A1 := I as IMyCom1;
+  A1.A1;
+  A2 := I as IMyCom2;
+  A2.A2;
+end.

+ 47 - 0
tests/webtbf/tw6797b.pp

@@ -0,0 +1,47 @@
+{ %fail }
+program intfbug2;
+{$ifdef fpc}
+{$mode objfpc} {$H+}
+{$endif fpc}
+
+uses
+  Classes, SysUtils;
+
+type
+  IMyCom1 = interface
+    procedure A1;
+  end;
+  IMyCom2 = interface
+    procedure A2;
+  end;
+
+  TMyComCorba = class(TInterfacedObject, IMyCom1, IMyCom2)
+    procedure A1;
+    procedure A2;
+    procedure B;
+  end;
+
+procedure TMyComCorba.A1;
+begin
+  WriteLN('Com1');
+end;
+
+procedure TMyComCorba.A2;
+begin
+  WriteLN('Com2');
+end;
+
+procedure TMyComCorba.B;
+begin
+  WriteLN('Corba');
+end;
+
+var
+  I: IUnknown;
+  A1: IMyCom1;
+  A2: IMyCom2;
+
+begin
+  I := TMyComCorba.Create;
+  if Supports(I, IMyCom1, A1) then A1.A1;
+end.

+ 59 - 0
tests/webtbs/tw10203.pp

@@ -0,0 +1,59 @@
+{ %cpu=i386 }
+{ %target=win32 }
+
+{compilation: fpc test.pp}
+{$IFDEF FPC}
+{$MODE DELPHI}
+{$ASMMODE Intel}
+{$ELSE}
+{$APPTYPE CONSOLE}
+{$ENDIF}
+type
+  TBig=record
+    data:array[1..1000] of integer;
+  end;
+  TBig2=array[1..1000] of integer;
+var
+  s,s1:integer;
+  x:TBig;
+  x2:TBig2;
+  err : boolean;
+procedure temp(x:TBig);stdcall;
+begin
+  asm
+    mov s,ebp
+  end;
+end;
+procedure temp2(x:TBig2);stdcall;
+begin
+  asm
+    mov s,ebp
+  end;
+end;
+begin
+  asm
+    mov s1,esp
+  end;
+  writeln(s1);
+  temp(x);
+  writeln(s);
+  if (s1-s)<1000 then
+    begin
+      writeln('incompatible with Delphi: records');
+      err:=true;
+    end;
+
+  asm
+    mov s1,esp
+  end;
+  writeln(s1);
+  temp2(x2);
+  writeln(s);
+  if (s1-s)>1000 then
+    begin
+      writeln('incompatible with Delphi: arrays');
+      err:=true;
+    end;
+  if err then
+    halt(1);
+end.

+ 46 - 0
tests/webtbs/tw10371.pp

@@ -0,0 +1,46 @@
+program bug;
+
+{$MODE OBJFPC} {$H+}
+{$INLINE ON}
+
+uses
+  SysUtils, Classes;
+
+type
+  TBug = class
+  protected
+    function InlinedMethod : longword; inline;
+    fL: longword;
+  public
+    procedure Method1(var Buf); 
+    procedure Method2;
+  end;
+
+function TBug.InlinedMethod : longword; inline;
+begin
+  Method1(Result);
+end;
+
+procedure TBug.Method2;
+var aValue: longword;
+begin
+  aValue := InlinedMethod;
+  fL:=aValue;
+end;
+
+procedure TBug.Method1(var Buf);
+type
+  plongword=^longword;
+begin
+  plongword(@buf)^:=$12345678;
+end;
+
+var
+  b: tbug;
+begin
+  b:=tbug.create;
+  b.method2;
+  if (b.fl<>$12345678) then
+    halt(1);
+  b.free;
+end.

+ 66 - 0
tests/webtbs/tw10425.pp

@@ -0,0 +1,66 @@
+{ %norun }
+
+unit tw10425;
+
+{$mode delphi}
+
+interface
+
+type
+  TFloat      = double;
+  TPoint2D    = record x,y:TFloat; end;
+  TRectangle  = array [1..2] of TPoint2D;
+
+  TPoint2DArray  = array of TPoint2D;
+  TPolygon2D     = array of TPoint2D;
+  
+  function AABB(const Polygon   : TPolygon2D   ):TRectangle; overload;
+  function AABB(const Curve     : TPoint2DArray):TRectangle; overload;
+
+implementation
+
+function AABB(const Polygon : TPolygon2D):TRectangle;
+var
+  i  : Integer;
+begin
+  Result[1].x := Polygon[0].x;
+  Result[1].y := Polygon[0].y;
+  Result[2].x := Polygon[0].x;
+  Result[2].y := Polygon[0].y;
+  for i := 1 to Length(Polygon) - 1 do
+  begin
+    if Polygon[i].x < Result[1].x then
+      Result[1].x := Polygon[i].x
+    else if Polygon[i].x > Result[2].x then
+      Result[2].x := Polygon[i].x;
+    if Polygon[i].y < Result[1].y then
+      Result[1].y := Polygon[i].y
+    else if Polygon[i].y > Result[2].y then
+      Result[2].y := Polygon[i].y;
+  end;
+end;
+
+function AABB(const Curve : TPoint2DArray):TRectangle;
+var
+  i  : Integer;
+begin
+  Result[1].x := Curve[0].x;
+  Result[1].y := Curve[0].y;
+  Result[2].x := Curve[0].x;
+  Result[2].y := Curve[0].y;
+  for i := 1 to Length(Curve) - 1 do
+  begin
+    if Curve[i].x < Result[1].x then
+      Result[1].x := Curve[i].x
+    else if Curve[i].x > Result[2].x then
+      Result[2].x := Curve[i].x;
+    if Curve[i].y < Result[1].y then
+      Result[1].y := Curve[i].y
+    else if Curve[i].y > Result[2].y then
+      Result[2].y := Curve[i].y;
+  end;
+end;
+
+
+end.
+

+ 1 - 0
tests/webtbs/tw7281.pp

@@ -7,6 +7,7 @@ uses
 
 type
   ITest = interface
+    ['{7B7E58C4-6E23-4414-8EB2-CA81023348DE}']
     procedure DoIt(AMsg : string);
   end;