Browse Source

--- Merging r13785 into '.':
U compiler/ncgcon.pas
--- Merging r13918 into '.':
A tests/webtbs/tw14812.pp
U compiler/pdecsub.pas
--- Merging r13958 into '.':
A tests/webtbf/tw14849.pp
U compiler/nutils.pas
--- Merging r14006 into '.':
A tests/webtbf/tw14777.pp
A tests/webtbf/tw14777a.pp
U compiler/ninl.pas
--- Merging r14206 into '.':
U compiler/ncgset.pas
--- Merging r14261 into '.':
A tests/webtbs/tw15169.pp
U compiler/ncgflw.pas
--- Merging r14280 into '.':
U rtl/inc/system.inc
--- Merging r14287 into '.':
U compiler/sparc/cgcpu.pas
--- Merging r14296 into '.':
U compiler/rgobj.pas
--- Merging r14327 into '.':
U compiler/dbgdwarf.pas
U compiler/i386/ag386nsm.pas
U compiler/i386/daopt386.pas
U compiler/powerpc/agppcmpw.pas
U compiler/aggas.pas
U compiler/aasmtai.pas
G compiler/ncgflw.pas
U compiler/x86/agx86int.pas
--- Merging r14367 through r14368 into '.':
A tests/webtbf/tw15287.pp
A tests/webtbf/tw15288.pp
U compiler/nmem.pas
U compiler/ncnv.pas
--- Merging r14370 into '.':
A tests/webtbs/tw15274.pp
U compiler/pstatmnt.pas
--- Merging r14379 into '.':
A tests/webtbs/tw15304.pp
G compiler/ninl.pas
--- Merging r14395 into '.':
U compiler/x86_64/cpuinfo.pas
--- Merging r14396 into '.':
A tests/webtbs/tw15015.pp
G compiler/ncnv.pas
--- Merging r14412 into '.':
A tests/webtbs/tw15293a.pp
A tests/webtbs/tw15293.pp
U compiler/scanner.pas
--- Merging r14417 into '.':
G compiler/x86_64/cpuinfo.pas
--- Merging r14418 into '.':
U compiler/x86_64/x8664ats.inc
U compiler/x86/x86ins.dat
--- Merging r14437 into '.':
U compiler/i386/i386atts.inc
--- Merging r14445 into '.':
A tests/webtbs/tw15364.pp
G compiler/nmem.pas
--- Merging r14470 into '.':
U compiler/aopt.pas
U compiler/aoptobj.pas
--- Merging r14504 into '.':
U rtl/unix/tthread.inc
--- Merging r14516 into '.':
A tests/webtbs/tw15453a.pp
U compiler/constexp.pas
--- Merging r14524 into '.':
U compiler/utils/samplecfg
--- Merging r14548 into '.':
U compiler/pexpr.pas
--- Merging r14842 into '.':
U compiler/globals.pas
--- Merging r14922 into '.':
U rtl/linux/ossysc.inc
--- Merging r14961 into '.':
U compiler/pdecobj.pas
--- Merging r14970 into '.':
U rtl/unix/cthreads.pp
--- Merging r14997 into '.':
U compiler/cfileutl.pas
--- Merging r15000 into '.':
U compiler/verbose.pas
--- Merging r15049 into '.':
G rtl/unix/cthreads.pp
A tests/webtbs/tw15821.pp

git-svn-id: branches/fixes_2_4@15175 -

Jonas Maebe 15 năm trước cách đây
mục cha
commit
75b5b6c74d
53 tập tin đã thay đổi với 769 bổ sung319 xóa
  1. 15 0
      .gitattributes
  2. 1 1
      compiler/aasmtai.pas
  3. 2 2
      compiler/aggas.pas
  4. 4 4
      compiler/aopt.pas
  5. 2 2
      compiler/aoptobj.pas
  6. 3 3
      compiler/cfileutl.pas
  7. 20 7
      compiler/constexp.pas
  8. 18 5
      compiler/dbgdwarf.pas
  9. 20 4
      compiler/globals.pas
  10. 2 2
      compiler/i386/ag386nsm.pas
  11. 2 2
      compiler/i386/daopt386.pas
  12. 1 1
      compiler/i386/i386atts.inc
  13. 6 4
      compiler/ncgcon.pas
  14. 48 2
      compiler/ncgflw.pas
  15. 13 5
      compiler/ncgset.pas
  16. 21 15
      compiler/ncnv.pas
  17. 6 4
      compiler/ninl.pas
  18. 11 3
      compiler/nmem.pas
  19. 4 0
      compiler/nutils.pas
  20. 1 0
      compiler/pdecobj.pas
  21. 12 2
      compiler/pdecsub.pas
  22. 3 1
      compiler/pexpr.pas
  23. 2 2
      compiler/powerpc/agppcmpw.pas
  24. 1 1
      compiler/pstatmnt.pas
  25. 2 2
      compiler/rgobj.pas
  26. 9 2
      compiler/scanner.pas
  27. 1 1
      compiler/sparc/cgcpu.pas
  28. 224 227
      compiler/utils/fpccfg.inc
  29. 2 2
      compiler/utils/samplecfg
  30. 4 1
      compiler/verbose.pas
  31. 2 2
      compiler/x86/agx86int.pas
  32. 1 1
      compiler/x86/x86ins.dat
  33. 4 4
      compiler/x86_64/cpuinfo.pas
  34. 1 1
      compiler/x86_64/x8664ats.inc
  35. 1 1
      rtl/inc/system.inc
  36. 10 0
      rtl/linux/ossysc.inc
  37. 9 2
      rtl/unix/cthreads.pp
  38. 3 1
      rtl/unix/tthread.inc
  39. 10 0
      tests/webtbf/tw14777.pp
  40. 10 0
      tests/webtbf/tw14777a.pp
  41. 48 0
      tests/webtbf/tw14849.pp
  42. 19 0
      tests/webtbf/tw15287.pp
  43. 26 0
      tests/webtbf/tw15288.pp
  44. 27 0
      tests/webtbs/tw14812.pp
  45. 13 0
      tests/webtbs/tw15015.pp
  46. 17 0
      tests/webtbs/tw15169.pp
  47. 43 0
      tests/webtbs/tw15274.pp
  48. 5 0
      tests/webtbs/tw15293.pp
  49. 4 0
      tests/webtbs/tw15293a.pp
  50. 10 0
      tests/webtbs/tw15304.pp
  51. 16 0
      tests/webtbs/tw15364.pp
  52. 12 0
      tests/webtbs/tw15453a.pp
  53. 18 0
      tests/webtbs/tw15821.pp

+ 15 - 0
.gitattributes

@@ -8845,7 +8845,12 @@ tests/webtbf/tw14104c.pp svneol=native#text/plain
 tests/webtbf/tw14248.pp svneol=native#text/plain
 tests/webtbf/tw1432.pp svneol=native#text/plain
 tests/webtbf/tw1467.pp svneol=native#text/plain
+tests/webtbf/tw14777.pp svneol=native#text/plain
+tests/webtbf/tw14777a.pp svneol=native#text/plain
 tests/webtbf/tw1483.pp svneol=native#text/plain
+tests/webtbf/tw14849.pp svneol=native#text/plain
+tests/webtbf/tw15287.pp svneol=native#text/plain
+tests/webtbf/tw15288.pp svneol=native#text/plain
 tests/webtbf/tw1599.pp svneol=native#text/plain
 tests/webtbf/tw1599b.pp svneol=native#text/plain
 tests/webtbf/tw1633.pp svneol=native#text/plain
@@ -9449,6 +9454,7 @@ tests/webtbs/tw14743.pp svneol=native#text/pascal
 tests/webtbs/tw1477.pp svneol=native#text/plain
 tests/webtbs/tw1479.pp svneol=native#text/plain
 tests/webtbs/tw14798.pp svneol=native#text/plain
+tests/webtbs/tw14812.pp svneol=native#text/plain
 tests/webtbs/tw1485.pp svneol=native#text/plain
 tests/webtbs/tw1489.pp svneol=native#text/plain
 tests/webtbs/tw14958a.pp svneol=native#text/plain
@@ -9457,14 +9463,23 @@ tests/webtbs/tw14992a.pp svneol=native#text/pascal
 tests/webtbs/tw14992b.pp svneol=native#text/pascal
 tests/webtbs/tw14992c.pp svneol=native#text/pascal
 tests/webtbs/tw1501.pp svneol=native#text/plain
+tests/webtbs/tw15015.pp svneol=native#text/plain
+tests/webtbs/tw15169.pp svneol=native#text/plain
+tests/webtbs/tw15274.pp svneol=native#text/plain
+tests/webtbs/tw15293.pp svneol=native#text/plain
+tests/webtbs/tw15293a.pp svneol=native#text/plain
 tests/webtbs/tw15296.pp svneol=native#text/plain
+tests/webtbs/tw15304.pp svneol=native#text/plain
 tests/webtbs/tw1532.pp svneol=native#text/plain
+tests/webtbs/tw15364.pp svneol=native#text/plain
 tests/webtbs/tw15377.pp svneol=native#text/pascal
 tests/webtbs/tw1539.pp svneol=native#text/plain
+tests/webtbs/tw15453a.pp svneol=native#text/plain
 tests/webtbs/tw15467.pp svneol=native#text/pascal
 tests/webtbs/tw1567.pp svneol=native#text/plain
 tests/webtbs/tw15690.pp svneol=native#text/plain
 tests/webtbs/tw1573.pp svneol=native#text/plain
+tests/webtbs/tw15821.pp svneol=native#text/plain
 tests/webtbs/tw1592.pp svneol=native#text/plain
 tests/webtbs/tw1617.pp svneol=native#text/plain
 tests/webtbs/tw1622.pp svneol=native#text/plain

+ 1 - 1
compiler/aasmtai.pas

@@ -243,7 +243,7 @@ interface
       TAsmMarker = (
         mark_NoPropInfoStart,mark_NoPropInfoEnd,
         mark_AsmBlockStart,mark_AsmBlockEnd,
-        mark_InlineStart,mark_InlineEnd,mark_BlockStart,
+        mark_NoLineInfoStart,mark_NoLineInfoEnd,mark_BlockStart,
         mark_Position
       );
 

+ 2 - 2
compiler/aggas.pas

@@ -1058,9 +1058,9 @@ implementation
              end;
 
            ait_marker :
-             if tai_marker(hp).kind=mark_InlineStart then
+             if tai_marker(hp).kind=mark_NoLineInfoStart then
                inc(InlineLevel)
-             else if tai_marker(hp).kind=mark_InlineEnd then
+             else if tai_marker(hp).kind=mark_NoLineInfoEnd then
                dec(InlineLevel);
 
            ait_directive :

+ 4 - 4
compiler/aopt.pas

@@ -73,7 +73,7 @@ Unit aopt;
       Var LabelFound: Boolean;
           p: tai;
       Begin
-        LabelInfo^.LowLabel := High(AWord);
+        LabelInfo^.LowLabel := High(longint);
         LabelInfo^.HighLabel := 0;
         LabelInfo^.LabelDif := 0;
         LabelInfo^.LabelTable:=nil;
@@ -90,9 +90,9 @@ Unit aopt;
                    (tai_Label(p).labsym.is_used) Then
                   Begin
                     LabelFound := True;
-                    If (tai_Label(p).labsym.labelnr < int64(LowLabel)) Then
+                    If (tai_Label(p).labsym.labelnr < LowLabel) Then
                       LowLabel := tai_Label(p).labsym.labelnr;
-                    If (tai_Label(p).labsym.labelnr > int64(HighLabel)) Then
+                    If (tai_Label(p).labsym.labelnr > HighLabel) Then
                       HighLabel := tai_Label(p).labsym.labelnr
                   End;
                 GetNextInstruction(p, p)
@@ -190,7 +190,7 @@ Unit aopt;
             LabelInfo^.labeltable := nil;
           end;
         LabelInfo^.labeldif:=0;
-        LabelInfo^.lowlabel:=high(AWord);
+        LabelInfo^.lowlabel:=high(longint);
         LabelInfo^.highlabel:=0;
       end;
 

+ 2 - 2
compiler/aoptobj.pas

@@ -216,8 +216,8 @@ Unit AoptObj;
       TLabelInfo = Record
         { the highest and lowest label number occurring in the current code }
         { fragment                                                          }
-        LowLabel, HighLabel: AWord;
-        LabelDif: AWord;
+        LowLabel, HighLabel: longint;
+        LabelDif: cardinal;
         { table that contains the addresses of the Pai_Label objects associated
           with each label number                                                }
         LabelTable: PLabelTable;

+ 3 - 3
compiler/cfileutl.pas

@@ -1044,7 +1044,7 @@ end;
           begin
             j:=Pos(';',s);
             if j=0 then
-             j:=255;
+             j:=length(s)+1;
             currPath:= TrimSpace(Copy(s,1,j-1));
             System.Delete(s,1,j);
           end;
@@ -1060,9 +1060,9 @@ end;
             if (CurrentDir<>'') and (Copy(currPath,1,length(CurrentDir))=CurrentDir) then
              begin
 {$if defined(amiga) and defined(morphos)}
-               currPath:= CurrentDir+Copy(currPath,length(CurrentDir)+1,255);
+               currPath:= CurrentDir+Copy(currPath,length(CurrentDir)+1,length(currPath));
 {$else}
-               currPath:= CurDirRelPath(source_info)+Copy(currPath,length(CurrentDir)+1,255);
+               currPath:= CurDirRelPath(source_info)+Copy(currPath,length(CurrentDir)+1,length(currPath));
 {$endif}
              end;
           end;

+ 20 - 7
compiler/constexp.pas

@@ -378,7 +378,8 @@ end;
 
 operator mod (const a,b:Tconstexprint):Tconstexprint;
 
-var aa,bb:qword;
+var aa,bb,r:qword;
+    sa,sb:boolean;
 
 begin
   if a.overflow or b.overflow then
@@ -387,20 +388,32 @@ begin
       exit;
     end;
   result.overflow:=false;
-  if a.signed then
-    aa:=qword(a.svalue)
+  sa:=a.signed and (a.svalue<0);
+  if sa then
+    {$Q-}
+    aa:=qword(-a.svalue)
+    {$ifdef ena_q}{$Q+}{$endif}
   else
     aa:=a.uvalue;
-  if b.signed then
-    bb:=qword(b.svalue)
+  sb:=b.signed and (b.svalue<0);
+  if sb then
+    {$Q-}
+    bb:=qword(-b.svalue)
+    {$ifdef ena_q}{$Q+}{$endif}
   else
     bb:=b.uvalue;
   if bb=0 then
     result.overflow:=true
   else
     begin
-      result.signed:=false;
-      result.uvalue:=aa mod bb;
+      { the sign of a modulo operation only depends on the sign of the
+        dividend }
+      r:=aa mod bb;
+      result.signed:=sa;
+      if not sa then
+        result.uvalue:=r
+      else
+        result.svalue:=-int64(r);
     end;
 end;
 

+ 18 - 5
compiler/dbgdwarf.pas

@@ -2837,7 +2837,8 @@ implementation
         diffline,
         prevline,
         prevfileidx,
-        currfileidx: Integer;
+        currfileidx,
+        nolineinfolevel : Integer;
         prevlabel,
         currlabel     : tasmlabel;
       begin
@@ -2851,6 +2852,7 @@ implementation
         prevline := 1;
         prevfileidx := 1;
         prevlabel := nil;
+        nolineinfolevel:=0;
         while assigned(hp) do
           begin
             case hp.typ of
@@ -2861,13 +2863,24 @@ implementation
                   currfuncname:=tai_function_name(hp).funcname;
                   asmline.concat(tai_comment.Create(strpnew('function: '+currfuncname^)));
                 end;
-              ait_force_line : begin
-                lastfileinfo.line:=-1;
-              end;
+              ait_force_line :
+                begin
+                  lastfileinfo.line:=-1;
+                end;
+              ait_marker :
+                begin
+                  case tai_marker(hp).kind of
+                    mark_NoLineInfoStart:
+                      inc(nolineinfolevel);
+                    mark_NoLineInfoEnd:
+                      dec(nolineinfolevel);
+                  end;
+                end;
             end;
 
             if (currsectype=sec_code) and
-               (hp.typ=ait_instruction) then
+               (hp.typ=ait_instruction) and
+               (nolineinfolevel=0) then
               begin
                 currfileinfo:=tailineinfo(hp).fileinfo;
                 { file changed ? (must be before line info) }

+ 20 - 4
compiler/globals.pas

@@ -1064,19 +1064,35 @@ implementation
           else if tok='LOOP' then
            b.loopalign:=l
           else if tok='CONSTMIN' then
-           b.constalignmin:=l
+           begin
+             b.constalignmin:=l;
+             if l>b.constalignmax then
+               b.constalignmax:=l;
+           end
           else if tok='CONSTMAX' then
            b.constalignmax:=l
           else if tok='VARMIN' then
-           b.varalignmin:=l
+           begin
+             b.varalignmin:=l;
+             if l>b.varalignmax then
+               b.varalignmax:=l;
+           end
           else if tok='VARMAX' then
            b.varalignmax:=l
           else if tok='LOCALMIN' then
-           b.localalignmin:=l
+           begin
+             b.localalignmin:=l;
+             if l>b.localalignmax then
+               b.localalignmax:=l;
+           end
           else if tok='LOCALMAX' then
            b.localalignmax:=l
           else if tok='RECORDMIN' then
-           b.recordalignmin:=l
+           begin
+             b.recordalignmin:=l;
+             if l>b.recordalignmax then
+               b.recordalignmax:=l;
+           end
           else if tok='RECORDMAX' then
            b.recordalignmax:=l
           else { Error }

+ 2 - 2
compiler/i386/ag386nsm.pas

@@ -975,9 +975,9 @@ interface
              end;
 
            ait_marker :
-             if tai_marker(hp).kind=mark_InlineStart then
+             if tai_marker(hp).kind=mark_NoLineInfoStart then
                inc(InlineLevel)
-             else if tai_marker(hp).kind=mark_InlineEnd then
+             else if tai_marker(hp).kind=mark_NoLineInfoEnd then
                dec(InlineLevel);
 
            ait_directive :

+ 2 - 2
compiler/i386/daopt386.pas

@@ -1086,7 +1086,7 @@ begin
     oldp := p;
     if (p.typ in SkipInstr) or
        ((p.typ = ait_marker) and
-        (tai_Marker(p).Kind in [mark_AsmBlockEnd,mark_InlineStart,mark_InlineEnd])) then
+        (tai_Marker(p).Kind in [mark_AsmBlockEnd,mark_NoLineInfoStart,mark_NoLineInfoEnd])) then
       GetNextInstruction(p,p)
     else if ((p.Typ = Ait_Marker) and
         (tai_Marker(p).Kind = mark_NoPropInfoStart)) then
@@ -1143,7 +1143,7 @@ begin
            ((p.typ = ait_label) and
             labelCanBeSkipped(tai_label(p))) or
            ((p.typ = ait_marker) and
-            (tai_Marker(p).Kind in [mark_AsmBlockEnd,mark_InlineStart,mark_InlineEnd]))) do
+            (tai_Marker(p).Kind in [mark_AsmBlockEnd,mark_NoLineInfoStart,mark_NoLineInfoEnd]))) do
          p := tai(p.next);
     while assigned(p) and
           (p.typ=ait_RegAlloc) Do

+ 1 - 1
compiler/i386/i386atts.inc

@@ -83,7 +83,7 @@ attsufNONE,
 attsufNONE,
 attsufFPUint,
 attsufFPUint,
-attsufNONE,
+attsufFPUint,
 attsufFPUint,
 attsufFPUint,
 attsufFPU,

+ 6 - 4
compiler/ncgcon.pas

@@ -448,10 +448,12 @@ implementation
           else
             begin
               location.value:=swapendian(Pcardinal(value_set)^);
-              location.value:= reverse_byte (location.value         and $ff)         or
-                              (reverse_byte((location.value shr  8) and $ff) shl  8) or
-                              (reverse_byte((location.value shr 16) and $ff) shl 16) or
-                              (reverse_byte((location.value shr 24) and $ff) shl 24);
+              location.value:=aint(
+                                 reverse_byte (location.value         and $ff)         or
+                                (reverse_byte((location.value shr  8) and $ff) shl  8) or
+                                (reverse_byte((location.value shr 16) and $ff) shl 16) or
+                                (reverse_byte((location.value shr 24) and $ff) shl 24)
+                              );
             end;
           if (target_info.endian=endian_big) then
             location.value:=location.value shr (32-resultdef.size*8);

+ 48 - 2
compiler/ncgflw.pas

@@ -424,7 +424,8 @@ implementation
 
     procedure tcgfornode.pass_generate_code;
       var
-         l3,oldclabel,oldblabel : tasmlabel;
+         l3,oldclabel,oldblabel,
+         otl, ofl : tasmlabel;
          temptovalue : boolean;
          hop : topcg;
          hcond : topcmp;
@@ -433,6 +434,7 @@ implementation
          cmp_const:Tconstexprint;
          oldflowcontrol : tflowcontrol;
          oldexecutionweight : longint;
+         isjump: boolean;
       begin
          location_reset(location,LOC_VOID,OS_NO);
          oldclabel:=current_procinfo.CurrContinueLabel;
@@ -454,7 +456,22 @@ implementation
          }
            and not(assigned(entrylabel));
 
-         secondpass(t1);
+        isjump:=(t1.expectloc=LOC_JUMP);
+        if isjump then
+          begin
+             otl:=current_procinfo.CurrTrueLabel;
+             current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
+             ofl:=current_procinfo.CurrFalseLabel;
+             current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
+          end;
+        secondpass(t1);
+        if t1.location.loc in [LOC_FLAGS,LOC_JUMP] then
+          location_force_reg(current_asmdata.CurrAsmList,t1.location,def_cgsize(t1.resultdef),false);
+        if isjump then
+          begin
+            current_procinfo.CurrTrueLabel:=otl;
+            current_procinfo.CurrFalseLabel:=ofl;
+          end;
          { calculate pointer value and check if changeable and if so }
          { load into temporary variable                       }
          if t1.nodetype<>ordconstn then
@@ -1099,12 +1116,18 @@ implementation
          if codegenerror then
            goto errorexit;
 
+         { don't generate line info for internal cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
+
          cg.a_label(current_asmdata.CurrAsmList,exceptlabel);
 
          free_exception(current_asmdata.CurrAsmList, excepttemps, 0, endexceptlabel, false);
 
          cg.a_label(current_asmdata.CurrAsmList,doexceptlabel);
 
+         { end cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
+
          { set control flow labels for the except block }
          { and the on statements                        }
          current_procinfo.CurrExitLabel:=exitexceptlabel;
@@ -1119,6 +1142,9 @@ implementation
          if assigned(right) then
            secondpass(right);
 
+         { don't generate line info for internal cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
+
          cg.a_label(current_asmdata.CurrAsmList,lastonlabel);
          { default handling except handling }
          if assigned(t1) then
@@ -1268,6 +1294,9 @@ implementation
          unget_exception_temps(current_asmdata.CurrAsmList,excepttemps);
          cg.a_label(current_asmdata.CurrAsmList,endexceptlabel);
 
+         { end cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
+
        errorexit:
          { restore all saved labels }
          endexceptlabel:=oldendexceptlabel;
@@ -1372,6 +1401,10 @@ implementation
 
               secondpass(right);
            end;
+
+         { don't generate lineinfo for internal cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
+
          current_asmdata.getjumplabel(doobjectdestroy);
          cg.a_label(current_asmdata.CurrAsmList,doobjectdestroyandreraise);
 
@@ -1441,6 +1474,7 @@ implementation
          cg.a_label(current_asmdata.CurrAsmList,nextonlabel);
          flowcontrol:=oldflowcontrol+(flowcontrol-[fc_inflowcontrol]);
          paraloc1.done;
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
 
          { next on node }
          if assigned(left) then
@@ -1514,10 +1548,16 @@ implementation
                 exit;
            end;
 
+         { don't generate line info for internal cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
+
          cg.a_label(current_asmdata.CurrAsmList,finallylabel);
          { just free the frame information }
          free_exception(current_asmdata.CurrAsmList,excepttemps,1,finallylabel,true);
 
+         { end cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
+
          { finally code }
          flowcontrol:=[fc_inflowcontrol];
          secondpass(right);
@@ -1528,6 +1568,9 @@ implementation
          if codegenerror then
            exit;
 
+         { don't generate line info for internal cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
+
          { the value should now be in the exception handler }
          cg.g_exception_reason_load(current_asmdata.CurrAsmList,excepttemps.reasonbuf);
          if implicitframe then
@@ -1620,6 +1663,9 @@ implementation
          unget_exception_temps(current_asmdata.CurrAsmList,excepttemps);
          cg.a_label(current_asmdata.CurrAsmList,endfinallylabel);
 
+         { end cleanup }
+         current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoEnd));
+
          current_procinfo.CurrExitLabel:=oldCurrExitLabel;
          if assigned(current_procinfo.CurrBreakLabel) then
           begin

+ 13 - 5
compiler/ncgset.pas

@@ -390,11 +390,19 @@ implementation
                   { load left in register }
                   location_force_reg(current_asmdata.CurrAsmList,left.location,location.size,true);
                   register_maybe_adjust_setbase(current_asmdata.CurrAsmList,left.location,setbase);
-                  location_force_reg(current_asmdata.CurrAsmList,right.location,opsize,true);
-                  { emit bit test operation }
-                  cg.a_bit_test_reg_reg_reg(current_asmdata.CurrAsmList,
-                    left.location.size,right.location.size,location.size,
-                    left.location.register,right.location.register,location.register);
+                  { emit bit test operation -- warning: do not use
+                    location_force_reg() to force a set into a register, except
+                    to a register of the same size as the set. The reason is
+                    that on big endian systems, this would require moving the
+                    set to the most significant part of the new register,
+                    and location_force_register can't do that (it does not
+                    know the type).
+
+                   a_bit_test_reg_loc_reg() properly takes into account the
+                   size of the set to adjust the register index to test }
+                  cg.a_bit_test_reg_loc_reg(current_asmdata.CurrAsmList,
+                    left.location.size,location.size,
+                    left.location.register,right.location,location.register);
 
                   { now zero the result if left > nr_of_bits_in_right_register }
                   hr := cg.getintregister(current_asmdata.CurrAsmList,location.size);

+ 21 - 15
compiler/ncnv.pas

@@ -515,9 +515,11 @@ implementation
 
                   stringdef :
                     begin
+                        if (p2.nodetype<>stringconstn) then
+                          Message(parser_e_illegal_expression)
                         { if we've already set elements which are constants }
                         { throw an error                                    }
-                        if ((hdef=nil) and assigned(buildp)) or
+                        else if ((hdef=nil) and assigned(buildp)) or
                           not(is_char(hdef)) then
                           CGMessage(type_e_typeconflict_in_set)
                         else
@@ -1921,15 +1923,15 @@ implementation
       end;
 
 
-{$ifndef cpu64bitaddr}
+{$ifndef cpu64bitalu}
 
     { checks whether we can safely remove 64 bit typeconversions }
     { in case range and overflow checking are off, and in case   }
     { the result of this node tree is downcasted again to a      }
     { 8/16/32 bit value afterwards                               }
-    function checkremove64bittypeconvs(n: tnode): boolean;
+    function checkremove64bittypeconvs(n: tnode; out gotsint: boolean): boolean;
       var
-        gotmuldivmod, gotsint: boolean;
+        gotmuldivmod: boolean;
 
       { checks whether a node is either an u32bit, or originally }
       { was one but was implicitly converted to s64bit           }
@@ -2008,22 +2010,23 @@ implementation
       end;
 
 
-    procedure doremove64bittypeconvs(var n: tnode; todef: tdef);
+    procedure doremove64bittypeconvs(var n: tnode; todef: tdef; forceunsigned: boolean);
       begin
         case n.nodetype of
           subn,addn,muln,divn,modn,xorn,andn,orn:
             begin
               exclude(n.flags,nf_internal);
-              if is_signed(n.resultdef) then
+              if not forceunsigned and
+                 is_signed(n.resultdef) then
                 begin
-                  doremove64bittypeconvs(tbinarynode(n).left,s32inttype);
-                  doremove64bittypeconvs(tbinarynode(n).right,s32inttype);
+                  doremove64bittypeconvs(tbinarynode(n).left,s32inttype,false);
+                  doremove64bittypeconvs(tbinarynode(n).right,s32inttype,false);
                   n.resultdef:=s32inttype
                 end
               else
                 begin
-                  doremove64bittypeconvs(tbinarynode(n).left,u32inttype);
-                  doremove64bittypeconvs(tbinarynode(n).right,u32inttype);
+                  doremove64bittypeconvs(tbinarynode(n).left,u32inttype,forceunsigned);
+                  doremove64bittypeconvs(tbinarynode(n).right,u32inttype,forceunsigned);
                   n.resultdef:=u32inttype
                 end;
             end;
@@ -2033,12 +2036,15 @@ implementation
             n.resultdef:=todef;
         end;
       end;
-{$endif not cpu64bitaddr}
+{$endif not cpu64bitalu}
 
 
     function ttypeconvnode.simplify: tnode;
       var
         hp: tnode;
+{$ifndef cpu64bitalu}
+        foundsint: boolean;
+{$endif not cpu64bitalu}
       begin
         result := nil;
         { Constant folding and other node transitions to
@@ -2198,7 +2204,7 @@ implementation
             end;
         end;
 
-{$ifndef cpu64bitaddr}
+{$ifndef cpu64bitalu}
         { must be done before code below, because we need the
           typeconversions for ordconstn's as well }
         case convtype of
@@ -2209,15 +2215,15 @@ implementation
                  (resultdef.size <= 4) and
                  is_64bitint(left.resultdef) and
                  (left.nodetype in [subn,addn,muln,divn,modn,xorn,andn,orn]) and
-                 checkremove64bittypeconvs(left) then
+                 checkremove64bittypeconvs(left,foundsint) then
                 begin
                   { avoid unnecessary widening of intermediary calculations }
                   { to 64 bit                                               }
-                  doremove64bittypeconvs(left,generrordef);
+                  doremove64bittypeconvs(left,generrordef,not foundsint);
                 end;
             end;
         end;
-{$endif not cpu64bitaddr}
+{$endif not cpu64bitalu}
 
       end;
 

+ 6 - 4
compiler/ninl.pas

@@ -1121,7 +1121,7 @@ implementation
         { check if codepara is valid }
         if assigned(codepara) and
            (
-            (codepara.resultdef.typ <> orddef)
+            not is_integer(codepara.resultdef)
 {$ifndef cpu64bitaddr}
             or is_64bitint(codepara.resultdef)
 {$endif not cpu64bitaddr}
@@ -1132,7 +1132,9 @@ implementation
           end;
 
         { check if dest para is valid }
-        if not(destpara.resultdef.typ in [orddef,floatdef,enumdef]) then
+        if not is_integer(destpara.resultdef) and
+           not is_currency(destpara.resultdef) and
+           not(destpara.resultdef.typ in [floatdef,enumdef]) then
           begin
             CGMessagePos(destpara.fileinfo,type_e_integer_or_real_expr_expected);
             exit;
@@ -2586,9 +2588,9 @@ implementation
 
                    if not((hpp.resultdef.typ=orddef) and
 {$ifndef cpu64bitaddr}
-                          (torddef(hpp.resultdef).ordtype<>u32bit)) then
+                          (torddef(hpp.resultdef).ordtype=u32bit)) then
 {$else not cpu64bitaddr}
-                          (torddef(hpp.resultdef).ordtype<>u64bit)) then
+                          (torddef(hpp.resultdef).ordtype=u64bit)) then
 {$endif not cpu64bitaddr}
                      inserttypeconv_internal(hpp,sinttype);
                    { make sure we don't call functions part of the left node twice (and generally }

+ 11 - 3
compiler/nmem.pas

@@ -710,9 +710,9 @@ implementation
           exit;
 
          { maybe type conversion for the index value, but
-           do not convert enums,booleans,char
+           do not convert enums, char (why not? (JM))
            and do not convert range nodes }
-         if (right.nodetype<>rangen) and (is_integer(right.resultdef) or (left.resultdef.typ<>arraydef)) then
+         if (right.nodetype<>rangen) and (is_integer(right.resultdef) or is_boolean(right.resultdef) or (left.resultdef.typ<>arraydef)) then
            case left.resultdef.typ of
              arraydef:
                if ado_isvariant in Tarraydef(left.resultdef).arrayoptions then
@@ -725,6 +725,9 @@ implementation
                  {Arrays without a high bound (dynamic arrays, open arrays) are zero based,
                   convert indexes into these arrays to aword.}
                  inserttypeconv(right,uinttype)
+               { convert between pasbool and cbool if necessary }
+               else if is_boolean(right.resultdef) then
+                 inserttypeconv(right,tarraydef(left.resultdef).rangedef)
                else
                  {Convert array indexes to low_bound..high_bound.}
                  inserttypeconv(right,Torddef.create(Torddef(sinttype).ordtype,
@@ -870,7 +873,12 @@ implementation
          else if is_widestring(left.resultdef) and (tf_winlikewidestring in target_info.flags) then
            exclude(flags,nf_callunique);
 
-         if (not is_packed_array(left.resultdef)) or
+         { a range node as array index can only appear in function calls, and
+           those convert the range node into something else in
+           tcallnode.gen_high_tree }
+         if (right.nodetype=rangen) then
+           CGMessagePos(right.fileinfo,parser_e_illegal_expression)
+         else if (not is_packed_array(left.resultdef)) or
             ((tarraydef(left.resultdef).elepackedbitsize mod 8) = 0) then
            if left.expectloc=LOC_CREFERENCE then
              expectloc:=LOC_CREFERENCE

+ 4 - 0
compiler/nutils.pas

@@ -345,6 +345,10 @@ implementation
       var
         pd : tprocdef;
       begin
+        result:=nil;
+        { is not assigned while parsing a property }
+        if not assigned(current_procinfo) then
+          exit;
         { we can't use searchsym here, because the
           symtablestack is not fully setup when pass1
           is run for nested procedures }

+ 1 - 0
compiler/pdecobj.pas

@@ -787,6 +787,7 @@ implementation
 
         { generate vmt space if needed }
         if not(oo_has_vmt in current_objectdef.objectoptions) and
+           not(oo_is_forward in current_objectdef.objectoptions) and
            (
             ([oo_has_virtual,oo_has_constructor,oo_has_destructor]*current_objectdef.objectoptions<>[]) or
             (current_objectdef.objecttype in [odt_class])

+ 12 - 2
compiler/pdecsub.pas

@@ -391,10 +391,11 @@ implementation
         old_block_type : tblock_type;
         currparast : tparasymtable;
         parseprocvar : tppv;
-        explicit_paraloc : boolean;
         locationstr : string;
         paranr : integer;
         dummytype : ttypesym;
+        explicit_paraloc,
+        need_array: boolean;
       begin
         old_block_type:=block_type;
         explicit_paraloc:=false;
@@ -493,7 +494,16 @@ implementation
            begin
              consume(_COLON);
              { check for an open array }
-             if token=_ARRAY then
+             need_array:=false;
+             { bitpacked open array are not yet supported }
+             if (token=_PACKED) and
+                not(cs_bitpacking in current_settings.localswitches) then
+               begin
+                 consume(_PACKED);
+                 need_array:=true;
+               end;
+             if (token=_ARRAY) or
+                need_array then
               begin
                 consume(_ARRAY);
                 consume(_OF);

+ 3 - 1
compiler/pexpr.pas

@@ -1352,6 +1352,7 @@ implementation
                     { check if we are reading a field of an object/class/   }
                     { record. is_member_read() will deal with withsymtables }
                     { if needed.                                            }
+                    p1:=nil;
                     if is_member_read(srsym,srsymtable,p1,hdef) then
                       begin
                         { if the field was originally found in an    }
@@ -1535,6 +1536,7 @@ implementation
 
                 procsym :
                   begin
+                    p1:=nil;
                     { check if it's a method/class method }
                     if is_member_read(srsym,srsymtable,p1,hdef) then
                       begin
@@ -1555,6 +1557,7 @@ implementation
 
                 propertysym :
                   begin
+                    p1:=nil;
                     { property of a class/object? }
                     if is_member_read(srsym,srsymtable,p1,hdef) then
                       begin
@@ -1571,7 +1574,6 @@ implementation
                     else
                     { no method pointer }
                       begin
-                        p1:=nil;
                         handle_propertysym(tpropertysym(srsym),srsymtable,p1);
                       end;
                   end;

+ 2 - 2
compiler/powerpc/agppcmpw.pas

@@ -1102,9 +1102,9 @@ interface
                 end;
               ait_marker :
                  begin
-                   if tai_marker(hp).kind=mark_InlineStart then
+                   if tai_marker(hp).kind=mark_NoLineInfoStart then
                      inc(InlineLevel)
-                   else if tai_marker(hp).kind=mark_InlineEnd then
+                   else if tai_marker(hp).kind=mark_NoLineInfoEnd then
                      dec(InlineLevel);
                  end;
          else

+ 1 - 1
compiler/pstatmnt.pas

@@ -628,7 +628,7 @@ implementation
                 if token<>_SEMICOLON then
                   p:=statement
                 else
-                  p:=cerrornode.create;
+                  p:=cnothingnode.create;
               end;
 
             { remove symtables in reverse order from the stack }

+ 2 - 2
compiler/rgobj.pas

@@ -260,7 +260,7 @@ unit rgobj;
     {Ok, sorting pointers is silly, but it does the job to make Trgobj.combine
      faster.}
 
-    var h,i,p:word;
+    var h,i,p:longword;
         t:Tlinkedlistitem;
 
     begin
@@ -790,7 +790,7 @@ unit rgobj;
      registers in it cause. This allows simplify to execute in
      constant time.}
 
-    var p,h,i,leni,lent:word;
+    var p,h,i,leni,lent:longword;
         t:Tsuperregister;
         adji,adjt:Psuperregisterworklist;
 

+ 9 - 2
compiler/scanner.pas

@@ -3187,7 +3187,12 @@ In case not, the value returned can be arbitrary.
                    continue;
                  end;
                #10,#13 :
-                 linebreak;
+                 begin
+                   if found=4 then
+                    inc_comment_level;
+                   linebreak;
+                   found:=0;
+                 end;
                '*' :
                  begin
                    if found=3 then
@@ -3204,7 +3209,9 @@ In case not, the value returned can be arbitrary.
                        found:=2
                       else
                        found:=0;
-                    end;
+                    end
+                   else
+                    found:=0;
                  end;
                '(' :
                  begin

+ 1 - 1
compiler/sparc/cgcpu.pas

@@ -1264,7 +1264,7 @@ implementation
         else
           begin
             reference_reset(src,source.alignment);
-            reference_reset(dst,dst.alignment);
+            reference_reset(dst,dest.alignment);
             { load the address of source into src.base }
             src.base:=GetAddressRegister(list);
             a_loadaddr_ref_reg(list,source,src.base);

+ 224 - 227
compiler/utils/fpccfg.inc

@@ -1,237 +1,234 @@
 {$ifdef Delphi}
-const DefaultConfig : array[0..25] of string[240]=(
+const DefaultConfig : array[0..24] of string[240]=(
 {$else Delphi}
-const DefaultConfig : array[0..25,1..240] of char=(
+const DefaultConfig : array[0..24,1..240] of char=(
 {$endif Delphi}
-  '#'#013#010+
-  '# Config file generated by fpcmkcfg on %BUILDDATE% - %BUILDTIME%'#013#010+
-  '# Example fpc.cfg for Free Pascal Compiler'#013#010+
-  '#'#013#010+
-  #013#010+
-  '# ----------------------'#013#010+
-  '# Defines (preprocessor)'#013#010+
-  '# ----------------------'#013#010+
-  #013#010+
-  '#'#013#010+
-  '# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE',', #DEFINE, #UNDEF are allowed'+
-  #013#010+
-  '#'#013#010+
-  '# -d is the same as #DEFINE'#013#010+
-  '# -u is the same as #UNDEF'#013#010+
-  '#'#013#010+
-  #013#010+
-  '#'#013#010+
-  '# Some examples (for switches see below, and the -? helppages)'#013#010+
-  '#'#013#010+
-  '# Try compiling with the -dRELEASE or -dDEBUG on the commandline'#013#010+
-  '#'#013#010+
-  #013#010+
-  '# F','or a release compile with optimizes and strip debuginfo'#013#010+
-  '#IFDEF RELEASE'#013#010+
-  '  -O2'#013#010+
-  '  -Xs'#013#010+
-  '  #WRITE Compiling Release Version'#013#010+
-  '#ENDIF'#013#010+
-  #013#010+
+  '#'#010+
+  '# Config file generated by fpcmkcfg on %BUILDDATE% - %BUILDTIME%'#010+
+  '# Example fpc.cfg for Free Pascal Compiler'#010+
+  '#'#010+
+  #010+
+  '# ----------------------'#010+
+  '# Defines (preprocessor)'#010+
+  '# ----------------------'#010+
+  #010+
+  '#'#010+
+  '# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE,',' #UNDEF are allowed'+
+  #010+
+  '#'#010+
+  '# -d is the same as #DEFINE'#010+
+  '# -u is the same as #UNDEF'#010+
+  '#'#010+
+  #010+
+  '#'#010+
+  '# Some examples (for switches see below, and the -? helppages)'#010+
+  '#'#010+
+  '# Try compiling with the -dRELEASE or -dDEBUG on the commandline'#010+
+  '#'#010+
+  #010+
+  '# For a release compile w','ith optimizes and strip debuginfo'#010+
+  '#IFDEF RELEASE'#010+
+  '  -O2'#010+
+  '  -Xs'#010+
+  '  #WRITE Compiling Release Version'#010+
+  '#ENDIF'#010+
+  #010+
   '# For a debug version compile with debuginfo and all codegeneration ch'+
-  'ecks on'#013#010+
-  '#IFDEF DEBUG'#013#010+
-  '  -glh'#013#010+
-  '  -Crt','oi'#013#010+
-  '  #WRITE Compiling Debug Version'#013#010+
-  '#ENDIF'#013#010+
-  #013#010+
-  '# ----------------'#013#010+
-  '# Parsing switches'#013#010+
-  '# ----------------'#013#010+
-  #013#010+
-  '# Pascal language mode'#013#010+
-  '#      -Mfpc      free pascal dialect (default)'#013#010+
-  '#      -Mobjfpc   switch some Delphi 2 extensions on'#013#010+
-  '#  ','    -Mdelphi   tries to be Delphi compatible'#013#010+
-  '#      -Mtp       tries to be TP/BP 7.0 compatible'#013#010+
-  '#      -Mgpc      tries to be gpc compatible'#013#010+
+  'ecks on'#010+
+  '#IFDEF DEBUG'#010+
+  '  -glh'#010+
+  '  -Crtoi'#010+
+  '  #WRITE Compiling Debug Vers','ion'#010+
+  '#ENDIF'#010+
+  #010+
+  '# ----------------'#010+
+  '# Parsing switches'#010+
+  '# ----------------'#010+
+  #010+
+  '# Pascal language mode'#010+
+  '#      -Mfpc      free pascal dialect (default)'#010+
+  '#      -Mobjfpc   switch some Delphi 2 extensions on'#010+
+  '#      -Mdelphi   tries to be Delphi compatibl','e'#010+
+  '#      -Mtp       tries to be TP/BP 7.0 compatible'#010+
+  '#      -Mgpc      tries to be gpc compatible'#010+
   '#      -Mmacpas   tries to be compatible to the macintosh pascal diale'+
-  'cts'#013#010+
-  '#'#013#010+
-  '# Turn on Object P','ascal extensions by default'#013#010+
-  '#-Mobjfpc'#013#010+
-  #013#010+
-  '# Assembler reader mode'#013#010+
-  '#      -Rdefault  use default assembler'#013#010+
-  '#      -Ratt      read AT&T style assembler'#013#010+
-  '#      -Rintel    read Intel style assembler'#013#010+
-  '#'#013#010+
-  '# All assembler blocks are AT&T styled',' by default'#013#010+
-  '#-Ratt'#013#010+
-  #013#010+
-  '# Semantic checking'#013#010+
-  '#      -S2        same as -Mobjfpc'#013#010+
-  '#      -Sc        supports operators like C (*=,+=,/= and -=)'#013#010+
-  '#      -Sa        include assertion code.'#013#010+
-  '#      -Sd        same as -Mdelphi'#013#010+
-  '#      -Se<x>     ','compiler stops after the <x> errors (default is 1)'+
-  #013#010+
-  '#      -Sg        allow LABEL and GOTO'#013#010+
-  '#      -Sh        Use ansistrings'#013#010+
-  '#      -Si        support C++ styled INLINE'#013#010+
-  '#      -SI<x>     set interface style to <x>'#013#010+
-  '#         -SIcomCOM co','mpatible interface (default)'#013#010+
-  '#         -SIcorbaCORBA compatible interface'#013#010+
-  '#      -Sm        support macros like C (global)'#013#010+
-  '#      -So        same as -Mtp'#013#010+
-  '#      -Sp        same as -Mgpc'#013#010+
-  '#      -Ss        constructor name must be init (','destructor must be '+
-  'done)'#013#010+
-  '#      -St        allow static keyword in objects'#013#010+
-  '#'#013#010+
-  '# Allow goto, inline, C-operators, C-vars'#013#010+
-  '-Sgic'#013#010+
-  #013#010+
-  '# ---------------'#013#010+
-  '# Code generation'#013#010+
-  '# ---------------'#013#010+
-  #013#010+
-  '# Uncomment the next line if you always want stat','ic/dynamic units by'+
-  ' default'#013#010+
-  '# (can be overruled with -CD, -CS at the commandline)'#013#010+
-  '#-CS'#013#010+
-  '#-CD'#013#010+
-  #013#010+
-  '# Set the default heapsize to 8Mb'#013#010+
-  '#-Ch8000000'#013#010+
-  #013#010+
-  '# Set default codegeneration checks (iocheck, overflow, range, stack)'#013+
-  #010+
-  '#-Ci'#013#010+
-  '#-Co'#013#010+
-  '#-Cr'#013#010+
-  '#-C','t'#013#010+
-  #013#010+
-  '# Optimizer switches for i386 compiler'#013#010+
-  '# -Os        generate smaller code'#013#010+
-  '# -O1        level 1 optimizations (quick optimizations)'#013#010+
-  '# -O2        level 2 optimizations (-O1 + slower optimizations)'#013#010+
-  '# -O3        level 3 optimizations (','same as -O2u)'#013#010+
-  '# -Oa=N      set alignment to N'#013#010+
-  '# -OoX       switch on optimalization X. '#013#010+
-  '# -OoNOX     switch off optimalization X.'#013#010+
+  'cts'#010+
+  '#'#010+
+  '# Turn on Object Pascal extensions by default'#010+
+  '#-Mobjfpc'#010+
+  #010+
+  '# Assembl','er reader mode'#010+
+  '#      -Rdefault  use default assembler'#010+
+  '#      -Ratt      read AT&T style assembler'#010+
+  '#      -Rintel    read Intel style assembler'#010+
+  '#'#010+
+  '# All assembler blocks are AT&T styled by default'#010+
+  '#-Ratt'#010+
+  #010+
+  '# Semantic checking'#010+
+  '#      -S2      ','  same as -Mobjfpc'#010+
+  '#      -Sc        supports operators like C (*=,+=,/= and -=)'#010+
+  '#      -Sa        include assertion code.'#010+
+  '#      -Sd        same as -Mdelphi'#010+
+  '#      -Se<x>     compiler stops after the <x> errors (default is 1)'#010+
+  '#      -Sg   ','     allow LABEL and GOTO'#010+
+  '#      -Sh        Use ansistrings'#010+
+  '#      -Si        support C++ styled INLINE'#010+
+  '#      -SI<x>     set interface style to <x>'#010+
+  '#         -SIcomCOM compatible interface (default)'#010+
+  '#         -SIcorbaCORBA compatible inter','face'#010+
+  '#      -Sm        support macros like C (global)'#010+
+  '#      -So        same as -Mtp'#010+
+  '#      -Sp        same as -Mgpc'#010+
+  '#      -Ss        constructor name must be init (destructor must be do'+
+  'ne)'#010+
+  '#      -St        allow static keyword in objects',#010+
+  '#'#010+
+  '# Allow goto, inline, C-operators, C-vars'#010+
+  '-Sgic'#010+
+  #010+
+  '# ---------------'#010+
+  '# Code generation'#010+
+  '# ---------------'#010+
+  #010+
+  '# Uncomment the next line if you always want static/dynamic units by d'+
+  'efault'#010+
+  '# (can be overruled with -CD, -CS at the commandline)'#010+
+  '#-','CS'#010+
+  '#-CD'#010+
+  #010+
+  '# Set the default heapsize to 8Mb'#010+
+  '#-Ch8000000'#010+
+  #010+
+  '# Set default codegeneration checks (iocheck, overflow, range, stack)'#010+
+  '#-Ci'#010+
+  '#-Co'#010+
+  '#-Cr'#010+
+  '#-Ct'#010+
+  #010+
+  '# Optimizer switches for i386 compiler'#010+
+  '# -Os        generate smaller code'#010+
+  '# -O1        level ','1 optimizations (quick optimizations)'#010+
+  '# -O2        level 2 optimizations (-O1 + slower optimizations)'#010+
+  '# -O3        level 3 optimizations (same as -O2u)'#010+
+  '# -Oa=N      set alignment to N'#010+
+  '# -OoX       switch on optimalization X. '#010+
+  '# -OoNOX     s','witch off optimalization X.'#010+
   '#               X is one of REGVAR UNCERTAIN STACKFRAME PEEPHOLE ASMCS'+
-  'E LOOPUNROLL'#013#010+
-  '# -OpCPU     set targe','t processor.'#013#010+
+  'E LOOPUNROLL'#010+
+  '# -OpCPU     set target processor.'#010+
   '#             CPU is one of 386, PENTIUM, PENTIUM2, PENTIUM3, PENTIUM4'+
-  ', PENTIUMM '#013#010+
-  #013#010+
-  #013#010+
-  '# -----------------------'#013#010+
-  '# Set Filenames and Paths'#013#010+
-  '# -----------------------'#013#010+
-  #013#010+
-  '# Both slashes and backslashes are allowed in paths'#013#010+
-  #013#010+
-  '#',' path to the messagefile, not necessary anymore but can be used to '+
-  'override'#013#010+
-  '# the default language'#013#010+
-  '#-Fr%basepath%/msg/errore.msg'#013#010+
-  '#-Fr%basepath%/msg/errorn.msg'#013#010+
-  '#-Fr%basepath%/msg/errores.msg'#013#010+
-  '#-Fr%basepath%/msg/errord.msg'#013#010+
-  '#-Fr%basepath%','/msg/errorr.msg'#013#010+
-  #013#010+
-  '# path to the gcclib'#013#010+
-  '#-Fl%basepath%/lib'#013#010+
-  #013#010+
-  '# searchpath for includefiles'#013#010+
-  '#-Fi/pp/inc;/pp/rtl/inc'#013#010+
-  #013#010+
-  '# searchpath for includefiles'#013#010+
-  '# release them only if you know what you do'#013#010+
-  '# because this could cause a rebuild of the',' runtime library'#013#010+
-  '# if you tell them compiler/ide to build the project (FK)'#013#010+
-  '#-Fi%basepath%/source/rtl/inc;%basepath%/source/rtl/i386'#013#010+
-  #013#010+
-  '# searchpath for objectfiles'#013#010+
-  '#-Fo%basepath%/source/rtl/inc;%basepath%/source/rtl/i386'#013#010+
-  #013#010+
-  '#IFDEF FPCAPA','CHE_1_13'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/httpd-1.3/'#013#010+
-  '#ELSE'#013#010+
-  '#IFDEF FPCAPACHE_2_0'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/httpd-2.0'#013#010+
-  '#ELSE'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/httpd-2.2'#013#010+
-  '#ENDIF'#013#010+
-  '#ENDIF'#013#010+
-  #013#010+
-  '# searchpath for units and other system dependent',' things'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/*'#013#010+
-  '-Fu%basepath%/units/$FPCTARGET/rtl'#013#010+
-  #013#010+
-  '# searchpath for libraries'#013#010+
-  '#-Fl%basepath%/lib'#013#010+
-  '#-Fl/lib;/usr/lib'#013#010+
-  #013#010+
-  '# searchpath for tools'#013#010+
-  '-FD%basepath%/bin/$FPCTARGET'#013#010+
-  #013#010+
-  '#',' binutils prefix for cross compiling'#013#010+
-  '#IFDEF FPC_CROSSCOMPILING'#013#010+
-  '  -XP$FPCTARGET-'#013#010+
-  '#ENDIF'#013#010+
-  #013#010+
-  #013#010+
-  '# -------------'#013#010+
-  '# Linking'#013#010+
-  '# -------------'#013#010+
-  #013#010+
-  '# generate always debugging information for GDB (slows down the compil'+
-  'ing'#013#010+
-  '# process)'#013#010+
-  '#      -gc ','       generate checks for pointers'#013#010+
-  '#      -gd        use dbx'#013#010+
-  '#      -gg        use gsym'#013#010+
-  '#      -gh        use heap trace unit (for memory leak debugging)'#013#010+
-  '#      -gl        use line info unit to show more info for backtraces'#013+
-  #010+
-  '#      -gv','        generates programs tracable with valgrind'#013#010+
-  '#      -gw        generate dwarf debugging info'#013#010+
-  '#'#013#010+
-  '# Enable debuginfo and use the line info unit by default'#013#010+
-  '#-gl'#013#010+
-  #013#010+
-  '# always pass an option to the linker'#013#010+
-  '#-k-s'#013#010+
-  #013#010+
-  '# Always strip debuginf','o from the executable'#013#010+
-  '-Xs'#013#010+
-  #013#010+
-  #013#010+
-  '# -------------'#013#010+
-  '# Miscellaneous'#013#010+
-  '# -------------'#013#010+
-  #013#010+
-  '# Write always a nice FPC logo ;)'#013#010+
-  '-l'#013#010+
-  #013#010+
-  '# Verbosity'#013#010+
-  '#      e : Show errors (default)       d : Show debug info'#013#010+
-  '#      w : Show warnings               u ',': Show unit info'#013#010+
-  '#      n : Show notes                  t : Show tried/used files'#013#010+
-  '#      h : Show hints                  m : Show defined macros'#013#010+
-  '#      i : Show general info           p : Show compiled procedures'#013+
-  #010+
-  '#      l : Show linenum','bers            c : Show conditionals'#013#010+
+  ', PENTIUMM '#010+
+  #010+
+  #010+
+  '# --------','---------------'#010+
+  '# Set Filenames and Paths'#010+
+  '# -----------------------'#010+
+  #010+
+  '# Both slashes and backslashes are allowed in paths'#010+
+  #010+
+  '# path to the messagefile, not necessary anymore but can be used to ov'+
+  'erride'#010+
+  '# the default language'#010+
+  '#-Fr%basepath%/msg','/errore.msg'#010+
+  '#-Fr%basepath%/msg/errorn.msg'#010+
+  '#-Fr%basepath%/msg/errores.msg'#010+
+  '#-Fr%basepath%/msg/errord.msg'#010+
+  '#-Fr%basepath%/msg/errorr.msg'#010+
+  #010+
+  '# path to the gcclib'#010+
+  '#-Fl%basepath%/lib'#010+
+  #010+
+  '# searchpath for includefiles'#010+
+  '#-Fi/pp/inc;/pp/rtl/inc'#010+
+  #010+
+  '# searchpa','th for includefiles'#010+
+  '# release them only if you know what you do'#010+
+  '# because this could cause a rebuild of the runtime library'#010+
+  '# if you tell them compiler/ide to build the project (FK)'#010+
+  '#-Fi%basepath%/source/rtl/inc;%basepath%/source/rtl/i386'#010+
+  #010,
+  '# searchpath for objectfiles'#010+
+  '#-Fo%basepath%/source/rtl/inc;%basepath%/source/rtl/i386'#010+
+  #010+
+  '#IFDEF FPCAPACHE_1_13'#010+
+  '-Fu%basepath%/units/$FPCTARGET/httpd-1.3/'#010+
+  '#ELSE'#010+
+  '#IFDEF FPCAPACHE_2_0'#010+
+  '-Fu%basepath%/units/$FPCTARGET/httpd-2.0'#010+
+  '#ELSE'#010+
+  '-Fu%basepath%/u','nits/$FPCTARGET/httpd-2.2'#010+
+  '#ENDIF'#010+
+  '#ENDIF'#010+
+  #010+
+  '# searchpath for units and other system dependent things'#010+
+  '-Fu%basepath%/units/$FPCTARGET/'#010+
+  '-Fu%basepath%/units/$FPCTARGET/*'#010+
+  '-Fu%basepath%/units/$FPCTARGET/rtl'#010+
+  #010+
+  '# searchpath for libraries'#010+
+  '#-Fl%basepath%','/lib'#010+
+  '#-Fl/lib;/usr/lib'#010+
+  #010+
+  '# searchpath for tools'#010+
+  '-FD%basepath%/bin/$FPCTARGET'#010+
+  #010+
+  '# binutils prefix for cross compiling'#010+
+  '#IFDEF FPC_CROSSCOMPILING'#010+
+  '  -XP$FPCTARGET-'#010+
+  '#ENDIF'#010+
+  #010+
+  #010+
+  '# -------------'#010+
+  '# Linking'#010+
+  '# -------------'#010+
+  #010+
+  '# generate always debugging in','formation for GDB (slows down the comp'+
+  'iling'#010+
+  '# process)'#010+
+  '#      -gc        generate checks for pointers'#010+
+  '#      -gd        use dbx'#010+
+  '#      -gg        use gsym'#010+
+  '#      -gh        use heap trace unit (for memory leak debugging)'#010+
+  '#      -gl        u','se line info unit to show more info for backtrace'+
+  's'#010+
+  '#      -gv        generates programs tracable with valgrind'#010+
+  '#      -gw        generate dwarf debugging info'#010+
+  '#'#010+
+  '# Enable debuginfo and use the line info unit by default'#010+
+  '#-gl'#010+
+  #010+
+  '# always pass an',' option to the linker'#010+
+  '#-k-s'#010+
+  #010+
+  '# Always strip debuginfo from the executable'#010+
+  '-Xs'#010+
+  #010+
+  #010+
+  '# -------------'#010+
+  '# Miscellaneous'#010+
+  '# -------------'#010+
+  #010+
+  '# Write always a nice FPC logo ;)'#010+
+  '-l'#010+
+  #010+
+  '# Verbosity'#010+
+  '#      e : Show errors (default)       d : Show debug info'#010+
+  '# ','     w : Show warnings               u : Show unit info'#010+
+  '#      n : Show notes                  t : Show tried/used files'#010+
+  '#      h : Show hints                  m : Show defined macros'#010+
+  '#      i : Show general info           p : Show compiled',' procedures'#010+
+  '#      l : Show linenumbers            c : Show conditionals'#010+
   '#      a : Show everything             0 : Show nothing (except errors'+
-  ')'#013#010+
+  ')'#010+
   '#      b : Show all procedure          r : Rhide/GCC compatibility mod'+
-  'e'#013#010+
-  '#          declarations if an error    x : Executable i','nfo (Win32 on'+
-  'ly)'#013#010+
-  '#          occurs'#013#010+
-  '#'#013#010+
-  '# Display Info, Warnings, Notes and Hints'#013#010+
-  '-viwn'#013#010+
-  '# If you don'#039't want so much verbosity use'#013#010+
-  '#-vw'#013#010
+  'e'#010+
+  '#          declarations',' if an error    x : Executable info (Win32 on'+
+  'ly)'#010+
+  '#          occurs'#010+
+  '#'#010+
+  '# Display Info, Warnings, Notes and Hints'#010+
+  '-viwn'#010+
+  '# If you don'#039't want so much verbosity use'#010+
+  '#-vw'#010
 );

+ 2 - 2
compiler/utils/samplecfg

@@ -47,10 +47,10 @@ else
 fi
 FPCBIN=`dirname "$1"`/../../bin/fpc
 FPBIN=`dirname "$1"`/../../bin/fp
-sysfpdirbase=`dirname "$1"`/`$FPCBIN -iV`
+sysfpdirbase=`dirname "$1"`/`"$FPCBIN" -iV`
 sysfpdirbase2=$sysfpdirbase/ide
 sysfpdir=$sysfpdirbase2/text
-fpctargetos=`$FPCBIN -iTO`
+fpctargetos=`"$FPCBIN" -iTO`
 
 # Detect if we have write permission in sysdir.
 if [ -w "$sysdir" ] ; then

+ 4 - 1
compiler/verbose.pas

@@ -118,7 +118,7 @@ interface
 implementation
 
     uses
-      comphook,fmodule,constexp,globals;
+      comphook,fmodule,constexp,globals,cfileutl;
 
 {****************************************************************************
                        Extra Handlers for default compiler
@@ -422,6 +422,9 @@ implementation
               status.currentmodulestate:=ModuleStateStr[module.state];
               status.currentsource:=module.sourcefiles.get_file_name(current_filepos.fileindex);
               status.currentsourcepath:=module.sourcefiles.get_file_path(current_filepos.fileindex);
+              { if currentsourcepath is relative, make it absolute }
+              if not path_absolute(status.currentsourcepath) then
+                status.currentsourcepath:=GetCurrentDir+status.currentsourcepath;
 
               { update lastfileidx only if name known PM }
               if status.currentsource<>'' then

+ 2 - 2
compiler/x86/agx86int.pas

@@ -795,9 +795,9 @@ implementation
                end;
            ait_marker :
              begin
-               if tai_marker(hp).kind=mark_InlineStart then
+               if tai_marker(hp).kind=mark_NoLineInfoStart then
                  inc(InlineLevel)
-               else if tai_marker(hp).kind=mark_InlineEnd then
+               else if tai_marker(hp).kind=mark_NoLineInfoEnd then
                  dec(InlineLevel);
              end;
 

+ 1 - 1
compiler/x86/x86ins.dat

@@ -475,7 +475,7 @@ mem32                 \300\323\1\xDB\203              8086,FPU
 mem16                 \300\324\1\xDF\203              8086,FPU
 mem64                 \300\323\1\xDF\207              8086,FPU
 
-[FISTTP]
+[FISTTP,fisttpR]
 (Ch_Wop1, Ch_None, Ch_None)
 mem32                 \300\323\1\xDB\201              PRESCOTT,FPU
 mem16                 \300\323\1\xDF\201              PRESCOTT,FPU

+ 4 - 4
compiler/x86_64/cpuinfo.pas

@@ -45,7 +45,7 @@ Type
 
    tfputype =
      (fpu_none,
-      fpu_soft,  { generic }
+//      fpu_soft,  { generic }
       fpu_sse64,
       fpu_sse3
      );
@@ -75,13 +75,13 @@ Const
    );
 
    fputypestr : array[tfputype] of string[6] = ('',
-     'SOFT',
+//     'SOFT',
      'SSE64',
      'SSE3'
    );
 
-   sse_singlescalar : set of tfputype = [fpu_sse64];
-   sse_doublescalar : set of tfputype = [fpu_sse64];
+   sse_singlescalar : set of tfputype = [fpu_sse64,fpu_sse3];
+   sse_doublescalar : set of tfputype = [fpu_sse64,fpu_sse3];
 
    { Supported optimizations, only used for information }
    supported_optimizerswitches = genericlevel1optimizerswitches+

+ 1 - 1
compiler/x86_64/x8664ats.inc

@@ -83,7 +83,7 @@ attsufNONE,
 attsufNONE,
 attsufFPUint,
 attsufFPUint,
-attsufNONE,
+attsufFPUint,
 attsufFPUint,
 attsufFPUint,
 attsufFPU,

+ 1 - 1
rtl/inc/system.inc

@@ -553,7 +553,7 @@ end;
 {$ifndef FPUNONE}
 function random: extended;
 begin
-  random := cardinal(genrand_MT19937) * (1.0/(int64(1) shl 32));
+  random := cardinal(genrand_MT19937) * (extended(1.0)/(int64(1) shl 32));
 end;
 {$endif}
 {$endif FPC_HAS_FEATURE_RANDOM}

+ 10 - 0
rtl/linux/ossysc.inc

@@ -244,7 +244,12 @@ end;
 procedure linux_restore; cdecl; nostackframe; assembler;
 {$ifdef cpuarm}
 asm
+{$ifdef FPC_ABI_EABI}
+  mov r7, syscall_nr_sigreturn
+  swi #0x0
+{$else}
   swi syscall_nr_sigreturn
+{$endif}
 end;
 {$endif}
 {$ifdef cpui386}
@@ -268,7 +273,12 @@ end;
 procedure linux_restore_rt; cdecl; nostackframe; assembler;
 {$ifdef cpuarm}
 asm
+{$ifdef FPC_ABI_EABI}
+  mov r7, syscall_nr_rt_sigreturn
+  swi #0x0
+{$else}
   swi syscall_nr_rt_sigreturn
+{$endif}
 end;
 {$endif}
 {$ifdef cpui386}

+ 9 - 2
rtl/unix/cthreads.pp

@@ -15,6 +15,13 @@
  **********************************************************************}
 {$mode objfpc}
 {$ifdef linux}
+{ we can combine both compile-time linking and dynamic loading, in order to:
+    a) solve a problem on some systems with dynamically loading libpthread if
+       it's not linked at compile time
+    b) still enabling dynamically checking whether or not certain functions
+       are available (could also be implemented via weak linking)
+}
+{$linklib pthread}
 {$define dynpthreads} // Useless on BSD, since they are in libc
 {$endif}
 
@@ -593,7 +600,7 @@ begin
 {$ifdef has_sem_open}
   { avoid a potential temporary nameclash with another process/thread }
   str(fpGetPid,semname);
-  str(ptruint(pthread_self),tid);
+  str(ptruint(pthread_self()),tid);
   semname:='/FPC'+semname+'T'+tid+#0;
   cIntSemaphoreInit:=cIntSemaphoreOpen(@semname[1],initvalue);
 {$else}
@@ -905,7 +912,7 @@ begin
 {$else}
   Result:=LoadPthreads;
 {$endif}
-  ThreadID := TThreadID (pthread_self);
+  ThreadID := TThreadID (pthread_self());
 {$ifdef DEBUG_MT}
   Writeln('InitThreads : ',Result);
 {$endif DEBUG_MT}

+ 3 - 1
rtl/unix/tthread.inc

@@ -85,6 +85,7 @@ end;
 function ThreadFunc(parameter: Pointer): ptrint;
 var
   LThread: TThread;
+  LFreeOnTerminate: boolean;
 {$ifdef DEBUG_MT}
   lErrorAddr, lErrorBase: Pointer;
 {$endif}
@@ -143,8 +144,9 @@ begin
   Result := LThread.FReturnValue;
   WRITE_DEBUG('Result is ',Result);
   LThread.FFinished := True;
+  LFreeOnTerminate := LThread.FreeOnTerminate;
   LThread.DoTerminate;
-  if LThread.FreeOnTerminate then
+  if LFreeOnTerminate then
     begin
       WRITE_DEBUG('Thread ',ptruint(lthread),' should be freed');
       LThread.Free;

+ 10 - 0
tests/webtbf/tw14777.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+var
+  S: String;
+  B: Boolean;
+  E: Word;
+begin
+  S := '0';
+  Val(S, B, E);
+end.

+ 10 - 0
tests/webtbf/tw14777a.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+var
+  S: String;
+  B: Boolean;
+  E: Word;
+begin
+  S := '0';
+  Val(S, E, B);
+end.

+ 48 - 0
tests/webtbf/tw14849.pp

@@ -0,0 +1,48 @@
+{ %norun }
+{ %fail }
+
+unit tw14849;
+
+{$mode objfpc}
+
+interface
+uses
+  Classes, SysUtils; 
+
+type
+  TMarkerState=(leftActive,rightActive);
+
+  TWorldPoint=record
+    fX,fY:double;
+  end;
+
+  TCoolClass = class(TComponent)
+  private
+    fMarkerPos:array[TMarkerState] of TWorldPoint;
+    { private declarations }
+
+  public
+    function LeftMarker :integer;
+		function RightMarker:integer;
+    { public declarations }
+    { error: using function to index property }
+    property xLPM:double read fMarkerPos[leftMarker].fX write fMarkerPos[leftmarker].fX;
+  end; 
+
+implementation
+
+function TCoolClass.LeftMarker :integer;
+begin
+  Result:=0;
+end;
+
+function TCoolClass.RightMarker:integer;
+begin
+  Result:=1;
+end;
+
+
+ 
+
+end.
+

+ 19 - 0
tests/webtbf/tw15287.pp

@@ -0,0 +1,19 @@
+{ %fail }
+
+program arrayrangeoperator;
+
+{$mode objfpc}{$H+}
+
+uses
+  Classes, SysUtils;
+
+type
+  TArrayOfInteger = array of integer;
+var
+  a, b: TArrayOfInteger;
+begin
+  SetLength(a,10);
+  b:=a[2..4];
+end.
+
+

+ 26 - 0
tests/webtbf/tw15288.pp

@@ -0,0 +1,26 @@
+{ %fail }
+
+program setcrash;
+
+{$mode objfpc}{$H+}
+
+uses
+  Classes, SysUtils;
+
+var
+  AString: String='blabla';
+
+procedure GetKey(var Key: Char);
+begin
+  if Key in ['c', AString] then
+    writeln('OK');
+end;
+
+var
+  AKey: Char;
+begin
+  AKey := 'c';
+  GetKey(AKey);
+end.
+
+

+ 27 - 0
tests/webtbs/tw14812.pp

@@ -0,0 +1,27 @@
+type
+  stdstrlong = string;
+
+procedure PackStr // Convert string to packed array
+   ( InStr: StdStrLong;
+    var OutArr: packed array of char);
+var
+  i: longint;
+begin
+  if (low(outarr)<>0) or
+     (high(outarr)<>5) then
+    halt(1);
+  if (instr<>'abc') then
+    halt(2);
+  for i:=1 to length(instr) do
+    outarr[i-1]:=instr[i];
+end;
+
+var
+  a: packed array[5..10] of char;
+begin
+  packstr('abc',a);
+  if (a[5]<>'a') or
+     (a[6]<>'b') or
+     (a[7]<>'c') then
+    halt(1);
+end.

+ 13 - 0
tests/webtbs/tw15015.pp

@@ -0,0 +1,13 @@
+program tget2;
+
+var
+  a, b: LongWord;
+  
+begin
+  a := 307;
+  b := 1 + ($FFFFFFFF mod (a - 2));
+  writeln(b);
+  if b <> 301 then Halt(1);
+  writeln(1 + $FFFFFFFF mod (a - 2));
+  if b <> 301 then Halt(1);
+end.  

+ 17 - 0
tests/webtbs/tw15169.pp

@@ -0,0 +1,17 @@
+
+type
+  TDragHandleStyle = (dhDouble, dhNone, dhSingle);
+
+
+var b : boolean;
+    fdraghandlestyle : TDraghandlestyle;
+    i : longint;
+begin
+  i:=0;
+  FDraghandlestyle:=dhDouble;
+  for B := False to (FDragHandleStyle = dhDouble) do 
+   inc(i);
+  if (i<>2) then
+    halt(1);
+end.
+

+ 43 - 0
tests/webtbs/tw15274.pp

@@ -0,0 +1,43 @@
+{ %norun }
+
+{$mode objfpc}{$H+}
+
+uses
+  Classes, SysUtils;
+
+type
+
+  { TItem }
+
+  TItem = class
+  public
+    procedure DoSomething;
+  end;
+
+  { TConainer }
+
+  TContainer = class
+  public
+    constructor Create;
+  end;
+
+{ TConainer }
+
+constructor TContainer.Create;
+begin
+  inherited Create;
+  with TItem.Create do
+   ;
+//   begin end;
+end;
+
+{ TItem }
+
+procedure TItem.DoSomething;
+begin
+end;
+
+begin
+end.
+
+

+ 5 - 0
tests/webtbs/tw15293.pp

@@ -0,0 +1,5 @@
+{ %norun }
+
+begin
+(* ()* *)
+end.

+ 4 - 0
tests/webtbs/tw15293a.pp

@@ -0,0 +1,4 @@
+begin
+  (*(*
+*)*)
+end.

+ 10 - 0
tests/webtbs/tw15304.pp

@@ -0,0 +1,10 @@
+{$r+,q+}
+
+var A : LongWord;
+
+begin
+  A := $0FFFFFFF;
+  Inc(A, LongWord($F0000000));
+  // no runtime error if the above line is changed to:
+  // A := A + LongWord($F0000000);
+end.

+ 16 - 0
tests/webtbs/tw15364.pp

@@ -0,0 +1,16 @@
+program test;
+
+uses sysutils;
+
+ var
+   a : array [Boolean,Boolean] of string;
+   b : wordbool;
+begin
+  a[False,True] := 'True';
+  a[False,False] := 'False';
+  a[True,True] := 'True';
+  a[True,False] := 'False';
+  b := True;
+  if a[false,b]<>'True' then
+    halt(1);
+end.

+ 12 - 0
tests/webtbs/tw15453a.pp

@@ -0,0 +1,12 @@
+uses Math;
+
+var
+  Result, Remainder: SmallInt;
+begin
+  Result := -9 div 5;
+  Remainder := -9 mod 5;
+  writeln(result,' - ',remainder);
+  if (result<>-1) or
+     (remainder<>-4) then
+    halt(1);
+end.

+ 18 - 0
tests/webtbs/tw15821.pp

@@ -0,0 +1,18 @@
+{$mode objfpc}{$H+}
+
+uses
+{$ifdef unix}
+  cthreads,
+{$endif}
+  Classes;
+
+begin
+  writeln('GetThreadID=', ptrint(GetThreadID));
+  writeln('GetCurrentThreadID=', ptrint(GetCurrentThreadId));
+  writeln('MainThreadID=', ptrint(MainThreadID));
+  if (GetThreadID<>GetCurrentThreadID) or
+     (MainThreadID<>GetThreadID) then
+    halt(1);
+end.
+
+