Browse Source

Marge of more trunk fixes into fixes branch.

------------------------------------------------------------------------
r39725 | pierre | 2018-09-10 13:28:33 +0000 (Mon, 10 Sep 2018) | 1 line

 Add branches for 3.2.0, 3.2.1 and 3.3.1 versions
------------------------------------------------------------------------
--- Merging r39725 into '.':
U    tests/utils/testsuite/utests.pp
--- Recording mergeinfo for merge of r39725 into '.':
 U   .
------------------------------------------------------------------------
r39733 | pierre | 2018-09-11 08:16:56 +0000 (Tue, 11 Sep 2018) | 1 line

 sparc64-linux objects recompiled with GCC 7.3.0
------------------------------------------------------------------------
--- Merging r39733 into '.':
U    tests/test/cg/obj/readme.txt
U    tests/test/cg/obj/linux/sparc64/ctest.o
U    tests/test/cg/obj/linux/sparc64/cpptcl1.o
U    tests/test/cg/obj/linux/sparc64/cpptcl2.o
U    tests/test/cg/obj/linux/sparc64/tcext3.o
U    tests/test/cg/obj/linux/sparc64/tcext4.o
U    tests/test/cg/obj/linux/sparc64/tcext5.o
U    tests/test/cg/obj/linux/sparc64/tcext6.o
--- Recording mergeinfo for merge of r39733 into '.':
 G   .
------------------------------------------------------------------------
r39808 | pierre | 2018-09-26 09:29:33 +0000 (Wed, 26 Sep 2018) | 1 line

Disable libraries not compiling for jvm-java or jvm-android targets
------------------------------------------------------------------------
--- Merging r39808 into '.':
U    packages/fppkg/fpmake.pp
U    packages/fcl-base/fpmake.pp
U    packages/rtl-extra/fpmake.pp
U    packages/hermes/fpmake.pp
U    packages/fcl-extra/fpmake.pp
U    packages/fcl-db/fpmake.pp
U    packages/unzip/fpmake.pp
U    packages/odbc/fpmake.pp
U    packages/gdbm/fpmake.pp
U    packages/pthreads/fpmake.pp
U    packages/fcl-json/fpmake.pp
U    packages/pcap/fpmake.pp
U    packages/numlib/fpmake.pp
U    packages/rtl-generics/fpmake.pp
U    packages/zlib/fpmake.pp
U    packages/paszlib/fpmake.pp
U    packages/webidl/fpmake.pp
U    packages/regexpr/fpmake.pp
U    packages/libgd/fpmake.pp
U    packages/fcl-net/fpmake.pp
U    packages/fcl-res/fpmake.pp
U    packages/libpng/fpmake.pp
U    packages/dblib/fpmake.pp
U    packages/tcl/fpmake.pp
U    packages/openssl/fpmake.pp
U    packages/ibase/fpmake.pp
U    packages/bzip2/fpmake.pp
U    packages/fcl-sdo/fpmake.pp
U    packages/fcl-sound/fpmake.pp
U    packages/fcl-passrc/fpmake.pp
U    packages/fcl-stl/fpmake.pp
U    packages/libmicrohttpd/fpmake.pp
U    packages/mysql/fpmake.pp
U    packages/postgres/fpmake.pp
U    packages/httpd22/fpmake.pp
U    packages/httpd24/fpmake.pp
U    packages/rtl-console/fpmake.pp
U    packages/sqlite/fpmake.pp
U    packages/fftw/fpmake.pp
U    packages/fcl-pdf/fpmake.pp
U    packages/rtl-objpas/fpmake.pp
U    packages/fcl-image/fpmake.pp
U    packages/pasjpeg/fpmake.pp
U    packages/chm/fpmake.pp
U    packages/fcl-registry/fpmake.pp
U    packages/libtar/fpmake.pp
U    packages/symbolic/fpmake.pp
U    packages/libenet/fpmake.pp
U    packages/imagemagick/fpmake.pp
U    packages/fcl-xml/fpmake.pp
U    packages/oracle/fpmake.pp
U    packages/fcl-fpcunit/fpmake.pp
U    packages/fcl-js/fpmake.pp
U    packages/fcl-async/fpmake.pp
U    packages/fcl-process/fpmake.pp
U    packages/pastojs/fpmake.pp
U    packages/hash/fpmake.pp
U    packages/rtl-unicode/fpmake.pp
U    packages/fpmkunit/fpmake.pp
--- Recording mergeinfo for merge of r39808 into '.':
 G   .
------------------------------------------------------------------------
r40027 | pierre | 2018-10-24 21:37:54 +0000 (Wed, 24 Oct 2018) | 1 line

 Fix compilation of RTL for watcom target
------------------------------------------------------------------------
--- Merging r40027 into '.':
U    compiler/x86/agx86int.pas
--- Recording mergeinfo for merge of r40027 into '.':
 G   .
------------------------------------------------------------------------
r40028 | pierre | 2018-10-25 06:39:42 +0000 (Thu, 25 Oct 2018) | 1 line

Try to fix compilation error after commit #40027
------------------------------------------------------------------------
--- Merging r40028 into '.':
G    compiler/x86/agx86int.pas
--- Recording mergeinfo for merge of r40028 into '.':
 G   .
------------------------------------------------------------------------
r40102 | pierre | 2018-10-31 09:07:57 +0000 (Wed, 31 Oct 2018) | 1 line

 Replace aint (which is a compiler specific type) by ptruint type, which is defined in system unit
------------------------------------------------------------------------
--- Merging r40102 into '.':
U    tests/test/tarray5.pp
--- Recording mergeinfo for merge of r40102 into '.':
 G   .
------------------------------------------------------------------------
r40103 | pierre | 2018-10-31 09:59:45 +0000 (Wed, 31 Oct 2018) | 1 line

 Use pdword to avoid range check erro in tentryfile.getdword method
------------------------------------------------------------------------
--- Merging r40103 into '.':
U    compiler/entfile.pas
--- Recording mergeinfo for merge of r40103 into '.':
 G   .
------------------------------------------------------------------------
r40104 | pierre | 2018-10-31 10:21:51 +0000 (Wed, 31 Oct 2018) | 1 line

 Use longint type instead of AWord for Initial parameter in CalcExecutionWeigths (to avoid range error for avr compiler)
------------------------------------------------------------------------
@@
      begin
        Result:=fen_false;
        n.allocoptinfo;
<<<<<<< MINE (select with 'mc') (367)
        Weight:=PAWord(arg)^;
||||||| ORIGINAL (367)
        Weight:=max(PAWord(arg)^,1);
=======
        Weight:=max(plongint(arg)^,1);
>>>>>>> THEIRS (select with 'tc') (367)
        case n.nodetype of
          casen:
            begin
--- Merging r40104 into '.':
C    compiler/optutils.pas
--- Recording mergeinfo for merge of r40104 into '.':
 G   .
Summary of conflicts:
  Text conflicts: 1
------------------------------------------------------------------------
r40110 | pierre | 2018-10-31 14:51:23 +0000 (Wed, 31 Oct 2018) | 1 line

 Avoid range check error in MaskLength evaluation
------------------------------------------------------------------------
--- Merging r40110 into '.':
U    compiler/x86/aoptx86.pas
--- Recording mergeinfo for merge of r40110 into '.':
 G   .
------------------------------------------------------------------------
r40111 | pierre | 2018-10-31 15:47:53 +0000 (Wed, 31 Oct 2018) | 1 line

 Complement commit 40104, by changing type of executionweight in toptinfo record and adapt pass_2 code
------------------------------------------------------------------------
--- Merging r40111 into '.':
U    compiler/pass_2.pas
U    compiler/optbase.pas
--- Recording mergeinfo for merge of r40111 into '.':
 G   .
------------------------------------------------------------------------
r40112 | pierre | 2018-10-31 15:48:32 +0000 (Wed, 31 Oct 2018) | 1 line

 Disable range check completely in arm/cgcpu unit
------------------------------------------------------------------------
--- Merging r40112 into '.':
U    compiler/arm/cgcpu.pas
--- Recording mergeinfo for merge of r40112 into '.':
 G   .
------------------------------------------------------------------------
r40113 | pierre | 2018-10-31 15:49:14 +0000 (Wed, 31 Oct 2018) | 1 line

 Avoid overflow in code
------------------------------------------------------------------------
--- Merging r40113 into '.':
U    compiler/symdef.pas
--- Recording mergeinfo for merge of r40113 into '.':
 G   .
------------------------------------------------------------------------
r40114 | pierre | 2018-10-31 15:50:26 +0000 (Wed, 31 Oct 2018) | 1 line

Add explicit rtlclean/rtl targets in fullcycle rule if DOWPOCYCLE is set
------------------------------------------------------------------------
--- Merging r40114 into '.':
U    compiler/Makefile.fpc
U    compiler/Makefile
--- Recording mergeinfo for merge of r40114 into '.':
 G   .
------------------------------------------------------------------------
r40120 | pierre | 2018-10-31 23:15:22 +0000 (Wed, 31 Oct 2018) | 1 line

 Change RemoveCurrentP parameter type to tai, because GetNextInstruction does not always return a taicpu, adapt code in avr/aoptcpu unit
------------------------------------------------------------------------
--- Merging r40120 into '.':
U    compiler/aoptobj.pas
U    compiler/avr/aoptcpu.pas
--- Recording mergeinfo for merge of r40120 into '.':
 G   .
------------------------------------------------------------------------
r40121 | pierre | 2018-10-31 23:16:51 +0000 (Wed, 31 Oct 2018) | 1 line

Add check about tloadnode.symtableentry type before typecast
------------------------------------------------------------------------
--- Merging r40121 into '.':
U    compiler/ncal.pas
--- Recording mergeinfo for merge of r40121 into '.':
 G   .
------------------------------------------------------------------------
r40122 | pierre | 2018-10-31 23:18:09 +0000 (Wed, 31 Oct 2018) | 1 line

Fix typecast in FindRegDeAlloc call
------------------------------------------------------------------------
--- Merging r40122 into '.':
U    compiler/arm/aoptcpu.pas
--- Recording mergeinfo for merge of r40122 into '.':
 G   .
------------------------------------------------------------------------
r40123 | pierre | 2018-10-31 23:19:39 +0000 (Wed, 31 Oct 2018) | 1 line

 Remove unneeded typecasts in TryTOptimizeMove
------------------------------------------------------------------------
--- Merging r40123 into '.':
U    compiler/m68k/aoptcpu.pas
--- Recording mergeinfo for merge of r40123 into '.':
 G   .
------------------------------------------------------------------------
r40124 | pierre | 2018-10-31 23:20:29 +0000 (Wed, 31 Oct 2018) | 1 line

 Add global range check disable for i8086 cgcpu and x86 nx86add units
------------------------------------------------------------------------
--- Merging r40124 into '.':
U    compiler/i8086/cgcpu.pas
U    compiler/x86/nx86add.pas
--- Recording mergeinfo for merge of r40124 into '.':
 G   .
------------------------------------------------------------------------
r40131 | pierre | 2018-11-01 07:01:02 +0000 (Thu, 01 Nov 2018) | 1 line

 Remove another wrong typecast when testing  that a tai is an instruction
------------------------------------------------------------------------
--- Merging r40131 into '.':
G    compiler/m68k/aoptcpu.pas
--- Recording mergeinfo for merge of r40131 into '.':
 G   .
------------------------------------------------------------------------
r40236 | pierre | 2018-11-06 07:40:31 +0000 (Tue, 06 Nov 2018) | 1 line

 Really change extension of hs1 local variable in get_exepath
------------------------------------------------------------------------
--- Merging r40236 into '.':
U    compiler/globals.pas
--- Recording mergeinfo for merge of r40236 into '.':
 G   .
------------------------------------------------------------------------
r40237 | pierre | 2018-11-06 07:41:15 +0000 (Tue, 06 Nov 2018) | 1 line

 Disable range checking in rax86int unit
------------------------------------------------------------------------
--- Merging r40237 into '.':
U    compiler/x86/rax86int.pas
--- Recording mergeinfo for merge of r40237 into '.':
 G   .
------------------------------------------------------------------------
r40278 | pierre | 2018-11-08 20:19:54 +0000 (Thu, 08 Nov 2018) | 1 line

 Downgrade EXTDEBUG warning to note about zero size temp, as it is used for empty sets
------------------------------------------------------------------------
--- Merging r40278 into '.':
U    compiler/tgobj.pas
--- Recording mergeinfo for merge of r40278 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40624 -
pierre 6 years ago
parent
commit
d8b0ded10c
90 changed files with 278 additions and 49 deletions
  1. 1 1
      .gitattributes
  2. 4 0
      compiler/Makefile
  3. 6 1
      compiler/Makefile.fpc
  4. 3 3
      compiler/aoptobj.pas
  5. 1 1
      compiler/arm/aoptcpu.pas
  6. 4 0
      compiler/arm/cgcpu.pas
  7. 15 15
      compiler/avr/aoptcpu.pas
  8. 1 1
      compiler/entfile.pas
  9. 3 3
      compiler/globals.pas
  10. 4 0
      compiler/i8086/cgcpu.pas
  11. 3 3
      compiler/m68k/aoptcpu.pas
  12. 2 1
      compiler/ncal.pas
  13. 1 1
      compiler/optbase.pas
  14. 4 4
      compiler/optutils.pas
  15. 1 1
      compiler/pass_2.pas
  16. 1 1
      compiler/symdef.pas
  17. 1 1
      compiler/tgobj.pas
  18. 61 5
      compiler/x86/agx86int.pas
  19. 7 0
      compiler/x86/aoptx86.pas
  20. 3 0
      compiler/x86/nx86add.pas
  21. 2 2
      compiler/x86/rax86int.pas
  22. 2 0
      packages/bzip2/fpmake.pp
  23. 2 0
      packages/chm/fpmake.pp
  24. 4 0
      packages/dblib/fpmake.pp
  25. 2 0
      packages/fcl-async/fpmake.pp
  26. 2 0
      packages/fcl-base/fpmake.pp
  27. 2 0
      packages/fcl-db/fpmake.pp
  28. 3 0
      packages/fcl-extra/fpmake.pp
  29. 2 0
      packages/fcl-fpcunit/fpmake.pp
  30. 2 0
      packages/fcl-image/fpmake.pp
  31. 2 0
      packages/fcl-js/fpmake.pp
  32. 2 0
      packages/fcl-json/fpmake.pp
  33. 2 0
      packages/fcl-net/fpmake.pp
  34. 2 0
      packages/fcl-passrc/fpmake.pp
  35. 3 0
      packages/fcl-pdf/fpmake.pp
  36. 2 0
      packages/fcl-process/fpmake.pp
  37. 2 0
      packages/fcl-registry/fpmake.pp
  38. 2 0
      packages/fcl-res/fpmake.pp
  39. 2 0
      packages/fcl-sdo/fpmake.pp
  40. 2 0
      packages/fcl-sound/fpmake.pp
  41. 2 0
      packages/fcl-stl/fpmake.pp
  42. 2 0
      packages/fcl-xml/fpmake.pp
  43. 2 0
      packages/fftw/fpmake.pp
  44. 2 0
      packages/fpmkunit/fpmake.pp
  45. 2 0
      packages/fppkg/fpmake.pp
  46. 2 0
      packages/gdbm/fpmake.pp
  47. 3 0
      packages/hash/fpmake.pp
  48. 2 0
      packages/hermes/fpmake.pp
  49. 3 0
      packages/httpd22/fpmake.pp
  50. 2 0
      packages/httpd24/fpmake.pp
  51. 2 0
      packages/ibase/fpmake.pp
  52. 2 0
      packages/imagemagick/fpmake.pp
  53. 3 0
      packages/libenet/fpmake.pp
  54. 2 0
      packages/libgd/fpmake.pp
  55. 3 0
      packages/libmicrohttpd/fpmake.pp
  56. 2 0
      packages/libpng/fpmake.pp
  57. 2 0
      packages/libtar/fpmake.pp
  58. 2 0
      packages/mysql/fpmake.pp
  59. 2 0
      packages/numlib/fpmake.pp
  60. 3 0
      packages/odbc/fpmake.pp
  61. 3 0
      packages/openssl/fpmake.pp
  62. 2 0
      packages/oracle/fpmake.pp
  63. 2 0
      packages/pasjpeg/fpmake.pp
  64. 3 0
      packages/pastojs/fpmake.pp
  65. 2 0
      packages/paszlib/fpmake.pp
  66. 3 0
      packages/pcap/fpmake.pp
  67. 2 0
      packages/postgres/fpmake.pp
  68. 3 0
      packages/pthreads/fpmake.pp
  69. 3 0
      packages/regexpr/fpmake.pp
  70. 3 0
      packages/rtl-console/fpmake.pp
  71. 3 0
      packages/rtl-extra/fpmake.pp
  72. 3 0
      packages/rtl-generics/fpmake.pp
  73. 3 0
      packages/rtl-objpas/fpmake.pp
  74. 3 0
      packages/rtl-unicode/fpmake.pp
  75. 3 0
      packages/sqlite/fpmake.pp
  76. 2 0
      packages/symbolic/fpmake.pp
  77. 2 0
      packages/tcl/fpmake.pp
  78. 2 0
      packages/unzip/fpmake.pp
  79. 2 0
      packages/webidl/fpmake.pp
  80. 3 0
      packages/zlib/fpmake.pp
  81. BIN
      tests/test/cg/obj/linux/sparc64/cpptcl1.o
  82. BIN
      tests/test/cg/obj/linux/sparc64/cpptcl2.o
  83. BIN
      tests/test/cg/obj/linux/sparc64/ctest.o
  84. BIN
      tests/test/cg/obj/linux/sparc64/tcext3.o
  85. BIN
      tests/test/cg/obj/linux/sparc64/tcext4.o
  86. BIN
      tests/test/cg/obj/linux/sparc64/tcext5.o
  87. BIN
      tests/test/cg/obj/linux/sparc64/tcext6.o
  88. 1 1
      tests/test/cg/obj/readme.txt
  89. 2 2
      tests/test/tarray5.pp
  90. 8 2
      tests/utils/testsuite/utests.pp

+ 1 - 1
.gitattributes

@@ -185,7 +185,7 @@ compiler/fppu.pas svneol=native#text/plain
 compiler/gendef.pas svneol=native#text/plain
 compiler/generic/cpuinfo.pas svneol=native#text/plain
 compiler/generic/symcpu.pas svneol=native#text/plain
-compiler/globals.pas -text svneol=native#text/plain
+compiler/globals.pas svneol=native#text/plain
 compiler/globstat.pas svneol=native#text/pascal
 compiler/globtype.pas svneol=native#text/plain
 compiler/hlcg2ll.pas svneol=native#text/plain

+ 4 - 0
compiler/Makefile

@@ -4347,6 +4347,10 @@ full: fullcycle
 fullcycle:
 	$(MAKE) cycle
 	$(MAKE) ppuclean
+ifdef DOWPOCYCLE
+	$(MAKE) rtlclean
+	$(MAKE) rtl 'FPC=$(BASEDIR)/$(EXENAME)'
+endif
 ifndef EXCLUDE_80BIT_TARGETS
 	$(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
 else

+ 6 - 1
compiler/Makefile.fpc

@@ -791,7 +791,8 @@ cvstest:
 #
 # 1. build a compiler using cycle
 # 2. remove all .ppufiles
-# 3. build all supported cross compilers except the
+# 3. clean and recompile rtl if DOWPOCYCLE is set
+# 4. build all supported cross compilers except the
 #    current PPC_TARGET which was already build
 # unless FPC_SUPPORT_X87_TYPES_ON_WIN64 is set,
 # win64 cannot compile i386 or i8086 compiler
@@ -811,6 +812,10 @@ full: fullcycle
 fullcycle:
         $(MAKE) cycle
         $(MAKE) ppuclean
+ifdef DOWPOCYCLE
+        $(MAKE) rtlclean
+        $(MAKE) rtl 'FPC=$(BASEDIR)/$(EXENAME)'
+endif
 ifndef EXCLUDE_80BIT_TARGETS
         $(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
 else

+ 3 - 3
compiler/aoptobj.pas

@@ -327,7 +327,7 @@ Unit AoptObj;
         function RegEndOfLife(reg: TRegister;p: taicpu): boolean;
 
         { removes p from asml, updates registers and replaces it by a valid value, if this is the case true is returned }
-        function RemoveCurrentP(var p : taicpu): boolean;
+        function RemoveCurrentP(var p : tai): boolean;
 
        { traces sucessive jumps to their final destination and sets it, e.g.
          je l1                je l3
@@ -1289,7 +1289,7 @@ Unit AoptObj;
       end;
 
 
-    function TAOptObj.RemoveCurrentP(var p : taicpu) : boolean;
+    function TAOptObj.RemoveCurrentP(var p : tai) : boolean;
       var
         hp1 : tai;
       begin
@@ -1299,7 +1299,7 @@ Unit AoptObj;
         UpdateUsedRegs(tai(p.Next));
         AsmL.Remove(p);
         p.Free;
-        p:=taicpu(hp1);
+        p:=hp1;
       end;
 
 

+ 1 - 1
compiler/arm/aoptcpu.pas

@@ -1344,7 +1344,7 @@ Implementation
                         if taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg then
                           taicpu(hp1).oper[1]^.ref^.index := taicpu(p).oper[1]^.reg;
 
-                        dealloc:=FindRegDeAlloc(taicpu(p).oper[1]^.reg, taicpu(p.Next));
+                        dealloc:=FindRegDeAlloc(taicpu(p).oper[1]^.reg, tai(p.Next));
                         if Assigned(dealloc) then
                           begin
                             asml.remove(dealloc);

+ 4 - 0
compiler/arm/cgcpu.pas

@@ -241,6 +241,10 @@ unit cgcpu;
        procinfo,cpupi,
        paramgr;
 
+{ Range check must be disabled explicitly as conversions between signed and unsigned
+  32-bit values are done without explicit typecasts }
+{$R-}
+
 
     function get_fpu_postfix(def : tdef) : toppostfix;
       begin

+ 15 - 15
compiler/avr/aoptcpu.pas

@@ -349,7 +349,7 @@ Implementation
 
                             DebugMsg('Peephole LdiMov/Cp2Ldi/Cpi performed', p);
 
-                            RemoveCurrentP(taicpu(p));
+                            RemoveCurrentP(p);
                           end;
                         ReleaseUsedRegs(TmpUsedRegs);
                       end;
@@ -541,7 +541,7 @@ Implementation
                       begin
                         DebugMsg('Redundant Andi removed', p);
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end;
                   end;
                 A_ADD:
@@ -552,7 +552,7 @@ Implementation
                     begin
                       DebugMsg('Peephole AddAdc2Add performed', p);
 
-                      result:=RemoveCurrentP(taicpu(p));
+                      result:=RemoveCurrentP(p);
                     end;
                   end;
                 A_SUB:
@@ -565,7 +565,7 @@ Implementation
 
                       taicpu(hp1).opcode:=A_SUB;
 
-                      result:=RemoveCurrentP(taicpu(p));
+                      result:=RemoveCurrentP(p);
                     end;
                   end;
                 A_CLR:
@@ -588,7 +588,7 @@ Implementation
                       begin
                         DebugMsg('Peephole ClrMov2Mov performed', p);
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end
                     { turn
                       clr rX
@@ -625,7 +625,7 @@ Implementation
                             dealloc.Free;
                           end;
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end;
                   end;
                 A_PUSH:
@@ -667,9 +667,9 @@ Implementation
 
                            taicpu(hp3).loadreg(1, taicpu(p).oper[0]^.reg);
 
-                           RemoveCurrentP(taicpu(p));
-                           RemoveCurrentP(taicpu(p));
-                           result:=RemoveCurrentP(taicpu(p));
+                           RemoveCurrentP(p);
+                           RemoveCurrentP(p);
+                           result:=RemoveCurrentP(p);
                          end
                        else
                          begin
@@ -757,7 +757,7 @@ Implementation
                           not(MatchInstruction(hp1,[A_CALL,A_RCALL])) then
                           begin
                             DebugMsg('Peephole Mov2Nop performed', p);
-                            result:=RemoveCurrentP(taicpu(p));
+                            result:=RemoveCurrentP(p);
                             ReleaseUsedRegs(TmpUsedRegs);
                             exit;
                           end;
@@ -807,7 +807,7 @@ Implementation
                         { p will be removed, update used register as we continue
                           with the next instruction after p }
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end
                     { remove
                       mov reg0,reg0
@@ -819,7 +819,7 @@ Implementation
                       begin
                         DebugMsg('Peephole RedundantMov performed', p);
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end
                     {
                       Turn
@@ -870,7 +870,7 @@ Implementation
                         asml.remove(hp2);
                         hp2.free;
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
                       end
                     {
                       Turn
@@ -913,7 +913,7 @@ Implementation
                             dealloc.Free;
                           end;
 
-                        result:=RemoveCurrentP(taicpu(p));
+                        result:=RemoveCurrentP(p);
 
                         asml.remove(hp2);
                         hp2.free;
@@ -968,7 +968,7 @@ Implementation
                         begin
                           DebugMsg('Peephole MovMov2Mov performed', p);
 
-                          result:=RemoveCurrentP(taicpu(p));
+                          result:=RemoveCurrentP(p);
 
                           GetNextInstruction(hp1,hp1);
                           if not assigned(hp1) then

+ 1 - 1
compiler/entfile.pas

@@ -664,7 +664,7 @@ begin
    end;
   if bufsize-bufidx>=sizeof(dword) then
     begin
-      result:=Unaligned(plongint(@buf[bufidx])^);
+      result:=Unaligned(pdword(@buf[bufidx])^);
       inc(bufidx,sizeof(longint));
     end
   else

+ 3 - 3
compiler/globals.pas

@@ -54,8 +54,8 @@ interface
          [m_delphi,m_class,m_objpas,m_result,m_string_pchar,
           m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
           m_out,m_default_para,m_duplicate_names,m_hintdirective,
-          m_property,m_default_inline,m_except,m_advanced_records,
-          m_array_operators];
+          m_property,m_default_inline,m_except,m_advanced_records,
+          m_array_operators];
        delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring];
        fpcmodeswitches =
          [m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,
@@ -1405,7 +1405,7 @@ implementation
        if localexepath='' then
         begin
           hs1 := ExtractFileName(exeName);
-          ChangeFileExt(hs1,source_info.exeext);
+	  hs1 := ChangeFileExt(hs1,source_info.exeext);
 {$ifdef macos}
           FindFile(hs1,GetEnvironmentVariable('Commands'),false,localExepath);
 {$else macos}

+ 4 - 0
compiler/i8086/cgcpu.pas

@@ -121,6 +121,10 @@ unit cgcpu;
        tgobj,
        hlcgobj;
 
+{ Range check must be disabled explicitly as the code uses
+  implicit typecast to aint troughout }
+{$R-}
+
     function use_push(const cgpara:tcgpara):boolean;
       begin
         result:=(not paramanager.use_fixed_stack) and

+ 3 - 3
compiler/m68k/aoptcpu.pas

@@ -139,7 +139,7 @@ unit aoptcpu;
       result:=false;
 
       if GetNextInstruction(p,next) and 
-         (taicpu(next).typ = ait_instruction) and
+         (next.typ = ait_instruction) and
          (taicpu(next).opcode = taicpu(p).opcode) and
          (taicpu(p).opsize = taicpu(next).opsize) and
          (taicpu(p).oper[1]^.typ = top_reg) and
@@ -199,9 +199,9 @@ unit aoptcpu;
         end;
 
       if GetNextInstruction(p,next) and
-         (taicpu(next).typ = ait_instruction) and
+         (next.typ = ait_instruction) and
          GetNextInstruction(next,next2) and
-         (taicpu(next2).typ = ait_instruction) and
+         (next2.typ = ait_instruction) and
          (taicpu(next).opcode <> taicpu(p).opcode) and
          (taicpu(next2).opcode = taicpu(p).opcode) and
          (taicpu(p).oper[0]^.typ = top_reg) and

+ 2 - 1
compiler/ncal.pas

@@ -4591,7 +4591,8 @@ implementation
              ((tloadnode(n).symtable.symtabletype = staticsymtable) and
               (tloadnode(n).symtable = TSymtable(arg))) or
              { if the addr of the symbol is taken somewhere, it can be also non-local }
-             (tabstractvarsym(tloadnode(n).symtableentry).addr_taken)
+             ((tloadnode(n).symtableentry is tabstractvarsym) and
+	      (tabstractvarsym(tloadnode(n).symtableentry).addr_taken))
             )
            ) or
            ((n.nodetype = subscriptn) and

+ 1 - 1
compiler/optbase.pas

@@ -44,7 +44,7 @@ unit optbase;
         defsum : tdfaset;
         avail : tdfaset;
         { estimation, how often the node is executed per subroutine call times 100, calculated by optutils.CalcExecutionWeight }
-        executionweight : aword;
+        executionweight : longint;
       end;
 
       poptinfo = ^toptinfo;

+ 4 - 4
compiler/optutils.pas

@@ -49,7 +49,7 @@ unit optutils;
     procedure CalcDefSum(p : tnode);
 
     { calculates/estimates the field execution weight of optinfo }
-    procedure CalcExecutionWeights(p : tnode;Initial : AWord = 100);
+    procedure CalcExecutionWeights(p : tnode;Initial : longint = 100);
 
     { returns true, if n is a valid node and has life info }
     function has_life_info(n : tnode) : boolean;
@@ -359,12 +359,12 @@ unit optutils;
 
     function SetExecutionWeight(var n: tnode; arg: pointer): foreachnoderesult;
       var
-        Weight : AWord;
+        Weight : longint;
         i : Integer;
       begin
         Result:=fen_false;
         n.allocoptinfo;
-        Weight:=PAWord(arg)^;
+        Weight:=max(plongint(arg)^,1);
         case n.nodetype of
           casen:
             begin
@@ -402,7 +402,7 @@ unit optutils;
       end;
 
 
-    procedure CalcExecutionWeights(p : tnode;Initial : AWord = 100);
+    procedure CalcExecutionWeights(p : tnode;Initial : longint = 100);
       begin
         if assigned(p) then
           foreachnodestatic(pm_postprocess,p,@SetExecutionWeight,Pointer(@Initial));

+ 1 - 1
compiler/pass_2.pas

@@ -192,7 +192,7 @@ implementation
             current_settings.localswitches:=p.localswitches;
             codegenerror:=false;
             if assigned(p.optinfo) then
-              cg.executionweight:=min(p.optinfo^.executionweight,QWord(high(cg.executionweight)))
+              cg.executionweight:=min(p.optinfo^.executionweight,high(cg.executionweight))
             else
               cg.executionweight:=100;
 {$ifdef EXTDEBUG}

+ 1 - 1
compiler/symdef.pas

@@ -4425,7 +4425,7 @@ implementation
                     foffset:=tfieldvarsym(symtable.symlist[i]).fieldoffset*8;
                     fsize:=tfieldvarsym(symtable.symlist[i]).vardef.size*8;
                   end;
-                if (foffset div (sizeof(aword)*8)) <> ((foffset+fsize-1) div (sizeof(aword)*8)) then
+                if (fsize>0) and ((foffset div (sizeof(aword)*8)) <> ((foffset+fsize-1) div (sizeof(aword)*8))) then
                   exit;
                 { search recursively }
                 if (tstoreddef(tfieldvarsym(symtable.symlist[i]).vardef).typ=recorddef) and

+ 1 - 1
compiler/tgobj.pas

@@ -266,7 +266,7 @@ implementation
          if size=0 then
           begin
 {$ifdef EXTDEBUG}
-            Comment(V_Warning,'tgobj: (AllocTemp) temp of size 0 requested, allocating 4 bytes');
+            Comment(V_Note,'tgobj: (AllocTemp) temp of size 0 requested, allocating 4 bytes');
 {$endif}
             size:=4;
           end;

+ 61 - 5
compiler/x86/agx86int.pas

@@ -53,7 +53,7 @@ interface
 implementation
 
     uses
-      SysUtils,
+      SysUtils,math,
       cutils,globtype,globals,systems,cclasses,
       verbose,cscript,cpuinfo,
       itx86int,
@@ -65,6 +65,7 @@ implementation
 
     const
       line_length = 70;
+      max_tokens : longint = 25;
 
       wasm_cpu_name : array[tcputype] of string = (
 {$if defined(x86_64)}
@@ -500,7 +501,7 @@ implementation
       hp,nhp   : tai;
       cpu: tcputype;
       counter,
-      lines,
+      lines, tokens,
       InlineLevel : longint;
       i,j,l    : longint;
       consttype : taiconst_type;
@@ -607,6 +608,7 @@ implementation
                    begin
                      writer.AsmWrite(ait_const2str[consttype]);
                      l:=0;
+		     tokens:=1;
                      repeat
                        if assigned(tai_const(hp).sym) then
                          begin
@@ -621,7 +623,9 @@ implementation
                          s:=tostr(tai_const(hp).value);
                        writer.AsmWrite(s);
                        inc(l,length(s));
+		       inc(tokens);
                        if (l>line_length) or
+                          (tokens>max_tokens) or
                           (hp.next=nil) or
                           (tai(hp.next).typ<>ait_const) or
                           (tai_const(hp.next).consttype<>consttype) then
@@ -643,11 +647,48 @@ implementation
              begin
                case tai_realconst(hp).realtyp of
                  aitrealconst_s32bit:
-                   writer.AsmWriteLn(#9#9'DD'#9+single2str(tai_realconst(hp).value.s32val));
+                   begin
+                     if (asminfo^.id = as_i386_wasm) and (IsInfinite(tai_realconst(hp).value.s32val)) then
+                       begin
+                         { Watcom Wasm does not handle Infinity }
+                         if Sign(tai_realconst(hp).value.s32val)=PositiveValue then
+                           writer.AsmWriteln(#9#9'DB'#9'0,0,80h,7Fh')
+                         else
+                           writer.AsmWriteln(#9#9'DW'#9'0,0,80h,FFh');
+                       end
+                     else if (asminfo^.id = as_i386_wasm) and (IsNan(tai_realconst(hp).value.s32val)) then
+                       writer.AsmWriteln(#9#9'DB'#9'1,0,80h,7Fh')
+                     else
+                       writer.AsmWriteLn(#9#9'DD'#9+single2str(tai_realconst(hp).value.s32val));
+                   end;
                  aitrealconst_s64bit:
-                   writer.AsmWriteLn(#9#9'DQ'#9+double2str(tai_realconst(hp).value.s64val));
+                   begin
+                     if (asminfo^.id = as_i386_wasm) and (IsInfinite(tai_realconst(hp).value.s64val)) then
+                       begin
+                         { Watcom Wasm does not handle Infinity }
+                         if Sign(tai_realconst(hp).value.s64val)=PositiveValue then
+                           writer.AsmWriteln(#9#9'DW'#9'0,0,0,7FF0h')
+                         else
+                           writer.AsmWriteln(#9#9'DW'#9'0,0,0,FFF0h');
+                       end
+                     else if (asminfo^.id = as_i386_wasm) and (IsNan(tai_realconst(hp).value.s64val)) then
+                       writer.AsmWriteln(#9#9'DW'#9'0,0,0,0,7FF8h')
+                     else
+                       writer.AsmWriteLn(#9#9'DQ'#9+double2str(tai_realconst(hp).value.s64val));
+                   end;
                  aitrealconst_s80bit:
-                   writer.AsmWriteLn(#9#9'DT'#9+extended2str(tai_realconst(hp).value.s80val));
+                   if (asminfo^.id = as_i386_wasm) and (IsInfinite(tai_realconst(hp).value.s80val)) then
+                     begin
+                       { Watcom Wasm does not handle Infinity }
+                       if Sign(tai_realconst(hp).value.s80val)=PositiveValue then
+                         writer.AsmWriteln(#9#9'DW'#9'0,0,0,8000h,7FFFh')
+                       else
+                         writer.AsmWriteln(#9#9'DW'#9'0,0,0,8000h,FFFFh');
+                     end
+                   else if (asminfo^.id = as_i386_wasm) and (IsNan(tai_realconst(hp).value.s80val)) then
+                     writer.AsmWriteln(#9#9'DW'#9'0,0,0,C000h,7FFFh')
+                   else
+                     writer.AsmWriteLn(#9#9'DT'#9+extended2str(tai_realconst(hp).value.s80val));
                  aitrealconst_s64comp:
                    writer.AsmWriteLn(#9#9'DQ'#9+extended2str(tai_realconst(hp).value.s64compval));
                  else
@@ -840,6 +881,21 @@ implementation
                else if (asminfo^.id=as_x86_64_masm) and
                  (fixed_opcode=A_MOVQ) then
                  writer.AsmWrite(#9#9'mov')
+{$ifdef I386}
+               else if (asminfo^.id = as_i386_wasm) and ((fixed_opcode=A_RETD)
+                       or (fixed_opcode=A_RETND) or (fixed_opcode=A_RETFD)) then
+                 begin
+                   { no 'd' suffix for Watcom assembler }
+                   case fixed_opcode of
+                       A_RETD:
+                         writer.AsmWrite(#9#9'ret');
+                       A_RETND:
+                         writer.AsmWrite(#9#9'retn');
+                       A_RETFD:
+                         writer.AsmWrite(#9#9'retf');
+                   end
+                 end
+{$endif I386}
                else
                  writer.AsmWrite(#9#9+prefix+std_op2str[fixed_opcode]+cond2str[taicpu(hp).condition]+suffix);
                if taicpu(hp).ops<>0 then

+ 7 - 0
compiler/x86/aoptx86.pas

@@ -3301,10 +3301,17 @@ unit aoptx86;
               MatchOpType(taicpu(hp1),top_const,top_reg) and
               (getsupreg(taicpu(p).oper[1]^.reg)=getsupreg(taicpu(hp1).oper[1]^.reg)) then
               begin
+{$ifopt R+}
+{$define RANGE_WAS_ON}
+{$R-}
+{$endif}
                 { get length of potential and mask }
                 MaskLength:=SizeOf(taicpu(p).oper[0]^.val)*8-BsrQWord(taicpu(p).oper[0]^.val)-1;
 
                 { really a mask? }
+{$ifdef RANGE_WAS_ON}
+{$R+}
+{$endif}
                 if (((QWord(1) shl MaskLength)-1)=taicpu(p).oper[0]^.val) and
                   { unmasked part shifted out? }
                   ((MaskLength+taicpu(hp1).oper[0]^.val)>=topsize2memsize[taicpu(hp1).opsize]) then

+ 3 - 0
compiler/x86/nx86add.pas

@@ -79,6 +79,9 @@ unit nx86add;
       ncon,nset,ninl,
       defutil;
 
+{ Range check must be disabled explicitly as the code serves
+  on three different architecture sizes }
+{$R-}
 
 {*****************************************************************************
                                   Helpers

+ 2 - 2
compiler/x86/rax86int.pas

@@ -1966,8 +1966,8 @@ Unit Rax86int;
           end;
         until false;
       end;
-
-
+{ Disable range check because opr.val must accept values from min(longint) to max(dword) for i386 }
+{$R-}
     Procedure tx86intreader.BuildConstantOperand(oper: tx86operand);
       var
         l,size : tcgint;

+ 2 - 0
packages/bzip2/fpmake.pp

@@ -29,6 +29,8 @@ begin
     P.Description := 'BZip2 decompression unit.';
     P.NeedLibC:= true;
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/chm/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Standalone CHM reader and writer library';
     P.NeedLibC:= false;
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos,atari];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     D:=P.Dependencies.Add('fcl-xml');
     D:=P.Dependencies.Add('fcl-base');

+ 4 - 0
packages/dblib/fpmake.pp

@@ -30,6 +30,10 @@ begin
       P.SourcePath.Add('src');
       P.IncludePath.Add('src');
 
+      P.OSes := DBLibOSes;
+      if Defaults.CPU=jvm then
+        P.OSes := P.OSes - [android];
+
       T:=P.Targets.AddUnit('dblib.pp',DBLibOSes);
     end;
 end;

+ 2 - 0
packages/fcl-async/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Asynchronous event management of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllUnixOses;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.SourcePath.Add('src/unix',AllUnixOSes);

+ 2 - 0
packages/fcl-base/fpmake.pp

@@ -28,6 +28,8 @@ begin
     P.Description := 'Base library of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.SourcePath.Add('src/$(OS)');

+ 2 - 0
packages/fcl-db/fpmake.pp

@@ -33,6 +33,8 @@ begin
     P.Description := 'Database library of Free Component Libraries(FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.Directory:=ADirectory;
     P.Version:='3.2.0-beta';

+ 3 - 0
packages/fcl-extra/fpmake.pp

@@ -19,6 +19,9 @@ begin
     P.Version:='3.2.0-beta';
     P.Dependencies.Add('fcl-base');
     P.OSes:=[Win32,Win64]+AllUnixOSes;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('winunits-jedi',[Win32,Win64]);
     P.Dependencies.Add('winunits-base',[Win32,Win64]);
     P.Dependencies.Add('univint',[darwin,iPhoneSim]);

+ 2 - 0
packages/fcl-fpcunit/fpmake.pp

@@ -31,6 +31,8 @@ begin
     P.Description := 'Unit testing system inspired by JUnit of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos,symbian];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/fcl-image/fpmake.pp

@@ -29,6 +29,8 @@ begin
     P.Description := 'Image loading and conversion parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/fcl-js/fpmake.pp

@@ -24,6 +24,8 @@ begin
     P.Email := '[email protected]';
     P.Description := 'Javascript scanner/parser/syntax tree units';
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.Dependencies.Add('fcl-base');
     P.Dependencies.Add('fcl-json');

+ 2 - 0
packages/fcl-json/fpmake.pp

@@ -27,6 +27,8 @@ begin
     P.Description := 'Json interfacing, part of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 2 - 0
packages/fcl-net/fpmake.pp

@@ -32,6 +32,8 @@ begin
     P.Description := 'Network related parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=P.OSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src/unix',AllUnixOSes);

+ 2 - 0
packages/fcl-passrc/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Pascal parsing parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 3 - 0
packages/fcl-pdf/fpmake.pp

@@ -25,6 +25,9 @@ begin
     P.Description := 'PDF generating and TTF file info library';
     P.NeedLibC:= false;
     P.OSes:=P.OSes-[embedded,win16,msdos,nativent,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-objpas');
     P.Dependencies.Add('fcl-base');
     P.Dependencies.Add('fcl-image');

+ 2 - 0
packages/fcl-process/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Options.Add('-S2h');
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,go32v2,nativent,macos,palmos,atari];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src/unix',AllUnixOSes);

+ 2 - 0
packages/fcl-registry/fpmake.pp

@@ -28,6 +28,8 @@ begin
     P.Description := 'Windows registry + emulation parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/fcl-res/fpmake.pp

@@ -25,6 +25,8 @@ begin
     P.Description := 'Resource handling of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/fcl-sdo/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Email := '[email protected]';
     P.Description := 'Free Pascal implementation of Service Data Objects';
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     // P.NeedLibC:= false;
     P.SourcePath.Add('src/base');

+ 2 - 0
packages/fcl-sound/fpmake.pp

@@ -27,6 +27,8 @@ begin
     P.Description := 'Sound loading, storing and conversion parts for the Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 2 - 0
packages/fcl-stl/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Generic container library of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.Options.Add('-S2h');
     P.SourcePath.Add('src');

+ 2 - 0
packages/fcl-xml/fpmake.pp

@@ -31,6 +31,8 @@ begin
     P.Description := 'XML and DOM parts of Free Component Libraries (FCL), FPC''s OOP library.';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/fftw/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data';
     P.NeedLibC:= true; // should be true for a header linking to C?
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 2 - 0
packages/fpmkunit/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Basic library of the fpmake/fppkg build system.';
     P.NeedLibC:= false;  // true for headers that indirectly link to libc?
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     // All dependencies (including implicit) are listed
     // here to be able to update all requirements to

+ 2 - 0
packages/fppkg/fpmake.pp

@@ -45,6 +45,8 @@ begin
     P.Description := 'Libraries to create fppkg package managers.';
     P.NeedLibC:= false;
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,atari,macos,palmos,symbian];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/gdbm/fpmake.pp

@@ -24,6 +24,8 @@ begin
     P.Description := 'GNU dbm is a set of database routines that use extensible hashing.';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
     P.OSes := AllUnixOSes - [qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 3 - 0
packages/hash/fpmake.pp

@@ -24,6 +24,9 @@ begin
     P.Description := 'Several hash and cryptography algorithms (MD5,CRC,Linux crypt and NTLM1).';
     P.NeedLibC:= false;
     P.OSes:=P.OSes-[embedded,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-objpas');
 
     P.Version:='3.2.0-beta';

+ 2 - 0
packages/hermes/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'Library for pixel graphics conversion';
     P.NeedLibC := false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 3 - 0
packages/httpd22/fpmake.pp

@@ -25,6 +25,9 @@ begin
     P.Description := 'Headers for the Apache 2.2 series www server';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-extra');
 
     P.SourcePath.Add('src');

+ 2 - 0
packages/httpd24/fpmake.pp

@@ -25,6 +25,8 @@ begin
     P.Description := 'Headers for the Apache 2.4 series www server';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.SourcePath.Add('src/apr');

+ 2 - 0
packages/ibase/fpmake.pp

@@ -25,6 +25,8 @@ begin
     P.Description := 'Headers for the Interbase/Firebird RDBMS';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/imagemagick/fpmake.pp

@@ -25,6 +25,8 @@ begin
     P.Description := 'Header to Imagemagick, a graphics manipulation program .';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
     P.OSes := AllUnixOSes+[win32,win64]-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 3 - 0
packages/libenet/fpmake.pp

@@ -23,6 +23,9 @@ begin
     P.IncludePath.Add('src');
     { only enable for darwin after testing }
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx,darwin,iphonesim];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-extra'); // winsock2
     
     T:=P.Targets.AddUnit('enettypes.pp');

+ 2 - 0
packages/libgd/fpmake.pp

@@ -21,6 +21,8 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := P.OSes - [embedded,nativent,msdos,wii,win16,atari,macos,palmos,symbian];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('gd.pas');
 

+ 3 - 0
packages/libmicrohttpd/fpmake.pp

@@ -25,6 +25,9 @@ begin
     P.NeedLibC:= true;
     P.Dependencies.Add('rtl-extra');
     P.OSes := [android,freebsd,linux,netbsd,openbsd,win32,win64];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
     T:=P.Targets.AddUnit('libmicrohttpd.pp');

+ 2 - 0
packages/libpng/fpmake.pp

@@ -22,6 +22,8 @@ begin
     P.Dependencies.Add('zlib');
     P.SourcePath.Add('src');
     P.OSes := AllUnixOSes-[qnx]+[win32,os2,emx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('png.pp');
 {$ifndef ALLPACKAGES}

+ 2 - 0
packages/libtar/fpmake.pp

@@ -25,6 +25,8 @@ begin
     P.Description := 'Library for handling tar-files.';
 
     P.OSes:=AllOSes-[embedded,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     T:=P.Targets.AddUnit('libtar.pp');

+ 2 - 0
packages/mysql/fpmake.pp

@@ -21,6 +21,8 @@ begin
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('my4_sys.pp');
     T:=P.Targets.AddUnit('mysql3_comdyn.pp');

+ 2 - 0
packages/numlib/fpmake.pp

@@ -20,6 +20,8 @@ begin
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
     P.OSes := AllUnixOSes+AllWindowsOSes+AllAmigaLikeOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 //    P.Dependencies.Add('x11');
 
     T:=P.Targets.AddUnit('det.pas');

+ 3 - 0
packages/odbc/fpmake.pp

@@ -18,6 +18,9 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
 

+ 3 - 0
packages/openssl/fpmake.pp

@@ -21,6 +21,9 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := AllUnixOSes+AllWindowsOSes+[OS2,EMX]-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-extra',[OS2,EMX]);
 
     T:=P.Targets.AddUnit('openssl.pas');

+ 2 - 0
packages/oracle/fpmake.pp

@@ -21,6 +21,8 @@ begin
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('ocidyn.pp');
       with T.Dependencies do

+ 2 - 0
packages/pasjpeg/fpmake.pp

@@ -20,6 +20,8 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes:=P.OSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 3 - 0
packages/pastojs/fpmake.pp

@@ -20,6 +20,9 @@ begin
 
     P.Version:='3.2.0-beta';
     P.OSes:=AllUnixOSes+AllBSDOSes+AllWindowsOSes-[WinCE];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('paszlib');
     P.Dependencies.Add('fcl-js');
     P.Dependencies.Add('fcl-json');

+ 2 - 0
packages/paszlib/fpmake.pp

@@ -21,6 +21,8 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     D:=P.Dependencies.Add('hash');
       D.Version:='3.2.0-beta';

+ 3 - 0
packages/pcap/fpmake.pp

@@ -19,6 +19,9 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := AllUnixOSes+[win32]-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-extra');
 
     T:=P.Targets.AddUnit('pcap.pp');

+ 2 - 0
packages/postgres/fpmake.pp

@@ -20,6 +20,8 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := AllUnixOSes-[qnx]+AllWindowsOSes;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.IncludePath.Add('src');
 

+ 3 - 0
packages/pthreads/fpmake.pp

@@ -18,6 +18,9 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly,android];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
 

+ 3 - 0
packages/regexpr/fpmake.pp

@@ -20,6 +20,9 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes:=P.OSes-[embedded,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Dependencies.Add('rtl-objpas');
     P.SourcePath.Add('src');
 

+ 3 - 0
packages/rtl-console/fpmake.pp

@@ -41,6 +41,9 @@ begin
     P.License := 'LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
     P.OSes:=Rtl_ConsoleOSes;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Email := '';
     P.Description := 'Rtl-console, console abstraction';
     P.NeedLibC:= false;

+ 3 - 0
packages/rtl-extra/fpmake.pp

@@ -48,6 +48,9 @@ begin
     P.License := 'LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
     P.OSes:=AllTargetsextra;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Email := '';
     P.Description := 'Rtl-extra, RTL not needed for bootstrapping';
     P.NeedLibC:= false;

+ 3 - 0
packages/rtl-generics/fpmake.pp

@@ -24,6 +24,9 @@ begin
     P.Description := 'Generic collection library.';
     P.NeedLibC:= false;
     P.OSes := AllOSes-[embedded,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Directory:=ADirectory;
     P.Version:='3.2.0-beta';
     P.Dependencies.Add('rtl-objpas');

+ 3 - 0
packages/rtl-objpas/fpmake.pp

@@ -46,6 +46,9 @@ begin
     P.License := 'LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
     P.OSes:=AllTargetsObjPas;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Email := '';
     P.Description := 'Rtl-objpas, aux. Delphi compat units';
     P.NeedLibC:= false;

+ 3 - 0
packages/rtl-unicode/fpmake.pp

@@ -39,6 +39,9 @@ begin
     P.License := 'LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
     P.OSes:=unicodeAllOSes;
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.Email := '';
     P.Description := 'Rtl-unicode, misc Unicode units';
     P.NeedLibC:= false;

+ 3 - 0
packages/sqlite/fpmake.pp

@@ -19,6 +19,9 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes := AllUnixOSes+AllWindowsOSes-[qnx,win16];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
 

+ 2 - 0
packages/symbolic/fpmake.pp

@@ -24,6 +24,8 @@ begin
     P.Description := 'Expression parser with support for fast evaluation';
     P.NeedLibC:= false;
     P.OSes:=P.OSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');

+ 2 - 0
packages/tcl/fpmake.pp

@@ -20,6 +20,8 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := AllUnixOSes+AllWindowsOSes+[os2,emx]-[qnx,win16];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('tcl80.pp');
 

+ 2 - 0
packages/unzip/fpmake.pp

@@ -21,6 +21,8 @@ begin
     P.Version:='3.2.0-beta';
     P.SourcePath.Add('src');
     P.OSes := P.OSes - [embedded,nativent,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     T:=P.Targets.AddUnit('unzip51g.pp');
       with T.Dependencies do

+ 2 - 0
packages/webidl/fpmake.pp

@@ -26,6 +26,8 @@ begin
     P.Description := 'WEB IDL parser and converter to Object Pascal classes';
     P.NeedLibC:= false;
     P.OSes:=AllOSes-[embedded,msdos,win16,macos,palmos];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
 
     P.SourcePath.Add('src');
 

+ 3 - 0
packages/zlib/fpmake.pp

@@ -19,6 +19,9 @@ begin
 {$endif ALLPACKAGES}
     P.Version:='3.2.0-beta';
     P.OSes := AllUnixOSes+AllWindowsOSes+[os2,emx,netware,netwlibc]-[qnx];
+    if Defaults.CPU=jvm then
+      P.OSes := P.OSes - [java,android];
+
     P.SourcePath.Add('src');
 
     T:=P.Targets.AddUnit('zlib.pp');

BIN
tests/test/cg/obj/linux/sparc64/cpptcl1.o


BIN
tests/test/cg/obj/linux/sparc64/cpptcl2.o


BIN
tests/test/cg/obj/linux/sparc64/ctest.o


BIN
tests/test/cg/obj/linux/sparc64/tcext3.o


BIN
tests/test/cg/obj/linux/sparc64/tcext4.o


BIN
tests/test/cg/obj/linux/sparc64/tcext5.o


BIN
tests/test/cg/obj/linux/sparc64/tcext6.o


+ 1 - 1
tests/test/cg/obj/readme.txt

@@ -62,4 +62,4 @@ Data retrieved from Dwarf producer information:
 darwin-x86_64 : GNU C 4.0.1 (Apple Inc. build 5465)
 
 linux-aarch64 : gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04) 4.8.4
-
+linux-sparc64 : GCC: (Debian 7.3.0-10) 7.3.0

+ 2 - 2
tests/test/tarray5.pp

@@ -2,8 +2,8 @@
 
 var
   { This shouldn't be allowed, the number of elements
-    doesn't fit in a aint }
-  mem  : array[0..high(aint)] of byte ;
+    doesn't fit in the address range  }
+  mem  : array[0..high(ptruint)] of byte ;
 
 begin
 end;

+ 8 - 2
tests/utils/testsuite/utests.pp

@@ -256,7 +256,10 @@ const
    '3.0.3',
    '3.0.4',
    '3.0.5',
-   '3.1.1'
+   '3.1.1',
+   '3.2.0',
+   '3.2.1',
+   '3.3.1'
   );
 
   ver_branch : array [known_versions] of string =
@@ -291,13 +294,16 @@ const
    'tags/release_2_6_4',
    'tags/release_2_6_4',
    'branches/fixes_2_6',
-   'trunk',
+   'branches/release_3_0_0',
    'branches/release_3_0_0',
    'branches/release_3_0_2',
    'branches/release_3_0_2',
    'branches/release_3_0_4',
    'branches/release_3_0_4',
    'branches/fixes_3_0',
+   'branches/fixes_3_2',
+   'branches/fixes_3_2',
+   'branches/fixes_3_2',
    'trunk'
   );