ソースを参照

Merge branch 'main' into basemath

florian 1 年間 前
コミット
1726afada3
100 ファイル変更1852 行追加4193 行削除
  1. 2 0
      .gitignore
  2. 1 1
      .gitlab-ci.yml
  3. 6 4
      compiler/Makefile
  4. 6 4
      compiler/Makefile.fpc
  5. 3 1
      compiler/aarch64/a64att.inc
  6. 2 0
      compiler/aarch64/a64atts.inc
  7. 4 0
      compiler/aarch64/a64ins.dat
  8. 3 1
      compiler/aarch64/a64op.inc
  9. 2 0
      compiler/aarch64/aasmcpu.pas
  10. 15 3
      compiler/aarch64/agcpugas.pas
  11. 3 2
      compiler/aarch64/aoptcpu.pas
  12. 19 33
      compiler/aarch64/cgcpu.pas
  13. 17 7
      compiler/aarch64/cpuinfo.pas
  14. 1 0
      compiler/aarch64/cpunode.pas
  15. 26 13
      compiler/aarch64/ncpuset.pas
  16. 7 0
      compiler/aasmtai.pas
  17. 1 0
      compiler/aggas.pas
  18. 14 10
      compiler/aoptbase.pas
  19. 4 2
      compiler/aoptobj.pas
  20. 17 1
      compiler/arm/aasmcpu.pas
  21. 6 2
      compiler/arm/aoptcpu.pas
  22. 5 33
      compiler/arm/cgcpu.pas
  23. 1 1
      compiler/arm/cpuinfo.pas
  24. 1 0
      compiler/arm/cpunode.pas
  25. 15 26
      compiler/arm/narminl.pas
  26. 47 21
      compiler/armgen/aoptarm.pas
  27. 259 0
      compiler/armgen/narmbas.pas
  28. 8 0
      compiler/assemble.pas
  29. 0 28
      compiler/avr/cgcpu.pas
  30. 7 3
      compiler/avr/navrinl.pas
  31. 14 0
      compiler/cgbase.pas
  32. 35 0
      compiler/cgobj.pas
  33. 2 2
      compiler/comphook.pas
  34. 5 1
      compiler/compiler.pas
  35. 6 4
      compiler/dbgdwarf.pas
  36. 27 11
      compiler/fmodule.pas
  37. 5 5
      compiler/fpcdefs.inc
  38. 81 62
      compiler/fppu.pas
  39. 1 1
      compiler/htypechk.pas
  40. 24 22
      compiler/i386/cpuinfo.pas
  41. 1 0
      compiler/i386/cpunode.pas
  42. 7 0
      compiler/i386/cputarg.pas
  43. 9 1
      compiler/i386/i386att.inc
  44. 8 0
      compiler/i386/i386atts.inc
  45. 9 1
      compiler/i386/i386int.inc
  46. 1 1
      compiler/i386/i386nop.inc
  47. 9 1
      compiler/i386/i386op.inc
  48. 50 42
      compiler/i386/i386prop.inc
  49. 114 2
      compiler/i386/i386tab.inc
  50. 0 32
      compiler/i386/n386inl.pas
  51. 7 2
      compiler/i8086/cgcpu.pas
  52. 13 11
      compiler/i8086/cpuinfo.pas
  53. 1 0
      compiler/i8086/cpunode.pas
  54. 9 1
      compiler/i8086/i8086att.inc
  55. 8 0
      compiler/i8086/i8086atts.inc
  56. 9 1
      compiler/i8086/i8086int.inc
  57. 1 1
      compiler/i8086/i8086nop.inc
  58. 9 1
      compiler/i8086/i8086op.inc
  59. 50 42
      compiler/i8086/i8086prop.inc
  60. 114 2
      compiler/i8086/i8086tab.inc
  61. 3 21
      compiler/i8086/n8086add.pas
  62. 3 3
      compiler/jvm/njvminl.pas
  63. 11 4
      compiler/m68k/ag68kgas.pas
  64. 34 2
      compiler/m68k/aoptcpu.pas
  65. 0 33
      compiler/mips/cgcpu.pas
  66. 21 1
      compiler/mips/cpugas.pas
  67. 2 46
      compiler/mips/cpuinfo.pas
  68. 8 0
      compiler/msg/errore.msg
  69. 0 1186
      compiler/msgidx.inc
  70. 0 2154
      compiler/msgtxt.inc
  71. 56 23
      compiler/nadd.pas
  72. 243 159
      compiler/nbas.pas
  73. 1 0
      compiler/ncal.pas
  74. 41 7
      compiler/ncginl.pas
  75. 14 3
      compiler/nflw.pas
  76. 2 4
      compiler/ngenutil.pas
  77. 8 2
      compiler/ninl.pas
  78. 5 3
      compiler/nmat.pas
  79. 25 35
      compiler/nobj.pas
  80. 10 0
      compiler/nset.pas
  81. 18 0
      compiler/nutils.pas
  82. 1 0
      compiler/ogbase.pas
  83. 10 8
      compiler/ogcoff.pas
  84. 2 0
      compiler/ogelf.pas
  85. 20 3
      compiler/ogwasm.pas
  86. 16 11
      compiler/optconstprop.pas
  87. 5 4
      compiler/optcse.pas
  88. 22 14
      compiler/options.pas
  89. 2 2
      compiler/pdecl.pas
  90. 24 1
      compiler/pdecsub.pas
  91. 20 4
      compiler/pdecvar.pas
  92. 0 1
      compiler/pexpr.pas
  93. 2 0
      compiler/pgentype.pas
  94. 24 4
      compiler/pgenutil.pas
  95. 54 7
      compiler/pmodules.pas
  96. 1 1
      compiler/pparautl.pas
  97. 6 1
      compiler/ppcaarch64.lpi
  98. 1 0
      compiler/procdefutil.pas
  99. 4 1
      compiler/pstatmnt.pas
  100. 2 0
      compiler/psub.pas

+ 2 - 0
.gitignore

@@ -67,6 +67,8 @@ symbol_order*.fpc
 !/compiler/ppc*.lpi
 !/compiler/ppc*.lpi
 !/compiler/ppc*.pas
 !/compiler/ppc*.pas
 /compiler/*/pp
 /compiler/*/pp
+/compiler/msgidx.inc
+/compiler/msgtxt.inc
 /compiler/revision.inc
 /compiler/revision.inc
 /compiler/utils/fpc
 /compiler/utils/fpc
 /compiler/utils/msg2inc
 /compiler/utils/msg2inc

+ 1 - 1
.gitlab-ci.yml

@@ -6,7 +6,7 @@
 .linux_runners:
 .linux_runners:
   image: registry.gitlab.com/freepascal.org/fpc/source/debian-buster-x86_64
   image: registry.gitlab.com/freepascal.org/fpc/source/debian-buster-x86_64
   tags:
   tags:
-    - linux
+    - saas-linux-medium-amd64
 
 
 stages:
 stages:
   - compilercycle
   - compilercycle

+ 6 - 4
compiler/Makefile

@@ -650,7 +650,7 @@ REVSTR:=exported
 export REVSTR
 export REVSTR
 endif
 endif
 endif
 endif
-override LOCALOPT+=-d$(CPC_TARGET) -dGDB
+override LOCALOPT+=-d$(CPC_TARGET)
 ifdef LLVM
 ifdef LLVM
 ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
 ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
 $(error The $(PPC_TARGET) architecture is not (yet) supported by the FPC/LLVM code generator)
 $(error The $(PPC_TARGET) architecture is not (yet) supported by the FPC/LLVM code generator)
@@ -5284,7 +5284,7 @@ wpocycle:
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler 
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
@@ -5489,7 +5489,7 @@ rtlclean:
 rtlinstall:
 rtlinstall:
 	$(MAKE) -C $(PACKAGEDIR_RTL) install
 	$(MAKE) -C $(PACKAGEDIR_RTL) install
 PPUDIR=$(COMPILER_UNITTARGETDIR)
 PPUDIR=$(COMPILER_UNITTARGETDIR)
-ALLPPUDIR=$(CPU_TARGET)/units/*
+ALLPPUDIRS:=$(wildcard $(CPU_TARGET)/units/*)
 PPULIST=$(wildcard $(PPUDIR)/*.ppu)
 PPULIST=$(wildcard $(PPUDIR)/*.ppu)
 PPULOGLIST=$(subst .ppu,.log-ppu,$(PPULIST))
 PPULOGLIST=$(subst .ppu,.log-ppu,$(PPULIST))
 RTLPPUDIR=../rtl/units/$(TARGETSUFFIX)
 RTLPPUDIR=../rtl/units/$(TARGETSUFFIX)
@@ -5505,6 +5505,7 @@ vpath %.log-ppu $(PPUDIR) $(RTLPPUDIR) $(ALLPPUDIR)
 ./utils/ppudump$(EXEEXT):
 ./utils/ppudump$(EXEEXT):
 	$(MAKE) -C $(COMPILERUTILSDIR) ppudump$(EXEEXT)
 	$(MAKE) -C $(COMPILERUTILSDIR) ppudump$(EXEEXT)
 ppuinfo :
 ppuinfo :
+	echo list of PPU directories is "$(ALLPPUDIRS)"
 	echo PPU list is "$(PPULIST)"
 	echo PPU list is "$(PPULIST)"
 	echo PPULOG list is "$(PPULOGLIST)"
 	echo PPULOG list is "$(PPULOGLIST)"
 	echo RTLPPUDIR is "$(RTLPPUDIR)"
 	echo RTLPPUDIR is "$(RTLPPUDIR)"
@@ -5514,7 +5515,8 @@ cleanppulogs :
 cleanrtlppulogs :
 cleanrtlppulogs :
 	-$(RMPROG) $(RTLPPULOGLIST)
 	-$(RMPROG) $(RTLPPULOGLIST)
 testppudump :
 testppudump :
-	$(MAKE) cleanrtlppulogs cleanppulogs ppulogs rtlppulogs
+	$(MAKE) cleanrtlppulogs cleanppulogs
+	$(MAKE) ppulogs rtlppulogs
 localmake:=$(strip $(wildcard makefile.loc))
 localmake:=$(strip $(wildcard makefile.loc))
 ifdef localmake
 ifdef localmake
 include ./$(localmake)
 include ./$(localmake)

+ 6 - 4
compiler/Makefile.fpc

@@ -378,7 +378,7 @@ endif
 endif
 endif
 
 
 # set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
 # set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
-override LOCALOPT+=-d$(CPC_TARGET) -dGDB
+override LOCALOPT+=-d$(CPC_TARGET)
 
 
 #include LLVM define/directory if requested
 #include LLVM define/directory if requested
 ifdef LLVM
 ifdef LLVM
@@ -974,7 +974,7 @@ wpocycle:
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(RTLOPT) $(OPTWPOPERFORM) $(OPTNEW))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' $(addsuffix _clean,$(ALLTARGETS))
-	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler 
+	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3PREFIX)$(TEMPNAME3)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT)))' 'COMPILEREXENAME=$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' compiler
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
 	$(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtlclean
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(RTLOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' rtl
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
         $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1PREFIX)$(TEMPWPONAME1)' 'OPT=$(strip $(LOCALOPT) $(OPTNEW) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM)))' $(addsuffix _clean,$(ALLTARGETS))
@@ -1280,7 +1280,7 @@ rtlinstall:
 #####################################################################
 #####################################################################
 
 
 PPUDIR=$(COMPILER_UNITTARGETDIR)
 PPUDIR=$(COMPILER_UNITTARGETDIR)
-ALLPPUDIR=$(CPU_TARGET)/units/*
+ALLPPUDIRS:=$(wildcard $(CPU_TARGET)/units/*)
 PPULIST=$(wildcard $(PPUDIR)/*.ppu)
 PPULIST=$(wildcard $(PPUDIR)/*.ppu)
 PPULOGLIST=$(subst .ppu,.log-ppu,$(PPULIST))
 PPULOGLIST=$(subst .ppu,.log-ppu,$(PPULIST))
 
 
@@ -1306,6 +1306,7 @@ vpath %.log-ppu $(PPUDIR) $(RTLPPUDIR) $(ALLPPUDIR)
 	$(MAKE) -C $(COMPILERUTILSDIR) ppudump$(EXEEXT)
 	$(MAKE) -C $(COMPILERUTILSDIR) ppudump$(EXEEXT)
 
 
 ppuinfo :
 ppuinfo :
+	echo list of PPU directories is "$(ALLPPUDIRS)"
 	echo PPU list is "$(PPULIST)"
 	echo PPU list is "$(PPULIST)"
 	echo PPULOG list is "$(PPULOGLIST)"
 	echo PPULOG list is "$(PPULOGLIST)"
 	echo RTLPPUDIR is "$(RTLPPUDIR)"
 	echo RTLPPUDIR is "$(RTLPPUDIR)"
@@ -1318,7 +1319,8 @@ cleanrtlppulogs :
 	-$(RMPROG) $(RTLPPULOGLIST)
 	-$(RMPROG) $(RTLPPULOGLIST)
 
 
 testppudump :
 testppudump :
-	$(MAKE) cleanrtlppulogs cleanppulogs ppulogs rtlppulogs
+	$(MAKE) cleanrtlppulogs cleanppulogs
+	$(MAKE) ppulogs rtlppulogs
 
 
 #####################################################################
 #####################################################################
 # local user configurable file
 # local user configurable file

+ 3 - 1
compiler/aarch64/a64att.inc

@@ -429,5 +429,7 @@
 'sha512h',
 'sha512h',
 'sha512h2',
 'sha512h2',
 'sha512su0',
 'sha512su0',
-'sha512su1'
+'sha512su1',
+'abs',
+'ctz'
 );
 );

+ 2 - 0
compiler/aarch64/a64atts.inc

@@ -429,5 +429,7 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE
 attsufNONE
 );
 );

+ 4 - 0
compiler/aarch64/a64ins.dat

@@ -864,3 +864,7 @@
 [SHA512SU0]
 [SHA512SU0]
 
 
 [SHA512SU1]
 [SHA512SU1]
+
+[ABS]
+
+[CTZ]

+ 3 - 1
compiler/aarch64/a64op.inc

@@ -429,5 +429,7 @@ A_SDOT,
 A_SHA512H,
 A_SHA512H,
 A_SHA512H2,
 A_SHA512H2,
 A_SHA512SU0,
 A_SHA512SU0,
-A_SHA512SU1
+A_SHA512SU1,
+A_ABS,
+A_CTZ
 );
 );

+ 2 - 0
compiler/aarch64/aasmcpu.pas

@@ -1085,6 +1085,7 @@ implementation
            A_AND,
            A_AND,
            A_ASR,
            A_ASR,
            A_BFXIL,
            A_BFXIL,
+           A_BIC,
            A_CLZ,
            A_CLZ,
            A_CSEL,
            A_CSEL,
            A_CSET,
            A_CSET,
@@ -1093,6 +1094,7 @@ implementation
            A_EON,
            A_EON,
            A_EOR,
            A_EOR,
            A_FADD,
            A_FADD,
+           A_FCSEL,
            A_FCVT,
            A_FCVT,
            A_FDIV,
            A_FDIV,
            A_FMADD,
            A_FMADD,

+ 15 - 3
compiler/aarch64/agcpugas.pas

@@ -75,7 +75,10 @@ unit agcpugas;
         'armv8.3-a',
         'armv8.3-a',
         'armv8.4-a',
         'armv8.4-a',
         'armv8.5-a',
         'armv8.5-a',
-        'armv8.6-a'
+        'armv8.6-a',
+        'armv8.7-a',
+        'armv8.8-a',
+        'armv8.9-a'
       );
       );
 
 
       cputype_to_clang_march : array[tcputype] of string = (
       cputype_to_clang_march : array[tcputype] of string = (
@@ -87,7 +90,10 @@ unit agcpugas;
         'armv8.3-a',
         'armv8.3-a',
         'armv8.4-a',
         'armv8.4-a',
         'armv8.5-a',
         'armv8.5-a',
-        'armv8.6-a'
+        'armv8.6-a',
+        'armv8.7-a',
+        'armv8.8-a',
+        'armv8.9-a'
       );
       );
 
 
   implementation
   implementation
@@ -122,11 +128,17 @@ unit agcpugas;
               CPUAARCH64_HAS_MEMTAG:
               CPUAARCH64_HAS_MEMTAG:
                 Result:=Result+'+memtag';
                 Result:=Result+'+memtag';
               CPUAARCH64_HAS_PAUTH:
               CPUAARCH64_HAS_PAUTH:
-                Result:=Result+'+pauth';
+                { currently, clang on aarch64-darwin does not support pauth and as
+                  it is actually part of -march==armv8.4-a (and higher) we actually don't need it,
+                  so ignore it at this point }
+                if not(current_settings.cputype>=cpu_armv84a) then
+                  Result:=Result+'+pauth';
               CPUAARCH64_HAS_TME:
               CPUAARCH64_HAS_TME:
                 Result:=Result+'+tme';
                 Result:=Result+'+tme';
               CPUAARCH64_HAS_PROFILE:
               CPUAARCH64_HAS_PROFILE:
                 Result:=Result+'+profile';
                 Result:=Result+'+profile';
+              CPUAARCH64_HAS_CSSC:
+                Result:=Result+'+cssc';
               else
               else
                 ;
                 ;
             end
             end

+ 3 - 2
compiler/aarch64/aoptcpu.pas

@@ -1509,8 +1509,9 @@ Implementation
       if p.typ=ait_instruction then
       if p.typ=ait_instruction then
         begin
         begin
           case taicpu(p).opcode of
           case taicpu(p).opcode of
-            A_AND:
-              Result := OptPass2AND(p);
+            A_AND,
+            A_BIC:
+              Result := OptPass2Bitwise(p);
             A_B:
             A_B:
               Result := OptPass2B(p);
               Result := OptPass2B(p);
             A_CSEL:
             A_CSEL:

+ 19 - 33
compiler/aarch64/cgcpu.pas

@@ -101,7 +101,6 @@ interface
         procedure g_maybe_got_init(list: TAsmList); override;
         procedure g_maybe_got_init(list: TAsmList); override;
         procedure g_restore_registers(list: TAsmList);override;
         procedure g_restore_registers(list: TAsmList);override;
         procedure g_save_registers(list: TAsmList);override;
         procedure g_save_registers(list: TAsmList);override;
-        procedure g_concatcopy_move(list: TAsmList; const source, dest: treference; len: tcgint);
         procedure g_concatcopy(list: TAsmList; const source, dest: treference; len: tcgint);override;
         procedure g_concatcopy(list: TAsmList; const source, dest: treference; len: tcgint);override;
         procedure g_adjust_self_value(list: TAsmList; procdef: tprocdef; ioffset: tcgint);override;
         procedure g_adjust_self_value(list: TAsmList; procdef: tprocdef; ioffset: tcgint);override;
         procedure g_check_for_fpu_exception(list: TAsmList; force, clear: boolean);override;
         procedure g_check_for_fpu_exception(list: TAsmList; force, clear: boolean);override;
@@ -313,6 +312,9 @@ implementation
         { base + offset }
         { base + offset }
         if ref.base<>NR_NO then
         if ref.base<>NR_NO then
           begin
           begin
+            if ref.offset=0 then
+              exit;
+
             { valid offset for LDUR/STUR -> use that }
             { valid offset for LDUR/STUR -> use that }
             if (ref.addressmode=AM_OFFSET) and
             if (ref.addressmode=AM_OFFSET) and
                (op in [A_LDR,A_STR]) and
                (op in [A_LDR,A_STR]) and
@@ -1055,7 +1057,22 @@ implementation
                 list.concat(taicpu.op_reg_reg_const_const(A_UBFIZ,makeregsize(reg2,OS_64),makeregsize(reg1,OS_64),0,32));
                 list.concat(taicpu.op_reg_reg_const_const(A_UBFIZ,makeregsize(reg2,OS_64),makeregsize(reg1,OS_64),0,32));
               OS_64,
               OS_64,
               OS_S64:
               OS_S64:
-                list.concat(taicpu.op_reg_reg(A_SXTW,reg2,makeregsize(reg1,OS_32)));
+                case fromsize of
+                  OS_8:
+                    list.concat(taicpu.op_reg_reg(A_UXTB,reg2,makeregsize(reg1,OS_64)));
+                  OS_S8:
+                    list.concat(taicpu.op_reg_reg(A_SXTB,reg2,makeregsize(reg1,OS_32)));
+                  OS_16:
+                    list.concat(taicpu.op_reg_reg(A_UXTH,reg2,makeregsize(reg1,OS_64)));
+                  OS_S16:
+                    list.concat(taicpu.op_reg_reg(A_SXTH,reg2,makeregsize(reg1,OS_32)));
+                  OS_32:
+                    list.concat(taicpu.op_reg_reg_const_const(A_UBFIZ,makeregsize(reg2,OS_64),makeregsize(reg1,OS_64),0,32));
+                  OS_S32:
+                    list.concat(taicpu.op_reg_reg(A_SXTW,reg2,makeregsize(reg1,OS_32)));
+                  else
+                    internalerror(2024070701);
+                end;
               else
               else
                 internalerror(2002090901);
                 internalerror(2002090901);
             end;
             end;
@@ -2168,37 +2185,6 @@ implementation
       end;
       end;
 
 
 
 
-    { ************* concatcopy ************ }
-
-    procedure tcgaarch64.g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
-      var
-        paraloc1,paraloc2,paraloc3 : TCGPara;
-        pd : tprocdef;
-      begin
-        pd:=search_system_proc('MOVE');
-        paraloc1.init;
-        paraloc2.init;
-        paraloc3.init;
-        paramanager.getcgtempparaloc(list,pd,1,paraloc1);
-        paramanager.getcgtempparaloc(list,pd,2,paraloc2);
-        paramanager.getcgtempparaloc(list,pd,3,paraloc3);
-        a_load_const_cgpara(list,OS_SINT,len,paraloc3);
-        a_loadaddr_ref_cgpara(list,dest,paraloc2);
-        a_loadaddr_ref_cgpara(list,source,paraloc1);
-        paramanager.freecgpara(list,paraloc3);
-        paramanager.freecgpara(list,paraloc2);
-        paramanager.freecgpara(list,paraloc1);
-        alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        alloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
-        a_call_name(list,'FPC_MOVE',false);
-        dealloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
-        dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        paraloc3.done;
-        paraloc2.done;
-        paraloc1.done;
-      end;
-
-
     procedure tcgaarch64.g_concatcopy(list: TAsmList; const source, dest: treference; len: tcgint);
     procedure tcgaarch64.g_concatcopy(list: TAsmList; const source, dest: treference; len: tcgint);
 
 
       var
       var

+ 17 - 7
compiler/aarch64/cpuinfo.pas

@@ -42,7 +42,10 @@ Type
        cpu_armv83a,
        cpu_armv83a,
        cpu_armv84a,
        cpu_armv84a,
        cpu_armv85a,
        cpu_armv85a,
-       cpu_armv86a
+       cpu_armv86a,
+       cpu_armv87a,
+       cpu_armv88a,
+       cpu_armv89a
       );
       );
 
 
 Type
 Type
@@ -120,7 +123,10 @@ Const
      'ARMV8.3-A',
      'ARMV8.3-A',
      'ARMV8.4-A',
      'ARMV8.4-A',
      'ARMV8.5-A',
      'ARMV8.5-A',
-     'ARMV8.6-A'
+     'ARMV8.6-A',
+     'ARMV8.7-A',
+     'ARMV8.8-A',
+     'ARMV8.9-A'
    );
    );
 
 
    fputypestr : array[tfputype] of string[9] = ('',
    fputypestr : array[tfputype] of string[9] = ('',
@@ -155,7 +161,8 @@ type
       CPUAARCH64_HAS_PROFILE, { CPU supports the profile extension }
       CPUAARCH64_HAS_PROFILE, { CPU supports the profile extension }
       CPUAARCH64_HAS_MEMTAG,  { CPU supports the memtag extension }
       CPUAARCH64_HAS_MEMTAG,  { CPU supports the memtag extension }
       CPUAARCH64_HAS_TME,     { CPU supports the tme extension }
       CPUAARCH64_HAS_TME,     { CPU supports the tme extension }
-      CPUAARCH64_HAS_PAUTH    { CPU supports the pauth extension }
+      CPUAARCH64_HAS_PAUTH,   { CPU supports the pauth extension }
+      CPUAARCH64_HAS_CSSC     { CPU supports the Common Short Sequence Compression (CSSC) extension }
      );
      );
 
 
    tfpuflags =
    tfpuflags =
@@ -169,10 +176,13 @@ const
        { cpu_armv8a    } [],
        { cpu_armv8a    } [],
        { cpu_armv81a   } [CPUAARCH64_HAS_LSE],
        { cpu_armv81a   } [CPUAARCH64_HAS_LSE],
        { cpu_armv82a   } [CPUAARCH64_HAS_LSE],
        { cpu_armv82a   } [CPUAARCH64_HAS_LSE],
-       { cpu_armv83a   } [CPUAARCH64_HAS_LSE],
-       { cpu_armv84a   } [CPUAARCH64_HAS_LSE],
-       { cpu_armv85a   } [CPUAARCH64_HAS_LSE],
-       { cpu_armv86a   } [CPUAARCH64_HAS_LSE]
+       { cpu_armv83a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv84a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv85a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv86a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv87a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv88a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH],
+       { cpu_armv89a   } [CPUAARCH64_HAS_LSE,CPUAARCH64_HAS_DOTPROD,CPUAARCH64_HAS_PAUTH,CPUAARCH64_HAS_CSSC]
      );
      );
 
 
    fpu_capabilities : array[tfputype] of set of tfpuflags =
    fpu_capabilities : array[tfputype] of set of tfpuflags =

+ 1 - 0
compiler/aarch64/cpunode.pas

@@ -35,6 +35,7 @@ implementation
     symcpu,
     symcpu,
     aasmdef,
     aasmdef,
 {$ifndef llvm}
 {$ifndef llvm}
+    narmbas,
     ncpuadd,ncpumat,ncpumem,ncpuinl,ncpucnv,ncpuset,ncpucon,ncpuflw,naarch64util
     ncpuadd,ncpumat,ncpumem,ncpuinl,ncpucnv,ncpuset,ncpucon,ncpuflw,naarch64util
 {$else llvm}
 {$else llvm}
     llvmnode
     llvmnode

+ 26 - 13
compiler/aarch64/ncpuset.pas

@@ -203,13 +203,19 @@ implementation
           i:=last.svalue+1;
           i:=last.svalue+1;
           while i<=t^._low.svalue-1 do
           while i<=t^._low.svalue-1 do
             begin
             begin
-              list.concat(Tai_const.Create_rel_sym(jtitemconsttype,tablelabel,elselabel));
+              if target_info.system=system_aarch64_win64 then
+                list.concat(Tai_const.Create_sym(elselabel))
+              else
+                list.concat(Tai_const.Create_rel_sym(jtitemconsttype,tablelabel,elselabel));
               inc(i);
               inc(i);
             end;
             end;
           i:=t^._low.svalue;
           i:=t^._low.svalue;
           while i<=t^._high.svalue do
           while i<=t^._high.svalue do
             begin
             begin
-              list.concat(Tai_const.Create_rel_sym(jtitemconsttype,tablelabel,blocklabel(t^.blockid)));
+              if target_info.system=system_aarch64_win64 then
+                list.concat(Tai_const.Create_sym(blocklabel(t^.blockid)))
+              else
+                list.concat(Tai_const.Create_rel_sym(jtitemconsttype,tablelabel,blocklabel(t^.blockid)));
               inc(i);
               inc(i);
             end;
             end;
           last:=t^._high;
           last:=t^._high;
@@ -243,25 +249,32 @@ implementation
         basereg:=cg.getaddressregister(current_asmdata.CurrAsmList);
         basereg:=cg.getaddressregister(current_asmdata.CurrAsmList);
         cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,href,basereg);
         cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,href,basereg);
         { load table slot, 32-bit sign extended }
         { load table slot, 32-bit sign extended }
+        jumpreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
         reference_reset_base(href,basereg,0,href.temppos,4,[]);
         reference_reset_base(href,basereg,0,href.temppos,4,[]);
         href.index:=indexreg;
         href.index:=indexreg;
         href.shiftmode:=SM_LSL;
         href.shiftmode:=SM_LSL;
-        href.shiftimm:=2;
-        jumpreg:=cg.getaddressregister(current_asmdata.CurrAsmList);
-        cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_S32,OS_ADDR,href,jumpreg);
-        { add table address }
-        cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_ADDR,basereg,jumpreg);
+        if target_info.system=system_aarch64_win64 then
+          begin
+            { Use a 64-bit absolute table under aarch64-win64 }
+            href.shiftimm:=3;
+            cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,jumpreg);
+          end
+        else
+          begin
+            href.shiftimm:=2;
+            cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_S32,OS_ADDR,href,jumpreg);
+            { add table address }
+            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_ADDR,basereg,jumpreg);
+          end;
         { and finally jump }
         { and finally jump }
         current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_BR,jumpreg));
         current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_BR,jumpreg));
         { generate jump table }
         { generate jump table }
         if target_info.system=system_aarch64_win64 then
         if target_info.system=system_aarch64_win64 then
           begin
           begin
-            { for Windows we need to make sure that the jump table is located in the
-              same section as the corresponding code as for one clang generates a
-              ABSOLUTE32 relocation that can not be handled correctly and armasm64
-              rejects the difference entries due to the symbols being located in
-              different sections }
-            sectype:=sec_code;
+            { For windows, it has to be in a data section otherwise an access violation
+              will occur, but also full 64-bit references to avoid problems with 
+              relative references }
+            sectype:=sec_rodata;
             new_section(current_procinfo.aktlocaldata,sectype,lower(current_procinfo.procdef.mangledname),getprocalign);
             new_section(current_procinfo.aktlocaldata,sectype,lower(current_procinfo.procdef.mangledname),getprocalign);
           end
           end
         else
         else

+ 7 - 0
compiler/aasmtai.pas

@@ -108,6 +108,8 @@ interface
           ait_eabi_attribute
           ait_eabi_attribute
           );
           );
 
 
+        taitypes = set of taitype;
+
         taiconst_type = (
         taiconst_type = (
           aitconst_128bit,
           aitconst_128bit,
           aitconst_64bit,
           aitconst_64bit,
@@ -3159,6 +3161,11 @@ implementation
 {$endif jvm}
 {$endif jvm}
                 end;
                 end;
 {$ifdef ARM}
 {$ifdef ARM}
+              top_regset:
+                begin
+                  new(p.oper[i]^.regset);
+                  p.oper[i]^.regset^:=oper[i]^.regset^;
+                end;
               top_shifterop:
               top_shifterop:
                 begin
                 begin
                   new(p.oper[i]^.shifterop);
                   new(p.oper[i]^.shifterop);

+ 1 - 0
compiler/aggas.pas

@@ -513,6 +513,7 @@ implementation
          system_m68k_atari, { atari tos/mint GNU AS also doesn't seem to like .section (KB) }
          system_m68k_atari, { atari tos/mint GNU AS also doesn't seem to like .section (KB) }
          system_m68k_amiga, { amiga has old GNU AS (2.14), which blews up from .section (KB) }
          system_m68k_amiga, { amiga has old GNU AS (2.14), which blews up from .section (KB) }
          system_m68k_sinclairql, { same story, only ancient GNU tools available (KB) }
          system_m68k_sinclairql, { same story, only ancient GNU tools available (KB) }
+         system_m68k_palmos, { see above... (KB) }
          system_m68k_human68k: { see above... (KB) }
          system_m68k_human68k: { see above... (KB) }
            begin
            begin
              { ... but vasm is GAS compatible on amiga/atari, and supports named sections }
              { ... but vasm is GAS compatible on amiga/atari, and supports named sections }

+ 14 - 10
compiler/aoptbase.pas

@@ -60,12 +60,15 @@ unit aoptbase;
 
 
         { gets the next tai object after current that contains info relevant }
         { gets the next tai object after current that contains info relevant }
         { to the optimizer in p1. If there is none, it returns false and     }
         { to the optimizer in p1. If there is none, it returns false and     }
-        { sets p1 to nil                                                     }
-        class function GetNextInstruction(Current: tai; out Next: tai): Boolean; static;
+        { sets p1 to nil.  If AlsoStopOn is set, it will also stop on these  }
+        { object types that are normally skipped over.                       }
+        class function GetNextInstruction(Current: tai; out Next: tai; AlsoStopOn: taitypes = []): Boolean; static;
+
         { gets the previous tai object after current that contains info   }
         { gets the previous tai object after current that contains info   }
         { relevant to the optimizer in last. If there is none, it returns }
         { relevant to the optimizer in last. If there is none, it returns }
-        { false and sets last to nil                                      }
-        class function GetLastInstruction(Current: tai; out Last: tai): Boolean; static;
+        { false and sets last to nil.  If AlsoStopOn is set, it will also }
+        { stop on these object types that are normally skipped over.      }
+        class function GetLastInstruction(Current: tai; out Last: tai; AlsoStopOn: taitypes = []): Boolean; static;
 
 
         class function SkipEntryExitMarker(current: tai; out next: tai): boolean; static;
         class function SkipEntryExitMarker(current: tai; out next: tai): boolean; static;
 
 
@@ -185,12 +188,12 @@ unit aoptbase;
   end;
   end;
 
 
 
 
-  class function TAOptBase.GetNextInstruction(Current: tai; out Next: tai): Boolean;
+  class function TAOptBase.GetNextInstruction(Current: tai; out Next: tai; AlsoStopOn: taitypes): Boolean;
   Begin
   Begin
     Repeat
     Repeat
       Current := tai(Current.Next);
       Current := tai(Current.Next);
       While Assigned(Current) And
       While Assigned(Current) And
-            ((Current.typ In SkipInstr) or
+            ((Current.typ In SkipInstr - AlsoStopOn) or
 {$ifdef cpudelayslot}
 {$ifdef cpudelayslot}
              ((Current.typ=ait_instruction) and
              ((Current.typ=ait_instruction) and
               (taicpu(Current).opcode=A_NOP)
               (taicpu(Current).opcode=A_NOP)
@@ -223,7 +226,7 @@ unit aoptbase;
           (Tai_Marker(Current).Kind <> mark_NoPropInfoEnd);
           (Tai_Marker(Current).Kind <> mark_NoPropInfoEnd);
     Next := Current;
     Next := Current;
     If Assigned(Current) And
     If Assigned(Current) And
-       Not((Current.typ In SkipInstr) or
+       Not((Current.typ In SkipInstr - AlsoStopOn) or
            ((Current.typ = ait_label) And
            ((Current.typ = ait_label) And
             labelCanBeSkipped(Tai_Label(Current))))
             labelCanBeSkipped(Tai_Label(Current))))
       Then GetNextInstruction := True
       Then GetNextInstruction := True
@@ -234,14 +237,15 @@ unit aoptbase;
         End;
         End;
   End;
   End;
 
 
-  class function TAOptBase.GetLastInstruction(Current: tai; out Last: tai): Boolean;
+
+  class function TAOptBase.GetLastInstruction(Current: tai; out Last: tai; AlsoStopOn: taitypes): Boolean;
   Begin
   Begin
     Repeat
     Repeat
       Current := Tai(Current.previous);
       Current := Tai(Current.previous);
       While Assigned(Current) And
       While Assigned(Current) And
             (((Current.typ = ait_Marker) And
             (((Current.typ = ait_Marker) And
               Not(Tai_Marker(Current).Kind in [mark_AsmBlockEnd{,mark_NoPropInfoEnd}])) or
               Not(Tai_Marker(Current).Kind in [mark_AsmBlockEnd{,mark_NoPropInfoEnd}])) or
-             (Current.typ In SkipInstr) or
+             (Current.typ In SkipInstr - AlsoStopOn) or
              ((Current.typ = ait_label) And
              ((Current.typ = ait_label) And
               labelCanBeSkipped(Tai_Label(Current)))) Do
               labelCanBeSkipped(Tai_Label(Current)))) Do
         Current := Tai(Current.previous);
         Current := Tai(Current.previous);
@@ -258,7 +262,7 @@ unit aoptbase;
           (Current.typ <> ait_Marker) Or
           (Current.typ <> ait_Marker) Or
           not(tai_Marker(current).Kind in [mark_NoPropInfoStart,mark_NoPropInfoEnd]);
           not(tai_Marker(current).Kind in [mark_NoPropInfoStart,mark_NoPropInfoEnd]);
     If Not(Assigned(Current)) or
     If Not(Assigned(Current)) or
-       (Current.typ In SkipInstr) or
+       (Current.typ In SkipInstr - AlsoStopOn) or
        ((Current.typ = ait_label) And
        ((Current.typ = ait_label) And
         labelCanBeSkipped(Tai_Label(Current))) or
         labelCanBeSkipped(Tai_Label(Current))) or
        ((Current.typ = ait_Marker) And
        ((Current.typ = ait_Marker) And

+ 4 - 2
compiler/aoptobj.pas

@@ -486,7 +486,7 @@ Unit AoptObj;
 {$endif DEBUG_AOPTOBJ}
 {$endif DEBUG_AOPTOBJ}
 
 
 
 
-    function JumpTargetOp(ai: taicpu): poper; inline;
+    function JumpTargetOp(ai: taicpu): poper; {$IFDEF USEINLINE}inline;{$ENDIF}
       begin
       begin
 {$if defined(MIPS) or defined(riscv64) or defined(riscv32) or defined(xtensa) or defined(loongarch64)}
 {$if defined(MIPS) or defined(riscv64) or defined(riscv32) or defined(xtensa) or defined(loongarch64)}
         { Branches of above archs can have 1,2 or 3 operands, target label is the last one. }
         { Branches of above archs can have 1,2 or 3 operands, target label is the last one. }
@@ -1934,7 +1934,9 @@ Unit AoptObj;
                           repeat
                           repeat
                             with tai_label(tmp).labsym do
                             with tai_label(tmp).labsym do
                               begin
                               begin
-                                if (labeltype <> alt_jump) then
+                                { alt_addr is needed so alignment directives before
+                                  jump tables e.g. for arm thumb are not removed }
+                                if not(labeltype in [alt_addr,alt_jump]) then
                                   begin
                                   begin
                                     { Non-jump label - skip over }
                                     { Non-jump label - skip over }
                                     tmp := tai(tmp.Next);
                                     tmp := tai(tmp.Next);

+ 17 - 1
compiler/arm/aasmcpu.pas

@@ -5835,7 +5835,23 @@ implementation
           bytes:=((bytes shr 16) and $FFFF) or ((bytes and $FFFF) shl 16);
           bytes:=((bytes shr 16) and $FFFF) or ((bytes and $FFFF) shl 16);
 
 
         { we're finished, write code }
         { we're finished, write code }
-        objdata.writebytes(bytes,bytelen);
+        if source_info.endian<>target_info.endian then
+          begin
+            if (bytelen=4) then
+              if target_info.endian=endian_little then
+                objdata.writeInt32LE(int32(bytes))
+              else
+                objdata.writeInt32BE(int32(bytes))
+            else if (bytelen=2) then
+              if target_info.endian=endian_little then
+                objdata.writeInt16LE(int32(bytes))
+              else
+                objdata.writeInt16BE(int32(bytes))
+            else
+              internalerror(2024022601);
+          end
+        else
+          objdata.writebytes(bytes,bytelen);
       end;
       end;
 
 
 begin
 begin

+ 6 - 2
compiler/arm/aoptcpu.pas

@@ -2416,8 +2416,12 @@ Implementation
       if p.typ = ait_instruction then
       if p.typ = ait_instruction then
         begin
         begin
           case taicpu(p).opcode of
           case taicpu(p).opcode of
-            A_AND:
-              Result := OptPass2AND(p);
+            A_AND,
+            A_ORR,
+            A_EOR,
+            A_BIC,
+            A_ORN:
+              Result := OptPass2Bitwise(p);
             A_CMP:
             A_CMP:
               Result := OptPass2CMP(p);
               Result := OptPass2CMP(p);
             A_B:
             A_B:

+ 5 - 33
compiler/arm/cgcpu.pas

@@ -86,7 +86,6 @@ unit cgcpu;
 
 
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);override;
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);override;
         procedure g_concatcopy_unaligned(list : TAsmList;const source,dest : treference;len : tcgint);override;
         procedure g_concatcopy_unaligned(list : TAsmList;const source,dest : treference;len : tcgint);override;
-        procedure g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
         procedure g_concatcopy_internal(list : TAsmList;const source,dest : treference;len : tcgint;aligned : boolean);
         procedure g_concatcopy_internal(list : TAsmList;const source,dest : treference;len : tcgint;aligned : boolean);
 
 
         procedure g_overflowcheck(list: TAsmList; const l: tlocation; def: tdef); override;
         procedure g_overflowcheck(list: TAsmList; const l: tlocation; def: tdef); override;
@@ -2669,35 +2668,6 @@ unit cgcpu;
       end;
       end;
 
 
 
 
-    procedure tbasecgarm.g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
-      var
-        paraloc1,paraloc2,paraloc3 : TCGPara;
-        pd : tprocdef;
-      begin
-        pd:=search_system_proc('MOVE');
-        paraloc1.init;
-        paraloc2.init;
-        paraloc3.init;
-        paramanager.getcgtempparaloc(list,pd,1,paraloc1);
-        paramanager.getcgtempparaloc(list,pd,2,paraloc2);
-        paramanager.getcgtempparaloc(list,pd,3,paraloc3);
-        a_load_const_cgpara(list,OS_SINT,len,paraloc3);
-        a_loadaddr_ref_cgpara(list,dest,paraloc2);
-        a_loadaddr_ref_cgpara(list,source,paraloc1);
-        paramanager.freecgpara(list,paraloc3);
-        paramanager.freecgpara(list,paraloc2);
-        paramanager.freecgpara(list,paraloc1);
-        alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        alloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
-        a_call_name(list,'FPC_MOVE',false);
-        dealloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
-        dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        paraloc3.done;
-        paraloc2.done;
-        paraloc1.done;
-      end;
-
-
     procedure tbasecgarm.g_concatcopy_internal(list : TAsmList;const source,dest : treference;len : tcgint;aligned : boolean);
     procedure tbasecgarm.g_concatcopy_internal(list : TAsmList;const source,dest : treference;len : tcgint;aligned : boolean);
       const
       const
         maxtmpreg_arm = 10; {roozbeh: can be reduced to 8 or lower if might conflick with reserved ones,also +2 is used becouse of regs required for referencing}
         maxtmpreg_arm = 10; {roozbeh: can be reduced to 8 or lower if might conflick with reserved ones,also +2 is used becouse of regs required for referencing}
@@ -3663,10 +3633,10 @@ unit cgcpu;
               else
               else
                 internalerror(2003083102);
                 internalerror(2003083102);
             end;
             end;
+            ovloc.loc:=LOC_FLAGS;
             if size=OS_64 then
             if size=OS_64 then
               begin
               begin
-                { the arm has an weired opinion how flags for SUB/ADD are handled }
-                ovloc.loc:=LOC_FLAGS;
+                { arm has a weired opinion how flags for SUB/ADD are handled }
                 case op of
                 case op of
                   OP_ADD:
                   OP_ADD:
                     ovloc.resflags:=F_CS;
                     ovloc.resflags:=F_CS;
@@ -3675,7 +3645,9 @@ unit cgcpu;
                   else
                   else
                     internalerror(2019050917);
                     internalerror(2019050917);
                 end;
                 end;
-              end;
+              end
+            else
+              ovloc.resflags:=F_VS;
           end
           end
         else
         else
           begin
           begin

+ 1 - 1
compiler/arm/cpuinfo.pas

@@ -1081,7 +1081,7 @@ Const
 
 
    level1optimizerswitches = genericlevel1optimizerswitches;
    level1optimizerswitches = genericlevel1optimizerswitches;
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
-     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
+     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse,cs_opt_consts];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [cs_opt_scheduler];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [cs_opt_scheduler];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
 
 

+ 1 - 0
compiler/arm/cpunode.pas

@@ -39,6 +39,7 @@ unit cpunode;
        }
        }
 {$ifndef llvm}
 {$ifndef llvm}
        narmadd,
        narmadd,
+       narmbas,
        narmcal,
        narmcal,
        narmmat,
        narmmat,
        narminl,
        narminl,

+ 15 - 26
compiler/arm/narminl.pas

@@ -414,7 +414,7 @@ implementation
         opsize : tcgsize;
         opsize : tcgsize;
         ovloc: tlocation;
         ovloc: tlocation;
       begin
       begin
-        if GenerateThumbCode then
+        if GenerateThumbCode or is_64bitint(left.resultdef)  then
           begin
           begin
             inherited second_abs_long;
             inherited second_abs_long;
             exit;
             exit;
@@ -422,35 +422,24 @@ implementation
 
 
         secondpass(left);
         secondpass(left);
         opsize:=def_cgsize(left.resultdef);
         opsize:=def_cgsize(left.resultdef);
-        if is_64bitint(left.resultdef) then
-          begin
-            hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
-            location:=left.location;
-            location.register64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
-            location.register64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
-            cg64.a_load64_reg_reg(current_asmdata.CurrAsmList,left.location.register64,location.register64);
-            cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SAR,OS_32,31,left.location.register64.reghi);
-            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,left.location.register64.reghi,location.register64.reglo);
-            cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,left.location.register64.reghi,location.register64.reghi);
-            current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_SUB,location.register64.reglo,location.register64.reglo,left.location.register64.reghi), PF_S));
-            current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_SBC,location.register64.reghi,location.register64.reghi,left.location.register64.reghi), PF_S));
-          end
-        else
-          begin
-            hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
-            location:=left.location;
-            location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
+        hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
+        location:=left.location;
+        location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
 
 
-            cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
-            current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_MOV,location.register,left.location.register), PF_S));
+        cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+        current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_MOV,location.register,left.location.register), PF_S));
 
 
-            if GenerateThumb2Code then
-              current_asmdata.CurrAsmList.concat(taicpu.op_cond(A_IT,C_MI));
+        if GenerateThumb2Code then
+          current_asmdata.CurrAsmList.concat(taicpu.op_cond(A_IT,C_MI));
 
 
+        if cs_check_overflow in current_settings.localswitches then
+          begin
             current_asmdata.CurrAsmList.concat(setoppostfix(setcondition(taicpu.op_reg_reg_const(A_RSB,location.register,location.register, 0), C_MI),PF_S));
             current_asmdata.CurrAsmList.concat(setoppostfix(setcondition(taicpu.op_reg_reg_const(A_RSB,location.register,location.register, 0), C_MI),PF_S));
-          end;
-        location_reset(ovloc,LOC_VOID,opsize);
-        cg.g_overflowCheck_loc(current_asmdata.CurrAsmList,ovloc,resultdef,ovloc);
+            location_reset(ovloc,LOC_VOID,opsize);
+            cg.g_overflowCheck_loc(current_asmdata.CurrAsmList,ovloc,resultdef,ovloc);
+          end
+        else
+          current_asmdata.CurrAsmList.concat(setcondition(taicpu.op_reg_reg_const(A_RSB,location.register,location.register, 0), C_MI));
 
 
         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
         cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
       end;
       end;

+ 47 - 21
compiler/armgen/aoptarm.pas

@@ -58,7 +58,7 @@ Type
     function OptPass1STR(var p: tai): Boolean; virtual;
     function OptPass1STR(var p: tai): Boolean; virtual;
     function OptPass1And(var p: tai): Boolean; virtual;
     function OptPass1And(var p: tai): Boolean; virtual;
 
 
-    function OptPass2AND(var p: tai): Boolean;
+    function OptPass2Bitwise(var p: tai): Boolean;
     function OptPass2TST(var p: tai): Boolean;
     function OptPass2TST(var p: tai): Boolean;
   End;
   End;
 
 
@@ -231,6 +231,8 @@ Implementation
           else
           else
             opoffset:=1;
             opoffset:=1;
           taicpu(hp1).loadReg(opoffset+1,taicpu(p).oper[1]^.reg);
           taicpu(hp1).loadReg(opoffset+1,taicpu(p).oper[1]^.reg);
+          if not(shiftmode in [SM_SXTX,SM_UXTX,SM_LSL]) then
+            setsubreg(taicpu(hp1).oper[opoffset+1]^.reg,R_SUBD);
           taicpu(hp1).ops:=opoffset+3;
           taicpu(hp1).ops:=opoffset+3;
           shifterop_reset(so);
           shifterop_reset(so);
           so.shiftmode:=shiftmode;
           so.shiftmode:=shiftmode;
@@ -1519,6 +1521,7 @@ Implementation
               taicpu(hp1).opcode:=A_AND;
               taicpu(hp1).opcode:=A_AND;
               taicpu(hp1).ops:=3;
               taicpu(hp1).ops:=3;
               taicpu(hp1).loadReg(1,taicpu(p).oper[1]^.reg);
               taicpu(hp1).loadReg(1,taicpu(p).oper[1]^.reg);
+              setsubreg(taicpu(hp1).oper[1]^.reg,getsubreg(taicpu(hp1).oper[0]^.reg));
               taicpu(hp1).loadconst(2,taicpu(p).oper[2]^.val);
               taicpu(hp1).loadconst(2,taicpu(p).oper[2]^.val);
               GetNextInstruction(p,hp1);
               GetNextInstruction(p,hp1);
               asml.remove(p);
               asml.remove(p);
@@ -1616,7 +1619,7 @@ Implementation
     end;
     end;
 
 
 
 
-  function TARMAsmOptimizer.OptPass2AND(var p: tai): Boolean;
+  function TARMAsmOptimizer.OptPass2Bitwise(var p: tai): Boolean;
     var
     var
       hp1, hp2: tai;
       hp1, hp2: tai;
       WorkingReg: TRegister;
       WorkingReg: TRegister;
@@ -1624,22 +1627,26 @@ Implementation
       Result := False;
       Result := False;
       {
       {
         change
         change
-        and  reg1, ...
+        and/bic  reg1, ...
         ...
         ...
-        cmp  reg1, #0
+        cmp      reg1, #0
         b<ne/eq> @Lbl
         b<ne/eq> @Lbl
         to
         to
-        ands reg1, ...
+        ands/bics reg1, ...
 
 
         Also:
         Also:
 
 
-        and  reg1, ...
+        and/bic  reg1, ...
         ...
         ...
-        cmp  reg1, #0
+        cmp      reg1, #0
         (reg1 end of life)
         (reg1 end of life)
         b<ne/eq> @Lbl
         b<ne/eq> @Lbl
         to
         to
         tst  reg1, ...
         tst  reg1, ...
+        or
+        bics xzr, reg1, ... under AArch64
+
+        For ARM, also include OR, EOR and ORN
       }
       }
       if (taicpu(p).condition = C_None) and
       if (taicpu(p).condition = C_None) and
         (taicpu(p).ops>=3) and
         (taicpu(p).ops>=3) and
@@ -1670,27 +1677,46 @@ Implementation
 
 
               WorkingReg := taicpu(p).oper[0]^.reg;
               WorkingReg := taicpu(p).oper[0]^.reg;
 
 
-              if RegEndOfLife(WorkingReg, taicpu(hp1)) then
+              if
+{$ifndef AARCH64}
+                (taicpu(p).opcode = A_AND) and
+{$endif AARCH64}
+                RegEndOfLife(WorkingReg, taicpu(hp1)) then
                 begin
                 begin
-                  taicpu(p).opcode := A_TST;
-                  taicpu(p).oppostfix := PF_None;
-                  taicpu(p).loadreg(0, taicpu(p).oper[1]^.reg);
-                  taicpu(p).loadoper(1, taicpu(p).oper[2]^);
-                  if (taicpu(p).ops = 4) then
+{$ifdef AARCH64}
+                  if (taicpu(p).opcode <> A_AND) then
                     begin
                     begin
-                      { Make sure any shifter operator is also transferred }
-                      taicpu(p).loadshifterop(2, taicpu(p).oper[3]^.shifterop^);
-                      taicpu(p).ops := 3;
+                      setsupreg(taicpu(p).oper[0]^.reg, RS_XZR);
+                      taicpu(p).oppostfix := PF_S;
+                      DebugMsg(SPeepholeOptimization + 'BIC; CMP -> BICS ' + gas_regname(taicpu(p).oper[0]^.reg), p);
                     end
                     end
                   else
                   else
-                    taicpu(p).ops := 2;
+{$endif AARCH64}
+                    begin
+                      taicpu(p).opcode := A_TST;
+                      taicpu(p).oppostfix := PF_None;
+                      taicpu(p).loadreg(0, taicpu(p).oper[1]^.reg);
+                      taicpu(p).loadoper(1, taicpu(p).oper[2]^);
+                      if (taicpu(p).ops = 4) then
+                        begin
+                          { Make sure any shifter operator is also transferred }
+                          taicpu(p).loadshifterop(2, taicpu(p).oper[3]^.shifterop^);
+                          taicpu(p).ops := 3;
+                        end
+                      else
+                        taicpu(p).ops := 2;
 
 
-                  DebugMsg(SPeepholeOptimization + 'AND; CMP -> TST', p);
+                      DebugMsg(SPeepholeOptimization + 'AND; CMP -> TST', p);
+                    end;
                 end
                 end
               else
               else
                 begin
                 begin
                   taicpu(p).oppostfix := PF_S;
                   taicpu(p).oppostfix := PF_S;
-                  DebugMsg(SPeepholeOptimization + 'AND; CMP -> ANDS', p);
+{$ifdef AARCH64}
+                  DebugMsg(SPeepholeOptimization + 'AND/BIC; CMP -> ANDS/BICS', p);
+{$else AARCH64}
+                  DebugMsg(SPeepholeOptimization + 'Bitwise; CMP -> Bitwise+S', p);
+{$endif AARCH64}
                 end;
                 end;
 
 
               RemoveInstruction(hp1);
               RemoveInstruction(hp1);
@@ -1712,13 +1738,13 @@ Implementation
               { The comparison is a null operation }
               { The comparison is a null operation }
               if RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
               if RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
                 begin
                 begin
-                  DebugMsg(SPeepholeOptimization + 'AND; CMP -> nop', p);
+                  DebugMsg(SPeepholeOptimization + 'Bitwise; CMP -> nop', p);
                   RemoveInstruction(hp1);
                   RemoveInstruction(hp1);
                   RemoveCurrentP(p);
                   RemoveCurrentP(p);
                 end
                 end
               else
               else
                 begin
                 begin
-                  DebugMsg(SPeepholeOptimization + 'CMP -> nop', hp1);
+                  DebugMsg(SPeepholeOptimization + 'CMP/BIC -> nop', hp1);
                   RemoveInstruction(hp1);
                   RemoveInstruction(hp1);
                 end;
                 end;
               Result := True;
               Result := True;

+ 259 - 0
compiler/armgen/narmbas.pas

@@ -0,0 +1,259 @@
+{
+    Copyright (c) 2024 by J. Gareth "Kit" Moreton
+
+    This unit implements the ARM and AArch64-specific assembly node
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit narmbas;
+
+{$i fpcdefs.inc}
+
+interface
+
+  uses
+    nbas, ncgbas, aasmtai;
+
+  type
+    TArmGenAsmNode = class(TCGAsmNode)
+{$ifdef DEBUG_NODE_XML}
+      procedure XMLPrintNodeData(var T: Text); override;
+    protected
+      function XMLFormatOp(const Oper: POper): string; override;
+      procedure XMLProcessInstruction(var T: Text; p: tai); override;
+{$endif DEBUG_NODE_XML}
+    end;
+
+implementation
+
+{$ifdef DEBUG_NODE_XML}
+  uses
+    cutils,
+    cgutils,
+    cgbase,
+    cpubase,
+    itcpugas,
+    aasmcpu,
+{$ifdef arm}
+    agarmgas, { Needed for gas_shiftmode2str }
+{$endif arm}
+{$ifdef aarch64}
+    agcpugas, { Needed for gas_shiftmode2str }
+{$endif aarch64}
+    verbose;
+{$endif DEBUG_NODE_XML}
+
+{$ifdef DEBUG_NODE_XML}
+  function TArmGenAsmNode.XMLFormatOp(const Oper: POper): string;
+  {$ifdef arm}
+    var
+      NotFirst: Boolean;
+      ThisSupReg: TSuperRegister;
+  {$endif arm}
+    begin
+      case Oper^.typ of
+        top_const:
+          begin
+            case Oper^.val of
+              -15..15:
+                Result := '#' + tostr(Oper^.val);
+              $10..$FF:
+                Result := '#0x' + hexstr(Oper^.val, 2);
+              $100..$FFFF:
+                Result := '#0x' + hexstr(Oper^.val, 4);
+  {$ifdef CPU32}
+              else
+                Result := '#0x' + hexstr(Oper^.val, 8);
+  {$else CPU32}
+              $10000..$FFFFFFFF:
+                Result := '#0x' + hexstr(Oper^.val, 8);
+              else
+                Result := '#0x' + hexstr(Oper^.val, 16);
+  {$endif CPU32}
+            end;
+          end;
+
+        top_ref:
+          with Oper^.ref^ do
+            begin
+              if Assigned(symbol) then
+                begin
+                  Result := symbol.Name;
+                  if (offset <> 0) then
+                    begin
+                      if (offset < 0) then
+                        Result := Result + ' - ' + tostr(-offset)
+                      else
+                        Result := Result + ' + ' + tostr(offset);
+                    end;
+                end
+              else
+                begin
+                  if (base <> NR_NO) then
+                    begin
+                      Result := '[' + gas_regname(base);
+                      if addressmode = AM_POSTINDEXED then
+                        Result := Result + '], '
+                      else if (offset <> 0) or (shiftmode <> SM_None) then
+                        Result := Result + ', ';
+                    end
+                  else { Usually a special kind of reference used by ldm/stm instructions }
+                    Result := '';
+
+                  if index <> NR_NO then
+                    Result := Result + gas_regname(index)
+                  else if (offset <> 0) or (shiftmode <> SM_None) or (addressmode = AM_POSTINDEXED) then
+                    Result := Result + '#' + tostr(offset);
+{$ifdef arm}
+                  if shiftmode = SM_RRX then
+                    Result := Result + ', rrx' { Implicit value of 1 }
+                  else
+{$endif arm}
+                  if shiftmode <> SM_None then
+                    Result := Result + ', ' + gas_shiftmode2str[shiftmode] + ' #' + tostr(shiftimm);
+
+                  if addressmode <> AM_POSTINDEXED then
+                    begin
+                      if (base <> NR_NO) then
+                        Result := Result + ']';
+
+                      if addressmode = AM_PREINDEXED then
+                        Result := Result + '!';
+                    end;
+                end;
+            end;
+{$ifdef arm}
+        top_regset:
+          begin
+            Result := '{';
+            NotFirst := False;
+            for ThisSupReg in Oper^.regset^ do
+              begin
+                if NotFirst then
+                  Result := Result + ', ';
+                Result := Result + gas_regname(newreg(Oper^.regtyp, ThisSupReg, Oper^.subreg));
+
+                NotFirst := True;
+              end;
+            Result := Result + '}';
+          end;
+
+        top_specialreg:
+          with Oper^ do
+            begin
+              Result := gas_regname(specialreg) + '_';
+              if (srC in specialflags) then
+                Result := Result + 'c';
+              if (srX in specialflags) then
+                Result := Result + 'x';
+              if (srF in specialflags) then
+                Result := Result + 'f';
+              if (srS in specialflags) then
+                Result := Result + 's';
+            end;
+{$endif arm}
+{$ifdef aarch64}
+        top_indexedreg:
+          with Oper^ do
+            Result := gas_regname(indexedreg)+'['+tostr(regindex)+']';
+{$endif aarch64}
+        top_conditioncode:
+          Result := cond2str[Oper^.cc];
+
+        top_realconst:
+          Result := '#' + realtostr(Oper^.val_real);
+
+        top_shifterop:
+          with Oper^.shifterop^ do
+            begin
+{$ifdef arm}
+              if shiftmode = SM_RRX then
+                begin
+                  Result := 'rrx'; { Implicit value of 1 }
+                  Exit;
+                end;
+              Result := gas_shiftmode2str[shiftmode] + ' ';
+              if rs <> NR_NO then
+                Result := Result + gas_regname(rs)
+              else
+                Result := Result + '#' + tostr(shiftimm);
+{$endif arm}
+{$ifdef aarch64}
+              Result := gas_shiftmode2str[shiftmode] + ' #' + tostr(shiftimm);
+{$endif aarch64}
+            end;
+        else
+          Result := inherited XMLFormatOp(Oper);
+      end;
+    end;
+
+
+  procedure TArmGenAsmNode.XMLProcessInstruction(var T: Text; p: tai);
+    var
+      ThisOp, ThisOper: string;
+      X: Integer;
+    begin
+      if p.typ = ait_instruction then
+        begin
+          ThisOp := gas_op2str[taicpu(p).opcode] + cond2str[taicpu(p).condition] + oppostfix2str[taicpu(p).oppostfix];
+
+          { Pad the opcode with spaces so the succeeding operands are aligned }
+          XMLPadString(ThisOp, 7);
+
+          Write(T, PrintNodeIndention, '  ', ThisOp); { Extra indentation to account for label formatting }
+          for X := 0 to taicpu(p).ops - 1 do
+            begin
+              Write(T, ' ');
+
+              ThisOper := XMLFormatOp(taicpu(p).oper[X]);
+              if X < taicpu(p).ops - 1 then
+                begin
+                  ThisOper := ThisOper + ',';
+
+                  XMLPadString(ThisOper, 4);
+                end;
+
+              Write(T, ThisOper);
+            end;
+          WriteLn(T);
+        end
+      else
+        inherited XMLProcessInstruction(T, p);
+    end;
+
+
+  procedure TArmGenAsmNode.XMLPrintNodeData(var T: Text);
+    var
+      hp: tai;
+    begin
+      if not Assigned(p_asm) then
+        Exit;
+
+      hp := tai(p_asm.First);
+      while Assigned(hp) do
+        begin
+          XMLProcessInstruction(T, hp);
+          hp := tai(hp.Next);
+        end;
+    end;
+{$endif DEBUG_NODE_XML}
+
+initialization
+  casmnode := TArmGenAsmNode;
+
+end.
+

+ 8 - 0
compiler/assemble.pas

@@ -2555,12 +2555,16 @@ Implementation
                      s:='A';
                      s:='A';
                      eabi_section.write(s[1],1);
                      eabi_section.write(s[1],1);
                      ddword:=eabi_section.Size-1;
                      ddword:=eabi_section.Size-1;
+                     if source_info.endian<>target_info.endian then
+                       ddword:=SwapEndian(ddword);
                      eabi_section.write(ddword,4);
                      eabi_section.write(ddword,4);
                      s:='aeabi'#0;
                      s:='aeabi'#0;
                      eabi_section.write(s[1],6);
                      eabi_section.write(s[1],6);
                      s:=#1;
                      s:=#1;
                      eabi_section.write(s[1],1);
                      eabi_section.write(s[1],1);
                      ddword:=eabi_section.Size-1-4-6-1;
                      ddword:=eabi_section.Size-1-4-6-1;
+                     if source_info.endian<>target_info.endian then
+                       ddword:=SwapEndian(ddword);
                      eabi_section.write(ddword,4);
                      eabi_section.write(ddword,4);
                    end;
                    end;
                  leblen:=EncodeUleb128(tai_eabi_attribute(hp).tag,lebbuf,0);
                  leblen:=EncodeUleb128(tai_eabi_attribute(hp).tag,lebbuf,0);
@@ -2588,9 +2592,13 @@ Implementation
                  TmpDataPos:=eabi_section.Data.Pos;
                  TmpDataPos:=eabi_section.Data.Pos;
                  eabi_section.Data.seek(1);
                  eabi_section.Data.seek(1);
                  ddword:=eabi_section.Size-1;
                  ddword:=eabi_section.Size-1;
+                 if source_info.endian<>target_info.endian then
+                   ddword:=SwapEndian(ddword);
                  eabi_section.Data.write(ddword,4);
                  eabi_section.Data.write(ddword,4);
                  eabi_section.Data.seek(12);
                  eabi_section.Data.seek(12);
                  ddword:=eabi_section.Size-1-4-6;
                  ddword:=eabi_section.Size-1-4-6;
+                 if source_info.endian<>target_info.endian then
+                   ddword:=SwapEndian(ddword);
                  eabi_section.Data.write(ddword,4);
                  eabi_section.Data.write(ddword,4);
                  eabi_section.Data.Seek(TmpDataPos);
                  eabi_section.Data.Seek(TmpDataPos);
                end;
                end;

+ 0 - 28
compiler/avr/cgcpu.pas

@@ -93,7 +93,6 @@ unit cgcpu;
         procedure a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);override;
         procedure a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);override;
 
 
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);override;
         procedure g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);override;
-        procedure g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
 
 
         procedure g_overflowcheck(list: TAsmList; const l: tlocation; def: tdef); override;
         procedure g_overflowcheck(list: TAsmList; const l: tlocation; def: tdef); override;
         procedure g_overflowCheck_loc(List: TAsmList; const Loc: TLocation; def: TDef; ovloc: tlocation); override;
         procedure g_overflowCheck_loc(List: TAsmList; const Loc: TLocation; def: TDef; ovloc: tlocation); override;
@@ -2657,33 +2656,6 @@ unit cgcpu;
       end;
       end;
 
 
 
 
-    procedure tcgavr.g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
-      var
-        paraloc1,paraloc2,paraloc3 : TCGPara;
-        pd : tprocdef;
-      begin
-        pd:=search_system_proc('MOVE');
-        paraloc1.init;
-        paraloc2.init;
-        paraloc3.init;
-        paramanager.getcgtempparaloc(list,pd,1,paraloc1);
-        paramanager.getcgtempparaloc(list,pd,2,paraloc2);
-        paramanager.getcgtempparaloc(list,pd,3,paraloc3);
-        a_load_const_cgpara(list,OS_SINT,len,paraloc3);
-        a_loadaddr_ref_cgpara(list,dest,paraloc2);
-        a_loadaddr_ref_cgpara(list,source,paraloc1);
-        paramanager.freecgpara(list,paraloc3);
-        paramanager.freecgpara(list,paraloc2);
-        paramanager.freecgpara(list,paraloc1);
-        alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        a_call_name_static(list,'FPC_MOVE');
-        dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
-        paraloc3.done;
-        paraloc2.done;
-        paraloc1.done;
-      end;
-
-
     procedure tcgavr.g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);
     procedure tcgavr.g_concatcopy(list : TAsmList;const source,dest : treference;len : tcgint);
       var
       var
         countreg,tmpreg,tmpreg2: tregister;
         countreg,tmpreg,tmpreg2: tregister;

+ 7 - 3
compiler/avr/navrinl.pas

@@ -40,7 +40,7 @@ unit navrinl;
   implementation
   implementation
 
 
     uses
     uses
-      verbose,
+      verbose,globtype,globals,
       constexp,
       constexp,
       compinnr,
       compinnr,
       aasmdata,
       aasmdata,
@@ -57,19 +57,23 @@ unit navrinl;
       var
       var
         hl: TAsmLabel;
         hl: TAsmLabel;
         size: TCgSize;
         size: TCgSize;
+        dummyloc: tlocation;
       begin
       begin
         secondpass(left);
         secondpass(left);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
 
 
         location:=left.location;
         location:=left.location;
-        location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
+        location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
 
 
-        size:=def_cgsize(left.resultdef);
+        size:=def_cgsize(resultdef);
 
 
         current_asmdata.getjumplabel(hl);
         current_asmdata.getjumplabel(hl);
         cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,size,OC_GTE,0,left.location.register,hl);
         cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,size,OC_GTE,0,left.location.register,hl);
         cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,size,left.location.register,location.register);
         cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,size,left.location.register,location.register);
 
 
+        if cs_check_overflow in current_settings.localswitches then
+          cg.g_overflowcheck(current_asmdata.CurrAsmList,dummyloc,resultdef);
+
         cg.a_label(current_asmdata.CurrAsmList,hl);
         cg.a_label(current_asmdata.CurrAsmList,hl);
       end;
       end;
 
 

+ 14 - 0
compiler/cgbase.pas

@@ -511,6 +511,8 @@ interface
     function double_array_cgsize(const a: tcgint): tcgsize;{$ifdef USEINLINE}inline;{$endif}
     function double_array_cgsize(const a: tcgint): tcgsize;{$ifdef USEINLINE}inline;{$endif}
 
 
     function tcgsize2str(cgsize: tcgsize):string;
     function tcgsize2str(cgsize: tcgsize):string;
+    function topcg2str(opcg: topcg):string;
+    function topcmp2str(opcmp: topcmp):string;
 
 
     { return the inverse condition of opcmp }
     { return the inverse condition of opcmp }
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
@@ -873,6 +875,18 @@ implementation
       end;
       end;
 
 
 
 
+    function topcg2str(opcg: topcg):string;
+      begin
+        Str(opcg, Result);
+      end;
+
+
+    function topcmp2str(opcmp: topcmp):string;
+      begin
+        Str(opcmp, Result);
+      end;
+
+
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
       const
       const
         list: array[TOpCmp] of TOpCmp =
         list: array[TOpCmp] of TOpCmp =

+ 35 - 0
compiler/cgobj.pas

@@ -372,6 +372,14 @@ unit cgobj;
           procedure optimize_op_const(size: TCGSize; var op: topcg; var a : tcgint);virtual;
           procedure optimize_op_const(size: TCGSize; var op: topcg; var a : tcgint);virtual;
 
 
 
 
+          {# This emits code to copy len bytes from the source using the move procedure
+
+             @param(source Source reference of copy)
+             @param(dest Destination reference of copy)
+
+          }
+          procedure g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);virtual;
+
           {# This should emit the opcode to copy len bytes from the source
           {# This should emit the opcode to copy len bytes from the source
              to destination.
              to destination.
 
 
@@ -2660,6 +2668,33 @@ implementation
       end;
       end;
 
 
 
 
+    procedure tcg.g_concatcopy_move(list : TAsmList;const source,dest : treference;len : tcgint);
+      var
+        paraloc1,paraloc2,paraloc3 : TCGPara;
+        pd : tprocdef;
+      begin
+        pd:=search_system_proc('MOVE');
+        paraloc1.init;
+        paraloc2.init;
+        paraloc3.init;
+        paramanager.getcgtempparaloc(list,pd,1,paraloc1);
+        paramanager.getcgtempparaloc(list,pd,2,paraloc2);
+        paramanager.getcgtempparaloc(list,pd,3,paraloc3);
+        a_load_const_cgpara(list,OS_SINT,len,paraloc3);
+        a_loadaddr_ref_cgpara(list,dest,paraloc2);
+        a_loadaddr_ref_cgpara(list,source,paraloc1);
+        paramanager.freecgpara(list,paraloc3);
+        paramanager.freecgpara(list,paraloc2);
+        paramanager.freecgpara(list,paraloc1);
+        allocallcpuregisters(list);
+        a_call_name(list,'FPC_MOVE',false);
+        deallocallcpuregisters(list);
+        paraloc3.done;
+        paraloc2.done;
+        paraloc1.done;
+      end;
+
+
     procedure tcg.g_concatcopy_unaligned(list : TAsmList;const source,dest : treference;len : tcgint);
     procedure tcg.g_concatcopy_unaligned(list : TAsmList;const source,dest : treference;len : tcgint);
       begin
       begin
         g_concatcopy(list,source,dest,len);
         g_concatcopy(list,source,dest,len);

+ 2 - 2
compiler/comphook.pas

@@ -183,7 +183,7 @@ begin
 end;
 end;
 
 
 type
 type
-  TOutputColor = (oc_black,oc_red,oc_green,oc_orange,og_blue,oc_magenta,oc_cyan,oc_lightgray);
+  TOutputColor = (oc_black,oc_red,oc_green,oc_orange,oc_blue,oc_magenta,oc_cyan,oc_lightgray);
 
 
 procedure WriteColoredOutput(var t: Text;color: TOutputColor;const s : AnsiString);
 procedure WriteColoredOutput(var t: Text;color: TOutputColor;const s : AnsiString);
   begin
   begin
@@ -198,7 +198,7 @@ procedure WriteColoredOutput(var t: Text;color: TOutputColor;const s : AnsiStrin
              write(t,#27'[1m'#27'[32m');
              write(t,#27'[1m'#27'[32m');
            oc_orange:
            oc_orange:
              write(t,#27'[1m'#27'[33m');
              write(t,#27'[1m'#27'[33m');
-           og_blue:
+           oc_blue:
              write(t,#27'[1m'#27'[34m');
              write(t,#27'[1m'#27'[34m');
            oc_magenta:
            oc_magenta:
              write(t,#27'[1m'#27'[35m');
              write(t,#27'[1m'#27'[35m');

+ 5 - 1
compiler/compiler.pas

@@ -269,6 +269,7 @@ var
   m : tppumodule;
   m : tppumodule;
 
 
 begin
 begin
+  m:=nil;
   try
   try
     try
     try
        ExceptionMask:=GetExceptionMask;
        ExceptionMask:=GetExceptionMask;
@@ -349,7 +350,10 @@ begin
           { in case of 50 errors, this could cause another exception,
           { in case of 50 errors, this could cause another exception,
             suppress this exception
             suppress this exception
           }
           }
-          Message(general_f_compilation_aborted);
+          if assigned(m) then
+            Message(general_f_compilation_aborted)
+          else
+            Message(general_f_compiler_aborted);
         except
         except
           on ECompilerAbort do
           on ECompilerAbort do
             ;
             ;

+ 6 - 4
compiler/dbgdwarf.pas

@@ -155,7 +155,7 @@ interface
           tvarrec for us (must only pass one element in the last parameter).  }
           tvarrec for us (must only pass one element in the last parameter).  }
         procedure append_attribute(attr: tdwarf_attribute; form: tdwarf_form; const values: array of const);
         procedure append_attribute(attr: tdwarf_attribute; form: tdwarf_form; const values: array of const);
         procedure append_attribute(attr: tdwarf_attribute; form: tdwarf_form; const value: tvarrec);
         procedure append_attribute(attr: tdwarf_attribute; form: tdwarf_form; const value: tvarrec);
-        procedure append_entry(tag : tdwarf_tag;has_children : boolean;data : array of const);
+        procedure append_entry(tag : tdwarf_tag;has_children : boolean;const data : array of const);
         procedure append_block1(attr: tdwarf_attribute; size: aint);
         procedure append_block1(attr: tdwarf_attribute; size: aint);
         procedure append_labelentry(attr : tdwarf_attribute;sym : tasmsymbol);
         procedure append_labelentry(attr : tdwarf_attribute;sym : tasmsymbol);
         procedure append_labelentry_addr_ref(sym : tasmsymbol); virtual;
         procedure append_labelentry_addr_ref(sym : tasmsymbol); virtual;
@@ -943,7 +943,7 @@ implementation
 
 
     { writing the data through a few simply procedures allows to create easily extra information
     { writing the data through a few simply procedures allows to create easily extra information
       for debugging of debug info }
       for debugging of debug info }
-    procedure TDebugInfoDwarf.append_entry(tag : tdwarf_tag;has_children : boolean;data : array of const);
+    procedure TDebugInfoDwarf.append_entry(tag : tdwarf_tag;has_children : boolean;const data : array of const);
       var
       var
         i : longint;
         i : longint;
       begin
       begin
@@ -3048,6 +3048,10 @@ implementation
         { minimum_instruction_length }
         { minimum_instruction_length }
         linelist.concat(tai_const.create_8bit(1));
         linelist.concat(tai_const.create_8bit(1));
 
 
+        { maximum ops per instruction }
+        if dwarf_version>=4 then
+          linelist.concat(tai_const.create_8bit(1));
+
         { default_is_stmt }
         { default_is_stmt }
         linelist.concat(tai_const.create_8bit(1));
         linelist.concat(tai_const.create_8bit(1));
 
 
@@ -3142,8 +3146,6 @@ implementation
 
 
 
 
     procedure TDebugInfoDwarf.inserttypeinfo;
     procedure TDebugInfoDwarf.inserttypeinfo;
-
-
       var
       var
         storefilepos  : tfileposinfo;
         storefilepos  : tfileposinfo;
         lenstartlabel,arangestartlabel: tasmlabel;
         lenstartlabel,arangestartlabel: tasmlabel;

+ 27 - 11
compiler/fmodule.pas

@@ -113,7 +113,6 @@ interface
       public
       public
         is_reset,                 { has reset been called ? }
         is_reset,                 { has reset been called ? }
         do_reload,                { force reloading of the unit }
         do_reload,                { force reloading of the unit }
-        do_compile,               { need to compile the sources }
         sources_avail,            { if all sources are reachable }
         sources_avail,            { if all sources are reachable }
         interface_compiled,       { if the interface section has been parsed/compiled/loaded }
         interface_compiled,       { if the interface section has been parsed/compiled/loaded }
         is_dbginfo_written,
         is_dbginfo_written,
@@ -647,7 +646,6 @@ implementation
         globalmacrosymtable:=nil;
         globalmacrosymtable:=nil;
         localmacrosymtable:=nil;
         localmacrosymtable:=nil;
         do_reload:=false;
         do_reload:=false;
-        do_compile:=false;
         sources_avail:=true;
         sources_avail:=true;
         mainfilepos.line:=0;
         mainfilepos.line:=0;
         mainfilepos.column:=0;
         mainfilepos.column:=0;
@@ -718,6 +716,7 @@ implementation
               end;
               end;
             { release procinfo tree }
             { release procinfo tree }
             tprocinfo(procinfo).destroy_tree;
             tprocinfo(procinfo).destroy_tree;
+            procinfo := nil;
           end;
           end;
         DoneDebugInfo(self,current_debuginfo_reset);
         DoneDebugInfo(self,current_debuginfo_reset);
         used_units.free;
         used_units.free;
@@ -794,6 +793,7 @@ implementation
       var
       var
         i   : longint;
         i   : longint;
         current_debuginfo_reset : boolean;
         current_debuginfo_reset : boolean;
+        m : tmodule;
       begin
       begin
         is_reset:=true;
         is_reset:=true;
         if assigned(scanner) then
         if assigned(scanner) then
@@ -856,6 +856,7 @@ implementation
         llvmmetadatastrings.free;
         llvmmetadatastrings.free;
         llvmmetadatastrings:=TFPHashList.Create;
         llvmmetadatastrings:=TFPHashList.Create;
 {$endif llvm}
 {$endif llvm}
+        ansistrdef:=nil;
         wpoinfo.free;
         wpoinfo.free;
         wpoinfo:=nil;
         wpoinfo:=nil;
         checkforwarddefs.free;
         checkforwarddefs.free;
@@ -904,9 +905,23 @@ implementation
         linkorderedsymbols:=TCmdStrList.Create;
         linkorderedsymbols:=TCmdStrList.Create;
         pendingspecializations.free;
         pendingspecializations.free;
         pendingspecializations:=tfphashobjectlist.create(false);
         pendingspecializations:=tfphashobjectlist.create(false);
+        genericdummysyms.Free;
+        genericdummysyms := tfphashobjectlist.create(true);
+        extendeddefs.Free;
+        extendeddefs:=TFPHashObjectList.Create(true);
         if assigned(waitingforunit) and
         if assigned(waitingforunit) and
           (waitingforunit.count<>0) then
           (waitingforunit.count<>0) then
-          internalerror(2016070501);
+           begin
+           Write(Self.modulename^, ' is reset while still waiting for units: ');
+           for I:=0 to waitingforunit.Count-1 do
+             begin
+             M:=tmodule(waitingforunit.Items[i]);
+             write(m.modulename^,' (state:',M.state,') ');
+
+             end;
+           Writeln;
+           internalerror(2016070501);
+           end;
         waitingforunit.free;
         waitingforunit.free;
         waitingforunit:=tfpobjectlist.create(false);
         waitingforunit:=tfpobjectlist.create(false);
         linkunitofiles.Free;
         linkunitofiles.Free;
@@ -926,7 +941,6 @@ implementation
         stringdispose(mainname);
         stringdispose(mainname);
         FImportLibraryList.Free;
         FImportLibraryList.Free;
         FImportLibraryList:=TFPHashObjectList.Create;
         FImportLibraryList:=TFPHashObjectList.Create;
-        do_compile:=false;
         do_reload:=false;
         do_reload:=false;
         interface_compiled:=false;
         interface_compiled:=false;
         in_interface:=true;
         in_interface:=true;
@@ -1002,6 +1016,8 @@ implementation
     procedure tmodule.flagdependent(callermodule:tmodule);
     procedure tmodule.flagdependent(callermodule:tmodule);
       var
       var
         pm : tdependent_unit;
         pm : tdependent_unit;
+        m : tmodule;
+
       begin
       begin
         { flag all units that depend on this unit for reloading }
         { flag all units that depend on this unit for reloading }
         pm:=tdependent_unit(current_module.dependent_units.first);
         pm:=tdependent_unit(current_module.dependent_units.first);
@@ -1010,16 +1026,16 @@ implementation
            { We do not have to reload the unit that wants to load
            { We do not have to reload the unit that wants to load
              this unit, unless this unit is already compiled during
              this unit, unless this unit is already compiled during
              the loading }
              the loading }
-           if (pm.u=callermodule) and
-              (pm.u.state<ms_compiled) then
-             Message1(unit_u_no_reload_is_caller,pm.u.modulename^)
+           m:=pm.u;
+           if (m=callermodule) and (m.state<ms_compiled) then
+             Message1(unit_u_no_reload_is_caller,m.modulename^)
            else
            else
-            if (pm.u.state=ms_compile) and (pm.u.compilecount>1) then
-              Message1(unit_u_no_reload_in_second_compile,pm.u.modulename^)
+            if (m.state=ms_compile) {and (pm.u.compilecount>1)} then
+              Message1(unit_u_no_reload_in_second_compile,m.modulename^)
            else
            else
             begin
             begin
-              pm.u.do_reload:=true;
-              Message1(unit_u_flag_for_reload,pm.u.modulename^);
+              m.do_reload:=true;
+              Message1(unit_u_flag_for_reload,m.modulename^);
             end;
             end;
            pm:=tdependent_unit(pm.next);
            pm:=tdependent_unit(pm.next);
          end;
          end;

+ 5 - 5
compiler/fpcdefs.inc

@@ -1,9 +1,14 @@
 {$mode objfpc}
 {$mode objfpc}
 {$asmmode default}
 {$asmmode default}
+{$modeswitch advancedrecords}
 {$H-}
 {$H-}
 {$goto on}
 {$goto on}
 {$ifndef DISABLE_INLINE}
 {$ifndef DISABLE_INLINE}
   {$inline on}
   {$inline on}
+  { Inline small functions, but not when EXTDEBUG is used }
+  {$ifndef EXTDEBUG}
+    {$define USEINLINE}
+  {$endif EXTDEBUG}
 {$endif}
 {$endif}
 {$interfaces corba}
 {$interfaces corba}
 
 
@@ -31,11 +36,6 @@
   {$define cpawaremessages}
   {$define cpawaremessages}
 {$endif}
 {$endif}
 
 
-{ Inline small functions, but not when EXTDEBUG is used }
-{$ifndef EXTDEBUG}
-  {$define USEINLINE}
-{$endif EXTDEBUG}
-
 {$ifdef DEBUG_ALL_OPT}
 {$ifdef DEBUG_ALL_OPT}
   { for aopt unit }
   { for aopt unit }
   {$define DEBUG_OPTALLOC}
   {$define DEBUG_OPTALLOC}

+ 81 - 62
compiler/fppu.pas

@@ -44,6 +44,8 @@ interface
 
 
     type
     type
        { tppumodule }
        { tppumodule }
+       TAvailableUnitFile = (auPPU,auSrc);
+       TAvailableUnitFiles = set of TAvailableUnitFile;
 
 
        tppumodule = class(tmodule)
        tppumodule = class(tmodule)
           ppufile    : tcompilerppufile; { the PPU file }
           ppufile    : tcompilerppufile; { the PPU file }
@@ -90,8 +92,8 @@ interface
           function  openppu(ppufiletime:longint):boolean;
           function  openppu(ppufiletime:longint):boolean;
           procedure prepare_second_load(from_module: tmodule);
           procedure prepare_second_load(from_module: tmodule);
           procedure recompile_from_sources(from_module: tmodule);
           procedure recompile_from_sources(from_module: tmodule);
-          function  search_unit_files(loaded_from : tmodule; onlysource:boolean):boolean;
-          function  search_unit(loaded_from : tmodule; onlysource,shortname:boolean):boolean;
+          function  search_unit_files(loaded_from : tmodule; onlysource:boolean):TAvailableUnitFiles;
+          function  search_unit(loaded_from : tmodule; onlysource,shortname:boolean):TAvailableUnitFiles;
           function  loadfrompackage:boolean;
           function  loadfrompackage:boolean;
           procedure load_interface;
           procedure load_interface;
           procedure load_implementation;
           procedure load_implementation;
@@ -438,28 +440,24 @@ var
         Message1(unit_u_ppu_crc,hexstr(ppufile.header.indirect_checksum,8)+' (indc)');
         Message1(unit_u_ppu_crc,hexstr(ppufile.header.indirect_checksum,8)+' (indc)');
         Comment(V_used,'Number of definitions: '+tostr(ppufile.header.deflistsize));
         Comment(V_used,'Number of definitions: '+tostr(ppufile.header.deflistsize));
         Comment(V_used,'Number of symbols: '+tostr(ppufile.header.symlistsize));
         Comment(V_used,'Number of symbols: '+tostr(ppufile.header.symlistsize));
-        do_compile:=false;
         openppu:=true;
         openppu:=true;
       end;
       end;
 
 
 
 
-    function tppumodule.search_unit_files(loaded_from : tmodule; onlysource:boolean):boolean;
+    function tppumodule.search_unit_files(loaded_from : tmodule; onlysource:boolean):TAvailableUnitFiles;
       var
       var
-        found : boolean;
+        found : TAvailableUnitFiles;
       begin
       begin
-        found:=false;
-        if search_unit(loaded_from,onlysource,false) then
-          found:=true;
-        if (not found) and
+        found:=search_unit(loaded_from,onlysource,false);
+        if (found=[]) and
            (ft83 in AllowedFilenameTransFormations) and
            (ft83 in AllowedFilenameTransFormations) and
-           (length(modulename^)>8) and
-           search_unit(loaded_from,onlysource,true) then
-          found:=true;
+           (length(modulename^)>8) then
+           found:=search_unit(loaded_from,onlysource,true);
         search_unit_files:=found;
         search_unit_files:=found;
       end;
       end;
 
 
 
 
-    function tppumodule.search_unit(loaded_from : tmodule; onlysource,shortname:boolean):boolean;
+    function tppumodule.search_unit(loaded_from : tmodule; onlysource,shortname:boolean):TAvailableUnitFiles;
       var
       var
          singlepathstring,
          singlepathstring,
          filename : TCmdStr;
          filename : TCmdStr;
@@ -512,7 +510,6 @@ var
            singlepathstring:=FixPath(s,false);
            singlepathstring:=FixPath(s,false);
          { Check for Sources }
          { Check for Sources }
            ppufile:=nil;
            ppufile:=nil;
-           do_compile:=true;
            recompile_reason:=rr_noppu;
            recompile_reason:=rr_noppu;
          {Check for .pp file}
          {Check for .pp file}
            Found:=UnitExists(sourceext,hs,prefix);
            Found:=UnitExists(sourceext,hs,prefix);
@@ -549,30 +546,32 @@ var
            SourceSearchPath:=Found;
            SourceSearchPath:=Found;
          end;
          end;
 
 
-         Function SearchPath(const s,prefix:TCmdStr):boolean;
+         Function SearchPath(const s,prefix:TCmdStr):TAvailableUnitFiles;
          var
          var
-           found : boolean;
+           found : TAvailableUnitFiles;
          begin
          begin
            { First check for a ppu, then for the source }
            { First check for a ppu, then for the source }
-           found:=false;
+           found:=[];
            if not onlysource then
            if not onlysource then
-            found:=PPUSearchPath(s,prefix);
-           if not found then
-            found:=SourceSearchPath(s,prefix);
+             if PPUSearchPath(s,prefix) then
+               Include(found,auPPU);
+           if found=[] then
+             if SourceSearchPath(s,prefix) then
+              Include(found,auSrc);
            SearchPath:=found;
            SearchPath:=found;
          end;
          end;
 
 
-         Function SearchPathList(list:TSearchPathList;const prefix:TCmdStr):boolean;
+         Function SearchPathList(list:TSearchPathList;const prefix:TCmdStr):TAvailableUnitFiles;
          var
          var
            hp : TCmdStrListItem;
            hp : TCmdStrListItem;
-           found : boolean;
+           found : TAvailableUnitFiles;
          begin
          begin
-           found:=false;
+           found:=[];
            hp:=TCmdStrListItem(list.First);
            hp:=TCmdStrListItem(list.First);
            while assigned(hp) do
            while assigned(hp) do
             begin
             begin
               found:=SearchPath(hp.Str,prefix);
               found:=SearchPath(hp.Str,prefix);
-              if found then
+              if found<>[] then
                break;
                break;
               hp:=TCmdStrListItem(hp.next);
               hp:=TCmdStrListItem(hp.next);
             end;
             end;
@@ -588,34 +587,38 @@ var
             result:=PPUSearchPath(main_module.Path,prefix);
             result:=PPUSearchPath(main_module.Path,prefix);
          end;
          end;
 
 
-         function SearchSourcePaths(const prefix:TCmdStr):boolean;
+         function SearchSourcePaths(const prefix:TCmdStr):TAvailableUnitFiles;
          begin
          begin
-           result:=SourceSearchPath('.',prefix);
-           if (not result) and Assigned(main_module) and (main_module.Path<>'') then
-             result:=SourceSearchPath(main_module.Path,prefix);
-           if (not result) and Assigned(loaded_from) then
+           result:=[];
+           if SourceSearchPath('.',prefix) then
+              include(Result,auSrc);
+           if (result=[]) and Assigned(main_module) and (main_module.Path<>'') then
+             if SourceSearchPath(main_module.Path,prefix) then
+              include(Result,auSrc);
+           if (result=[]) and Assigned(loaded_from) then
              result:=SearchPathList(loaded_from.LocalUnitSearchPath,prefix);
              result:=SearchPathList(loaded_from.LocalUnitSearchPath,prefix);
-           if not result then
+           if (result=[]) then
              result:=SearchPathList(UnitSearchPath,prefix);
              result:=SearchPathList(UnitSearchPath,prefix);
          end;
          end;
 
 
-         function SearchNamespaceList(const prefixes:TCmdStrList):boolean;
+         function SearchNamespaceList(const prefixes:TCmdStrList): TAvailableUnitFiles;
          var
          var
            nsitem : TCmdStrListItem;
            nsitem : TCmdStrListItem;
-           res : Boolean;
+           res : TAvailableUnitFiles;
          begin
          begin
-           res:=false;
+           res:=[];
            nsitem:=TCmdStrListItem(prefixes.first);
            nsitem:=TCmdStrListItem(prefixes.first);
            while assigned(nsitem) do
            while assigned(nsitem) do
              begin
              begin
                if not onlysource then
                if not onlysource then
                  begin
                  begin
-                   res:=SearchPPUPaths(nsitem.str);
-                   if res then
+                   if SearchPPUPaths(nsitem.str) then
+                     Include(res,auPPU);
+                   if res<>[] then
                      break;
                      break;
                  end;
                  end;
                res:=SearchSourcePaths(nsitem.str);
                res:=SearchSourcePaths(nsitem.str);
-               if res then
+               if res<>[] then
                  break;
                  break;
                nsitem:=TCmdStrListItem(nsitem.next);
                nsitem:=TCmdStrListItem(nsitem.next);
              end;
              end;
@@ -626,9 +629,10 @@ var
 
 
 
 
        var
        var
-         fnd : boolean;
+         fnd : TAvailableUnitFiles;
          hs : TPathStr;
          hs : TPathStr;
        begin
        begin
+         fnd:=[];
          if shortname then
          if shortname then
           filename:=FixFileName(Copy(realmodulename^,1,8))
           filename:=FixFileName(Copy(realmodulename^,1,8))
          else
          else
@@ -644,46 +648,49 @@ var
             8. global unit pathlist
             8. global unit pathlist
             9. for each default namespace:
             9. for each default namespace:
                   repeat 1 - 3 and 5 - 8 with namespace as prefix }
                   repeat 1 - 3 and 5 - 8 with namespace as prefix }
-         fnd:=false;
          if not onlysource then
          if not onlysource then
-            fnd:=SearchPPUPaths('');
-         if (not fnd) and (sourcefn<>'') then
+           if SearchPPUPaths('') then
+             include(fnd,auPPU);
+         if (fnd=[]) and (sourcefn<>'') then
           begin
           begin
             { the full filename is specified so we can't use here the
             { the full filename is specified so we can't use here the
               searchpath (PFV) }
               searchpath (PFV) }
             if CheckVerbosity(V_Tried) then
             if CheckVerbosity(V_Tried) then
               Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,sourceext));
               Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,sourceext));
-            fnd:=FindFile(ChangeFileExt(sourcefn,sourceext),'',true,hs);
-            if not fnd then
+            if FindFile(ChangeFileExt(sourcefn,sourceext),'',true,hs) then
+              include(fnd,auSrc);
+            if (fnd=[]) then
              begin
              begin
                if CheckVerbosity(V_Tried) then
                if CheckVerbosity(V_Tried) then
                  Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pasext));
                  Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pasext));
-               fnd:=FindFile(ChangeFileExt(sourcefn,pasext),'',true,hs);
+               if FindFile(ChangeFileExt(sourcefn,pasext),'',true,hs) then
+                 include(fnd,auSrc);
              end;
              end;
-            if not fnd and
+            if (fnd=[]) and
                ((m_mac in current_settings.modeswitches) or
                ((m_mac in current_settings.modeswitches) or
                 (tf_p_ext_support in target_info.flags)) then
                 (tf_p_ext_support in target_info.flags)) then
              begin
              begin
                if CheckVerbosity(V_Tried) then
                if CheckVerbosity(V_Tried) then
                  Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pext));
                  Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,pext));
-               fnd:=FindFile(ChangeFileExt(sourcefn,pext),'',true,hs);
+               if FindFile(ChangeFileExt(sourcefn,pext),'',true,hs) then
+                include(fnd,auSrc)
              end;
              end;
-            if fnd then
+            if [auSrc]=fnd then
              begin
              begin
                sources_avail:=true;
                sources_avail:=true;
-               do_compile:=true;
+               state:=ms_compile;
                recompile_reason:=rr_noppu;
                recompile_reason:=rr_noppu;
                mainsource:=hs;
                mainsource:=hs;
                SetFileName(hs,false);
                SetFileName(hs,false);
              end;
              end;
           end;
           end;
-         if not fnd then
+         if fnd=[] then
            begin
            begin
              fnd:=SearchSourcePaths('');
              fnd:=SearchSourcePaths('');
              // current_namespacelist is set to the current module's namespacelist.
              // current_namespacelist is set to the current module's namespacelist.
-             if not fnd and assigned(current_namespacelist) and (current_namespacelist.count>0) then
+             if (fnd=[]) and assigned(current_namespacelist) and (current_namespacelist.count>0) then
                fnd:=SearchNameSpaceList(current_namespacelist);
                fnd:=SearchNameSpaceList(current_namespacelist);
-             if not fnd and (namespacelist.count>0) then
+             if (fnd=[]) and (namespacelist.count>0) then
                fnd:=SearchNameSpaceList(namespacelist);
                fnd:=SearchNameSpaceList(namespacelist);
            end;
            end;
          search_unit:=fnd;
          search_unit:=fnd;
@@ -784,6 +791,7 @@ var
         i : longint;
         i : longint;
         deref : pderef;
         deref : pderef;
       begin
       begin
+        unitimportsymsderefs.capacity:=unitimportsymsderefs.count+unitimportsyms.count;
         for i:=0 to unitimportsyms.count-1 do
         for i:=0 to unitimportsyms.count-1 do
           begin
           begin
             new(deref);
             new(deref);
@@ -798,6 +806,7 @@ var
         i : longint;
         i : longint;
         sym : tsym;
         sym : tsym;
       begin
       begin
+        unitimportsyms.capacity:=unitimportsyms.count+unitimportsymsderefs.count;
         for i:=0 to unitimportsymsderefs.count-1 do
         for i:=0 to unitimportsymsderefs.count-1 do
           begin
           begin
             sym:=tsym(pderef(unitimportsymsderefs[i])^.resolve);
             sym:=tsym(pderef(unitimportsymsderefs[i])^.resolve);
@@ -1256,7 +1265,7 @@ var
                       if (orgfiletime<>-1) and
                       if (orgfiletime<>-1) and
                          (source_time<>orgfiletime) then
                          (source_time<>orgfiletime) then
                         begin
                         begin
-                          do_compile:=true;
+                          state:=ms_compile;
                           recompile_reason:=rr_sourcenewer;
                           recompile_reason:=rr_sourcenewer;
                           Message2(unit_u_source_modified,hs,ppufilename,@queuecomment);
                           Message2(unit_u_source_modified,hs,ppufilename,@queuecomment);
                           temp:=temp+' *';
                           temp:=temp+' *';
@@ -1292,7 +1301,7 @@ var
         available }
         available }
         if do_build and sources_avail then
         if do_build and sources_avail then
           begin
           begin
-             do_compile:=true;
+             state:=ms_compile;
              recompile_reason:=rr_build;
              recompile_reason:=rr_build;
           end;
           end;
       end;
       end;
@@ -1572,7 +1581,7 @@ var
              Message1(unit_f_ppu_invalid_entry,tostr(b));
              Message1(unit_f_ppu_invalid_entry,tostr(b));
            end;
            end;
            { we can already stop when we know that we must recompile }
            { we can already stop when we know that we must recompile }
-           if do_compile then
+           if state=ms_compile then
              exit;
              exit;
          until false;
          until false;
       end;
       end;
@@ -1969,7 +1978,7 @@ var
                    Comment(V_Normal,'  implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
                    Comment(V_Normal,'  implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
 {$endif DEBUG_UNIT_CRC_CHANGES}
 {$endif DEBUG_UNIT_CRC_CHANGES}
                  recompile_reason:=rr_crcchanged;
                  recompile_reason:=rr_crcchanged;
-                 do_compile:=true;
+                 state:=ms_compile;
                  exit;
                  exit;
                end;
                end;
             end;
             end;
@@ -2022,7 +2031,7 @@ var
                     Comment(V_Normal,'  indcrc change (2): '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^);
                     Comment(V_Normal,'  indcrc change (2): '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^);
 {$endif DEBUG_UNIT_CRC_CHANGES}
 {$endif DEBUG_UNIT_CRC_CHANGES}
                   recompile_reason:=rr_crcchanged;
                   recompile_reason:=rr_crcchanged;
-                  do_compile:=true;
+                  state:=ms_compile;
                   exit;
                   exit;
                 end;
                 end;
             end;
             end;
@@ -2192,7 +2201,6 @@ var
             begin
             begin
               Message1(unit_u_second_compile_unit,modulename^);
               Message1(unit_u_second_compile_unit,modulename^);
               state:=ms_compile;
               state:=ms_compile;
-              do_compile:=true;
             end
             end
           else
           else
             state:=ms_load;
             state:=ms_load;
@@ -2202,15 +2210,18 @@ var
 
 
       begin
       begin
         Message1(unit_u_loading_unit,modulename^);
         Message1(unit_u_loading_unit,modulename^);
-        search_unit_files(from_module,false);
-        if not do_compile then
+        if auPPU in search_unit_files(from_module,false) then
+          state:=ms_load
+        else
+          state:=ms_compile;
+        if not (state=ms_compile) then
          begin
          begin
            load_interface;
            load_interface;
            setdefgeneration;
            setdefgeneration;
-           if not do_compile then
+           if not (state=ms_compile) then
             begin
             begin
               load_usedunits;
               load_usedunits;
-              if not do_compile then
+              if not (state=ms_compile) then
                 Message1(unit_u_finished_loading_unit,modulename^);
                 Message1(unit_u_finished_loading_unit,modulename^);
             end;
             end;
          end;
          end;
@@ -2296,6 +2307,7 @@ var
         second_time        : boolean;
         second_time        : boolean;
 
 
       begin
       begin
+
         Result:=false;
         Result:=false;
         Message3(unit_u_load_unit,from_module.modulename^,
         Message3(unit_u_load_unit,from_module.modulename^,
                  ImplIntf[from_module.in_interface],
                  ImplIntf[from_module.in_interface],
@@ -2327,6 +2339,13 @@ var
         { loading the unit for a second time? }
         { loading the unit for a second time? }
         if state=ms_registered then
         if state=ms_registered then
           state:=ms_load
           state:=ms_load
+        else if (state in [ms_compile, ms_compiling_waitintf]) then
+          begin
+          { no use continuing if we must be compiled }
+          // but we still need to restore current_module!
+          set_current_module(from_module);
+          exit(false)
+          end
         else
         else
           begin
           begin
             second_time:=true;
             second_time:=true;
@@ -2343,11 +2362,11 @@ var
 
 
         { try to opening ppu, skip this when we already
         { try to opening ppu, skip this when we already
           know that we need to compile the unit }
           know that we need to compile the unit }
-        if not do_compile then
+        if not (state=ms_compile) then
           try_load_ppufile(from_module);
           try_load_ppufile(from_module);
 
 
         { Do we need to recompile the unit }
         { Do we need to recompile the unit }
-        if do_compile then
+        if (state=ms_compile) then
           recompile_from_sources(from_module)
           recompile_from_sources(from_module)
         else
         else
           state:=ms_compiled;
           state:=ms_compiled;

+ 1 - 1
compiler/htypechk.pas

@@ -1828,7 +1828,7 @@ implementation
              blockn,
              blockn,
              calln :
              calln :
                begin
                begin
-                 if (hp.nodetype=calln) or
+                 if ((hp.nodetype=calln) and not(is_void(hp.resultdef))) or
                     (nf_no_lvalue in hp.flags) then
                     (nf_no_lvalue in hp.flags) then
                    begin
                    begin
                      { Temp strings are stored in memory, for compatibility with
                      { Temp strings are stored in memory, for compatibility with

+ 24 - 22
compiler/i386/cpuinfo.pas

@@ -182,7 +182,7 @@ Const
 
 
    level1optimizerswitches = genericlevel1optimizerswitches;
    level1optimizerswitches = genericlevel1optimizerswitches;
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
    level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
-     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
+     [{$ifndef llvm}cs_opt_regvar,{$endif}cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse,cs_opt_consts];
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches;
    level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches;
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [cs_useebp];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [cs_useebp];
 
 
@@ -220,17 +220,19 @@ type
 
 
    { Instruction optimisation hints }
    { Instruction optimisation hints }
    TCPUOptimizeFlags =
    TCPUOptimizeFlags =
-      (CPUX86_HINT_FAST_BT_REG_IMM,  { BT instructions with register source and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BT_REG_REG,  { BT instructions with register source and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BTX_REG_IMM, { BTC/R/S instructions with register source and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BTX_REG_REG, { BTC/R/S instructions with register source and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BT_MEM_IMM,  { BT instructions with memory sources and inmediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BT_MEM_REG,  { BT instructions with memory sources and register indices and a register index are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BTX_MEM_IMM, { BTC/R/S instructions with memory sources and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BTX_MEM_REG, { BTC/R/S instructions with memory sources and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_XCHG,        { XCHG %reg,%reg executes in 2 cycles or fewer }
-       CPUX86_HINT_FAST_PDEP_PEXT,   { The BMI2 instructions PDEP and PEXT execute in a single cycle }
-       CPUX86_HINT_FAST_3COMP_ADDR   { A 3-component address (base, index and offset) has the same latency as the 2-component version (most notable with LEA instructions) }
+      (CPUX86_HINT_FAST_BT_REG_IMM,            { BT instructions with register source and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BT_REG_REG,            { BT instructions with register source and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BTX_REG_IMM,           { BTC/R/S instructions with register source and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BTX_REG_REG,           { BTC/R/S instructions with register source and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BT_MEM_IMM,            { BT instructions with memory sources and inmediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BT_MEM_REG,            { BT instructions with memory sources and register indices and a register index are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BTX_MEM_IMM,           { BTC/R/S instructions with memory sources and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BTX_MEM_REG,           { BTC/R/S instructions with memory sources and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_XCHG,                  { XCHG %reg,%reg executes in 2 cycles or fewer }
+       CPUX86_HINT_FAST_PDEP_PEXT,             { The BMI2 instructions PDEP and PEXT execute in a single cycle }
+       CPUX86_HINT_FAST_3COMP_ADDR,            { A 3-component address (base, index and offset) has the same latency as the 2-component version (most notable with LEA instructions) }
+       CPUX86_HINT_FAST_SHORT_REP_MOVS,        { short rep movs instruction }
+       CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1  { BSR/F does not change the destination if ZF is set }
       );
       );
 
 
  const
  const
@@ -284,19 +286,19 @@ type
      { cpu_Pentium4  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM],
      { cpu_Pentium4  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM],
      { cpu_PentiumM  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
      { cpu_PentiumM  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
      { cpu_core_i    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
      { cpu_core_i    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_bobcat    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
+     { cpu_bobcat    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
      { cpu_core_avx  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG], { From Sandy Bridge up to Ice Lake, complex LEA instructions are much slower }
      { cpu_core_avx  } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG], { From Sandy Bridge up to Ice Lake, complex LEA instructions are much slower }
-     { cpu_jaguar    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_piledriver} [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_excavator } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
+     { cpu_jaguar    } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
+     { cpu_piledriver} [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
+     { cpu_excavator } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
      { cpu_core_avx2 } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT],
      { cpu_core_avx2 } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT],
-     { cpu_zen       } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_zen2      } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR],
+     { cpu_zen       } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
+     { cpu_zen2      } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1],
      { cpu_skylake_x } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR],
      { cpu_skylake_x } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_icelake   } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_icelake_client } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_icelake_server } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR],
-     { cpu_zen3      } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR]
+     { cpu_icelake   } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_FAST_SHORT_REP_MOVS],
+     { cpu_icelake_client } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_FAST_SHORT_REP_MOVS],
+     { cpu_icelake_server } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_FAST_SHORT_REP_MOVS],
+     { cpu_zen3      } [CPUX86_HINT_FAST_BT_REG_IMM,CPUX86_HINT_FAST_BTX_REG_IMM,CPUX86_HINT_FAST_BT_MEM_IMM,CPUX86_HINT_FAST_XCHG,CPUX86_HINT_FAST_PDEP_PEXT,CPUX86_HINT_FAST_3COMP_ADDR,CPUX86_HINT_FAST_SHORT_REP_MOVS,CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1]
    );
    );
 
 
 Implementation
 Implementation

+ 1 - 0
compiler/i386/cpunode.pas

@@ -45,6 +45,7 @@ unit cpunode;
          the processor specific nodes must be included
          the processor specific nodes must be included
          after the generic one (FK)
          after the generic one (FK)
        }
        }
+       nx86bas,
        nx86set,
        nx86set,
        nx86con,
        nx86con,
        nx86cnv,
        nx86cnv,

+ 7 - 0
compiler/i386/cputarg.pas

@@ -107,9 +107,16 @@ implementation
       ,agx86int
       ,agx86int
     {$endif}
     {$endif}
 
 
+    {$ifndef NOOGCOFF}
       ,ogcoff
       ,ogcoff
+    {$endif}
+    {$ifndef NOOGELF}
       ,ogelf
       ,ogelf
       ,cpuelf
       ,cpuelf
+    {$endif}
+    {$ifndef NOOGMACHO}
+      ,ogmacho
+    {$endif}
 
 
 {**************************************
 {**************************************
         Assembler Readers
         Assembler Readers

+ 9 - 1
compiler/i386/i386att.inc

@@ -254,7 +254,7 @@
 'pmaddwd',
 'pmaddwd',
 'pmagw',
 'pmagw',
 'pmulhriw',
 'pmulhriw',
-'pmulhrwa',
+'pmulhrw',
 'pmulhrwc',
 'pmulhrwc',
 'pmulhw',
 'pmulhw',
 'pmullw',
 'pmullw',
@@ -686,6 +686,10 @@
 'rdtscp',
 'rdtscp',
 'movbe',
 'movbe',
 'pclmulqdq',
 'pclmulqdq',
+'pclmullqlqdq',
+'pclmulhqlqdq',
+'pclmullqhqdq',
+'pclmulhqhqdq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -879,6 +883,10 @@
 'vpblendvb',
 'vpblendvb',
 'vpblendw',
 'vpblendw',
 'vpclmulqdq',
 'vpclmulqdq',
+'vpclmullqlqdq',
+'vpclmulhqlqdq',
+'vpclmullqhqdq',
+'vpclmulhqhqdq',
 'vpcmpeqb',
 'vpcmpeqb',
 'vpcmpeqd',
 'vpcmpeqd',
 'vpcmpeqq',
 'vpcmpeqq',

+ 8 - 0
compiler/i386/i386atts.inc

@@ -781,6 +781,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufMMX,
 attsufMMX,
 attsufMMX,
 attsufMMX,
 attsufNONE,
 attsufNONE,
@@ -1025,6 +1029,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,

+ 9 - 1
compiler/i386/i386int.inc

@@ -254,7 +254,7 @@
 'pmaddwd',
 'pmaddwd',
 'pmagw',
 'pmagw',
 'pmulhriw',
 'pmulhriw',
-'pmulhrwa',
+'pmulhrw',
 'pmulhrwc',
 'pmulhrwc',
 'pmulhw',
 'pmulhw',
 'pmullw',
 'pmullw',
@@ -686,6 +686,10 @@
 'rdtscp',
 'rdtscp',
 'movbe',
 'movbe',
 'pclmulqdq',
 'pclmulqdq',
+'pclmullqlqdq',
+'pclmulhqlqdq',
+'pclmullqhqdq',
+'pclmulhqhqdq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -879,6 +883,10 @@
 'vpblendvb',
 'vpblendvb',
 'vpblendw',
 'vpblendw',
 'vpclmulqdq',
 'vpclmulqdq',
+'vpclmullqlqdq',
+'vpclmulhqlqdq',
+'vpclmullqhqdq',
+'vpclmulhqhqdq',
 'vpcmpeqb',
 'vpcmpeqb',
 'vpcmpeqd',
 'vpcmpeqd',
 'vpcmpeqq',
 'vpcmpeqq',

+ 1 - 1
compiler/i386/i386nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
 { don't edit, this file is generated from x86ins.dat }
-4171;
+4187;

+ 9 - 1
compiler/i386/i386op.inc

@@ -254,7 +254,7 @@ A_PMACHRIW,
 A_PMADDWD,
 A_PMADDWD,
 A_PMAGW,
 A_PMAGW,
 A_PMULHRIW,
 A_PMULHRIW,
-A_PMULHRWA,
+A_PMULHRW,
 A_PMULHRWC,
 A_PMULHRWC,
 A_PMULHW,
 A_PMULHW,
 A_PMULLW,
 A_PMULLW,
@@ -686,6 +686,10 @@ A_AESKEYGENASSIST,
 A_RDTSCP,
 A_RDTSCP,
 A_MOVBE,
 A_MOVBE,
 A_PCLMULQDQ,
 A_PCLMULQDQ,
+A_PCLMULLQLQDQ,
+A_PCLMULHQLQDQ,
+A_PCLMULLQHQDQ,
+A_PCLMULHQHQDQ,
 A_VADDPD,
 A_VADDPD,
 A_VADDPS,
 A_VADDPS,
 A_VADDSD,
 A_VADDSD,
@@ -879,6 +883,10 @@ A_VPAVGW,
 A_VPBLENDVB,
 A_VPBLENDVB,
 A_VPBLENDW,
 A_VPBLENDW,
 A_VPCLMULQDQ,
 A_VPCLMULQDQ,
+A_VPCLMULLQLQDQ,
+A_VPCLMULHQLQDQ,
+A_VPCLMULLQHQDQ,
+A_VPCLMULHQHQDQ,
 A_VPCMPEQB,
 A_VPCMPEQB,
 A_VPCMPEQD,
 A_VPCMPEQD,
 A_VPCMPEQQ,
 A_VPCMPEQQ,

+ 50 - 42
compiler/i386/i386prop.inc

@@ -685,7 +685,11 @@
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
-(Ch: [Ch_Mop3, Ch_Rop2]),
+(Ch: [Ch_Mop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -891,6 +895,10 @@
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2]),
 (Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -945,7 +953,7 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
@@ -1027,10 +1035,10 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
@@ -1359,28 +1367,28 @@
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Mop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Mop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
@@ -1399,10 +1407,10 @@
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
@@ -1423,18 +1431,18 @@
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),

+ 114 - 2
compiler/i386/i386tab.inc

@@ -3865,7 +3865,7 @@
     flags   : [if_pent,if_mmx,if_sm,if_cyrix]
     flags   : [if_pent,if_mmx,if_sm,if_cyrix]
   ),
   ),
   (
   (
-    opcode  : A_PMULHRWA;
+    opcode  : A_PMULHRW;
     ops     : 2;
     ops     : 2;
     optypes : (ot_mmxreg,ot_mmxrm,ot_none,ot_none);
     optypes : (ot_mmxreg,ot_mmxrm,ot_none,ot_none);
     code    : #2#15#15#72#1#183;
     code    : #2#15#15#72#1#183;
@@ -8729,6 +8729,34 @@
     code    : #241#3#15#58#68#72#22;
     code    : #241#3#15#58#68#72#22;
     flags   : [if_clmul,if_sandybridge]
     flags   : [if_clmul,if_sandybridge]
   ),
   ),
+  (
+    opcode  : A_PCLMULLQLQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#0;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULHQLQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#16;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULLQHQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#1;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULHQHQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#17;
+    flags   : [if_clmul,if_sandybridge]
+  ),
   (
   (
     opcode  : A_VADDPD;
     opcode  : A_VADDPD;
     ops     : 3;
     ops     : 3;
@@ -13034,6 +13062,90 @@
     code    : #232#233#241#250#1#68#61#80#23;
     code    : #232#233#241#250#1#68#61#80#23;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#0;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#0;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#0;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#16;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#16;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#16;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#1;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#1;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#1;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#17;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#17;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#17;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
   (
     opcode  : A_VPCMPEQB;
     opcode  : A_VPCMPEQB;
     ops     : 3;
     ops     : 3;
@@ -29173,7 +29285,7 @@
     opcode  : A_SHA1MSG2;
     opcode  : A_SHA1MSG2;
     ops     : 2;
     ops     : 2;
     optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
     optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
-    code    : #3#15#56#12#72;
+    code    : #3#15#56#202#72;
     flags   : [if_sha]
     flags   : [if_sha]
   ),
   ),
   (
   (

+ 0 - 32
compiler/i386/n386inl.pas

@@ -33,7 +33,6 @@ interface
        public
        public
          function first_sar: tnode; override;
          function first_sar: tnode; override;
          procedure second_rox_sar; override;
          procedure second_rox_sar; override;
-         procedure second_abs_long; override;
        end;
        end;
 
 
 implementation
 implementation
@@ -121,37 +120,6 @@ implementation
         inherited second_rox_sar;
         inherited second_rox_sar;
     end;
     end;
 
 
-
-  procedure ti386inlinenode.second_abs_long;
-    var
-      hl: TAsmLabel;
-    begin
-      if is_64bitint(left.resultdef) then
-        begin
-          secondpass(left);
-          hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
-          location:=left.location;
-          location.register64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
-          location.register64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
-          cg64.a_load64_reg_reg(current_asmdata.CurrAsmList,left.location.register64,location.register64);
-          cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SAR,OS_32,31,left.location.register64.reghi);
-          cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,left.location.register64.reghi,location.register64.reglo);
-          cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,left.location.register64.reghi,location.register64.reghi);
-          emit_reg_reg(A_SUB,S_L,left.location.register64.reghi,location.register64.reglo);
-          emit_reg_reg(A_SBB,S_L,left.location.register64.reghi,location.register64.reghi);
-          if cs_check_overflow in current_settings.localswitches then
-            begin
-              current_asmdata.getjumplabel(hl);
-              cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NO,hl);
-              cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false);
-              cg.a_label(current_asmdata.CurrAsmList,hl);
-            end;
-        end
-      else
-        inherited second_abs_long;
-    end;
-
-
 begin
 begin
    cinlinenode:=ti386inlinenode;
    cinlinenode:=ti386inlinenode;
 end.
 end.

+ 7 - 2
compiler/i8086/cgcpu.pas

@@ -1569,7 +1569,7 @@ unit cgcpu;
                             a_loadaddr_ref_reg(list,r,tmpreg);
                             a_loadaddr_ref_reg(list,r,tmpreg);
                             list.concat(taicpu.op_reg(A_PUSH,S_W,tmpreg));
                             list.concat(taicpu.op_reg(A_PUSH,S_W,tmpreg));
                           end
                           end
-                        else if base=NR_BP then
+                        else if (base=NR_BP) or (base=NR_SP) then
                           begin
                           begin
                             list.concat(Taicpu.op_reg(A_PUSH,S_W,NR_SS));
                             list.concat(Taicpu.op_reg(A_PUSH,S_W,NR_SS));
                             tmpreg:=getaddressregister(list);
                             tmpreg:=getaddressregister(list);
@@ -1577,7 +1577,12 @@ unit cgcpu;
                             list.concat(taicpu.op_reg(A_PUSH,S_W,tmpreg));
                             list.concat(taicpu.op_reg(A_PUSH,S_W,tmpreg));
                           end
                           end
                         else
                         else
-                          internalerror(2014032403);
+                          begin
+                            list.concat(Taicpu.op_reg(A_PUSH,S_W,NR_DS));
+                            tmpreg:=getaddressregister(list);
+                            a_loadaddr_ref_reg(list,r,tmpreg);
+                            list.concat(taicpu.op_reg(A_PUSH,S_W,tmpreg));
+                          end;
                       end;
                       end;
                   end
                   end
                 else
                 else

+ 13 - 11
compiler/i8086/cpuinfo.pas

@@ -166,17 +166,19 @@ type
 
 
    { Instruction optimisation hints }
    { Instruction optimisation hints }
    TCPUOptimizeFlags =
    TCPUOptimizeFlags =
-      (CPUX86_HINT_FAST_BT_REG_IMM,  { BT instructions with register source and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BT_REG_REG,  { BT instructions with register source and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BTX_REG_IMM, { BTC/R/S instructions with register source and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BTX_REG_REG, { BTC/R/S instructions with register source and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BT_MEM_IMM,  { BT instructions with memory sources and inmediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BT_MEM_REG,  { BT instructions with memory sources and register indices and a register index are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_BTX_MEM_IMM, { BTC/R/S instructions with memory sources and immediate indices are at least as fast as logical instructions }
-       CPUX86_HINT_FAST_BTX_MEM_REG, { BTC/R/S instructions with memory sources and register indices are at least as fast as equivalent logical instructions }
-       CPUX86_HINT_FAST_XCHG,        { XCHG %reg,%reg executes in 2 cycles or less }
-       CPUX86_HINT_FAST_3COMP_ADDR,  { A 3-component address (base, index and offset) has the same latency as the 2-component version (most notable with LEA instructions) }
-       CPUX86_HINT_FAST_3COMP_ADDR_16{ As above, but with 16-bit addresses }
+      (CPUX86_HINT_FAST_BT_REG_IMM,            { BT instructions with register source and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BT_REG_REG,            { BT instructions with register source and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BTX_REG_IMM,           { BTC/R/S instructions with register source and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BTX_REG_REG,           { BTC/R/S instructions with register source and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BT_MEM_IMM,            { BT instructions with memory sources and inmediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BT_MEM_REG,            { BT instructions with memory sources and register indices and a register index are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_BTX_MEM_IMM,           { BTC/R/S instructions with memory sources and immediate indices are at least as fast as logical instructions }
+       CPUX86_HINT_FAST_BTX_MEM_REG,           { BTC/R/S instructions with memory sources and register indices are at least as fast as equivalent logical instructions }
+       CPUX86_HINT_FAST_XCHG,                  { XCHG %reg,%reg executes in 2 cycles or less }
+       CPUX86_HINT_FAST_3COMP_ADDR,            { A 3-component address (base, index and offset) has the same latency as the 2-component version (most notable with LEA instructions) }
+       CPUX86_HINT_FAST_3COMP_ADDR_16,         { As above, but with 16-bit addresses }
+       CPUX86_HINT_FAST_SHORT_REP_MOVS,        { short rep movs instruction }
+       CPUX86_HINT_BSX_DEST_UNCHANGED_ON_ZF_1  { BSR/F does not change the destination if ZF is set }
       );
       );
 
 
  const
  const

+ 1 - 0
compiler/i8086/cpunode.pas

@@ -45,6 +45,7 @@ unit cpunode;
          the processor specific nodes must be included
          the processor specific nodes must be included
          after the generic one (FK)
          after the generic one (FK)
        }
        }
+       nx86bas,
        nx86set,
        nx86set,
 
 
        n8086add,
        n8086add,

+ 9 - 1
compiler/i8086/i8086att.inc

@@ -254,7 +254,7 @@
 'pmaddwd',
 'pmaddwd',
 'pmagw',
 'pmagw',
 'pmulhriw',
 'pmulhriw',
-'pmulhrwa',
+'pmulhrw',
 'pmulhrwc',
 'pmulhrwc',
 'pmulhw',
 'pmulhw',
 'pmullw',
 'pmullw',
@@ -686,6 +686,10 @@
 'rdtscp',
 'rdtscp',
 'movbe',
 'movbe',
 'pclmulqdq',
 'pclmulqdq',
+'pclmullqlqdq',
+'pclmulhqlqdq',
+'pclmullqhqdq',
+'pclmulhqhqdq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -879,6 +883,10 @@
 'vpblendvb',
 'vpblendvb',
 'vpblendw',
 'vpblendw',
 'vpclmulqdq',
 'vpclmulqdq',
+'vpclmullqlqdq',
+'vpclmulhqlqdq',
+'vpclmullqhqdq',
+'vpclmulhqhqdq',
 'vpcmpeqb',
 'vpcmpeqb',
 'vpcmpeqd',
 'vpcmpeqd',
 'vpcmpeqq',
 'vpcmpeqq',

+ 8 - 0
compiler/i8086/i8086atts.inc

@@ -781,6 +781,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufMMX,
 attsufMMX,
 attsufMMX,
 attsufMMX,
 attsufNONE,
 attsufNONE,
@@ -1025,6 +1029,10 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufINT,
 attsufNONE,
 attsufNONE,

+ 9 - 1
compiler/i8086/i8086int.inc

@@ -254,7 +254,7 @@
 'pmaddwd',
 'pmaddwd',
 'pmagw',
 'pmagw',
 'pmulhriw',
 'pmulhriw',
-'pmulhrwa',
+'pmulhrw',
 'pmulhrwc',
 'pmulhrwc',
 'pmulhw',
 'pmulhw',
 'pmullw',
 'pmullw',
@@ -686,6 +686,10 @@
 'rdtscp',
 'rdtscp',
 'movbe',
 'movbe',
 'pclmulqdq',
 'pclmulqdq',
+'pclmullqlqdq',
+'pclmulhqlqdq',
+'pclmullqhqdq',
+'pclmulhqhqdq',
 'vaddpd',
 'vaddpd',
 'vaddps',
 'vaddps',
 'vaddsd',
 'vaddsd',
@@ -879,6 +883,10 @@
 'vpblendvb',
 'vpblendvb',
 'vpblendw',
 'vpblendw',
 'vpclmulqdq',
 'vpclmulqdq',
+'vpclmullqlqdq',
+'vpclmulhqlqdq',
+'vpclmullqhqdq',
+'vpclmulhqhqdq',
 'vpcmpeqb',
 'vpcmpeqb',
 'vpcmpeqd',
 'vpcmpeqd',
 'vpcmpeqq',
 'vpcmpeqq',

+ 1 - 1
compiler/i8086/i8086nop.inc

@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
 { don't edit, this file is generated from x86ins.dat }
-4203;
+4219;

+ 9 - 1
compiler/i8086/i8086op.inc

@@ -254,7 +254,7 @@ A_PMACHRIW,
 A_PMADDWD,
 A_PMADDWD,
 A_PMAGW,
 A_PMAGW,
 A_PMULHRIW,
 A_PMULHRIW,
-A_PMULHRWA,
+A_PMULHRW,
 A_PMULHRWC,
 A_PMULHRWC,
 A_PMULHW,
 A_PMULHW,
 A_PMULLW,
 A_PMULLW,
@@ -686,6 +686,10 @@ A_AESKEYGENASSIST,
 A_RDTSCP,
 A_RDTSCP,
 A_MOVBE,
 A_MOVBE,
 A_PCLMULQDQ,
 A_PCLMULQDQ,
+A_PCLMULLQLQDQ,
+A_PCLMULHQLQDQ,
+A_PCLMULLQHQDQ,
+A_PCLMULHQHQDQ,
 A_VADDPD,
 A_VADDPD,
 A_VADDPS,
 A_VADDPS,
 A_VADDSD,
 A_VADDSD,
@@ -879,6 +883,10 @@ A_VPAVGW,
 A_VPBLENDVB,
 A_VPBLENDVB,
 A_VPBLENDW,
 A_VPBLENDW,
 A_VPCLMULQDQ,
 A_VPCLMULQDQ,
+A_VPCLMULLQLQDQ,
+A_VPCLMULHQLQDQ,
+A_VPCLMULLQHQDQ,
+A_VPCLMULHQHQDQ,
 A_VPCMPEQB,
 A_VPCMPEQB,
 A_VPCMPEQD,
 A_VPCMPEQD,
 A_VPCMPEQQ,
 A_VPCMPEQQ,

+ 50 - 42
compiler/i8086/i8086prop.inc

@@ -685,7 +685,11 @@
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
-(Ch: [Ch_Mop3, Ch_Rop2]),
+(Ch: [Ch_Mop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -891,6 +895,10 @@
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2]),
 (Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -945,7 +953,7 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
 (Ch: [Ch_Wop3, Ch_Rop2]),
@@ -1027,10 +1035,10 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
@@ -1373,28 +1381,28 @@
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Mop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Mop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop4, Ch_Rop3, Ch_Rop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
+(Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
@@ -1413,10 +1421,10 @@
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
@@ -1437,18 +1445,18 @@
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
-(Ch: [Ch_All]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
+(Ch: [Ch_Rop1, Ch_Rop2, Ch_Rop3, Ch_Wop4]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),

+ 114 - 2
compiler/i8086/i8086tab.inc

@@ -3879,7 +3879,7 @@
     flags   : [if_pent,if_mmx,if_sm,if_cyrix]
     flags   : [if_pent,if_mmx,if_sm,if_cyrix]
   ),
   ),
   (
   (
-    opcode  : A_PMULHRWA;
+    opcode  : A_PMULHRW;
     ops     : 2;
     ops     : 2;
     optypes : (ot_mmxreg,ot_mmxrm,ot_none,ot_none);
     optypes : (ot_mmxreg,ot_mmxrm,ot_none,ot_none);
     code    : #2#15#15#72#1#183;
     code    : #2#15#15#72#1#183;
@@ -8757,6 +8757,34 @@
     code    : #241#3#15#58#68#72#22;
     code    : #241#3#15#58#68#72#22;
     flags   : [if_clmul,if_sandybridge]
     flags   : [if_clmul,if_sandybridge]
   ),
   ),
+  (
+    opcode  : A_PCLMULLQLQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#0;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULHQLQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#16;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULLQHQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#1;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
+    opcode  : A_PCLMULHQHQDQ;
+    ops     : 2;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
+    code    : #241#3#15#58#68#72#1#17;
+    flags   : [if_clmul,if_sandybridge]
+  ),
   (
   (
     opcode  : A_VADDPD;
     opcode  : A_VADDPD;
     ops     : 3;
     ops     : 3;
@@ -13062,6 +13090,90 @@
     code    : #232#233#241#250#1#68#61#80#23;
     code    : #232#233#241#250#1#68#61#80#23;
     flags   : [if_avx512,if_tfv]
     flags   : [if_avx512,if_tfv]
   ),
   ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#0;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#0;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQLQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#0;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#16;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#16;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQLQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#16;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#1;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#1;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULLQHQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#1;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
+    code    : #232#241#242#250#1#68#61#80#1#17;
+    flags   : [if_avx,if_sandybridge,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_ymmreg,ot_ymmreg,ot_ymmrm,ot_none);
+    code    : #232#241#244#250#1#68#61#80#1#17;
+    flags   : [if_avx512,if_tfv]
+  ),
+  (
+    opcode  : A_VPCLMULHQHQDQ;
+    ops     : 3;
+    optypes : (ot_zmmreg,ot_zmmreg,ot_zmmrm,ot_none);
+    code    : #232#233#241#250#1#68#61#80#1#17;
+    flags   : [if_avx512,if_tfv]
+  ),
   (
   (
     opcode  : A_VPCMPEQB;
     opcode  : A_VPCMPEQB;
     ops     : 3;
     ops     : 3;
@@ -29397,7 +29509,7 @@
     opcode  : A_SHA1MSG2;
     opcode  : A_SHA1MSG2;
     ops     : 2;
     ops     : 2;
     optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
     optypes : (ot_xmmreg,ot_xmmrm,ot_none,ot_none);
-    code    : #3#15#56#12#72;
+    code    : #3#15#56#202#72;
     flags   : [if_sha]
     flags   : [if_sha]
   ),
   ),
   (
   (

+ 3 - 21
compiler/i8086/n8086add.pas

@@ -57,7 +57,7 @@ interface
       cutils,verbose,globals,constexp,pass_1,
       cutils,verbose,globals,constexp,pass_1,
       symconst,symdef,symtype,symcpu,paramgr,defutil,
       symconst,symdef,symtype,symcpu,paramgr,defutil,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       aasmbase,aasmtai,aasmdata,aasmcpu,
-      cgbase,procinfo,
+      nutils,cgbase,procinfo,
       ncal,ncon,nset,cgutils,tgobj,
       ncal,ncon,nset,cgutils,tgobj,
       cga,ncgutil,cgobj,cg64f32,cgx86,
       cga,ncgutil,cgobj,cg64f32,cgx86,
       hlcgobj;
       hlcgobj;
@@ -98,26 +98,8 @@ interface
             t:=nil;
             t:=nil;
 
 
             { load values }
             { load values }
-            case lt of
-              ordconstn:
-                lv:=tordconstnode(left).value;
-              pointerconstn:
-                lv:=tpointerconstnode(left).value;
-              niln:
-                lv:=0;
-              else
-                internalerror(2002080201);
-            end;
-            case rt of
-              ordconstn:
-                rv:=tordconstnode(right).value;
-              pointerconstn:
-                rv:=tpointerconstnode(right).value;
-              niln:
-                rv:=0;
-              else
-                internalerror(2002080204);
-            end;
+            lv:=get_int_value(left);
+            rv:=get_int_value(right);
 
 
             case nodetype of
             case nodetype of
               addn:
               addn:

+ 3 - 3
compiler/jvm/njvminl.pas

@@ -465,13 +465,13 @@ implementation
             case finaltype of
             case finaltype of
               'R':
               'R':
                 begin
                 begin
-                  { expects array of FpcBaseRecord}
+                  { expects array of FpcBaseRecord }
                   setlenroutine:='FPC_SETLENGTH_DYNARR_JRECORD';
                   setlenroutine:='FPC_SETLENGTH_DYNARR_JRECORD';
                   objarraydef:=search_system_type('TJRECORDARRAY').typedef;
                   objarraydef:=search_system_type('TJRECORDARRAY').typedef;
                 end;
                 end;
               'T':
               'T':
                 begin
                 begin
-                  { expects array of ShortstringClass}
+                  { expects array of ShortstringClass }
                   setlenroutine:='FPC_SETLENGTH_DYNARR_JSHORTSTRING';
                   setlenroutine:='FPC_SETLENGTH_DYNARR_JSHORTSTRING';
                   objarraydef:=search_system_type('TSHORTSTRINGARRAY').typedef;
                   objarraydef:=search_system_type('TSHORTSTRINGARRAY').typedef;
                 end;
                 end;
@@ -489,7 +489,7 @@ implementation
         newparas:=ccallparanode.create(newnode,newparas);
         newparas:=ccallparanode.create(newnode,newparas);
         { prepend deepcopy }
         { prepend deepcopy }
         newparas:=ccallparanode.create(cordconstnode.create(0,pasbool1type,false),newparas);
         newparas:=ccallparanode.create(cordconstnode.create(0,pasbool1type,false),newparas);
-        { call the right setlenght helper }
+        { call the right setlength helper }
         if ndims>1 then
         if ndims>1 then
           begin
           begin
             { create proper parameters, from right to left:
             { create proper parameters, from right to left:

+ 11 - 4
compiler/m68k/ag68kgas.pas

@@ -38,8 +38,11 @@ interface
 
 
     type
     type
       Tm68kAoutGNUAssembler=class(TAoutGNUAssembler)
       Tm68kAoutGNUAssembler=class(TAoutGNUAssembler)
-        constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
-        function MakeCmdLine : TCmdStr; override;
+        protected
+          function sectionattrs(atype:TAsmSectiontype):string; override;
+        public
+          constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
+          function MakeCmdLine : TCmdStr; override;
       end;
       end;
 
 
 
 
@@ -101,6 +104,10 @@ interface
      Replace(result,'$ARCH',GasMachineArg);
      Replace(result,'$ARCH',GasMachineArg);
    end;
    end;
 
 
+  function tm68kAoutGNUAssembler.sectionattrs(atype:TAsmSectiontype):string;
+    begin
+      result:='';
+    end;
 
 
     function getreferencestring(var ref : treference) : string;
     function getreferencestring(var ref : treference) : string;
       var
       var
@@ -364,7 +371,7 @@ interface
             idtxt  : 'AS';
             idtxt  : 'AS';
             asmbin : 'as';
             asmbin : 'as';
             asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM';
             asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM';
-            supported_targets : [system_m68k_macosclassic,system_m68k_linux,system_m68k_PalmOS,system_m68k_netbsd,system_m68k_human68k,system_m68k_embedded];
+            supported_targets : [system_m68k_macosclassic,system_m68k_linux,system_m68k_netbsd,system_m68k_human68k,system_m68k_embedded];
             flags : [af_needar,af_smartlink_sections];
             flags : [af_needar,af_smartlink_sections];
             labelprefix : '.L';
             labelprefix : '.L';
             labelmaxlen : -1;
             labelmaxlen : -1;
@@ -378,7 +385,7 @@ interface
             idtxt  : 'AS-AOUT';
             idtxt  : 'AS-AOUT';
             asmbin : 'as';
             asmbin : 'as';
             asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM';
             asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM';
-            supported_targets : [system_m68k_Amiga,system_m68k_Atari];
+            supported_targets : [system_m68k_Amiga,system_m68k_Atari,system_m68k_palmos];
             flags : [af_needar];
             flags : [af_needar];
             labelprefix : '.L';
             labelprefix : '.L';
             labelmaxlen : -1;
             labelmaxlen : -1;

+ 34 - 2
compiler/m68k/aoptcpu.pas

@@ -38,6 +38,7 @@ unit aoptcpu;
         function RegLoadedWithNewValue(reg: tregister; hp: tai): boolean; override;
         function RegLoadedWithNewValue(reg: tregister; hp: tai): boolean; override;
         function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
         function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
 
 
+        function TryToFoldDoubleAND(var p: tai): boolean;
         function TryToRemoveTST(var p: tai): boolean;
         function TryToRemoveTST(var p: tai): boolean;
         function TryToOptimizeMove(var p: tai): boolean;
         function TryToOptimizeMove(var p: tai): boolean;
         function MaybeRealConstOperSimplify(var p: tai): boolean;
         function MaybeRealConstOperSimplify(var p: tai): boolean;
@@ -219,6 +220,26 @@ unit aoptcpu;
     end;
     end;
 {$endif DEBUG_AOPTCPU}
 {$endif DEBUG_AOPTCPU}
 
 
+  function TCpuAsmOptimizer.TryToFoldDoubleAND(var p: tai): boolean;
+    var
+      next, next2: tai;
+      opstr: string[15];
+    begin
+      result:=false;
+
+      if ((taicpu(p).oper[0]^.typ=top_const) and (taicpu(p).oper[1]^.typ=top_reg)) and
+        GetNextInstruction(p,next) and
+        MatchInstruction(next,A_AND,[taicpu(p).opsize]) and
+        (taicpu(next).oper[0]^.typ=top_const) and
+        MatchOperand(taicpu(p).oper[1]^,taicpu(next).oper[1]^) then
+       begin
+         DebugMsg('Optimizer: folding double AND',p);
+         taicpu(p).oper[0]^.val:=taicpu(p).oper[0]^.val and taicpu(next).oper[0]^.val;
+         RemoveInstruction(next);
+         result:=true;
+       end;
+    end;
+
   function TCpuAsmOptimizer.TryToRemoveTST(var p: tai): boolean;
   function TCpuAsmOptimizer.TryToRemoveTST(var p: tai): boolean;
     var
     var
       next, next2: tai;
       next, next2: tai;
@@ -231,7 +252,7 @@ unit aoptcpu;
         MatchInstruction(next,A_TST,[taicpu(p).opsize]) and
         MatchInstruction(next,A_TST,[taicpu(p).opsize]) and
         MatchOperand(taicpu(p).oper[1]^,taicpu(next).oper[0]^) and
         MatchOperand(taicpu(p).oper[1]^,taicpu(next).oper[0]^) and
         GetNextInstruction(next,next2) and
         GetNextInstruction(next,next2) and
-        MatchInstruction(next2,[A_BXX,A_SXX],[S_NO]) and
+        MatchInstruction(next2,[A_BXX,A_SXX],[S_NO,S_B]) and
         (taicpu(next2).condition in [C_NE,C_EQ,C_PL,C_MI]) then
         (taicpu(next2).condition in [C_NE,C_EQ,C_PL,C_MI]) then
         begin
         begin
           opstr:=opname(p);
           opstr:=opname(p);
@@ -433,7 +454,18 @@ unit aoptcpu;
 
 
   function TCpuAsmOptimizer.OptPass1Bitwise(var p: tai): Boolean;
   function TCpuAsmOptimizer.OptPass1Bitwise(var p: tai): Boolean;
     begin
     begin
-      Result:=TryToRemoveTST(p);
+      result:=false;
+      case p.typ of
+        ait_instruction:
+          begin
+            if taicpu(p).opcode = A_AND then
+              result:=TryToFoldDoubleAND(p);
+            if not result then
+              result:=TryToRemoveTST(p);
+          end;
+        else
+          ;
+      end;
     end;
     end;
 
 
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;

+ 0 - 33
compiler/mips/cgcpu.pas

@@ -87,7 +87,6 @@ type
     procedure g_proc_exit(list: tasmlist; parasize: longint; nostackframe: boolean); override;
     procedure g_proc_exit(list: tasmlist; parasize: longint; nostackframe: boolean); override;
     procedure g_concatcopy(list: tasmlist; const Source, dest: treference; len: tcgint); override;
     procedure g_concatcopy(list: tasmlist; const Source, dest: treference; len: tcgint); override;
     procedure g_concatcopy_unaligned(list: tasmlist; const Source, dest: treference; len: tcgint); override;
     procedure g_concatcopy_unaligned(list: tasmlist; const Source, dest: treference; len: tcgint); override;
-    procedure g_concatcopy_move(list: tasmlist; const Source, dest: treference; len: tcgint);
     procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
     procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
     procedure g_profilecode(list: TAsmList);override;
     procedure g_profilecode(list: TAsmList);override;
   end;
   end;
@@ -1528,38 +1527,6 @@ begin
 end;
 end;
 
 
 
 
-
-{ ************* concatcopy ************ }
-
-procedure TCGMIPS.g_concatcopy_move(list: tasmlist; const Source, dest: treference; len: tcgint);
-var
-  paraloc1, paraloc2, paraloc3: TCGPara;
-  pd: tprocdef;
-begin
-  pd:=search_system_proc('MOVE');
-  paraloc1.init;
-  paraloc2.init;
-  paraloc3.init;
-  paramanager.getcgtempparaloc(list, pd, 1, paraloc1);
-  paramanager.getcgtempparaloc(list, pd, 2, paraloc2);
-  paramanager.getcgtempparaloc(list, pd, 3, paraloc3);
-  a_load_const_cgpara(list, OS_SINT, len, paraloc3);
-  a_loadaddr_ref_cgpara(list, dest, paraloc2);
-  a_loadaddr_ref_cgpara(list, Source, paraloc1);
-  paramanager.freecgpara(list, paraloc3);
-  paramanager.freecgpara(list, paraloc2);
-  paramanager.freecgpara(list, paraloc1);
-  alloccpuregisters(list, R_INTREGISTER, paramanager.get_volatile_registers_int(pocall_default));
-  alloccpuregisters(list, R_FPUREGISTER, paramanager.get_volatile_registers_fpu(pocall_default));
-  a_call_name(list, 'FPC_MOVE', false);
-  dealloccpuregisters(list, R_FPUREGISTER, paramanager.get_volatile_registers_fpu(pocall_default));
-  dealloccpuregisters(list, R_INTREGISTER, paramanager.get_volatile_registers_int(pocall_default));
-  paraloc3.done;
-  paraloc2.done;
-  paraloc1.done;
-end;
-
-
 procedure TCGMIPS.g_concatcopy(list: tasmlist; const Source, dest: treference; len: tcgint);
 procedure TCGMIPS.g_concatcopy(list: tasmlist; const Source, dest: treference; len: tcgint);
 var
 var
   tmpreg1, hreg, countreg: TRegister;
   tmpreg1, hreg, countreg: TRegister;

+ 21 - 1
compiler/mips/cpugas.pas

@@ -57,6 +57,26 @@ unit cpugas;
       globals, verbose, itcpugas, cgbase, cgutils;
       globals, verbose, itcpugas, cgbase, cgutils;
 
 
 
 
+      { abi strings as accepted by
+        GNU assembler in -abi=XXX option }
+      function gas_abitype(abi : tabi) : string;
+        begin
+          case abi of
+            abi_eabi:
+              result:='eabi';
+            abi_mips_o32:
+              result:='32';
+            abi_mips_n32:
+              result:='n32';
+            abi_mips_o64:
+              result:='o64';
+            abi_mips_n64:
+              result:='64';
+            else
+              result:='32';
+          end;
+        end;
+
       function asm_regname(reg : TRegister) : string;
       function asm_regname(reg : TRegister) : string;
 
 
         begin
         begin
@@ -83,7 +103,7 @@ unit cpugas;
       begin
       begin
          result := Inherited MakeCmdLine;
          result := Inherited MakeCmdLine;
          { ABI selection }
          { ABI selection }
-         Replace(result,'$ABI','-mabi='+abitypestr[mips_abi]);
+         Replace(result,'$ABI','-mabi='+gas_abitype(target_info.abi));
          { ARCH selection }
          { ARCH selection }
          Replace(result,'$ARCH','-march='+lower(cputypestr[current_settings.cputype]));
          Replace(result,'$ARCH','-march='+lower(cputypestr[current_settings.cputype]));
 //          Replace(result,'$ARCH','-march=pic32mx -mtune=pic32mx');      
 //          Replace(result,'$ARCH','-march=pic32mx -mtune=pic32mx');      

+ 2 - 46
compiler/mips/cpuinfo.pas

@@ -19,7 +19,8 @@ Unit CPUInfo;
 Interface
 Interface
 
 
   uses
   uses
-    globtype;
+    globtype,
+    systems;
 
 
 Type
 Type
    bestreal = double;
    bestreal = double;
@@ -47,17 +48,6 @@ Type
 
 
    tfputype =(fpu_none,fpu_soft,fpu_mips2,fpu_mips3);
    tfputype =(fpu_none,fpu_soft,fpu_mips2,fpu_mips3);
 
 
-   tabitype = 
-     (
-     abi_none,
-     abi_default,
-     abi_o32,
-     abi_n32,
-     abi_o64,
-     abi_n64,
-     abi_eabi
-     );
-
 Const
 Const
    {# Size of native extended floating point type }
    {# Size of native extended floating point type }
    extended_size = 8;
    extended_size = 8;
@@ -92,20 +82,6 @@ Const
      'MIPS2','MIPS3'
      'MIPS2','MIPS3'
    );
    );
 
 
-   { abi strings as accepted by 
-     GNU assembler in -abi=XXX option }
-   abitypestr : array[tabitype] of string[4] =
-     ({ abi_none    } '',
-      { abi_default } '32',
-      { abi_o32     } '32',
-      { abi_n32     } 'n32',
-      { abi_o64     } 'o64',
-      { abi_n64     } '64',
-      { abi_eabi    } 'eabi'
-     );
-
-   mips_abi : tabitype = abi_default;
-
 type
 type
    tcpuflags=(
    tcpuflags=(
      CPUMIPS_HAS_CMOV,             { conditional move instructions (mips4+) }
      CPUMIPS_HAS_CMOV,             { conditional move instructions (mips4+) }
@@ -248,26 +224,6 @@ const
    level3optimizerswitches = level2optimizerswitches;
    level3optimizerswitches = level2optimizerswitches;
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
    level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
 
 
-function SetMipsABIType(const s : string) : boolean;
-
 Implementation
 Implementation
 
 
-uses
-  cutils;
-
-function SetMipsABIType(const s : string) : boolean;
-
-  var
-    abi : tabitype;
-  begin
-    SetMipsABIType:=false;
-    for abi := low(tabitype) to high(tabitype) do
-      if (lower(s)=abitypestr[abi]) then
-        begin
-          mips_abi:=abi;
-          SetMipsABIType:=true;
-          break;
-        end;
-  end;
-           
 end.
 end.

+ 8 - 0
compiler/msg/errore.msg

@@ -146,6 +146,8 @@ general_t_unitscope=01027_T_Using unit scope: $1
 general_i_reduced_filesearch=01028_I_Reduced file search: Not searching for uppercased or 8.3 unit filenames.
 general_i_reduced_filesearch=01028_I_Reduced file search: Not searching for uppercased or 8.3 unit filenames.
 % When the \var{-Ft} switch is used, this line informs you that the compiler
 % When the \var{-Ft} switch is used, this line informs you that the compiler
 % will not look for uppercased filenames or 8.3 conforming filenames.
 % will not look for uppercased filenames or 8.3 conforming filenames.
+general_f_compiler_aborted=01029_F_Compiler stopped
+% Compilation was aborted.
 % \end{description}
 % \end{description}
 #
 #
 # Scanner
 # Scanner
@@ -1677,6 +1679,9 @@ parser_e_nostringaliasinsystem=03370_E_Using 'string' alias is not allowed in th
 parser_e_coperators_off=03371_E_C styled assignment operators are turned off
 parser_e_coperators_off=03371_E_C styled assignment operators are turned off
 % By default, c style assignment operators (+=, -=, *=, /=) are turn off. Either turn them on by the command line
 % By default, c style assignment operators (+=, -=, *=, /=) are turn off. Either turn them on by the command line
 % parameter -Sc or in the source code by {\$COPERATORS ON}
 % parameter -Sc or in the source code by {\$COPERATORS ON}
+parser_e_cannot_evaluate_expression_at_compile_time=03372_E_Expression cannot be evaluted at compile time
+% Certain operations like the size of an object cannot be determined at compile time,
+% so it cannot be e.g. part of a constant expression.
 %
 %
 % \end{description}
 % \end{description}
 %
 %
@@ -4320,7 +4325,9 @@ A*2Twince_Windows CE
 # aarch64 targets
 # aarch64 targets
 a*2Tandroid_Android
 a*2Tandroid_Android
 a*2Tdarwin_Darwin/Mac OS X
 a*2Tdarwin_Darwin/Mac OS X
+a*2Tembedded_Embedded
 a*2Tfreebsd_FreeBSD
 a*2Tfreebsd_FreeBSD
+a*2Tiphonesim_iPhoneSimulator
 a*2Tios_iOS
 a*2Tios_iOS
 a*2Tlinux_Linux
 a*2Tlinux_Linux
 a*2Twin64_Windows 64
 a*2Twin64_Windows 64
@@ -4485,6 +4492,7 @@ x*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possible values
 4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)
 4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)
 a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)
 a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)
 A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)
 A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)
+R*2WP<x>_esp-idf version number: 4.4, 5.0.6, ... (esp32c3)
 x*2WP<x>_Esp8266-rtos-sdk or esp-idf version number: 3.3, 3.4 (esp8266) or 4.2, 4.3 (esp32)
 x*2WP<x>_Esp8266-rtos-sdk or esp-idf version number: 3.3, 3.4 (esp8266) or 4.2, 4.3 (esp32)
 3*2WR_Generate relocation code (Windows)
 3*2WR_Generate relocation code (Windows)
 4*2WR_Generate relocation code (Windows)
 4*2WR_Generate relocation code (Windows)

+ 0 - 1186
compiler/msgidx.inc

@@ -1,1186 +0,0 @@
-const
-  general_t_compilername=01000;
-  general_d_sourceos=01001;
-  general_i_targetos=01002;
-  general_t_exepath=01003;
-  general_t_unitpath=01004;
-  general_t_includepath=01005;
-  general_t_librarypath=01006;
-  general_t_objectpath=01007;
-  general_i_abslines_compiled=01008;
-  general_f_no_memory_left=01009;
-  general_i_writingresourcefile=01010;
-  general_e_errorwritingresourcefile=01011;
-  general_i_fatal=01012;
-  general_i_error=01013;
-  general_i_warning=01014;
-  general_i_note=01015;
-  general_i_hint=01016;
-  general_e_path_does_not_exist=01017;
-  general_f_compilation_aborted=01018;
-  general_text_bytes_code=01019;
-  general_text_bytes_data=01020;
-  general_i_number_of_warnings=01021;
-  general_i_number_of_hints=01022;
-  general_i_number_of_notes=01023;
-  general_f_ioerror=01024;
-  general_f_oserror=01025;
-  general_e_exception_raised=01026;
-  general_t_unitscope=01027;
-  general_i_reduced_filesearch=01028;
-  scan_f_end_of_file=02000;
-  scan_f_string_exceeds_line=02001;
-  scan_f_illegal_char=02002;
-  scan_f_syn_expected=02003;
-  scan_t_start_include_file=02004;
-  scan_w_comment_level=02005;
-  scan_n_ignored_switch=02008;
-  scan_w_illegal_switch=02009;
-  scan_w_switch_is_global=02010;
-  scan_e_illegal_char_const=02011;
-  scan_f_cannot_open_input=02012;
-  scan_f_cannot_open_includefile=02013;
-  scan_e_illegal_pack_records=02015;
-  scan_e_illegal_pack_enum=02016;
-  scan_e_endif_expected=02017;
-  scan_e_preproc_syntax_error=02018;
-  scan_e_error_in_preproc_expr=02019;
-  scan_w_macro_cut_after_255_chars=02020;
-  scan_e_endif_without_if=02021;
-  scan_f_user_defined=02022;
-  scan_e_user_defined=02023;
-  scan_w_user_defined=02024;
-  scan_n_user_defined=02025;
-  scan_h_user_defined=02026;
-  scan_i_user_defined=02027;
-  scan_e_keyword_cant_be_a_macro=02028;
-  scan_f_macro_buffer_overflow=02029;
-  scan_w_macro_too_deep=02030;
-  scan_w_wrong_styled_switch=02031;
-  scan_d_handling_switch=02032;
-  scan_c_endif_found=02033;
-  scan_c_ifdef_found=02034;
-  scan_c_ifopt_found=02035;
-  scan_c_if_found=02036;
-  scan_c_ifndef_found=02037;
-  scan_c_else_found=02038;
-  scan_c_skipping_until=02039;
-  scan_i_press_enter=02040;
-  scan_w_unsupported_switch=02041;
-  scan_w_illegal_directive=02042;
-  scan_t_back_in=02043;
-  scan_w_unsupported_app_type=02044;
-  scan_w_app_type_not_support=02045;
-  scan_w_description_not_support=02046;
-  scan_n_version_not_support=02047;
-  scan_n_only_exe_version=02048;
-  scan_w_wrong_version_ignored=02049;
-  scan_e_illegal_asmmode_specifier=02050;
-  scan_w_no_asm_reader_switch_inside_asm=02051;
-  scan_e_wrong_switch_toggle=02052;
-  scan_e_resourcefiles_not_supported=02053;
-  scan_w_include_env_not_found=02054;
-  scan_e_invalid_maxfpureg_value=02055;
-  scan_w_only_one_resourcefile_supported=02056;
-  scan_w_macro_support_turned_off=02057;
-  scan_e_invalid_interface_type=02058;
-  scan_w_appid_not_support=02059;
-  scan_w_appname_not_support=02060;
-  scan_e_string_exceeds_255_chars=02061;
-  scan_f_include_deep_ten=02062;
-  scan_e_too_many_push=02063;
-  scan_e_too_many_pop=02064;
-  scan_e_error_macro_lacks_value=02065;
-  scan_e_wrong_switch_toggle_default=02066;
-  scan_e_mode_switch_not_allowed=02067;
-  scan_e_error_macro_undefined=02068;
-  scan_e_utf8_bigger_than_65535=02069;
-  scan_e_utf8_malformed=02070;
-  scan_c_switching_to_utf8=02071;
-  scan_e_compile_time_typeerror=02072;
-  scan_n_app_type_not_support=02073;
-  scan_e_illegal_optimization_specifier=02074;
-  scan_w_setpeflags_not_support=02075;
-  scan_w_imagebase_not_support=02076;
-  scan_w_minstacksize_not_support=02077;
-  scan_w_maxstacksize_not_support=02078;
-  scanner_e_illegal_warn_state=02079;
-  scan_e_only_packset=02080;
-  scan_w_pic_ignored=02081;
-  scan_w_unsupported_switch_by_target=02082;
-  scan_w_frameworks_darwin_only=02084;
-  scan_e_illegal_minfpconstprec=02085;
-  scan_w_multiple_main_name_overrides=02086;
-  scanner_w_illegal_warn_identifier=02087;
-  scanner_e_illegal_alignment_directive=02088;
-  scanner_f_illegal_utf8_bom=02089;
-  scanner_w_directive_ignored_on_target=02090;
-  scan_w_unavailable_system_codepage=02091;
-  scan_w_setpeoptflags_not_support=02092;
-  scan_e_illegal_peflag=02093;
-  scan_e_illegal_peoptflag=02094;
-  scan_e_unsupported_switch=02095;
-  scan_w_invalid_stacksize=02096;
-  scan_w_heapmax_lessthan_heapmin=02097;
-  scan_e_illegal_hugepointernormalization=02098;
-  scan_e_illegal_asmcpu_specifier=02099;
-  scan_w_syscall_convention_not_useable_on_target=02100;
-  scan_w_syscall_convention_invalid=02101;
-  scan_w_setpeuserversion_not_support=02102;
-  scan_w_setpeosversion_not_support=02103;
-  scan_w_setpesubsysversion_not_support=02104;
-  scan_n_changecputype=02105;
-  scan_e_emptymacroname=02106;
-  scan_e_unexpected_ifend=02107;
-  scan_e_unexpected_endif=02108;
-  scan_e_invalid_rtti_clause=02109;
-  scan_e_incomplete_rtti_clause=02110;
-  scan_e_invalid_rtti_option=02111;
-  scan_e_duplicate_rtti_option=02112;
-  scan_e_misplaced_rtti_directive=02113;
-  parser_e_syntax_error=03000;
-  parser_e_dont_nest_interrupt=03004;
-  parser_w_proc_directive_ignored=03005;
-  parser_e_no_overload_for_all_procs=03006;
-  parser_e_export_name_double=03008;
-  parser_e_export_ordinal_double=03009;
-  parser_e_export_invalid_index=03010;
-  parser_w_parser_reloc_no_debug=03011;
-  parser_w_parser_win32_debug_needs_WN=03012;
-  parser_e_constructorname_must_be_init=03013;
-  parser_e_destructorname_must_be_done=03014;
-  parser_e_proc_inline_not_supported=03016;
-  parser_w_constructor_should_be_public=03018;
-  parser_w_destructor_should_be_public=03019;
-  parser_n_only_one_destructor=03020;
-  parser_e_no_local_objects=03021;
-  parser_f_no_anonym_objects=03022;
-  parser_n_object_has_no_vmt=03023;
-  parser_e_illegal_parameter_list=03024;
-  parser_e_wrong_parameter_size=03026;
-  parser_e_overloaded_no_procedure=03027;
-  parser_e_overloaded_have_same_parameters=03028;
-  parser_e_header_dont_match_forward=03029;
-  parser_e_header_different_var_names=03030;
-  parser_n_duplicate_enum=03031;
-  parser_e_no_with_for_variable_in_other_segments=03033;
-  parser_e_too_much_lexlevel=03034;
-  parser_e_range_check_error=03035;
-  parser_w_range_check_error=03036;
-  parser_e_double_caselabel=03037;
-  parser_e_case_lower_less_than_upper_bound=03038;
-  parser_e_type_const_not_possible=03039;
-  parser_e_no_overloaded_procvars=03040;
-  parser_e_invalid_string_size=03041;
-  parser_w_use_extended_syntax_for_objects=03042;
-  parser_w_no_new_dispose_on_void_pointers=03043;
-  parser_e_no_new_dispose_on_void_pointers=03044;
-  parser_e_class_id_expected=03045;
-  parser_e_no_type_not_allowed_here=03046;
-  parser_e_methode_id_expected=03047;
-  parser_e_header_dont_match_any_member=03048;
-  parser_d_procedure_start=03049;
-  parser_e_error_in_real=03050;
-  parser_e_fail_only_in_constructor=03051;
-  parser_e_no_paras_for_destructor=03052;
-  parser_e_only_class_members_via_class_ref=03053;
-  parser_e_only_class_members=03054;
-  parser_e_case_mismatch=03055;
-  parser_e_illegal_symbol_exported=03056;
-  parser_w_should_use_override=03057;
-  parser_e_nothing_to_be_overridden=03058;
-  parser_e_no_procedure_to_access_property=03059;
-  parser_w_stored_not_implemented=03060;
-  parser_e_ill_property_access_sym=03061;
-  parser_e_cant_access_protected_member=03062;
-  parser_e_cant_access_private_member=03063;
-  parser_e_overridden_methods_not_same_ret=03066;
-  parser_e_dont_nest_export=03067;
-  parser_e_methods_dont_be_export=03068;
-  parser_e_call_by_ref_without_typeconv=03069;
-  parser_e_no_super_class=03070;
-  parser_e_self_not_in_method=03071;
-  parser_e_generic_methods_only_in_methods=03072;
-  parser_e_illegal_colon_qualifier=03073;
-  parser_e_illegal_set_expr=03074;
-  parser_e_pointer_to_class_expected=03075;
-  parser_e_expr_have_to_be_constructor_call=03076;
-  parser_e_expr_have_to_be_destructor_call=03077;
-  parser_e_invalid_record_const=03078;
-  parser_e_false_with_expr=03079;
-  parser_e_void_function=03080;
-  parser_e_only_methods_allowed=03081;
-  parser_e_operator_not_overloaded=03082;
-  parser_e_no_such_assignment=03083;
-  parser_e_overload_impossible=03084;
-  parser_e_no_reraise_possible=03085;
-  parser_e_no_new_or_dispose_for_classes=03086;
-  parser_e_procedure_overloading_is_off=03088;
-  parser_e_overload_operator_failed=03089;
-  parser_e_comparative_operator_return_boolean=03090;
-  parser_e_only_virtual_methods_abstract=03091;
-  parser_f_unsupported_feature=03092;
-  parser_e_mix_of_classes_and_objects=03093;
-  parser_w_unknown_proc_directive_ignored=03094;
-  parser_e_directive_only_one_var=03095;
-  parser_e_absolute_only_to_var_or_const=03096;
-  parser_e_initialized_only_one_var=03097;
-  parser_e_abstract_no_definition=03098;
-  parser_e_overloaded_must_be_all_global=03099;
-  parser_w_virtual_without_constructor=03100;
-  parser_c_macro_defined=03101;
-  parser_c_macro_undefined=03102;
-  parser_c_macro_set_to=03103;
-  parser_i_compiling=03104;
-  parser_u_parsing_interface=03105;
-  parser_u_parsing_implementation=03106;
-  parser_d_compiling_second_time=03107;
-  parser_e_no_property_found_to_override=03109;
-  parser_e_only_one_default_property=03110;
-  parser_e_property_need_paras=03111;
-  parser_e_constructor_cannot_be_not_virtual=03112;
-  parser_e_no_default_property_available=03113;
-  parser_e_cant_have_published=03114;
-  parser_e_forward_declaration_must_be_resolved=03115;
-  parser_e_no_local_operator=03116;
-  parser_e_proc_dir_not_allowed_in_interface=03117;
-  parser_e_proc_dir_not_allowed_in_implementation=03118;
-  parser_e_proc_dir_not_allowed_in_procvar=03119;
-  parser_e_function_already_declared_public_forward=03120;
-  parser_e_not_external_and_export=03121;
-  parser_n_not_supported_for_inline=03123;
-  parser_h_inlining_disabled=03124;
-  parser_i_writing_browser_log=03125;
-  parser_h_maybe_deref_caret_missing=03126;
-  parser_f_assembler_reader_not_supported=03127;
-  parser_e_proc_dir_conflict=03128;
-  parser_e_call_convention_dont_match_forward=03129;
-  parser_e_property_cant_have_a_default_value=03131;
-  parser_e_property_default_value_must_const=03132;
-  parser_e_cant_publish_that=03133;
-  parser_e_cant_publish_that_property=03134;
-  parser_e_empty_import_name=03136;
-  parser_e_division_by_zero=03138;
-  parser_e_invalid_float_operation=03139;
-  parser_e_array_lower_less_than_upper_bound=03140;
-  parser_w_string_too_long=03141;
-  parser_e_string_larger_array=03142;
-  parser_e_ill_msg_expr=03143;
-  parser_e_ill_msg_param=03144;
-  parser_e_duplicate_message_label=03145;
-  parser_e_self_in_non_message_handler=03146;
-  parser_e_threadvars_only_sg=03147;
-  parser_f_direct_assembler_not_allowed=03148;
-  parser_w_no_objpas_use_mode=03149;
-  parser_e_no_object_override=03150;
-  parser_e_cant_use_inittable_here=03151;
-  parser_e_resourcestring_only_sg=03152;
-  parser_e_exit_with_argument_not__possible=03153;
-  parser_e_stored_property_must_be_boolean=03154;
-  parser_e_ill_property_storage_sym=03155;
-  parser_e_only_publishable_classes_can_be_published=03156;
-  parser_e_proc_directive_expected=03157;
-  parser_e_invalid_property_index_value=03158;
-  parser_e_procname_to_short_for_export=03159;
-  parser_e_dlltool_unit_var_problem=03160;
-  parser_e_dlltool_unit_var_problem2=03161;
-  parser_f_need_objfpc_or_delphi_mode=03162;
-  parser_e_no_export_with_index_for_target=03163;
-  parser_e_no_export_of_variables_for_target=03164;
-  parser_e_improper_guid_syntax=03165;
-  parser_w_interface_mapping_notfound=03168;
-  parser_e_interface_id_expected=03169;
-  parser_e_type_cant_be_used_in_array_index=03170;
-  parser_e_no_con_des_in_interfaces=03171;
-  parser_e_no_access_specifier_in_interfaces=03172;
-  parser_e_no_vars_in_interfaces=03173;
-  parser_e_no_local_proc_external=03174;
-  parser_w_skipped_fields_before=03175;
-  parser_e_skipped_fields_before=03176;
-  parser_w_skipped_fields_after=03177;
-  parser_e_varargs_need_cdecl_and_external=03178;
-  parser_e_self_call_by_value=03179;
-  parser_e_interface_has_no_guid=03180;
-  parser_e_illegal_field_or_method=03181;
-  parser_w_proc_overriding_calling=03182;
-  parser_e_no_procvarobj_const=03183;
-  parser_e_default_value_only_one_para=03184;
-  parser_e_default_value_expected_for_para=03185;
-  parser_w_unsupported_feature=03186;
-  parser_h_c_arrays_are_references=03187;
-  parser_e_C_array_of_const_must_be_last=03188;
-  parser_h_type_redef=03189;
-  parser_w_cdecl_has_no_high=03190;
-  parser_w_cdecl_no_openstring=03191;
-  parser_e_initialized_not_for_threadvar=03192;
-  parser_e_msg_only_for_classes=03193;
-  parser_e_procedure_or_function_expected=03194;
-  parser_e_illegal_calling_convention=03195;
-  parser_e_no_object_reintroduce=03196;
-  parser_e_paraloc_only_one_para=03197;
-  parser_e_paraloc_all_paras=03198;
-  parser_e_illegal_explicit_paraloc=03199;
-  parser_e_32bitint_or_pointer_variable_expected=03200;
-  parser_e_goto_outside_proc=03201;
-  parser_f_too_complex_proc=03202;
-  parser_e_illegal_expression=03203;
-  parser_e_invalid_integer=03204;
-  parser_e_invalid_qualifier=03205;
-  parser_e_upper_lower_than_lower=03206;
-  parser_e_macpas_exit_wrong_param=03207;
-  parser_e_illegal_assignment_to_count_var=03208;
-  parser_e_no_local_var_external=03209;
-  parser_e_proc_already_external=03210;
-  parser_w_implicit_uses_of_variants_unit=03211;
-  parser_e_no_static_method_in_interfaces=03212;
-  parser_e_arithmetic_operation_overflow=03213;
-  parser_e_protected_or_private_expected=03214;
-  parser_e_illegal_slice=03215;
-  parser_e_dispinterface_cant_have_parent=03216;
-  parser_e_dispinterface_needs_a_guid=03217;
-  parser_w_overridden_methods_not_same_ret=03218;
-  parser_e_dispid_must_be_ord_const=03219;
-  parser_e_array_range_out_of_bounds=03220;
-  parser_e_packed_element_no_var_addr=03221;
-  parser_e_packed_dynamic_open_array=03222;
-  parser_e_packed_element_no_loop=03223;
-  parser_e_type_var_const_only_in_records_and_classes=03224;
-  parser_e_cant_create_generics_of_this_type=03225;
-  parser_w_no_lineinfo_use_switch=03226;
-  parser_e_no_funcret_specified=03227;
-  parser_e_special_onlygenerics=03228;
-  parser_e_no_generics_as_params=03229;
-  parser_e_type_object_constants=03230;
-  parser_e_label_outside_proc=03231;
-  parser_e_initialized_not_for_external=03233;
-  parser_e_illegal_function_result=03234;
-  parser_e_no_common_type=03235;
-  parser_e_no_generics_as_types=03236;
-  parser_w_register_list_ignored=03237;
-  parser_e_implements_must_be_class_or_interface=03238;
-  parser_e_implements_must_have_correct_type=03239;
-  parser_e_implements_must_read_specifier=03240;
-  parser_e_implements_must_not_have_write_specifier=03241;
-  parser_e_implements_must_not_have_stored_specifier=03242;
-  parser_e_implements_uses_non_implemented_interface=03243;
-  parser_e_unsupported_real=03244;
-  parser_e_class_doesnt_implement_interface=03245;
-  parser_e_class_implements_must_be_interface=03246;
-  parser_e_cant_export_var_different_name=03247;
-  parser_e_weak_external_not_supported=03248;
-  parser_e_forward_mismatch=03249;
-  parser_n_ignore_lower_visibility=03250;
-  parser_e_field_not_allowed_here=03251;
-  parser_e_no_local_para_def=03252;
-  parser_e_abstract_and_sealed_conflict=03253;
-  parser_e_sealed_descendant=03254;
-  parser_e_sealed_class_cannot_have_abstract_methods=03255;
-  parser_e_only_virtual_methods_final=03256;
-  parser_e_final_can_no_be_overridden=03257;
-  parser_e_multiple_messages=03258;
-  parser_e_invalid_enumerator_identifier=03259;
-  parser_e_enumerator_identifier_required=03260;
-  parser_e_enumerator_movenext_is_not_valid=03261;
-  parser_e_enumerator_current_is_not_valid=03262;
-  parser_e_only_one_enumerator_movenext=03263;
-  parser_e_only_one_enumerator_current=03264;
-  parser_e_for_in_loop_cannot_be_used_for_the_type=03265;
-  parser_e_objc_requires_msgstr=03266;
-  parser_e_objc_no_constructor_destructor=03267;
-  parser_e_message_string_too_long=03268;
-  parser_e_objc_message_name_too_long=03269;
-  parser_h_no_objc_parent=03270;
-  parser_e_no_objc_published=03271;
-  parser_f_need_objc=03272;
-  parser_e_must_use_override=03273;
-  parser_h_should_use_override=03274;
-  parser_e_objc_message_name_changed=03275;
-  parser_e_unique_unsupported=03276;
-  parser_e_no_category_as_types=03277;
-  parser_e_no_category_override=03278;
-  parser_e_must_use_reintroduce_objc=03279;
-  parser_h_should_use_reintroduce_objc=03280;
-  parser_e_implements_getter_not_default_cc=03281;
-  parser_e_no_refcounted_typed_file=03282;
-  parser_e_operator_not_overloaded_2=03283;
-  parser_e_operator_not_overloaded_3=03284;
-  parser_e_more_array_elements_expected=03285;
-  parser_e_string_const_too_long=03286;
-  parser_e_invalid_univ_para=03287;
-  parser_e_only_one_class_constructor_allowed=03288;
-  parser_e_only_one_class_destructor_allowed=03289;
-  parser_e_no_paras_for_class_constructor=03290;
-  parser_e_no_paras_for_class_destructor=03291;
-  parser_f_modeswitch_objc_required=03292;
-  parser_e_widestring_to_ansi_compile_time=03293;
-  parser_e_objc_enumerator_2_0=03294;
-  parser_e_objc_missing_enumeration_defs=03295;
-  parser_e_no_procvarnested_const=03296;
-  parser_f_no_generic_inside_generic=03297;
-  parser_e_forward_intf_declaration_must_be_resolved=03298;
-  parser_e_no_record_published=03299;
-  parser_e_no_destructor_in_records=03300;
-  parser_e_class_methods_only_static_in_records=03301;
-  parser_e_no_parameterless_constructor_in_records=03302;
-  parser_e_at_least_one_argument_must_be_of_type=03303;
-  parser_e_cant_use_type_parameters_here=03304;
-  parser_e_externals_no_section=03305;
-  parser_e_section_no_locals=03306;
-  parser_e_not_allowed_in_helper=03307;
-  parser_e_no_class_constructor_in_helpers=03308;
-  parser_e_inherited_not_in_record=03309;
-  parser_e_no_types_in_local_anonymous_records=03310;
-  parser_e_duplicate_implements_clause=03311;
-  parser_e_mapping_no_implements=03312;
-  parser_e_implements_no_mapping=03313;
-  parser_e_invalid_codepage=03314;
-  parser_e_final_only_const_var=03315;
-  parser_e_final_only_external=03316;
-  parser_e_no_typed_const=03317;
-  parser_e_java_no_inherited_constructor=03318;
-  parser_d_internal_parser_string=03319;
-  parser_e_feature_unsupported_for_vm=03320;
-  parser_e_jvm_invalid_virtual_constructor_call=03321;
-  parser_e_method_lower_visibility=03322;
-  parser_e_nostackframe_without_assembler=03323;
-  parser_e_nostackframe_with_locals=03324;
-  parser_e_cannot_generate_property_getter_setter=03325;
-  parser_w_overriding_property_getter_setter=03326;
-  parser_w_case_difference_auto_property_getter_setter_prefix=03327;
-  parser_e_no_consts_in_local_anonymous_records=03328;
-  parser_e_no_methods_in_local_anonymous_records=03329;
-  parser_e_no_properties_in_local_anonymous_records=03330;
-  parser_e_no_class_in_local_anonymous_records=03331;
-  parser_e_not_allowed_in_record=03332;
-  parser_e_dir_not_allowed=03333;
-  parser_e_no_assembler_in_generic=03334;
-  parser_e_property_only_sgr=03335;
-  parser_e_overloaded_have_same_mangled_name=03336;
-  parser_e_default_value_val_const=03337;
-  parser_w_ptr_type_ignored=03338;
-  parser_e_global_generic_references_static=03339;
-  parser_u_already_compiled=03340;
-  parser_e_explicit_method_implementation_for_specializations_not_allowed=03341;
-  parser_e_no_genfuncs_in_interfaces=03342;
-  parser_e_genfuncs_cannot_be_virtual=03343;
-  parser_e_packages_not_supported=03344;
-  parser_e_cannot_use_hardfloat_in_a_softfloat_environment=03345;
-  parser_e_invalid_internal_function_index=03346;
-  parser_w_operator_overloaded_hidden_3=03347;
-  parser_e_threadvar_must_be_class=03348;
-  parser_e_only_static_members_via_object_type=03349;
-  parser_e_callthrough_varargs=03350;
-  parser_e_unbound_attribute=03351;
-  parser_e_enumeration_out_of_range=03352;
-  parser_w_enumeration_out_of_range=03353;
-  parser_e_method_for_type_in_other_unit=03354;
-  parser_e_generic_constraints_not_allowed_here=03355;
-  parser_e_location_size_too_small=03356;
-  parser_e_location_size_too_large=03357;
-  parser_e_location_regpair_only_data=03358;
-  parser_e_location_regpair_only_consecutive=03359;
-  parser_e_constructurs_cannot_take_type_parameters=03360;
-  parser_e_raise_with_noreturn_not_allowed=03361;
-  parser_e_section_directive_not_allowed_for_target=03362;
-  parser_e_absolute_sym_cannot_reference_itself=03363;
-  parser_e_syscall_format_not_support=03364;
-  parser_w_ignoring_published_property=03365;
-  parser_e_wasm_ref_types_can_only_be_passed_by_value=03366;
-  parser_e_promising_exports_not_supported_on_current_platform=03367;
-  parser_e_suspending_externals_not_supported_on_current_platform=03368;
-  parser_w_widechar_set_reduced=03369;
-  parser_e_nostringaliasinsystem=03370;
-  parser_e_coperators_off=03371;
-  type_e_mismatch=04000;
-  type_e_incompatible_types=04001;
-  type_e_not_equal_types=04002;
-  type_e_type_id_expected=04003;
-  type_e_variable_id_expected=04004;
-  type_e_integer_expr_expected=04005;
-  type_e_boolean_expr_expected=04006;
-  type_e_ordinal_expr_expected=04007;
-  type_e_pointer_type_expected=04008;
-  type_e_class_type_expected=04009;
-  type_e_cant_eval_constant_expr=04011;
-  type_e_set_element_are_not_comp=04012;
-  type_e_set_operation_unknown=04013;
-  type_w_convert_real_2_comp=04014;
-  type_h_use_div_for_int=04015;
-  type_e_strict_var_string_violation=04016;
-  type_e_succ_and_pred_enums_with_assign_not_possible=04017;
-  type_e_cant_read_write_type=04018;
-  type_e_no_readln_writeln_for_typed_file=04019;
-  type_e_no_read_write_for_untyped_file=04020;
-  type_e_typeconflict_in_set=04021;
-  type_w_maybe_wrong_hi_lo=04022;
-  type_e_integer_or_real_expr_expected=04023;
-  type_e_wrong_type_in_array_constructor=04024;
-  type_e_wrong_parameter_type=04025;
-  type_e_no_method_and_procedure_not_compatible=04026;
-  type_e_wrong_math_argument=04027;
-  type_e_no_addr_of_constant=04028;
-  type_e_argument_cant_be_assigned=04029;
-  type_e_cannot_local_proc_to_procvar=04030;
-  type_e_no_assign_to_addr=04031;
-  type_e_no_assign_to_const=04032;
-  type_e_array_required=04033;
-  type_e_interface_type_expected=04034;
-  type_h_mixed_signed_unsigned=04035;
-  type_w_mixed_signed_unsigned2=04036;
-  type_e_typecast_wrong_size_for_assignment=04037;
-  type_e_array_index_enums_with_assign_not_possible=04038;
-  type_e_classes_not_related=04039;
-  type_w_classes_not_related=04040;
-  type_e_class_or_interface_type_expected=04041;
-  type_e_type_is_not_completly_defined=04042;
-  type_w_string_too_long=04043;
-  type_w_comparison_always_false=04044;
-  type_w_comparison_always_true=04045;
-  type_w_instance_with_abstract=04046;
-  type_h_in_range_check=04047;
-  type_w_smaller_possible_range_check=04048;
-  type_h_smaller_possible_range_check=04049;
-  type_e_cant_take_address_of_abstract_method=04050;
-  type_e_assignment_not_allowed=04051;
-  type_e_constant_expr_expected=04052;
-  type_e_operator_not_supported_for_types=04053;
-  type_e_illegal_type_conversion=04054;
-  type_h_pointer_to_longint_conv_not_portable=04055;
-  type_w_pointer_to_longint_conv_not_portable=04056;
-  type_e_cant_choose_overload_function=04057;
-  type_e_illegal_count_var=04058;
-  type_w_double_c_varargs=04059;
-  type_e_class_or_cominterface_type_expected=04060;
-  type_e_no_const_packed_array=04061;
-  type_e_got_expected_packed_array=04062;
-  type_e_got_expected_unpacked_array=04063;
-  type_e_no_packed_inittable=04064;
-  type_e_no_const_packed_record=04065;
-  type_w_untyped_arithmetic_unportable=04066;
-  type_e_cant_take_address_of_local_subroutine=04076;
-  type_e_cant_export_local=04077;
-  type_e_not_automatable=04078;
-  type_h_convert_add_operands_to_prevent_overflow=04079;
-  type_h_convert_sub_operands_to_prevent_overflow=04080;
-  type_h_convert_mul_operands_to_prevent_overflow=04081;
-  type_w_pointer_to_signed=04082;
-  type_e_interface_has_no_guid=04083;
-  type_e_invalid_objc_selector_name=04084;
-  type_e_expected_objc_method_but_got=04085;
-  type_e_expected_objc_method=04086;
-  type_e_no_type_info=04087;
-  type_e_ordinal_or_string_expr_expected=04088;
-  type_e_string_expr_expected=04089;
-  type_w_zero_to_nil=04090;
-  type_e_protocol_type_expected=04091;
-  type_e_objc_type_unsupported=04092;
-  type_e_class_or_objcclass_type_expected=04093;
-  type_e_objcclass_type_expected=04094;
-  type_w_procvar_univ_conflicting_para=04095;
-  type_e_generics_cannot_reference_itself=04096;
-  type_e_type_parameters_are_not_allowed_here=04097;
-  type_e_generic_declaration_does_not_match=04098;
-  type_e_helper_type_expected=04099;
-  type_e_record_type_expected=04100;
-  type_e_class_helper_must_extend_subclass=04101;
-  type_e_record_helper_must_extend_same_record=04102;
-  type_e_procedures_return_no_value=04103;
-  type_w_implicit_string_cast=04104;
-  type_w_implicit_string_cast_loss=04105;
-  type_w_explicit_string_cast=04106;
-  type_w_explicit_string_cast_loss=04107;
-  type_w_unicode_data_loss=04108;
-  type_e_range_check_error_bounds=04109;
-  type_w_range_check_error_bounds=04110;
-  type_e_type_not_allowed_for_default=04111;
-  type_e_java_class_method_not_static_virtual=04112;
-  type_e_invalid_final_assignment=04113;
-  type_e_no_managed_formal_assign_typecast=04114;
-  type_e_no_managed_assign_generic_typecast=04115;
-  type_w_interface_lower_visibility=04116;
-  type_e_interface_lower_visibility=04117;
-  type_e_typeof_requires_vmt=04118;
-  type_e_invalid_default_value=04119;
-  type_e_type_not_allowed_for_type_helper=04120;
-  type_e_procedure_must_be_far=04121;
-  type_w_instance_abstract_class=04122;
-  type_e_function_reference_kind=04123;
-  type_e_seg_procvardef_wrong_memory_model=04124;
-  type_w_empty_constant_range_set=04125;
-  type_e_cblock_callconv=04126;
-  type_e_forward_interface_type_does_not_match=04127;
-  type_e_generic_const_type_not_allowed=04128;
-  type_e_cant_read_write_type_in_iso_mode=04129;
-  type_w_array_size_does_not_match_size_of_constant_string=04130;
-  type_e_nested_procvar_to_funcref=04131;
-  type_e_cannot_take_address_of_wasm_externref=04132;
-  type_e_cannot_determine_size_of_wasm_reference_type=04133;
-  sym_e_id_not_found=05000;
-  sym_f_internal_error_in_symtablestack=05001;
-  sym_e_duplicate_id=05002;
-  sym_h_duplicate_id_where=05003;
-  sym_e_unknown_id=05004;
-  sym_e_forward_not_resolved=05005;
-  sym_e_error_in_type_def=05007;
-  sym_e_forward_type_not_resolved=05009;
-  sym_e_only_static_in_static=05010;
-  sym_e_type_must_be_rec_or_object_or_class=05012;
-  sym_e_no_instance_of_abstract_object=05013;
-  sym_w_label_not_defined=05014;
-  sym_e_label_used_and_not_defined=05015;
-  sym_e_ill_label_decl=05016;
-  sym_e_goto_and_label_not_supported=05017;
-  sym_e_label_not_found=05018;
-  sym_e_id_is_no_label_id=05019;
-  sym_e_label_already_defined=05020;
-  sym_e_ill_type_decl_set=05021;
-  sym_e_class_forward_not_resolved=05022;
-  sym_n_unit_not_used=05023;
-  sym_h_para_identifier_not_used=05024;
-  sym_n_local_identifier_not_used=05025;
-  sym_h_para_identifier_only_set=05026;
-  sym_n_local_identifier_only_set=05027;
-  sym_h_local_symbol_not_used=05028;
-  sym_n_private_identifier_not_used=05029;
-  sym_n_private_identifier_only_set=05030;
-  sym_n_private_method_not_used=05031;
-  sym_e_set_expected=05032;
-  sym_w_function_result_not_set=05033;
-  sym_w_wrong_C_pack=05034;
-  sym_e_illegal_field=05035;
-  sym_w_uninitialized_local_variable=05036;
-  sym_w_uninitialized_variable=05037;
-  sym_e_id_no_member=05038;
-  sym_h_param_list=05039;
-  sym_e_segment_too_large=05040;
-  sym_e_no_matching_implementation_found=05042;
-  sym_w_deprecated_symbol=05043;
-  sym_w_non_portable_symbol=05044;
-  sym_w_non_implemented_symbol=05055;
-  sym_e_cant_create_unique_type=05056;
-  sym_h_uninitialized_local_variable=05057;
-  sym_h_uninitialized_variable=05058;
-  sym_w_function_result_uninitialized=05059;
-  sym_h_function_result_uninitialized=05060;
-  sym_w_identifier_only_read=05061;
-  sym_h_abstract_method_list=05062;
-  sym_w_experimental_symbol=05063;
-  sym_w_forward_not_resolved=05064;
-  sym_w_library_symbol=05065;
-  sym_w_deprecated_symbol_with_msg=05066;
-  sym_e_no_enumerator=05067;
-  sym_e_no_enumerator_move=05068;
-  sym_e_no_enumerator_current=05069;
-  sym_e_objc_para_mismatch=05070;
-  sym_n_private_type_not_used=05071;
-  sym_n_private_const_not_used=05072;
-  sym_n_private_property_not_used=05073;
-  sym_w_deprecated_unit=05074;
-  sym_w_deprecated_unit_with_msg=05075;
-  sym_w_non_portable_unit=05076;
-  sym_w_library_unit=05077;
-  sym_w_non_implemented_unit=05078;
-  sym_w_experimental_unit=05079;
-  sym_e_formal_class_not_resolved=05080;
-  sym_e_interprocgoto_into_init_final_code_not_allowed=05081;
-  sym_e_external_class_name_mismatch1=05082;
-  sym_e_external_class_name_mismatch2=05083;
-  sym_w_library_overload=05084;
-  sym_e_duplicate_id_create_java_constructor=05085;
-  sym_e_no_matching_inherited_parameterless_constructor=05086;
-  sym_d_adding_helper_for=05087;
-  sym_e_param_list=05088;
-  sym_w_uninitialized_managed_local_variable=05089;
-  sym_w_uninitialized_managed_variable=05090;
-  sym_h_uninitialized_managed_local_variable=05091;
-  sym_h_uninitialized_managed_variable=05092;
-  sym_w_managed_function_result_uninitialized=05093;
-  sym_h_managed_function_result_uninitialized=05094;
-  sym_w_duplicate_id=05095;
-  sym_e_generic_type_param_mismatch=05096;
-  sym_e_generic_type_param_decl=05097;
-  sym_e_type_must_be_rec_or_object=05098;
-  sym_e_symbol_no_capture=05099;
-  sym_f_systemunitnotloaded=05100;
-  sym_e_wasm_ref_types_cannot_be_used_in_records=05101;
-  cg_e_parasize_too_big=06009;
-  cg_e_file_must_call_by_reference=06012;
-  cg_e_cant_use_far_pointer_there=06013;
-  cg_e_dont_call_exported_direct=06015;
-  cg_w_member_cd_call_from_method=06016;
-  cg_n_inefficient_code=06017;
-  cg_w_unreachable_code=06018;
-  cg_e_cant_call_abstract_method=06020;
-  cg_d_register_weight=06027;
-  cg_d_stackframe_omited=06029;
-  cg_e_unable_inline_object_methods=06031;
-  cg_e_unable_inline_procvar=06032;
-  cg_e_no_code_for_inline_stored=06033;
-  cg_e_can_access_element_zero=06035;
-  cg_e_cannot_call_cons_dest_inside_with=06037;
-  cg_e_cannot_call_message_direct=06038;
-  cg_e_goto_inout_of_exception_block=06039;
-  cg_e_control_flow_outside_finally=06040;
-  cg_w_parasize_too_big=06041;
-  cg_w_localsize_too_big=06042;
-  cg_e_localsize_too_big=06043;
-  cg_e_break_not_allowed=06044;
-  cg_e_continue_not_allowed=06045;
-  cg_f_unknown_compilerproc=06046;
-  cg_f_unknown_system_type=06047;
-  cg_h_inherited_ignored=06048;
-  cg_e_goto_label_not_found=06049;
-  cg_f_unknown_type_in_unit=06050;
-  cg_e_interprocedural_goto_only_to_outer_scope_allowed=06051;
-  cg_e_labels_cannot_defined_outside_declaration_scope=06052;
-  cg_e_goto_across_procedures_with_exceptions_not_allowed=06053;
-  cg_e_mod_only_defined_for_pos_quotient=06054;
-  cg_d_autoinlining=06055;
-  cg_e_function_not_support_by_selected_instruction_set=06056;
-  cg_f_max_units_reached=06057;
-  cg_n_no_inline=06058;
-  cg_e_case_missing_value=06059;
-  cg_w_case_incomplete=06060;
-  cg_w_cannot_compile_subroutine=06061;
-  cg_w_interrupt_does_not_save_registers=06062;
-  asmr_d_start_reading=07000;
-  asmr_d_finish_reading=07001;
-  asmr_e_none_label_contain_at=07002;
-  asmr_e_building_record_offset=07004;
-  asmr_e_offset_without_identifier=07005;
-  asmr_e_type_without_identifier=07006;
-  asmr_e_no_local_or_para_allowed=07007;
-  asmr_e_need_offset=07008;
-  asmr_e_need_dollar=07009;
-  asmr_e_cant_have_multiple_relocatable_symbols=07010;
-  asmr_e_only_add_relocatable_symbol=07011;
-  asmr_e_invalid_constant_expression=07012;
-  asmr_e_relocatable_symbol_not_allowed=07013;
-  asmr_e_invalid_reference_syntax=07014;
-  asmr_e_local_para_unreachable=07015;
-  asmr_e_local_label_not_allowed_as_ref=07016;
-  asmr_e_wrong_base_index=07017;
-  asmr_w_possible_object_field_bug=07018;
-  asmr_e_wrong_scale_factor=07019;
-  asmr_e_multiple_index=07020;
-  asmr_e_invalid_operand_type=07021;
-  asmr_e_invalid_string_as_opcode_operand=07022;
-  asmr_w_CODE_and_DATA_not_supported=07023;
-  asmr_e_null_label_ref_not_allowed=07024;
-  asmr_e_expr_zero_divide=07025;
-  asmr_e_expr_illegal=07026;
-  asmr_e_escape_seq_ignored=07027;
-  asmr_e_invalid_symbol_ref=07028;
-  asmr_w_fwait_emu_prob=07029;
-  asmr_w_fadd_to_faddp=07030;
-  asmr_w_enter_not_supported_by_linux=07031;
-  asmr_w_calling_overload_func=07032;
-  asmr_e_unsupported_symbol_type=07033;
-  asmr_e_constant_out_of_bounds=07034;
-  asmr_e_error_converting_decimal=07035;
-  asmr_e_error_converting_octal=07036;
-  asmr_e_error_converting_binary=07037;
-  asmr_e_error_converting_hexadecimal=07038;
-  asmr_h_direct_global_to_mangled=07039;
-  asmr_w_direct_global_is_overloaded_func=07040;
-  asmr_e_cannot_use_SELF_outside_a_method=07041;
-  asmr_e_cannot_use_OLDEBP_outside_nested_procedure=07042;
-  asmr_e_void_function=07043;
-  asmr_e_SEG_not_supported=07044;
-  asmr_e_size_suffix_and_dest_dont_match=07045;
-  asmr_w_size_suffix_and_dest_dont_match=07046;
-  asmr_e_syntax_error=07047;
-  asmr_e_invalid_opcode_and_operand=07048;
-  asmr_e_syn_operand=07049;
-  asmr_e_syn_constant=07050;
-  asmr_e_invalid_string_expression=07051;
-  asmr_w_const32bit_for_address=07052;
-  asmr_e_unknown_opcode=07053;
-  asmr_e_invalid_or_missing_opcode=07054;
-  asmr_e_invalid_prefix_and_opcode=07055;
-  asmr_e_invalid_override_and_opcode=07056;
-  asmr_e_too_many_operands=07057;
-  asmr_w_near_ignored=07058;
-  asmr_w_far_ignored=07059;
-  asmr_e_dup_local_sym=07060;
-  asmr_e_unknown_local_sym=07061;
-  asmr_e_unknown_label_identifier=07062;
-  asmr_e_invalid_register=07063;
-  asmr_e_invalid_fpu_register=07064;
-  asmr_w_modulo_not_supported=07066;
-  asmr_e_invalid_float_const=07067;
-  asmr_e_invalid_float_expr=07068;
-  asmr_e_wrong_sym_type=07069;
-  asmr_e_cannot_index_relative_var=07070;
-  asmr_e_invalid_seg_override=07071;
-  asmr_w_id_supposed_external=07072;
-  asmr_e_string_not_allowed_as_const=07073;
-  asmr_e_no_var_type_specified=07074;
-  asmr_w_assembler_code_not_returned_to_text=07075;
-  asmr_e_not_directive_or_local_symbol=07076;
-  asmr_w_using_defined_as_local=07077;
-  asmr_e_dollar_without_identifier=07078;
-  asmr_w_32bit_const_for_address=07079;
-  asmr_n_align_is_target_specific=07080;
-  asmr_e_cannot_access_field_directly_for_parameters=07081;
-  asmr_e_cannot_access_object_field_directly=07082;
-  asmr_e_unable_to_determine_reference_size=07083;
-  asmr_e_cannot_use_RESULT_here=07084;
-  asmr_w_adding_explicit_args_fXX=07086;
-  asmr_w_adding_explicit_first_arg_fXX=07087;
-  asmr_w_adding_explicit_second_arg_fXX=07088;
-  asmr_e_invalid_char_smaller=07089;
-  asmr_e_invalid_char_greater=07090;
-  asmr_w_align_not_supported=07093;
-  asmr_e_no_inc_and_dec_together=07094;
-  asmr_e_invalid_reg_list_in_movem_or_fmovem=07095;
-  asmr_e_invalid_reg_list_for_opcode=07096;
-  asmr_e_higher_cpu_mode_required=07097;
-  asmr_w_unable_to_determine_reference_size_using_dword=07098;
-  asmr_e_illegal_shifterop_syntax=07099;
-  asmr_e_packed_element=07100;
-  asmr_w_unable_to_determine_reference_size_using_byte=07101;
-  asmr_w_no_direct_ebp_for_parameter=07102;
-  asmr_w_direct_ebp_for_parameter_regcall=07103;
-  asmr_w_direct_ebp_neg_offset=07104;
-  asmr_w_direct_esp_neg_offset=07105;
-  asmr_e_no_vmtoffset_possible=07106;
-  asmr_e_need_pic_ref=07107;
-  asmr_e_mixing_regtypes=07108;
-  asmr_e_empty_regset=07109;
-  asmr_w_useless_got_for_local=07110;
-  asmr_w_general_segment_with_constant=07111;
-  asmr_e_bad_seh_directive_offset=07112;
-  asmr_e_bad_seh_directive_register=07113;
-  asmr_e_seh_in_pure_asm_only=07114;
-  asmr_e_unsupported_directive=07115;
-  asmr_e_complex_function_result_location=07116;
-  asmr_e_wrong_gotpcrel_intel_syntax=07117;
-  asmr_e_no_gotpcrel_support=07118;
-  asmr_w_global_access_without_got=07119;
-  asmr_w_check_mem_operand_size=07120;
-  asmr_w_check_mem_operand_size3=07121;
-  asmr_w_check_mem_operand_size_offset=07122;
-  asmr_w_check_mem_operand_negative_offset=07123;
-  asmr_w_check_mem_operand_automap_multiple_size=07124;
-  asmr_e_invalid_ref_register=07125;
-  asmr_e_seg_without_identifier=07126;
-  asmr_e_CODE_or_DATA_without_SEG=07127;
-  asmr_e_const16bit_for_segment=07128;
-  asmr_e_invalid_code_value=07129;
-  asmr_w_unable_to_determine_constant_size_using_byte=07130;
-  asmr_w_unable_to_determine_constant_size_using_word=07131;
-  asmr_e_cannot_override_es_segment=07132;
-  asmr_w_invalid_reference=07133;
-  asmr_e_address_sizes_do_not_match=07134;
-  asmr_e_pop_cs_not_valid=07135;
-  asmr_w_pop_cs_not_portable=07136;
-  asmr_e_public_must_be_used_before_label_definition=07137;
-  asmr_e_local_label_cannot_be_declared_public=07138;
-  asmr_e_multiple_segment_overrides=07139;
-  asmr_w_multiple_segment_overrides=07140;
-  asmr_w_segment_override_ignored_in_64bit_mode=07141;
-  asmr_e_mismatch_broadcasting_elements=07142;
-  asmr_e_invalid_arrangement=07143;
-  asmr_e_a64_invalid_regset=07144;
-  asmr_e_unknown_field=07145;
-  asmr_e_not_supported_combination_attsuffix_memrefsize_type=07146;
-  asmr_e_a64_regset_too_large=07147;
-  asmw_f_too_many_asm_files=08000;
-  asmw_f_assembler_output_not_supported=08001;
-  asmw_f_comp_not_supported=08002;
-  asmw_f_direct_not_supported=08003;
-  asmw_e_alloc_data_only_in_bss=08004;
-  asmw_f_no_binary_writer_selected=08005;
-  asmw_e_opcode_not_in_table=08006;
-  asmw_e_invalid_opcode_and_operands=08007;
-  asmw_e_16bit_not_supported=08008;
-  asmw_e_invalid_effective_address=08009;
-  asmw_e_immediate_or_reference_expected=08010;
-  asmw_e_value_exceeds_bounds=08011;
-  asmw_e_short_jmp_out_of_range=08012;
-  asmw_e_undefined_label=08013;
-  asmw_e_comp_not_supported=08014;
-  asmw_e_extended_not_supported=08015;
-  asmw_e_duplicate_label=08016;
-  asmw_e_redefined_label=08017;
-  asmw_e_first_defined_label=08018;
-  asmw_e_invalid_register=08019;
-  asmw_e_16bit_32bit_not_supported=08020;
-  asmw_e_64bit_not_supported=08021;
-  asmw_e_bad_reg_with_rex=08022;
-  asmw_e_missing_endprologue=08023;
-  asmw_e_prologue_too_large=08024;
-  asmw_e_handlerdata_no_handler=08025;
-  asmw_f_too_many_relocations=08026;
-  asmw_w_changing_bind_type=08027;
-  asmw_h_changing_bind_type=08028;
-  asmw_e_32bit_not_supported=08029;
-  asmw_f_code_segment_too_large=08030;
-  asmw_f_data_segment_too_large=08031;
-  asmw_e_instruction_not_supported_by_cpu=08032;
-  asmw_e_brxx_out_of_range=08033;
-  asmw_e_illegal_use_of_rip=08034;
-  asmw_e_seh_invalid_data_size=08035;
-  asmw_e_illegal_use_of_sp=08036;
-  asmw_e_illegal_unset_index=08037;
-  exec_w_source_os_redefined=09000;
-  exec_i_assembling_pipe=09001;
-  exec_d_cant_create_asmfile=09002;
-  exec_e_cant_create_objectfile=09003;
-  exec_e_cant_create_archivefile=09004;
-  exec_e_assembler_not_found=09005;
-  exec_t_using_assembler=09006;
-  exec_e_error_while_assembling=09007;
-  exec_e_cant_call_assembler=09008;
-  exec_i_assembling=09009;
-  exec_i_assembling_smart=09010;
-  exec_w_objfile_not_found=09011;
-  exec_w_libfile_not_found=09012;
-  exec_e_error_while_linking=09013;
-  exec_e_cant_call_linker=09014;
-  exec_i_linking=09015;
-  exec_e_util_not_found=09016;
-  exec_t_using_util=09017;
-  exec_e_exe_not_supported=09018;
-  exec_e_dll_not_supported=09019;
-  exec_i_closing_script=09020;
-  exec_e_res_not_found=09021;
-  exec_i_compilingresource=09022;
-  exec_t_unit_not_static_linkable_switch_to_smart=09023;
-  exec_t_unit_not_smart_linkable_switch_to_static=09024;
-  exec_t_unit_not_shared_linkable_switch_to_static=09025;
-  exec_e_unit_not_smart_or_static_linkable=09026;
-  exec_e_unit_not_shared_or_static_linkable=09027;
-  exec_d_resbin_params=09028;
-  exec_e_error_while_compiling_resources=09029;
-  exec_e_cant_call_resource_compiler=09030;
-  exec_e_cant_open_resource_file=09031;
-  exec_e_cant_write_resource_file=09032;
-  exec_n_backquote_cat_file_not_found=09033;
-  exec_w_init_file_not_found=09034;
-  exec_e_static_lib_not_supported=09035;
-  exec_f_controllertype_expected=09036;
-  execinfo_f_cant_process_executable=09128;
-  execinfo_f_cant_open_executable=09129;
-  execinfo_x_codesize=09130;
-  execinfo_x_initdatasize=09131;
-  execinfo_x_uninitdatasize=09132;
-  execinfo_x_stackreserve=09133;
-  execinfo_x_stackcommit=09134;
-  link_f_executable_too_big=09200;
-  link_w_32bit_absolute_reloc=09201;
-  link_e_program_segment_too_large=09202;
-  link_e_code_segment_too_large=09203;
-  link_e_data_segment_too_large=09204;
-  link_e_segment_too_large=09205;
-  link_e_group_too_large=09206;
-  link_e_com_program_uses_segment_relocations=09207;
-  link_w_program_uses_checkpointer=09208;
-  link_e_duplicate_symbol=09209;
-  link_e_comdat_select_unsupported=09210;
-  link_e_comdat_associative_section_expected=09211;
-  link_e_comdat_not_matching=09212;
-  link_e_comdat_associative_section_not_found=09213;
-  link_d_comdat_discard_any=09214;
-  link_d_comdat_discard_size=09215;
-  link_d_comdat_discard_content=09216;
-  link_d_comdat_replace_size=09217;
-  link_e_comdat_size_differs=09218;
-  link_e_comdat_content_differs=09219;
-  link_e_comdat_selection_differs=09220;
-  link_e_undefined_symbol_in_obj=09221;
-  link_e_undefined_symbol=09222;
-  link_w_unsupported_cross_endian_internal_linker=09223;
-  unit_t_unitsearch=10000;
-  unit_t_ppu_loading=10001;
-  unit_u_ppu_name=10002;
-  unit_u_ppu_flags=10003;
-  unit_u_ppu_crc=10004;
-  unit_u_ppu_time=10005;
-  unit_u_ppu_file_too_short=10006;
-  unit_u_ppu_invalid_header=10007;
-  unit_u_ppu_invalid_version=10008;
-  unit_u_ppu_invalid_processor=10009;
-  unit_u_ppu_invalid_target=10010;
-  unit_u_ppu_source=10011;
-  unit_u_ppu_write=10012;
-  unit_f_ppu_cannot_write=10013;
-  unit_f_ppu_read_error=10014;
-  unit_f_ppu_read_unexpected_end=10015;
-  unit_f_ppu_invalid_entry=10016;
-  unit_f_ppu_dbx_count_problem=10017;
-  unit_e_illegal_unit_name=10018;
-  unit_f_too_much_units=10019;
-  unit_f_circular_unit_reference=10020;
-  unit_f_cant_compile_unit=10021;
-  unit_f_cant_find_ppu=10022;
-  unit_w_unit_name_error=10023;
-  unit_f_unit_name_error=10024;
-  unit_w_switch_us_missed=10025;
-  unit_f_errors_in_unit=10026;
-  unit_u_load_unit=10027;
-  unit_u_recompile_crc_change=10028;
-  unit_u_recompile_source_found_alone=10029;
-  unit_u_recompile_staticlib_is_older=10030;
-  unit_u_recompile_sharedlib_is_older=10031;
-  unit_u_recompile_obj_and_asm_older=10032;
-  unit_u_recompile_obj_older_than_asm=10033;
-  unit_u_parsing_interface=10034;
-  unit_u_parsing_implementation=10035;
-  unit_u_second_load_unit=10036;
-  unit_u_check_time=10037;
-  unit_w_cant_compile_unit_with_changed_incfile=10040;
-  unit_u_source_modified=10041;
-  unit_u_ppu_invalid_fpumode=10042;
-  unit_u_loading_interface_units=10043;
-  unit_u_loading_implementation_units=10044;
-  unit_u_interface_crc_changed=10045;
-  unit_u_implementation_crc_changed=10046;
-  unit_u_finished_compiling=10047;
-  unit_u_add_depend_to=10048;
-  unit_u_no_reload_is_caller=10049;
-  unit_u_no_reload_in_second_compile=10050;
-  unit_u_flag_for_reload=10051;
-  unit_u_forced_reload=10052;
-  unit_u_previous_state=10053;
-  unit_u_second_compile_unit=10054;
-  unit_u_loading_unit=10055;
-  unit_u_finished_loading_unit=10056;
-  unit_u_registering_new_unit=10057;
-  unit_u_reresolving_unit=10058;
-  unit_u_skipping_reresolving_unit=10059;
-  unit_u_unload_resunit=10060;
-  unit_e_different_wpo_file=10061;
-  unit_u_indirect_crc_changed=10062;
-  unit_u_ppu_invalid_memory_model=10063;
-  unit_u_loading_from_package=10064;
-  cg_f_internal_type_not_found=10065;
-  cg_f_internal_type_does_not_match=10066;
-  unit_u_ppu_llvm_mismatch=10067;
-  unit_u_ppu_invalid_wasm_exceptions_mode=10068;
-  unit_u_ppu_symansistr_mismatch=10069;
-  unit_u_ppu_wasm_threads_mismatch=10070;
-  option_usage=11000;
-  option_only_one_source_support=11001;
-  option_def_only_for_os2=11002;
-  option_no_nested_response_file=11003;
-  option_no_source_found=11004;
-  option_no_option_found=11005;
-  option_illegal_para=11006;
-  option_help_pages_para=11007;
-  option_too_many_cfg_files=11008;
-  option_unable_open_file=11009;
-  option_reading_further_from=11010;
-  option_target_is_already_set=11011;
-  option_no_shared_lib_under_dos=11012;
-  option_too_many_ifdef=11013;
-  option_too_many_endif=11014;
-  option_too_less_endif=11015;
-  option_no_debug_support=11016;
-  option_no_debug_support_recompile_fpc=11017;
-  option_obsolete_switch=11018;
-  option_obsolete_switch_use_new=11019;
-  option_switch_bin_to_src_assembler=11020;
-  option_switch_bin_to_src_assembler_cross_endian=11068;
-  option_incompatible_asm=11021;
-  option_asm_forced=11022;
-  option_using_file=11026;
-  option_using_env=11027;
-  option_handling_option=11028;
-  option_help_press_enter=11029;
-  option_start_reading_configfile=11030;
-  option_end_reading_configfile=11031;
-  option_interpreting_option=11032;
-  option_interpreting_firstpass_option=11036;
-  option_interpreting_file_option=11033;
-  option_read_config_file=11034;
-  option_found_file=11035;
-  option_code_page_not_available=11039;
-  option_config_is_dir=11040;
-  option_confict_asm_debug=11041;
-  option_ppc386_deprecated=11042;
-  option_else_without_if=11043;
-  option_unsupported_target=11044;
-  option_unsupported_target_for_feature=11045;
-  option_dwarf_smart_linking=11046;
-  option_ignored_target=11047;
-  option_debug_external_unsupported=11048;
-  option_dwarf_smartlink_creation=11049;
-  option_invalid_macosx_deployment_target=11050;
-  option_invalid_iphoneos_deployment_target=11051;
-  option_illegal_fpu_eabihf=11052;
-  option_w_unsupported_debug_format=11053;
-  option_missing_arg=11054;
-  option_malformed_para=11055;
-  option_smart_link_requires_external_linker=11056;
-  option_com_files_require_tiny_model=11057;
-  option_gc_incompatible_with_release_flag=11058;
-  option_invalid_target_architecture=11059;
-  option_features_only_for_system_unit=11060;
-  option_debug_info_requires_external_linker=11061;
-  option_valgrind_heaptrc_mismatch=11062;
-  option_unsupported_fpu=11063;
-  option_too_many_exception_modes=11064;
-  option_subtarget_is_already_set=11065;
-  option_subtarget_config_not_found=11066;
-  option_x_ignored=11067;
-  wpo_cant_find_file=12000;
-  wpo_begin_processing=12001;
-  wpo_end_processing=12002;
-  wpo_expected_section=12003;
-  wpo_no_section_handler=12004;
-  wpo_found_section=12005;
-  wpo_no_input_specified=12006;
-  wpo_not_enough_info=12007;
-  wpo_no_output_specified=12008;
-  wpo_output_without_info_gen=12009;
-  wpo_input_without_info_use=12010;
-  wpo_skipping_unnecessary_section=12011;
-  wpo_duplicate_wpotype=12012;
-  wpo_cannot_extract_live_symbol_info_strip=12013;
-  wpo_cannot_extract_live_symbol_info_no_link=12014;
-  wpo_cannot_find_symbol_progs=12015;
-  wpo_error_reading_symbol_file=12016;
-  wpo_error_executing_symbol_prog=12017;
-  wpo_symbol_live_info_needs_smart_linking=12018;
-  wpo_cant_create_feedback_file=12019;
-  package_f_cant_find_pcp=13001;
-  package_u_pcp_found=13002;
-  package_e_duplicate_package=13003;
-  package_e_unit_deny_package=13004;
-  package_n_implicit_unit_import=13005;
-  package_f_cant_create_pcp=13006;
-  package_f_cant_read_pcp=13007;
-  package_t_pcp_loading=13008;
-  package_u_pcp_name=13009;
-  package_u_pcp_flags=13010;
-  package_u_pcp_crc=13011;
-  package_u_pcp_time=13012;
-  package_u_pcp_file_too_short=13013;
-  package_u_pcp_invalid_header=13014;
-  package_u_pcp_invalid_version=13015;
-  package_u_pcp_invalid_processor=13016;
-  package_u_pcp_invalid_target=13017;
-  package_u_pcp_write=13018;
-  package_f_pcp_cannot_write=13019;
-  package_f_pcp_read_error=13020;
-  package_f_pcp_read_unexpected_end=13021;
-  package_f_pcp_invalid_entry=13022;
-  package_u_pcp_invalid_fpumode=13023;
-  package_t_packagesearch=13024;
-  package_u_required_package=13025;
-  package_u_contained_unit=13026;
-  package_e_unit_already_contained_in_package=13027;
-  package_w_unit_from_indirect_package=13028;
-  package_u_ppl_filename=13029;
-  option_logo=11023;
-  option_info=11024;
-  option_help_pages=11025;
-
-  MsgTxtSize = 92776;
-
-  MsgIdxMax : array[1..20] of longint=(
-    29,114,372,134,102,63,148,38,224,71,
-    69,20,30,1,1,1,1,1,1,1
-  );

+ 0 - 2154
compiler/msgtxt.inc

@@ -1,2154 +0,0 @@
-const msgtxt_codepage=20127;
-{$ifdef Delphi}
-const msgtxt : array[0..000386] of string[240]=(
-{$else Delphi}
-const msgtxt : array[0..000386,1..240] of char=(
-{$endif Delphi}
-  '01000_T_Compiler: $1'#000+
-  '01001_D_Compiler OS: $1'#000+
-  '01002_I_Target OS: $1'#000+
-  '01003_T_Using executable path: $1'#000+
-  '01004_T_Using unit path: $1'#000+
-  '01005_T_Using include path: $1'#000+
-  '01006_T_Using library path: $1'#000+
-  '01007_T_Using object path: $1'#000+
-  '01008_I_$1 lines co','mpiled, $2 sec$3'#000+
-  '01009_F_No memory left'#000+
-  '01010_I_Writing Resource String Table file: $1'#000+
-  '01011_E_Writing Resource String Table file: $1'#000+
-  '01012_I_Fatal:'#000+
-  '01013_I_Error:'#000+
-  '01014_I_Warning:'#000+
-  '01015_I_Note:'#000+
-  '01016_I_Hint:'#000+
-  '01017_E_Path "$1" does not exis','t'#000+
-  '01018_F_Compilation aborted'#000+
-  '01019_bytes code'#000+
-  '01020_bytes data'#000+
-  '01021_I_$1 warning(s) issued'#000+
-  '01022_I_$1 hint(s) issued'#000+
-  '01023_I_$1 note(s) issued'#000+
-  '01024_F_I/O error: $1'#000+
-  '01025_F_Operating system error: $1'#000+
-  '01026_E_Compilation raised exception i','nternally'#000+
-  '01027_T_Using unit scope: $1'#000+
-  '01028_I_Reduced file search: Not searching for uppercased or 8.3 unit '+
-  'filenames.'#000+
-  '02000_F_Unexpected end of file'#000+
-  '02001_F_String exceeds line'#000+
-  '02002_F_Illegal character "$1" ($2)'#000+
-  '02003_F_Syntax error, "$1','" expected but "$2" found'#000+
-  '02004_TL_Start reading includefile $1'#000+
-  '02005_W_Comment level $1 found'#000+
-  '02008_N_Ignored compiler switch "$1"'#000+
-  '02009_W_Illegal compiler switch "$1"'#000+
-  '02010_W_Misplaced global compiler switch, ignored'#000+
-  '02011_E_Illegal char ','constant'#000+
-  '02012_F_Cannot open file "$1"'#000+
-  '02013_F_Cannot open include file "$1"'#000+
-  '02015_E_Illegal record alignment specifier "$1"'#000+
-  '02016_E_Illegal enum minimum-size specifier "$1"'#000+
-  '02017_E_$ENDIF expected for $1 $2 defined in $3 line $4'#000+
-  '02018_E_Sy','ntax error while parsing a conditional compiling expressio'+
-  'n'#000+
-  '02019_E_Evaluating a conditional compiling expression'#000+
-  '02020_W_Macro contents are limited to 255 characters in length'#000+
-  '02021_E_ENDIF without IF(N)DEF'#000+
-  '02022_F_User defined: $1'#000+
-  '02023_E','_User defined: $1'#000+
-  '02024_W_User defined: $1'#000+
-  '02025_N_User defined: $1'#000+
-  '02026_H_User defined: $1'#000+
-  '02027_I_User defined: $1'#000+
-  '02028_E_Keyword redefined as macro has no effect'#000+
-  '02029_F_Macro buffer overflow while reading or expanding a macro'#000+
-  '02030_W_','Expanding of macros exceeds a depth of 16.'#000+
-  '02031_W_Compiler switches are not supported in // styled comments'#000+
-  '02032_DL_Handling switch "$1"'#000+
-  '02033_CL_ENDIF $1 found'#000+
-  '02034_CL_IFDEF $1 found, $2'#000+
-  '02035_CL_IFOPT $1 found, $2'#000+
-  '02036_CL_IF $1 found,',' $2'#000+
-  '02037_CL_IFNDEF $1 found, $2'#000+
-  '02038_CL_ELSE $1 found, $2'#000+
-  '02039_CL_Skipping until...'#000+
-  '02040_I_Press <return> to continue'#000+
-  '02041_W_Unsupported switch "$1"'#000+
-  '02042_W_Illegal compiler directive "$1"'#000+
-  '02043_TL_Back in $1'#000+
-  '02044_W_Unsupported applic','ation type: "$1"'#000+
-  '02045_W_APPTYPE is not supported by the target OS'#000+
-  '02046_W_DESCRIPTION is not supported by the target OS'#000+
-  '02047_N_VERSION is not supported by target OS'#000+
-  '02048_N_VERSION only for exes or DLLs'#000+
-  '02049_W_Wrong format for VERSION di','rective "$1"'#000+
-  '02050_E_Illegal assembler style specified "$1"'#000+
-  '02051_W_ASM reader switch is not possible inside asm statement, "$1" w'+
-  'ill be effective only for next'#000+
-  '02052_E_Wrong switch toggle, use ON/OFF or +/-'#000+
-  '02053_E_Resource files are not s','upported for this target'#000+
-  '02054_W_Include environment "$1" not found in environment'#000+
-  '02055_E_Illegal value for FPU register limit'#000+
-  '02056_W_Only one resource file is supported for this target'#000+
-  '02057_W_Macro support has been turned off'#000+
-  '02058_E_Il','legal interface type specified. Valids are COM, CORBA or D'+
-  'EFAULT.'#000+
-  '02059_W_APPID is only supported for PalmOS'#000+
-  '02060_W_APPNAME is only supported for PalmOS'#000+
-  '02061_E_Constant strings cannot be longer than 255 chars'#000+
-  '02062_F_Including include fil','es exceeds a depth of 16.'#000+
-  '02063_F_Too many levels of PUSH'#000+
-  '02064_E_A POP without a preceding PUSH'#000+
-  '02065_E_Macro or compile time variable "$1" does not have any value'#000+
-  '02066_E_Wrong switch toggle, use ON/OFF/DEFAULT or +/-/*'#000+
-  '02067_E_Mode switc','h "$1" not allowed here'#000+
-  '02068_E_Compile time variable or macro "$1" is not defined.'#000+
-  '02069_E_UTF-8 code greater than 65535 found'#000+
-  '02070_E_Malformed UTF-8 string'#000+
-  '02071_C_UTF-8 signature found, using UTF-8 encoding'#000+
-  '02072_E_Compile time expressi','on: Wanted $1 but got $2 at $3'#000+
-  '02073_N_APPTYPE is not supported by the target OS'#000+
-  '02074_E_Illegal optimization specified "$1"'#000+
-  '02075_W_SETPEFLAGS is not supported by the target OS'#000+
-  '02076_W_IMAGEBASE is not supported by the target OS'#000+
-  '02077_W_MI','NSTACKSIZE is not supported by the target OS'#000+
-  '02078_W_MAXSTACKSIZE is not supported by the target OS'#000+
-  '02079_E_Illegal state "$1" for $WARN directive'#000+
-  '02080_E_Illegal set packing value'#000+
-  '02081_W_PIC directive or switch ignored'#000+
-  '02082_W_The switch ','"$1" is not supported by the currently selected t'+
-  'arget'#000+
-  '02084_W_Framework-related options are only supported for Darwin/Mac OS'+
-  ' X'#000+
-  '02085_E_Illegal minimal floating point constant precision "$1"'#000+
-  '02086_W_Overriding name of "main" procedure multi','ple times, was prev'+
-  'iously set to "$1"'#000+
-  '02087_W_Illegal identifier "$1" for $WARN directive'#000+
-  '02088_E_Illegal alignment directive'#000+
-  '02089_F_It is not possible to include a file that starts with an UTF-8'+
-  ' BOM in a module that uses a different code ','page'#000+
-  '02090_W_Directive "$1" is ignored for the current target platform'#000+
-  '02091_W_Current system codepage "$1" is not available for the compiler'+
-  '. Switching default codepage back to "$2".'#000+
-  '02092_W_SETPEOPTFLAGS is not supported by the target OS'#000,
-  '02093_E_Illegal argument for SETPEFLAGS'#000+
-  '02094_E_Illegal argument for SETPEOPTFLAGS'#000+
-  '02095_E_Directive $1 is not supported on this target'#000+
-  '02096_W_The specified stack size is not within the valid range for the'+
-  ' platform. Setting the stack size ','ignored.'#000+
-  '02097_W_The specified HeapMax value is smaller than the HeapMin value.'+
-  ' Setting HeapMax ignored.'#000+
-  '02098_E_Illegal argument for HUGEPOINTERNORMALIZATION'#000+
-  '02099_E_Illegal assembler CPU instruction set specified "$1"'#000+
-  '02100_W_Specified sy','scall convention is not useable on this target'#000+
-  '02101_W_Invalid syscall convention specified'#000+
-  '02102_W_SETPEUSERVERSION is not supported by the target OS'#000+
-  '02103_W_SETPEOSVERSION is not supported by the target OS'#000+
-  '02104_W_SETPESUBSYSVERSION is no','t supported by the target OS'#000+
-  '02105_N_Changed CPU type to be consistent with specified controller'#000+
-  '02106_E_A macro/compiler variable name cannot be empty'#000+
-  '02107_E_$IFEND directive found without a matching $IF directive'#000+
-  '02108_E_$ENDIF directive',' found without a matching $IF(N)DEF directiv'+
-  'e'#000+
-  '02109_E_A Invalid RTTI clause (expected Explicit or Inherit)'#000+
-  '02110_E_A Explicit clause requires at least one option (Methods, Prope'+
-  'rties or Fields)'#000+
-  '02111_E_A Invalid RTTI option "$1" (expected M','ethods, Properties or '+
-  'Fields)'#000+
-  '02112_E_A Duplicate RTTI option "$1"'#000+
-  '02113_E_A The RTTI directive cannot be used here'#000+
-  '03000_E_Parser - Syntax Error'#000+
-  '03004_E_INTERRUPT procedure cannot be nested'#000+
-  '03005_W_Procedure type "$1" ignored'#000+
-  '03006_E_Not a','ll declarations of "$1" are declared with OVERLOAD'#000+
-  '03008_E_Duplicate exported function name "$1"'#000+
-  '03009_E_Duplicate exported function index $1'#000+
-  '03010_E_Invalid index for exported function'#000+
-  '03011_W_Relocatable DLL or executable $1 debug info do','es not work, d'+
-  'isabled.'#000+
-  '03012_W_To allow debugging for win32 code you need to disable relocati'+
-  'on with -WN option'#000+
-  '03013_E_Constructor name must be INIT'#000+
-  '03014_E_Destructor name must be DONE'#000+
-  '03016_E_Procedure type INLINE not supported'#000+
-  '03018_W_C','onstructor should be public'#000+
-  '03019_W_Destructor should be public'#000+
-  '03020_N_Class should have one destructor only'#000+
-  '03021_E_Local class definitions are not allowed'#000+
-  '03022_F_Anonymous class definitions are not allowed'#000+
-  '03023_N_The object "$1" has no',' VMT'#000+
-  '03024_E_Illegal parameter list'#000+
-  '03026_E_Wrong number of parameters specified for call to "$1"'#000+
-  '03027_E_Overloaded identifier "$1" isn'#039't a function'#000+
-  '03028_E_Overloaded functions have the same parameter list'#000+
-  '03029_E_Function header doesn'#039't ','match the previous declaration "'+
-  '$1"'#000+
-  '03030_E_Function header "$1" doesn'#039't match forward : var name chan'+
-  'ges $2 => $3'#000+
-  '03031_N_Values in enumeration types have to be ascending'#000+
-  '03033_E_With cannot be used for variables in a different segment'#000+
-  '030','34_E_Function nesting > 31'#000+
-  '03035_E_Range check error while evaluating constants'#000+
-  '03036_W_Range check error while evaluating constants'#000+
-  '03037_E_Duplicate case label'#000+
-  '03038_E_Upper bound of case range is less than lower bound'#000+
-  '03039_E_Typed const','ants of classes or interfaces are not allowed'#000+
-  '03040_E_Function variables of overloaded functions are not allowed'#000+
-  '03041_E_String length must be a value from 1 to 255'#000+
-  '03042_W_Use extended syntax of NEW and DISPOSE for instances of object'+
-  's'#000+
-  '030','43_W_Use of NEW or DISPOSE for untyped pointers is meaningless'#000+
-  '03044_E_Use of NEW or DISPOSE is not possible for untyped pointers'#000+
-  '03045_E_Class identifier expected'#000+
-  '03046_E_type identifier not allowed here'#000+
-  '03047_E_Method identifier expected'#000,
-  '03048_E_Function header doesn'#039't match any method of this class "$1'+
-  '"'#000+
-  '03049_DL_procedure/function $1'#000+
-  '03050_E_Illegal floating point constant'#000+
-  '03051_E_FAIL can be used in constructors only'#000+
-  '03052_E_Destructors cannot have parameters'#000+
-  '03053_E_Only',' class methods, class properties and class variables can'+
-  ' be referred with class references'#000+
-  '03054_E_Only class methods, class properties and class variables can b'+
-  'e accessed in class methods'#000+
-  '03055_E_Constant and CASE types do not match'#000+
-  '03056_','E_The symbol cannot be exported from a library'#000+
-  '03057_W_An inherited method is hidden by "$1"'#000+
-  '03058_E_There is no method in an ancestor class to be overridden: "$1"'+
-  #000+
-  '03059_E_No member is provided to access property'#000+
-  '03060_W_Stored property dir','ective is not yet implemented'#000+
-  '03061_E_Illegal symbol for property access'#000+
-  '03062_E_Cannot access a protected field of an object here'#000+
-  '03063_E_Cannot access a private field of an object here'#000+
-  '03066_E_Overridden methods must have the same return ','type: "$2" is o'+
-  'verridden by "$1" which has another return type'#000+
-  '03067_E_EXPORT declared functions cannot be nested'#000+
-  '03068_E_Methods cannot be EXPORTed'#000+
-  '03069_E_Call by var for arg no. $1 has to match exactly: Got "$2" expe'+
-  'cted "$3"'#000+
-  '03070_E_Cla','ss isn'#039't a parent class of the current class'#000+
-  '03071_E_SELF is only allowed in methods'#000+
-  '03072_E_Methods can be only in other methods called direct with type i'+
-  'dentifier of the class'#000+
-  '03073_E_Illegal use of '#039':'#039#000+
-  '03074_E_Range check error in set co','nstructor or duplicate set elemen'+
-  't'#000+
-  '03075_E_Pointer to object expected'#000+
-  '03076_E_Expression must be constructor call'#000+
-  '03077_E_Expression must be destructor call'#000+
-  '03078_E_Illegal order of record elements'#000+
-  '03079_E_Expression type must be class or r','ecord type, got $1'#000+
-  '03080_E_Procedures cannot return a value'#000+
-  '03081_E_constructors, destructors and class operators must be methods'#000+
-  '03082_E_Operator is not overloaded'#000+
-  '03083_E_Impossible to overload assignment for equal types'#000+
-  '03084_E_Impossibl','e operator overload'#000+
-  '03085_E_Re-raise isn'#039't possible there'#000+
-  '03086_E_The extended syntax of new or dispose isn'#039't allowed for a '+
-  'class'#000+
-  '03088_E_Procedure overloading is switched off'#000+
-  '03089_E_It is not possible to overload this operator. Related ov','erlo'+
-  'adable operators (if any) are: $1'#000+
-  '03090_E_Comparative operator must return a boolean value'#000+
-  '03091_E_Only virtual methods can be abstract'#000+
-  '03092_F_Use of unsupported feature: "$1".'#000+
-  '03093_E_The mix of different kind of objects (class, objec','t, interfa'+
-  'ce, etc) isn'#039't allowed'#000+
-  '03094_W_Unknown procedure directive had to be ignored: "$1"'#000+
-  '03095_E_$1 can be associated with only one variable'#000+
-  '03096_E_absolute can only be associated with a var or const'#000+
-  '03097_E_Only one variable can be in','itialized'#000+
-  '03098_E_Abstract methods shouldn'#039't have any definition (with funct'+
-  'ion body)'#000+
-  '03099_E_This overloaded function cannot be local (must be exported)'#000+
-  '03100_W_Virtual methods are used without a constructor in "$1"'#000+
-  '03101_CL_Macro defined:',' $1'#000+
-  '03102_CL_Macro undefined: $1'#000+
-  '03103_CL_Macro $1 set to $2'#000+
-  '03104_I_Compiling $1'#000+
-  '03105_UL_Parsing interface of unit $1'#000+
-  '03106_UL_Parsing implementation of $1'#000+
-  '03107_DL_Compiling $1 for the second time'#000+
-  '03109_E_No property found to override'#000+
-  '03','110_E_Only one default property is allowed'#000+
-  '03111_E_The default property must be an array property'#000+
-  '03112_E_Virtual constructors are only supported in class object model'#000+
-  '03113_E_No default property available'#000+
-  '03114_E_The class cannot have a pu','blished section, use the {$M+} swi'+
-  'tch'#000+
-  '03115_E_Forward declaration of class "$1" must be resolved here to use'+
-  ' the class as ancestor'#000+
-  '03116_E_Local operators not supported'#000+
-  '03117_E_Procedure directive "$1" not allowed in interface section'#000+
-  '03118','_E_Procedure directive "$1" not allowed in implementation secti'+
-  'on'#000+
-  '03119_E_Procedure directive "$1" not allowed in procvar declaration'#000+
-  '03120_E_Function is already declared Public/Forward "$1"'#000+
-  '03121_E_Cannot use both EXPORT and EXTERNAL'#000+
-  '03123','_N_"$1" not yet supported inside inline procedure/function'#000+
-  '03124_H_Inlining disabled'#000+
-  '03125_I_Writing Browser log $1'#000+
-  '03126_H_Maybe pointer dereference is missing?'#000+
-  '03127_F_Selected assembler reader not supported'#000+
-  '03128_E_Procedure directive "$','1" cannot be used with $2'#000+
-  '03129_E_Calling convention doesn'#039't match forward'#000+
-  '03131_E_Property cannot have a default value'#000+
-  '03132_E_The default value of a property must be constant'#000+
-  '03133_E_Symbol cannot be published, can be only a class'#000+
-  '03134_E','_This kind of property cannot be published'#000+
-  '03136_E_An import name is required'#000+
-  '03138_E_Division by zero'#000+
-  '03139_E_Invalid floating point operation'#000+
-  '03140_E_Upper bound of range is less than lower bound'#000+
-  '03141_W_String "$1" is longer than "$2"'#000+
-  '03','142_E_String length is larger than array of char length'#000+
-  '03143_E_Illegal expression after message directive'#000+
-  '03144_E_Message handlers can take only one call by ref. parameter'#000+
-  '03145_E_Duplicate message label: "$1"'#000+
-  '03146_E_Self can only be an e','xplicit parameter in methods which are '+
-  'message handlers'#000+
-  '03147_E_Threadvars can be only static or global'#000+
-  '03148_F_Direct assembler not supported for binary output format'#000+
-  '03149_W_Don'#039't load OBJPAS unit manually, use {$mode objfpc} or {$m'+
-  'ode de','lphi} instead'#000+
-  '03150_E_OVERRIDE cannot be used in objects'#000+
-  '03151_E_Data types which require initialization/finalization cannot be'+
-  ' used in variant records'#000+
-  '03152_E_Resourcestrings can be only static or global'#000+
-  '03153_E_Exit with argument cannot b','e used here'#000+
-  '03154_E_The type of the storage symbol must be boolean'#000+
-  '03155_E_This symbol isn'#039't allowed as storage symbol'#000+
-  '03156_E_Only classes which are compiled in $M+ mode can be published'#000+
-  '03157_E_Procedure directive expected'#000+
-  '03158_E_The val','ue for a property index must be of an ordinal type'#000+
-  '03159_E_Procedure name too short to be exported'#000+
-  '03160_E_No DEFFILE entry can be generated for unit global vars'#000+
-  '03161_E_Compile without -WD option'#000+
-  '03162_F_You need ObjFpc (-S2) or Delphi (-S','d) mode to compile this m'+
-  'odule'#000+
-  '03163_E_Cannot export with index under $1'#000+
-  '03164_E_Exporting of variables is not supported under $1'#000+
-  '03165_E_Improper GUID syntax'#000+
-  '03168_W_Procedure named "$1" not found that is suitable for implementi'+
-  'ng the $2.$','3'#000+
-  '03169_E_Interface identifier expected'#000+
-  '03170_E_Type "$1" cannot be used as array index type'#000+
-  '03171_E_Con- and destructors are not allowed in interfaces'#000+
-  '03172_E_Access specifiers cannot be used in INTERFACEs and OBJCPROTOCO'+
-  'Ls'#000+
-  '03173_E_An inte','rface, helper or Objective-C protocol or category can'+
-  'not contain fields'#000+
-  '03174_E_Cannot declare local procedure as EXTERNAL'#000+
-  '03175_W_Some fields coming before "$1" were not initialized'#000+
-  '03176_E_Some fields coming before "$1" were not initializ','ed'#000+
-  '03177_W_Some fields coming after "$1" were not initialized'#000+
-  '03178_E_VarArgs directive (or '#039'...'#039' in MacPas) without CDecl/C'+
-  'PPDecl/MWPascal/StdCall and External'#000+
-  '03179_E_Self must be a normal (call-by-value) parameter'#000+
-  '03180_E_Interface "$1" ','has no interface identification'#000+
-  '03181_E_Unknown class field or method identifier "$1"'#000+
-  '03182_W_Overriding calling convention "$1" with "$2"'#000+
-  '03183_E_Typed constants of the type "procedure of object" need a Self '+
-  'pointer that'#039's known at compile',' time'#000+
-  '03184_E_Default value can only be assigned to one parameter'#000+
-  '03185_E_Default parameter required for "$1"'#000+
-  '03186_W_Use of unsupported feature!'#000+
-  '03187_H_C arrays are passed by reference'#000+
-  '03188_E_C array of const must be the last argument'#000+
-  '03','189_H_Type "$1" redefinition'#000+
-  '03190_W_cdecl'#039'ared functions have no high parameter'#000+
-  '03191_W_cdecl'#039'ared functions do not support open strings'#000+
-  '03192_E_Cannot initialize variables declared as threadvar'#000+
-  '03193_E_Message directive is only allowed in',' Classes'#000+
-  '03194_E_Procedure or Function expected'#000+
-  '03195_W_Calling convention directive ignored: "$1"'#000+
-  '03196_E_REINTRODUCE cannot be used in objects'#000+
-  '03197_E_Each argument must have its own location'#000+
-  '03198_E_Each argument must have an explicit lo','cation'#000+
-  '03199_E_Invalid explicit parameter location specified'#000+
-  '03200_E_32 Bit-Integer or pointer variable expected'#000+
-  '03201_E_Goto statements are not allowed between different procedures'#000+
-  '03202_F_Procedure too complex, it requires too many regist','ers'#000+
-  '03203_E_Illegal expression'#000+
-  '03204_E_Invalid integer expression'#000+
-  '03205_E_Illegal qualifier'#000+
-  '03206_E_High range limit < low range limit'#000+
-  '03207_E_Exit'#039's parameter must be the name of the procedure it is u'+
-  'sed in or of a surrounding procedure'#000+
-  '03','208_E_Illegal assignment to for-loop variable "$1"'#000+
-  '03209_E_Cannot declare local variable as EXTERNAL'#000+
-  '03210_E_Procedure is already declared EXTERNAL'#000+
-  '03211_W_Implicit uses of Variants unit'#000+
-  '03212_E_Class and static methods cannot be used in IN','TERFACES'#000+
-  '03213_E_Overflow in arithmetic operation'#000+
-  '03214_E_Protected or private expected'#000+
-  '03215_E_SLICE cannot be used outside of parameter list'#000+
-  '03216_E_A DISPINTERFACE cannot have a parent class'#000+
-  '03217_E_A DISPINTERFACE needs a guid'#000+
-  '03218_W_O','verridden methods must have a related return type. This cod'+
-  'e may crash, it depends on a Delphi parser bug ("$2" is overridden by '+
-  '"$1" which has another return type)'#000+
-  '03219_E_Dispatch IDs must be ordinal constants'#000+
-  '03220_E_The range of the arr','ay is too large'#000+
-  '03221_E_The address cannot be taken of bit packed array elements and r'+
-  'ecord fields'#000+
-  '03222_E_Dynamic arrays cannot be packed'#000+
-  '03223_E_Bit packed array elements and record fields cannot be used as '+
-  'loop variables'#000+
-  '03224_E_VAR, TYP','E and CONST are allowed only in records, objects and'+
-  ' classes'#000+
-  '03225_E_This type cannot be a generic'#000+
-  '03226_W_Don'#039't load LINEINFO unit manually, Use the -gl compiler sw'+
-  'itch instead'#000+
-  '03227_E_No function result type specified for function "$1"'#000+
-  '03','228_E_Specialization is only supported for generic types'#000+
-  '03229_E_Generics cannot be used as parameters when specializing generi'+
-  'cs'#000+
-  '03230_E_Constants of objects containing a VMT are not allowed'#000+
-  '03231_E_Taking the address of labels defined out','side the current sco'+
-  'pe isn'#039't allowed'#000+
-  '03233_E_Cannot initialize variables declared as external'#000+
-  '03234_E_Illegal function result type'#000+
-  '03235_E_No common type possible between "$1" and "$2"'#000+
-  '03236_E_Generics without specialization cannot be used ','as a type for'+
-  ' a variable'#000+
-  '03237_W_Register list is ignored for pure assembler routines'#000+
-  '03238_E_Implements property must have class or interface type'#000+
-  '03239_E_Implements-property must implement interface of correct type, '+
-  'found "$1" expected "$','2"'#000+
-  '03240_E_Implements-property must have read specifier'#000+
-  '03241_E_Implements-property must not have write-specifier'#000+
-  '03242_E_Implements-property must not have stored-specifier'#000+
-  '03243_E_Implements-property used on unimplemented interface: "$1"'#000+
-  '0','3244_E_Floating point not supported for this target'#000+
-  '03245_E_Class "$1" does not implement interface "$2"'#000+
-  '03246_E_Type used by implements must be an interface'#000+
-  '03247_E_Variables cannot be exported with a different name on this tar'+
-  'get, add the',' name to the declaration using the "export" directive (v'+
-  'ariable name: $1, declared export name: $2)'#000+
-  '03248_E_Weak external symbols are not supported for the current target'+
-  #000+
-  '03249_E_Forward type definition does not match'#000+
-  '03250_N_Virtual method',' "$1" has a lower visibility ($2) than parent '+
-  'class $3 ($4)'#000+
-  '03251_E_Fields cannot appear after a method or property definition, st'+
-  'art a new visibility section first'#000+
-  '03252_E_Parameters or result types cannot contain local type definitio'+
-  'ns. U','se a separate type definition in a type block.'#000+
-  '03253_E_ABSTRACT and SEALED conflict'#000+
-  '03254_E_Cannot create a descendant of the sealed class "$1"'#000+
-  '03255_E_SEALED class cannot have an ABSTRACT method'#000+
-  '03256_E_Only virtual methods can be final'#000+
-  '03','257_E_Final method cannot be overridden: "$1"'#000+
-  '03258_E_Only one message can be used per method.'#000+
-  '03259_E_Invalid enumerator identifier: "$1"'#000+
-  '03260_E_Enumerator identifier required'#000+
-  '03261_E_Enumerator MoveNext pattern method is not valid. Metho','d must'+
-  ' be a function with the Boolean return type and no required arguments.'+
-  #000+
-  '03262_E_Enumerator Current pattern property is not valid. Property mus'+
-  't have a getter.'#000+
-  '03263_E_Only one enumerator MoveNext method is allowed per class/objec'+
-  't'#000+
-  '0326','4_E_Only one enumerator Current property is allowed per class/ob'+
-  'ject'#000+
-  '03265_E_For in loop cannot be used for the type "$1"'#000+
-  '03266_E_Objective-C messages require their Objective-C selector name t'+
-  'o be specified using the "message" directive.'#000+
-  '03','267_E_Objective-C does not have formal constructors nor destructor'+
-  's. Use the alloc, initXXX and dealloc messages.'#000+
-  '03268_E_Message name is too long (max. 255 characters)'#000+
-  '03269_E_Objective-C message symbol name for "$1" is too long'#000+
-  '03270_H_De','fining a new Objective-C root class. To derive from anothe'+
-  'r root class (e.g., NSObject), specify it as the parent class.'#000+
-  '03271_E_Objective-C classes cannot have published sections.'#000+
-  '03272_F_This module requires an Objective-C mode switch to ','be compil'+
-  'ed'#000+
-  '03273_E_Inherited methods can only be overridden in Objective-C and Ja'+
-  'va, add "override" (inherited method defined in $1)'#000+
-  '03274_H_Inherited methods can only be overridden in Objective-C and Ja'+
-  'va, add "override" (inherited method',' defined in $1).'#000+
-  '03275_E_Message name "$1" in inherited class is different from message'+
-  ' name "$2" in current class.'#000+
-  '03276_E_It is not yet possible to make unique copies of Objective-C or'+
-  ' Java types'#000+
-  '03277_E_Objective-C categories and Object ','Pascal class helpers canno'+
-  't be used as types'#000+
-  '03278_E_Categories do not override, but replace methods. Use "reintrod'+
-  'uce" instead.'#000+
-  '03279_E_Replaced methods can only be reintroduced in Objective-C, add '+
-  '"reintroduce" (replaced method defined in',' $1).'#000+
-  '03280_H_Replaced methods can only be reintroduced in Objective-C, add '+
-  '"reintroduce" (replaced method defined in $1).'#000+
-  '03281_E_Getter for implements interface must use the target'#039's defa'+
-  'ult calling convention.'#000+
-  '03282_E_Typed files cannot ','contain reference-counted types.'#000+
-  '03283_E_Operator is not overloaded: $2 "$1"'#000+
-  '03284_E_Operator is not overloaded: "$1" $2 "$3"'#000+
-  '03285_E_Expected another $1 array elements'#000+
-  '03286_E_String constant too long while ansistrings are disabled'#000+
-  '03287_E','_Type cannot be used as univ parameter because its size is un'+
-  'known at compile time: "$1"'#000+
-  '03288_E_Only one class constructor can be declared in class: "$1"'#000+
-  '03289_E_Only one class destructor can be declared in class: "$1"'#000+
-  '03290_E_Class constr','uctors cannot have parameters'#000+
-  '03291_E_Class destructors cannot have parameters'#000+
-  '03292_F_This construct requires the \{\$modeswitch objectivec1\} mode '+
-  'switch to be active'#000+
-  '03293_E_Unicodechar/string constants cannot be converted to ansi/short'+
-  's','tring at compile-time'#000+
-  '03294_E_For-in Objective-Pascal loops require \{\$modeswitch Objective'+
-  'C2\} to be active'#000+
-  '03295_E_The compiler cannot find the NSFastEnumerationProtocol or NSFa'+
-  'stEnumerationState type in the CocoaAll unit'#000+
-  '03296_E_Typed c','onstants of the type '#039'procedure is nested'#039' ca'+
-  'n only be initialized with NIL and global procedures/functions'#000+
-  '03297_F_Declaration of generic inside another generic is not allowed'#000+
-  '03298_E_Forward declaration "$1" must be resolved before a clas','s can'+
-  ' conform to or implement it'#000+
-  '03299_E_Record types cannot have published sections'#000+
-  '03300_E_Destructors are not allowed in records or helpers'#000+
-  '03301_E_Class methods must be static in records'#000+
-  '03302_E_Parameterless constructors are not allowe','d in records or rec'+
-  'ord/type helpers'#000+
-  '03303_E_Either the result or at least one parameter must be of type "$'+
-  '1"'#000+
-  '03304_E_Type parameters may require initialization/finalization - cann'+
-  'ot be used in variant records'#000+
-  '03305_E_Variables being declare','d as external cannot be in a custom s'+
-  'ection'#000+
-  '03306_E_Non-static and non-global variables cannot have a section dire'+
-  'ctive'#000+
-  '03307_E_"$1" is not allowed in helper types'#000+
-  '03308_E_Class constructors are not allowed in helpers'#000+
-  '03309_E_The use of "in','herited" is not allowed in a record'#000+
-  '03310_E_Type declarations are not allowed in local or anonymous record'+
-  's'#000+
-  '03311_E_Duplicate implements clause for interface "$1"'#000+
-  '03312_E_Interface "$1" cannot be delegated by "$2", it already has met'+
-  'hod res','olutions'#000+
-  '03313_E_Interface "$1" cannot have method resolutions, "$2" already de'+
-  'legates it'#000+
-  '03314_E_Invalid codepage'#000+
-  '03315_E_Only fields (var-sections) and constants can be final in objec'+
-  't types'#000+
-  '03316_E_Final fields are currently only support','ed for external class'+
-  'es'#000+
-  '03317_E_Typed constants are not allowed here, only formal constants ar'+
-  'e'#000+
-  '03318_E_Constructors are not automatically inherited in the JVM; expli'+
-  'citly add a constructor that calls the inherited one if you need it'#000+
-  '03319_','D_Parsing internally generated code: $1'#000+
-  '03320_E_This language feature is not supported on managed VM targets'#000+
-  '03321_E_Calling a virtual constructor for the current instance inside '+
-  'another constructor is not possible on the JVM target'#000+
-  '03322_E','_Overriding method "$1" cannot have a lower visibility ($2) t'+
-  'han in parent class $3 ($4)'#000+
-  '03323_E_Procedure/Function declared with call option NOSTACKFRAME but '+
-  'without ASSEMBLER'#000+
-  '03324_E_Procedure/Function declared with call option NOSTACKFRA','ME bu'+
-  't local stack size is $1'#000+
-  '03325_E_Cannot generate property getter/setter $1 because its name cla'+
-  'shes with existing identifier $2'#000+
-  '03326_W_Automatically generated property getter/setter $1 overrides th'+
-  'e same-named getter/setter in class $','2'#000+
-  '03327_W_Case mismatch between declared property getter/setter $1 and a'+
-  'utomatically constructed name $2, not changing declared name'#000+
-  '03328_E_Constants declarations are not allowed in local or anonymous r'+
-  'ecords'#000+
-  '03329_E_Method declarations ar','e not allowed in local or anonymous re'+
-  'cords'#000+
-  '03330_E_Property declarations are not allowed in local or anonymous re'+
-  'cords'#000+
-  '03331_E_Class member declarations are not allowed in local or anonymou'+
-  's records'#000+
-  '03332_E_Visibility section "$1" not allo','wed in records'#000+
-  '03333_E_Directive "$1" not allowed here'#000+
-  '03334_E_Assembler blocks not allowed inside generics'#000+
-  '03335_E_Properties can be only static, global or inside structured typ'+
-  'es'#000+
-  '03336_E_Overloaded routines have the same mangled name'#000+
-  '0333','7_E_Default values can only be specified for value, const and co'+
-  'nstref parameters'#000+
-  '03338_W_Pointer type "$1" ignored'#000+
-  '03339_E_Generic template in interface section references symbol in imp'+
-  'lementation section'#000+
-  '03340_UL_Unit $1 has been already ','compiled meanwhile.'#000+
-  '03341_E_Explicit implementation of methods for specializations of gene'+
-  'rics is not allowed'#000+
-  '03342_E_Generic methods are not allowed in interfaces'#000+
-  '03343_E_Generic methods can not be virtual'#000+
-  '03344_E_Dynamic packages not supp','orted for target OS'#000+
-  '03345_E_The HardFloat directive cannot be used if soft float code is g'+
-  'enerated or fpu emulation is turned on'#000+
-  '03346_E_Index $1 is not a valid internal function index'#000+
-  '03347_W_Operator overload hidden by internal operator: ','"$1" $2 "$3"'#000+
-  '03348_E_Thread variables inside classes or records must be class varia'+
-  'bles'#000+
-  '03349_E_Only static methods and static variables can be referenced thr'+
-  'ough an object type'#000+
-  '03350_E_Cannot redeclare C-style variadic function "$1" as ext','ernal '+
-  'on this platform; make its first declaration already external'#000+
-  '03351_E_Unbound custom attribute: "$1".'#000+
-  '03352_E_Enumeration symbols can only have values in the range of -2^31'+
-  ' to 2^31-1'#000+
-  '03353_W_Enumeration symbols can only have values in',' the range of -2^'+
-  '31 to 2^31-1'#000+
-  '03354_E_Implementing a method for type "$1" declared in another unit'#000+
-  '03355_E_Generic constraint not allowed here'#000+
-  '03356_E_Explicit location is too small for parameter'#000+
-  '03357_E_Explicit location size is larger tha','n required by parameter'#000+
-  '03358_E_Only data registers are supported for explicit location regist'+
-  'er pairs'#000+
-  '03359_E_Only consecutive registers are supported for explicit location'+
-  ' register pairs'#000+
-  '03360_E_Constructors cannot take type parameters'#000+
-  '03','361_E_Raise in subroutines declared as noreturn is not allowed'#000+
-  '03362_E_Directive section not allowed for this target'#000+
-  '03363_E_Absolute variable cannot reference itself'#000+
-  '03364_E_Syntax of syscall directive not supported by current target'#000+
-  '03365','_W_This property will not be published'#000+
-  '03366_E_WebAssembly reference types can only be passed by value'#000+
-  '03367_E_Declaring exports as '#039'promising'#039' is WebAssembly-specif'+
-  'ic and is not supported on the current platform'#000+
-  '03368_E_Declaring externals',' as '#039'suspending'#039' is WebAssembly-s'+
-  'pecific and is not supported on the current platform'#000+
-  '03369_W_Reducing Widechar set to single-byte AnsiChar set.'#000+
-  '03370_E_Using '#039'string'#039' alias is not allowed in the system unit'+
-  '. Use short-,ansi- or unicodestri','ng.'#000+
-  '03371_E_C styled assignment operators are turned off'#000+
-  '04000_E_Type mismatch'#000+
-  '04001_E_Incompatible types: got "$1" expected "$2"'#000+
-  '04002_E_Type mismatch between "$1" and "$2"'#000+
-  '04003_E_Type identifier expected'#000+
-  '04004_E_Variable identifier expec','ted'#000+
-  '04005_E_Integer expression expected, but got "$1"'#000+
-  '04006_E_Boolean expression expected, but got "$1"'#000+
-  '04007_E_Ordinal expression expected'#000+
-  '04008_E_Pointer type expected, but got "$1"'#000+
-  '04009_E_Class type expected, but got "$1"'#000+
-  '04011_E_Can'#039't ','evaluate constant expression'#000+
-  '04012_E_Set elements are not compatible'#000+
-  '04013_E_Operation not implemented for sets'#000+
-  '04014_W_Automatic type conversion from floating type to COMP which is '+
-  'an integer type'#000+
-  '04015_H_Use DIV instead to get an integer ','result'#000+
-  '04016_E_String types have to match exactly in $V+ mode'#000+
-  '04017_E_Succ or Pred on enums with assignments not possible'#000+
-  '04018_E_Can'#039't read or write variables of this type'#000+
-  '04019_E_Can'#039't use readln or writeln on typed file'#000+
-  '04020_E_Can'#039't use',' read or write on untyped file.'#000+
-  '04021_E_Type conflict between set elements'#000+
-  '04022_W_lo/hi(dword/qword) returns the upper/lower word/dword'#000+
-  '04023_E_Integer or real expression expected'#000+
-  '04024_E_Wrong type "$1" in array constructor'#000+
-  '04025_E_Incomp','atible type for arg no. $1: Got "$2", expected "$3"'#000+
-  '04026_E_Method (variable) and Procedure (variable) are not compatible'#000+
-  '04027_E_Illegal constant passed to internal math function'#000+
-  '04028_E_Can'#039't take the address of constant expressions'#000+
-  '04029','_E_Argument cannot be assigned to'#000+
-  '04030_E_Can'#039't assign local procedure/function to procedure variabl'+
-  'e'#000+
-  '04031_E_Can'#039't assign values to an address'#000+
-  '04032_E_Can'#039't assign values to const variable'#000+
-  '04033_E_Array type required'#000+
-  '04034_E_Interface type',' expected, but got "$1"'#000+
-  '04035_H_Mixing signed expressions and longwords gives a 64 bit result'#000+
-  '04036_W_Mixing signed expressions and cardinals here may cause a range'+
-  ' check error'#000+
-  '04037_E_Typecast has different size ($1 -> $2) in assignment'#000+
-  '04','038_E_Enums with assignments cannot be used as array index'#000+
-  '04039_E_Class or Object types "$1" and "$2" are not related'#000+
-  '04040_W_Class types "$1" and "$2" are not related'#000+
-  '04041_E_Class or interface type expected, but got "$1"'#000+
-  '04042_E_Type "$1','" is not completely defined'#000+
-  '04043_W_String literal has more characters than short string length'#000+
-  '04044_W_Comparison might be always false due to range of constant and '+
-  'expression'#000+
-  '04045_W_Comparison might be always true due to range of constan','t and'+
-  ' expression'#000+
-  '04046_W_Constructing a class "$1" with abstract method "$2"'#000+
-  '04047_H_The left operand of the IN operator should be byte sized'#000+
-  '04048_W_Type size mismatch, possible loss of data / range check error'#000+
-  '04049_H_Type size mismatch, ','possible loss of data / range check erro'+
-  'r'#000+
-  '04050_E_The address of an abstract method cannot be taken'#000+
-  '04051_E_Assignments to formal parameters and open arrays are not possi'+
-  'ble'#000+
-  '04052_E_Constant Expression expected'#000+
-  '04053_E_Operation "$1" not su','pported for types "$2" and "$3"'#000+
-  '04054_E_Illegal type conversion: "$1" to "$2"'#000+
-  '04055_H_Conversion between ordinals and pointers is not portable'#000+
-  '04056_W_Conversion between ordinals and pointers is not portable'#000+
-  '04057_E_Can'#039't determine which ov','erloaded function to call'#000+
-  '04058_E_Illegal counter variable'#000+
-  '04059_W_Converting constant real value to double for C variable argume'+
-  'nt, add explicit typecast to prevent this.'#000+
-  '04060_E_Class or COM interface type expected, but got "$1"'#000+
-  '04061_E_C','onstant packed arrays are not yet supported'#000+
-  '04062_E_Incompatible type for arg no. $1: Got "$2" expected "(Bit)Pack'+
-  'ed Array"'#000+
-  '04063_E_Incompatible type for arg no. $1: Got "$2" expected "(not pack'+
-  'ed) Array"'#000+
-  '04064_E_Elements of packed arrays c','annot be of a type which need to '+
-  'be initialised'#000+
-  '04065_E_Constant packed records and objects are not yet supported'#000+
-  '04066_W_Arithmetic "$1" on untyped pointer is unportable to {$T+}, sug'+
-  'gest typecast'#000+
-  '04076_E_Can'#039't take address of a subroutine',' marked as local'#000+
-  '04077_E_Can'#039't export subroutine marked as local from a unit'#000+
-  '04078_E_Type is not automatable: "$1"'#000+
-  '04079_H_Converting the operands to "$1" before doing the add could pre'+
-  'vent overflow errors.'#000+
-  '04080_H_Converting the operands t','o "$1" before doing the subtract co'+
-  'uld prevent overflow errors.'#000+
-  '04081_H_Converting the operands to "$1" before doing the multiply coul'+
-  'd prevent overflow errors.'#000+
-  '04082_W_Converting pointers to signed integers may result in wrong com'+
-  'parison r','esults and range errors, use an unsigned type instead.'#000+
-  '04083_E_Interface type $1 has no valid GUID'#000+
-  '04084_E_Invalid selector name "$1"'#000+
-  '04085_E_Expected Objective-C method, but got $1'#000+
-  '04086_E_Expected Objective-C method or constant method nam','e'#000+
-  '04087_E_No type info available for this type'#000+
-  '04088_E_Ordinal or string expression expected'#000+
-  '04089_E_String expression expected'#000+
-  '04090_W_Converting 0 to NIL'#000+
-  '04091_E_Objective-C protocol type expected, but got "$1"'#000+
-  '04092_E_The type "$1" is no','t supported for interaction with the Obje'+
-  'ctive-C and the blocks runtime.'#000+
-  '04093_E_Class or objcclass type expected, but got "$1"'#000+
-  '04094_E_Objcclass type expected'#000+
-  '04095_W_Coerced univ parameter type in procedural variable may cause c'+
-  'rash or me','mory corruption: $1 to $2'#000+
-  '04096_E_Type parameters of specializations of generics cannot referenc'+
-  'e the currently specialized type'#000+
-  '04097_E_Type parameters are not allowed on non-generic class/record/ob'+
-  'ject procedure or function'#000+
-  '04098_E_Generi','c declaration of "$1" differs from previous declaratio'+
-  'n'#000+
-  '04099_E_Helper type expected'#000+
-  '04100_E_Record type expected'#000+
-  '04101_E_Derived class helper must extend a subclass of "$1" or the cla'+
-  'ss itself'#000+
-  '04102_E_Derived record or type helper must ext','end "$1"'#000+
-  '04103_E_Invalid assignment, procedures return no value'#000+
-  '04104_W_Implicit string type conversion from "$1" to "$2"'#000+
-  '04105_W_Implicit string type conversion with potential data loss from '+
-  '"$1" to "$2"'#000+
-  '04106_-W_Explicit string typecast f','rom "$1" to "$2"'#000+
-  '04107_-W_Explicit string typecast with potential data loss from "$1" t'+
-  'o "$2"'#000+
-  '04108_W_Unicode constant cast with potential data loss'#000+
-  '04109_E_Range check error while evaluating constants ($1 must be betwe'+
-  'en $2 and $3)'#000+
-  '04110_W','_Range check error while evaluating constants ($1 must be bet'+
-  'ween $2 and $3)'#000+
-  '04111_E_This type is not supported for the Default() intrinsic'#000+
-  '04112_E_JVM virtual class methods cannot be static'#000+
-  '04113_E_Final (class) fields can only be assigned',' in their class'#039+
-  ' (class) constructor'#000+
-  '04114_E_It is not possible to typecast untyped parameters on managed p'+
-  'latforms, simply assign a value to them instead.'#000+
-  '04115_E_The assignment side of an expression cannot be typecasted to a'+
-  ' supertype on ','managed platforms'#000+
-  '04116_-W_The interface method "$1" raises the visibility of "$2" to pu'+
-  'blic when accessed via an interface instance'#000+
-  '04117_E_The interface method "$1" has a higher visibility (public) tha'+
-  'n "$2"'#000+
-  '04118_E_TYPEOF can only be use','d on object types with VMT'#000+
-  '04119_E_It is not possible to define a default value for a parameter o'+
-  'f type "$1"'#000+
-  '04120_E_Type "$1" cannot be extended by a type helper'#000+
-  '04121_E_Procedure or function must be far in order to allow taking its'+
-  ' addres','s: "$1"'#000+
-  '04122_W_Creating an instance of abstract class "$1"'#000+
-  '04123_E_Subroutine references cannot be declared as "of object" or "is'+
-  ' nested", they can always refer to any kind of subroutine'#000+
-  '04124_E_Procedure variables in that memory model do ','not store segmen'+
-  't information'#000+
-  '04125_W_The first value of a set constructur range is greater then the'+
-  ' second value, so the range describes an empty set.'#000+
-  '04126_E_C block reference must use CDECL or MWPASCAL calling conventio'+
-  'n.'#000+
-  '04127_E_The int','erface type of the forward declaration and the declar'+
-  'ed interface type do not match for interface $1'#000+
-  '04128_E_Type not allowed for generic constant parameter: $1'#000+
-  '04129_E_Can'#039't read or write variables of this type in iso mode'#000+
-  '04130_W_The leng','th of the constant string (length is $1) must be equ'+
-  'al to the number of array elements ($2 elements)'#000+
-  '04131_E_A nested function variable can not be assigned to a function r'+
-  'eference.'#000+
-  '04132_E_Cannot take the address of a WebAssembly externref'#000,
-  '04133_E_WebAssembly reference types don'#039't have an observable size'#000+
-  '05000_E_Identifier not found "$1"'#000+
-  '05001_F_Internal Error in SymTableStack()'#000+
-  '05002_E_Duplicate identifier "$1"'#000+
-  '05003_H_Identifier already defined in $1 at line $2'#000+
-  '05004_E_Unkn','own identifier "$1"'#000+
-  '05005_E_Forward declaration not solved "$1"'#000+
-  '05007_E_Error in type definition'#000+
-  '05009_E_Forward type not resolved "$1"'#000+
-  '05010_E_Only static variables can be used in static methods or outside'+
-  ' methods'#000+
-  '05012_E_Record or object ','or class type expected'#000+
-  '05013_E_Instances of classes or objects with an abstract method are no'+
-  't allowed'#000+
-  '05014_W_Label not defined "$1"'#000+
-  '05015_E_Label used but not defined "$1"'#000+
-  '05016_E_Illegal label declaration'#000+
-  '05017_E_GOTO and LABEL are not s','upported (use switch -Sg)'#000+
-  '05018_E_Label not found'#000+
-  '05019_E_Identifier isn'#039't a label'#000+
-  '05020_E_Label already defined'#000+
-  '05021_E_Illegal type declaration of set elements'#000+
-  '05022_E_Forward class definition not resolved "$1"'#000+
-  '05023_H_Unit "$1" not used ','in $2'#000+
-  '05024_H_Parameter "$1" not used'#000+
-  '05025_N_Local variable "$1" not used'#000+
-  '05026_H_Value parameter "$1" is assigned but never used'#000+
-  '05027_N_Local variable "$1" is assigned but never used'#000+
-  '05028_H_Local $1 "$2" is not used'#000+
-  '05029_N_Private fiel','d "$1.$2" is never used'#000+
-  '05030_N_Private field "$1.$2" is assigned but never used'#000+
-  '05031_N_Private method "$1.$2" never used'#000+
-  '05032_E_Set type expected'#000+
-  '05033_W_Function result does not seem to be set'#000+
-  '05034_W_Type "$1" is not aligned correctly ','in current record for C'#000+
-  '05035_E_Unknown record field identifier "$1"'#000+
-  '05036_W_Local variable "$1" does not seem to be initialized'#000+
-  '05037_W_Variable "$1" does not seem to be initialized'#000+
-  '05038_E_Identifier idents no member "$1"'#000+
-  '05039_H_Found de','claration: $1'#000+
-  '05040_E_Data element too large'#000+
-  '05042_E_No matching implementation for interface method "$1" found'#000+
-  '05043_W_Symbol "$1" is deprecated'#000+
-  '05044_W_Symbol "$1" is not portable'#000+
-  '05055_W_Symbol "$1" is not implemented'#000+
-  '05056_E_Can'#039't creat','e unique type from this type'#000+
-  '05057_H_Local variable "$1" does not seem to be initialized'#000+
-  '05058_H_Variable "$1" does not seem to be initialized'#000+
-  '05059_W_Function result variable does not seem to be initialized'#000+
-  '05060_H_Function result variable',' does not seem to be initialized'#000+
-  '05061_W_Variable "$1" read but nowhere assigned'#000+
-  '05062_H_Found abstract method: $1'#000+
-  '05063_W_Symbol "$1" is experimental'#000+
-  '05064_W_Forward declaration "$1" not resolved, assumed external'#000+
-  '05065_W_Symbol "$1" is be','longs to a library'#000+
-  '05066_W_Symbol "$1" is deprecated: "$2"'#000+
-  '05067_E_Cannot find an enumerator for the type "$1"'#000+
-  '05068_E_Cannot find a "MoveNext" method in enumerator "$1"'#000+
-  '05069_E_Cannot find a "Current" property in enumerator "$1"'#000+
-  '05070_E_Mi','smatch between number of declared parameters and number of'+
-  ' colons in message string.'#000+
-  '05071_N_Private type "$1.$2" never used'#000+
-  '05072_N_Private const "$1.$2" never used'#000+
-  '05073_N_Private property "$1.$2" never used'#000+
-  '05074_W_Unit "$1" is deprecate','d'#000+
-  '05075_W_Unit "$1" is deprecated: "$2"'#000+
-  '05076_W_Unit "$1" is not portable'#000+
-  '05077_W_Unit "$1" is belongs to a library'#000+
-  '05078_W_Unit "$1" is not implemented'#000+
-  '05079_W_Unit "$1" is experimental'#000+
-  '05080_E_No full definition of the formally declared c','lass "$1" is in'+
-  ' scope. Add the unit containing its full definition to the uses clause'+
-  '.'#000+
-  '05081_E_Gotos into initialization or finalization blocks of units are '+
-  'not allowed'#000+
-  '05082_E_Invalid external name "$1" for formal class "$2"'#000+
-  '05083_E_Comple','te class definition with external name "$1" here'#000+
-  '05084_W_Possible library conflict: symbol "$1" from library "$2" also '+
-  'found in library "$3"'#000+
-  '05085_E_Cannot add implicit constructor '#039'Create'#039' because ident'+
-  'ifier already used by "$1"'#000+
-  '05086_E_Ca','nnot generate default constructor for class, because paren'+
-  't has no parameterless constructor'#000+
-  '05087_D_Adding helper for $1'#000+
-  '05088_E_Found declaration: $1'#000+
-  '05089_W_Local variable "$1" of a managed type does not seem to be init'+
-  'ialized'#000+
-  '05090_W_Va','riable "$1" of a managed type does not seem to be initiali'+
-  'zed'#000+
-  '05091_H_Local variable "$1" of a managed type does not seem to be init'+
-  'ialized'#000+
-  '05092_H_Variable "$1" of a managed type does not seem to be initialize'+
-  'd'#000+
-  '05093_W_Function result vari','able of a managed type does not seem to '+
-  'be initialized'#000+
-  '05094_H_Function result variable of a managed type does not seem to be'+
-  ' initialized'#000+
-  '05095_W_Duplicate identifier "$1"'#000+
-  '05096_E_Generic type parameter "$1" does not match with the one in t','h'+
-  'e declaration'#000+
-  '05097_E_Generic type parameter declared as "$1"'#000+
-  '05098_E_Record or object type expected'#000+
-  '05099_E_Symbol "$1" can not be captured'#000+
-  '05100_F_System unit not loaded'#000+
-  '05101_E_WebAssembly reference types cannot be used inside records, ','o'+
-  'bjects, or classes'#000+
-  '06009_E_Parameter list size exceeds 65535 bytes'#000+
-  '06012_E_File types must be var parameters'#000+
-  '06013_E_The use of a far pointer isn'#039't allowed there'#000+
-  '06015_E_EXPORT declared functions cannot be called'#000+
-  '06016_W_Possible illegal c','all of constructor or destructor'#000+
-  '06017_N_Inefficient code'#000+
-  '06018_W_Unreachable code'#000+
-  '06020_E_Abstract methods cannot be called directly'#000+
-  '06027_DL_Register $1 weight $2 $3'#000+
-  '06029_DL_Stack frame is omitted'#000+
-  '06031_E_Object or class methods cannot b','e inline.'#000+
-  '06032_E_Procvar calls cannot be inline.'#000+
-  '06033_E_No code for inline procedure stored'#000+
-  '06035_E_Element zero of an ansi/wide- or longstring cannot be accessed'+
-  ', use (set)length instead'#000+
-  '06037_E_Constructors or destructors cannot be call','ed inside a '#039'w'+
-  'ith'#039' clause'#000+
-  '06038_E_Cannot call message handler methods directly'#000+
-  '06039_E_Jump in or outside of an exception block'#000+
-  '06040_E_Control flow statements are not allowed in a finally block'#000+
-  '06041_W_Parameters size exceeds limit for cer','tain cpu'#039's'#000+
-  '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+
-  '06043_E_Local variables size exceeds supported limit'#000+
-  '06044_E_BREAK not allowed'#000+
-  '06045_E_CONTINUE not allowed'#000+
-  '06046_F_Unknown compilerproc "$1". Check if you use the correc','t run '+
-  'time library.'#000+
-  '06047_F_Cannot find system type "$1". Check if you use the correct run'+
-  ' time library.'#000+
-  '06048_H_Inherited call to abstract method ignored'#000+
-  '06049_E_Goto label "$1" not defined or optimized away'#000+
-  '06050_F_Cannot find type "$1" i','n unit "$2". Check if you use the cor'+
-  'rect run time library.'#000+
-  '06051_E_Interprocedural gotos are allowed only to outer subroutines'#000+
-  '06052_E_Label must be defined in the same scope as it is declared'#000+
-  '06053_E_Leaving procedures containing explicit',' or implicit exception'+
-  's frames using goto is not allowed'#000+
-  '06054_E_In ISO mode, the mod operator is defined only for positive quo'+
-  'tient'#000+
-  '06055_DL_Auto inlining: $1'#000+
-  '06056_E_The function used, is not supported by the selected instructio'+
-  'n set: $1'#000,
-  '06057_F_Maximum number of units ($1) reached for the current target'#000+
-  '06058_N_Call to subroutine "$1" marked as inline is not inlined'#000+
-  '06059_E_Case statement does not handle ordinal value "$1", and no else'+
-  '/otherwise statement is present.'#000+
-  '06060','_W_Case statement does not handle all possible cases'#000+
-  '06061_W_The current subroutine "$1" cannot be compiled for the target '+
-  'CPU, creating dummy'#000+
-  '06062_W_The target CPU does not support preserving the registers in su'+
-  'broutine "$1"'#000+
-  '07000_DL_Star','ting $1 styled assembler parsing'#000+
-  '07001_DL_Finished $1 styled assembler parsing'#000+
-  '07002_E_Non-label pattern contains @'#000+
-  '07004_E_Error building record offset'#000+
-  '07005_E_OFFSET used without identifier'#000+
-  '07006_E_TYPE used without identifier'#000+
-  '07007_E_Can','not use local variable or parameters here'#000+
-  '07008_E_Need to use OFFSET here'#000+
-  '07009_E_Need to use $ here'#000+
-  '07010_E_Cannot use multiple relocatable symbols'#000+
-  '07011_E_Relocatable symbol can only be added'#000+
-  '07012_E_Invalid constant expression'#000+
-  '07013_E_Re','locatable symbol is not allowed'#000+
-  '07014_E_Invalid reference syntax'#000+
-  '07015_E_You cannot reach $1 from that code'#000+
-  '07016_E_Local symbols/labels are not allowed as references'#000+
-  '07017_E_Invalid base and index register usage'#000+
-  '07018_W_Possible error in o','bject field handling'#000+
-  '07019_E_Wrong scale factor specified'#000+
-  '07020_E_Multiple index register usage'#000+
-  '07021_E_Invalid operand type'#000+
-  '07022_E_Invalid string as opcode operand: $1'#000+
-  '07023_W_@CODE and @DATA not supported'#000+
-  '07024_E_Null label references ar','e not allowed'#000+
-  '07025_E_Divide by zero in asm evaluator'#000+
-  '07026_E_Illegal expression'#000+
-  '07027_E_Escape sequence ignored: $1'#000+
-  '07028_E_Invalid symbol reference'#000+
-  '07029_W_Fwait can cause emulation problems with emu387'#000+
-  '07030_W_$1 without operand translat','ed into $1P'#000+
-  '07031_W_ENTER instruction is not supported by Linux kernel'#000+
-  '07032_W_Calling an overload function in assembler'#000+
-  '07033_E_Unsupported symbol type for operand'#000+
-  '07034_E_Constant value out of bounds'#000+
-  '07035_E_Error converting decimal $1'#000+
-  '07','036_E_Error converting octal $1'#000+
-  '07037_E_Error converting binary $1'#000+
-  '07038_E_Error converting hexadecimal $1'#000+
-  '07039_H_$1 translated to $2'#000+
-  '07040_W_$1 is associated to an overloaded function'#000+
-  '07041_E_Cannot use SELF outside a method'#000+
-  '07042_E_Canno','t use OLDEBP outside a nested procedure'#000+
-  '07043_W_Procedures cannot return any value in asm code'#000+
-  '07044_E_SEG not supported'#000+
-  '07045_E_Size suffix and destination or source size do not match'#000+
-  '07046_W_Size suffix and destination or source size do n','ot match'#000+
-  '07047_E_Assembler syntax error'#000+
-  '07048_E_Invalid combination of opcode and operands'#000+
-  '07049_E_Assembler syntax error in operand'#000+
-  '07050_E_Assembler syntax error in constant'#000+
-  '07051_E_Invalid String expression'#000+
-  '07052_W_Constant with symbol $','1 for address which is not on a pointe'+
-  'r'#000+
-  '07053_E_Unrecognized opcode $1'#000+
-  '07054_E_Invalid or missing opcode'#000+
-  '07055_E_Invalid combination of prefix and opcode: $1'#000+
-  '07056_E_Invalid combination of override and opcode: $1'#000+
-  '07057_E_Too many operands o','n line'#000+
-  '07058_W_NEAR ignored'#000+
-  '07059_W_FAR ignored'#000+
-  '07060_E_Duplicate local symbol $1'#000+
-  '07061_E_Undefined local symbol $1'#000+
-  '07062_E_Unknown label identifier $1'#000+
-  '07063_E_Invalid register name'#000+
-  '07064_E_Invalid floating point register name'#000+
-  '07066_W_Modul','o not supported'#000+
-  '07067_E_Invalid floating point constant $1'#000+
-  '07068_E_Invalid floating point expression'#000+
-  '07069_E_Wrong symbol type'#000+
-  '07070_E_Cannot index a local var or parameter with a register'#000+
-  '07071_E_Invalid segment override expression'#000+
-  '07072_W','_Identifier $1 supposed external'#000+
-  '07073_E_Strings not allowed as constants'#000+
-  '07074_E_No type of variable specified'#000+
-  '07075_E_Assembler code not returned to text section'#000+
-  '07076_E_Not a directive or local symbol $1'#000+
-  '07077_E_Using a defined name as a',' local label'#000+
-  '07078_E_Dollar token is used without an identifier'#000+
-  '07079_W_32 bit constant created for address'#000+
-  '07080_N_.align is target specific, use .balign or .p2align'#000+
-  '07081_E_Cannot directly access fields of pointer-based parameters'#000+
-  '07082_E','_Can'#039't access fields of objects/classes directly'#000+
-  '07083_E_No size specified and unable to determine the size of the oper'+
-  'ands'#000+
-  '07084_E_Cannot use RESULT in this function'#000+
-  '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+
-  '07087_W_"$1 ','%st(n)" translated into "$1 %st,%st(n)"'#000+
-  '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+
-  '07089_E_Char < not allowed here'#000+
-  '07090_E_Char > not allowed here'#000+
-  '07093_W_ALIGN not supported'#000+
-  '07094_E_Inc and Dec cannot be together'#000+
-  '07095_E_Invalid r','egister list for MOVEM or FMOVEM'#000+
-  '07096_E_Reglist invalid for opcode'#000+
-  '07097_E_Higher cpu mode required ($1)'#000+
-  '07098_W_No size specified and unable to determine the size of the oper'+
-  'ands, using DWORD as default'#000+
-  '07099_E_Syntax error while trying t','o parse a shifter operand'#000+
-  '07100_E_Address of packed component is not at a byte boundary'#000+
-  '07101_W_No size specified and unable to determine the size of the oper'+
-  'ands, using BYTE as default'#000+
-  '07102_W_Use of $1 for parameters invalid here'#000+
-  '07103_W_','Use of $1 is not compatible with regcall convention'#000+
-  '07104_W_Use of $1 is not recommended for local variable access'#000+
-  '07105_W_Use of $1, access may cause a crash or value may be lost'#000+
-  '07106_E_VMTOffset must be used in combination with a virtual',' method,'+
-  ' and "$1" is not virtual'#000+
-  '07107_E_Generating PIC, but reference is not PIC-safe'#000+
-  '07108_E_All registers in a register set must be of the same kind and w'+
-  'idth'#000+
-  '07109_E_A register set cannot be empty'#000+
-  '07110_W_@GOTPCREL is useless and potent','ially dangerous for local sym'+
-  'bols'#000+
-  '07111_W_Constant with general purpose segment register'#000+
-  '07112_E_Invalid offset value for $1'#000+
-  '07113_E_Invalid register for $1'#000+
-  '07114_E_SEH directives are allowed only in pure assembler procedures'#000+
-  '07115_E_Direct','ive "$1" is not supported for the current target'#000+
-  '07116_E_This function'#039's result location cannot be encoded directly'+
-  ' in a single operand when "nostackframe" is used'#000+
-  '07117_E_GOTPCREL references in Intel assembler syntax cannot contain a'+
-  ' base ','or index register, and their offset must 0.'#000+
-  '07118_E_The current target does not support GOTPCREL relocations'#000+
-  '07119_W_Exported/global symbols should be accessed via the GOT'#000+
-  '07120_W_Check size of memory operand "$1"'#000+
-  '07121_W_Check size of memo','ry operand "$1: memory-operand-size is $2 '+
-  'bits, but expected [$3 bits]"'#000+
-  '07122_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+
-  'ts, but expected [$3 bits + $4 byte offset]"'#000+
-  '07123_W_Check "$1: offset of memory operand is negati','ve "$2 byte"'#000+
-  '07124_W_Check "$1: size of memory operand is empty, but es exists diff'+
-  'erent definitions of the memory size =>> map to $2 (smallest option)"'#000+
-  '07125_E_Invalid register used in memory reference expression: "$1"'#000+
-  '07126_E_SEG used wit','hout identifier'#000+
-  '07127_E_@CODE and @DATA can only be used with the SEG operator'#000+
-  '07128_E_Not enough space (16 bits required) for the segment constant o'+
-  'f symbol $1'#000+
-  '07129_E_Invalid value of .code directive constant'#000+
-  '07130_W_No size specified and',' unable to determine the size of the co'+
-  'nstant, using BYTE as default'#000+
-  '07131_W_No size specified and unable to determine the size of the cons'+
-  'tant, using WORD as default'#000+
-  '07132_E_Cannot override ES segment'#000+
-  '07133_W_Reference is not valid here (e','xpected "$1")'#000+
-  '07134_E_Address sizes do not match'#000+
-  '07135_E_Instruction "POP CS" is not valid for the current target'#000+
-  '07136_W_Instruction "POP CS" is not portable (it only works on 8086 an'+
-  'd 8088 CPUs)'#000+
-  '07137_E_Label $1 can only be declared publi','c before it'#039's defined'+
-  #000+
-  '07138_E_Local label $1 cannot be declared public'#000+
-  '07139_E_Cannot use multiple segment overrides'#000+
-  '07140_W_Multiple segment overrides (only the last one will take effect'+
-  ')'#000+
-  '07141_W_Segment base $1 will be generated, but is i','gnored by the CPU'+
-  ' in 64 bit mode'#000+
-  '07142_E_Mismatch broadcasting elements (expected: {$1} found: {$2})'#000+
-  '07143_E_Invalid arrangement specifier "$1"'#000+
-  '07144_E_Registers in a register set must be consecutive.'#000+
-  '07145_E_Unknown field identifier'#000+
-  '07146_','E_Not supported combination opcode: $1 - att-suffix-type {$2} '+
-  'and memrefsize-type {$3}'#000+
-  '07147_E_Too many registers in register set.'#000+
-  '08000_F_Too many assembler files'#000+
-  '08001_F_Selected assembler output not supported'#000+
-  '08002_F_Comp not supported'#000+
-  '0','8003_F_Direct not support for binary writers'#000+
-  '08004_E_Allocating of data is only allowed in bss section'#000+
-  '08005_F_No binary writer selected'#000+
-  '08006_E_Asm: Opcode $1 not in table'#000+
-  '08007_E_Asm: $1 invalid combination of opcode and operands'#000+
-  '08008_E_','Asm: 16 bit references not supported'#000+
-  '08009_E_Asm: Invalid effective address'#000+
-  '08010_E_Asm: Immediate or reference expected'#000+
-  '08011_E_Asm: $1 value exceeds bounds $2'#000+
-  '08012_E_Asm: Short jump is out of range $1'#000+
-  '08013_E_Asm: Undefined label $1'#000+
-  '0801','4_E_Asm: Comp type not supported for this target'#000+
-  '08015_E_Asm: Extended type not supported for this target'#000+
-  '08016_E_Asm: Duplicate label $1'#000+
-  '08017_E_Asm: Redefined label $1'#000+
-  '08018_E_Asm: First defined here'#000+
-  '08019_E_Asm: Invalid register $1'#000+
-  '08020','_E_Asm: 16 or 32 bit references not supported'#000+
-  '08021_E_Asm: 64 bit operands not supported'#000+
-  '08022_E_Asm: AH,BH,CH or DH cannot be used in an instruction requiring'+
-  ' REX prefix'#000+
-  '08023_E_Missing .seh_endprologue directive'#000+
-  '08024_E_Function prologue ','exceeds 255 bytes'#000+
-  '08025_E_.seh_handlerdata directive without preceding .seh_handler'#000+
-  '08026_F_Relocation count for section $1 exceeds 65535'#000+
-  '08027_N_Change of bind type of symbol $1 from $2 to $3 after use'#000+
-  '08028_H_Change of bind type of symbol',' $1 from $2 to $3 after use'#000+
-  '08029_E_Asm: 32 bit references not supported'#000+
-  '08030_F_Code segment too large'#000+
-  '08031_F_Data segment too large'#000+
-  '08032_E_Instruction not supported by the selected instruction set'#000+
-  '08033_E_Asm: conditional branch destina','tion is out of range'#000+
-  '08034_E_Asm: RIP cannot be used as index register or with another regi'+
-  'ster in a reference'#000+
-  '08035_F_Illegal function size for SEH function'#000+
-  '08036_E_Asm: ESP/RSP cannot be used as index register'#000+
-  '08037_E_Wasm32 symbol $1 wit','hout index value error'#000+
-  '09000_W_Source operating system redefined'#000+
-  '09001_I_Assembling (pipe) $1'#000+
-  '09002_E_Can'#039't create assembler file: $1'#000+
-  '09003_E_Can'#039't create object file: $1 (error code: $2)'#000+
-  '09004_E_Can'#039't create archive file: $1'#000+
-  '09005_E_Assemb','ler $1 not found, switching to external assembling'#000+
-  '09006_T_Using assembler: $1'#000+
-  '09007_E_Error while assembling exitcode $1'#000+
-  '09008_E_Can'#039't call the assembler, error $1 switching to external a'+
-  'ssembling'#000+
-  '09009_I_Assembling $1'#000+
-  '09010_I_Assembling w','ith smartlinking $1'#000+
-  '09011_W_Object $1 not found, Linking may fail !'#000+
-  '09012_W_Library $1 not found, Linking may fail !'#000+
-  '09013_E_Error while linking'#000+
-  '09014_E_Can'#039't call the linker, switching to external linking (erro'+
-  'r was "$1")'#000+
-  '09015_I_Linking $','1'#000+
-  '09016_E_Util $1 not found, switching to external linking'#000+
-  '09017_T_Using util $1'#000+
-  '09018_E_Creation of Executables not supported'#000+
-  '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+
-  '09020_I_Closing script $1'#000+
-  '09021_E_Resource compiler "$','1" not found, switching to external mode'+
-  #000+
-  '09022_I_Compiling resource $1'#000+
-  '09023_T_Unit $1 cannot be statically linked, switching to smart linkin'+
-  'g'#000+
-  '09024_T_Unit $1 cannot be smart linked, switching to static linking'#000+
-  '09025_T_Unit $1 cannot be sha','red linked, switching to static linking'+
-  #000+
-  '09026_E_Unit $1 cannot be smart or static linked'#000+
-  '09027_E_Unit $1 cannot be shared or static linked'#000+
-  '09028_D_Calling resource compiler "$1" with "$2" as command line'#000+
-  '09029_E_Error while compiling resour','ces'#000+
-  '09030_E_Can'#039't call the resource compiler "$1", switching to extern'+
-  'al mode'#000+
-  '09031_E_Can'#039't open resource file "$1"'#000+
-  '09032_E_Can'#039't write resource file "$1"'#000+
-  '09033_N_File "$1" not found for backquoted cat command'#000+
-  '09034_W_"$1" not found, this w','ill probably cause a linking failure'#000+
-  '09035_E_Creation of Static Libraries not supported'#000+
-  '09036_F_To generate the correct linker call, a controller type must be'+
-  ' set by the directive -Wp'#000+
-  '09128_F_Can'#039't post process executable $1'#000+
-  '09129_F_Can'#039't o','pen executable $1'#000+
-  '09130_X_Size of Code: $1 bytes'#000+
-  '09131_X_Size of initialized data: $1 bytes'#000+
-  '09132_X_Size of uninitialized data: $1 bytes'#000+
-  '09133_X_Stack space reserved: $1 bytes'#000+
-  '09134_X_Stack space committed: $1 bytes'#000+
-  '09200_F_Executable image',' size is too big for $1 target.'#000+
-  '09201_W_Object file "$1" contains 32 bit absolute relocation to symbol'+
-  ' "$2".'#000+
-  '09202_E_Program segment too large (exceeds 64k by $1 bytes)'#000+
-  '09203_E_Code segment "$1" too large (exceeds 64k by $2 bytes)'#000+
-  '09204_E_D','ata segment "$1" too large (exceeds 64k by $2 bytes)'#000+
-  '09205_E_Segment "$1" too large (exceeds 64k by $2 bytes)'#000+
-  '09206_E_Group "$1" too large (exceeds 64k by $2 bytes)'#000+
-  '09207_E_Cannot create a .COM file, because the program contains segmen'+
-  't rel','ocations'#000+
-  '09208_W_Program "$1" uses experimental CheckPointer option'#000+
-  '09209_E_Multiple defined symbol "$1"'#000+
-  '09210_E_COMDAT selection mode $1 not supported (section: "$1")'#000+
-  '09211_E_Associative section expected for COMDAT section "$1"'#000+
-  '09212_E_COM','DAT section selection mode doesn'#039't match for section '+
-  '"$1" and symbol "$2"'#000+
-  '09213_E_Associative COMDAT section for section "$1" not found'#000+
-  '09214_D_Discarding duplicate symbol "$1" due to COMDAT selection mode'#000+
-  '09215_D_Discarding duplicate symbo','l "$1" with same size due to COMDA'+
-  'T selection mode'#000+
-  '09216_D_Discarding duplicate symbol "$1" with same content due to COMD'+
-  'AT selection mode'#000+
-  '09217_D_Replacing duplicate symbol "$1" with smaller size due to COMDA'+
-  'T selection mode'#000+
-  '09218_E_Size o','f duplicate COMDAT symbol "$1" differs'#000+
-  '09219_E_Content of duplicate COMDAT symbol "$1" differs'#000+
-  '09220_E_COMDAT selection mode for symbol "$1" differs'#000+
-  '09221_E_Undefined symbol: $1 (first seen in $2)'#000+
-  '09222_E_Undefined symbol: $1'#000+
-  '09223_W_Intern','al linker in cross-endian configuration is work in pro'+
-  'gress'#000+
-  '10000_T_Unitsearch: $1'#000+
-  '10001_T_PPU Loading $1'#000+
-  '10002_U_PPU Name: $1'#000+
-  '10003_U_PPU Flags: $1'#000+
-  '10004_U_PPU Crc: $1'#000+
-  '10005_U_PPU Time: $1'#000+
-  '10006_U_PPU File too short'#000+
-  '10007_U_PPU Invalid Hea','der (no PPU at the begin)'#000+
-  '10008_U_PPU Invalid Version $1'#000+
-  '10009_U_PPU is compiled for another processor'#000+
-  '10010_U_PPU is compiled for another target'#000+
-  '10011_U_PPU Source: $1'#000+
-  '10012_U_Writing $1'#000+
-  '10013_F_Can'#039't Write PPU-File'#000+
-  '10014_F_Error reading P','PU-File'#000+
-  '10015_F_Unexpected end of PPU-File'#000+
-  '10016_F_Invalid PPU-File entry: $1'#000+
-  '10017_F_PPU Dbx count problem'#000+
-  '10018_E_Illegal unit name: $1 (expecting $2)'#000+
-  '10019_F_Too much units'#000+
-  '10020_F_Circular unit reference between $1 and $2'#000+
-  '10021_F_Can'#039't ','compile unit $1, no sources available'#000+
-  '10022_F_Can'#039't find unit $1 used by $2'#000+
-  '10023_W_Unit $1 was not found but $2 exists'#000+
-  '10024_F_Unit $1 searched but $2 found'#000+
-  '10025_W_Compiling the system unit requires the -Us switch'#000+
-  '10026_F_There were $1 er','rors compiling module, stopping'#000+
-  '10027_U_Load from $1 ($2) unit $3'#000+
-  '10028_U_Recompiling $1, checksum changed for $2'#000+
-  '10029_U_Recompiling $1, source found only'#000+
-  '10030_U_Recompiling unit, static lib is older than ppufile'#000+
-  '10031_U_Recompiling unit,',' shared lib is older than ppufile'#000+
-  '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+
-  '10033_U_Recompiling unit, obj is older than asm'#000+
-  '10034_U_Parsing interface of $1'#000+
-  '10035_U_Parsing implementation of $1'#000+
-  '10036_U_Second load for unit',' $1'#000+
-  '10037_U_PPU Check file $1 time $2'#000+
-  '10040_W_Can'#039't recompile unit $1, but found modified include files'#000+
-  '10041_U_File $1 is newer than the one used for creating PPU file $2'#000+
-  '10042_U_Trying to use a unit which was compiled with a different FPU',' '+
-  'mode'#000+
-  '10043_U_Loading interface units from $1'#000+
-  '10044_U_Loading implementation units from $1'#000+
-  '10045_U_Interface CRC changed for unit $1'#000+
-  '10046_U_Implementation CRC changed for unit $1'#000+
-  '10047_U_Finished compiling unit $1'#000+
-  '10048_U_Adding dependency',': $1 depends on $2'#000+
-  '10049_U_No reload, is caller: $1'#000+
-  '10050_U_No reload, already in second compile: $1'#000+
-  '10051_U_Flag for reload: $1'#000+
-  '10052_U_Forced reloading'#000+
-  '10053_U_Previous state of $1: $2'#000+
-  '10054_U_Already compiling $1, setting second compile'#000,
-  '10055_U_Loading unit $1'#000+
-  '10056_U_Finished loading unit $1'#000+
-  '10057_U_Registering new unit $1'#000+
-  '10058_U_Re-resolving unit $1'#000+
-  '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
-  '10060_U_Unloading resource unit $1 (not needed)'#000+
-  '10061_E_Un','it $1 was compiled using a different whole program optimiz'+
-  'ation feedback input ($2, $3); recompile it without wpo or use the sam'+
-  'e wpo feedback input file for this compilation invocation'#000+
-  '10062_U_Indirect interface (objects/classes) CRC chang','ed for unit $1'+
-  #000+
-  '10063_U_PPU is compiled for another i8086 memory model'#000+
-  '10064_U_Loading unit $1 from package $2'#000+
-  '10065_F_Internal type "$1" was not found. Check if you use the correct'+
-  ' run time library.'#000+
-  '10066_F_Internal type "$1" does not look ','as expected. Check if you u'+
-  'se the correct run time library.'#000+
-  '10067_U_Skipping unit, PPU and compiler have to be both compiled with '+
-  'or without LLVM support'#000+
-  '10068_U_PPU is compiled for another WebAssembly exceptions mode'#000+
-  '10069_U_Skipping unit,',' PPU and compiler have to be both compiled wit'+
-  'h or without SYMANSISTR support'#000+
-  '10070_U_PPU and program must both be compiled with or without WebAssem'+
-  'bly multithreading support'#000+
-  '11000_O_$1 [options] <inputfile> [options]'#000+
-  '11001_W_Only one sourc','e file supported, changing source file to comp'+
-  'ile from "$1" into "$2"'#000+
-  '11002_W_DEF file can be created only for OS/2'#000+
-  '11003_E_Nested response files are not supported'#000+
-  '11004_F_No source file name in command line'#000+
-  '11005_N_No option inside $1 conf','ig file'#000+
-  '11006_E_Illegal parameter: $1'#000+
-  '11007_H_-? writes help pages'#000+
-  '11008_F_Too many config files nested'#000+
-  '11009_F_Unable to open file $1'#000+
-  '11010_D_Reading further options from $1'#000+
-  '11011_W_Target is already set to: $1'#000+
-  '11012_W_Shared libs not supp','orted on DOS platform, reverting to stat'+
-  'ic'#000+
-  '11013_F_In options file $1 at line $2 too many #IF(N)DEFs encountered'#000+
-  '11014_F_In options file $1 at line $2 unexpected #ENDIFs encountered'#000+
-  '11015_F_Open conditional at the end of the options file'#000+
-  '11','016_W_Debug information generation is not supported by this execut'+
-  'able'#000+
-  '11017_H_Try recompiling with -dGDB'#000+
-  '11018_W_You are using the obsolete switch $1'#000+
-  '11019_W_You are using the obsolete switch $1, please use $2'#000+
-  '11020_N_Switching assembler t','o default source writing assembler'#000+
-  '11068_N_Switching assembler to default source writing assembler in cro'+
-  'ss-endian configuration'#000+
-  '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
-  '11022_W_"$1" assembler use forced'#000+
-  '11026_T_Re','ading options from file $1'#000+
-  '11027_T_Reading options from environment $1'#000+
-  '11028_D_Handling option "$1"'#000+
-  '11029_O_*** press enter ***'#000+
-  '11030_H_Start of reading config file $1'#000+
-  '11031_H_End of reading config file $1'#000+
-  '11032_D_Interpreting option "$1"'#000+
-  '1','1036_D_Interpreting firstpass option "$1"'#000+
-  '11033_D_Interpreting file option "$1"'#000+
-  '11034_D_Reading config file "$1"'#000+
-  '11035_D_Found source file name "$1"'#000+
-  '11039_E_Unknown codepage "$1"'#000+
-  '11040_F_Config file $1 is a directory'#000+
-  '11041_W_Assembler outpu','t selected "$1" cannot generate debug info, d'+
-  'ebugging disabled'#000+
-  '11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead'#000+
-  '11043_F_In options file $1 at line $2 #ELSE directive without #IF(N)DE'+
-  'F found'#000+
-  '11044_F_Option "$1" is not, or ','not yet, supported on the current tar'+
-  'get platform'#000+
-  '11045_F_The feature "$1" is not, or not yet, supported on the selected'+
-  ' target platform'#000+
-  '11046_N_DWARF debug information cannot be used with smart linking on t'+
-  'his target, switching to static l','inking'#000+
-  '11047_W_Option "$1" is ignored for the current target platform.'#000+
-  '11048_W_Disabling external debug information because it is unsupported'+
-  ' for the selected target/debug format combination.'#000+
-  '11049_N_DWARF debug information cannot be used w','ith smart linking wi'+
-  'th external assembler, disabling static library creation.'#000+
-  '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET environment variabl'+
-  'e: $1'#000+
-  '11051_E_Invalid value for IPHONEOS_DEPLOYMENT_TARGET environment varia'+
-  'ble: $1'#000+
-  '11052_E_','You must use one of the VFP FPU types when using the EABIHF '+
-  'ABI target'#000+
-  '11053_W_The selected debug format is not supported on the current targ'+
-  'et, not changing the current setting'#000+
-  '11054_E_Argument to "$1" is missing'#000+
-  '11055_E_Malformed paramete','r: $1'#000+
-  '11056_W_Smart linking requires external linker'#000+
-  '11057_E_Creating .COM files is not supported in the current memory mod'+
-  'el. Only the tiny memory model supports making .COM files.'#000+
-  '11058_W_Experimental CheckPointer option not enabled becau','se it is i'+
-  'ncomptatible with -Ur option.'#000+
-  '11059_E_Unsupported target architecture -P$1, invoke the "fpc" compile'+
-  'r driver instead.'#000+
-  '11060_E_Feature switches are only supported while compiling the system'+
-  ' unit.'#000+
-  '11061_N_The selected debug format i','s not supported by the internal l'+
-  'inker, switching to external linking'#000+
-  '11062_E_You can not use both options ($1) ($2) at same time.'#000+
-  '11063_F_The selected FPU type "$1" is not supported by the selected in'+
-  'struction set "$2"'#000+
-  '11064_E_Only one Web','Assembly exception support mode can be specified'+
-  '.'#000+
-  '11065_W_Subtarget is already set to: $1'#000+
-  '11066_E_Subtarget $1 specified but no corresponding config file $2 fou'+
-  'nd.'#000+
-  '11067_N_Ignoring compiler executable suffix $1.'#000+
-  '12000_F_Cannot open whole pr','ogram optimization feedback file "$1"'#000+
-  '12001_D_Processing whole program optimization information in wpo feedb'+
-  'ack file "$1"'#000+
-  '12002_D_Finished processing the whole program optimization information'+
-  ' in wpo feedback file "$1"'#000+
-  '12003_E_Expected sect','ion header, but got "$2" at line $1 of wpo feed'+
-  'back file'#000+
-  '12004_W_No handler registered for whole program optimization section "'+
-  '$2" at line $1 of wpo feedback file, ignoring'#000+
-  '12005_D_Found whole program optimization section "$1" with informat','i'+
-  'on about "$2"'#000+
-  '12006_F_The selected whole program optimizations require a previously '+
-  'generated feedback file (use -Fw to specify)'#000+
-  '12007_E_No collected information necessary to perform "$1" whole progr'+
-  'am optimization found'#000+
-  '12008_F_Specify a ','whole program optimization feedback file to store '+
-  'the generated info in (using -FW)'#000+
-  '12009_E_Not generating any whole program optimization information, yet'+
-  ' a feedback file was specified (using -FW)'#000+
-  '12010_E_Not performing any whole program op','timizations, yet an input'+
-  ' feedback file was specified (using -Fw)'#000+
-  '12011_D_Skipping whole program optimization section "$1", because not '+
-  'needed by the requested optimizations'#000+
-  '12012_W_Overriding previously read information for "$1" from feedb','ac'+
-  'k input file using information in section "$2"'#000+
-  '12013_E_Cannot extract symbol liveness information from program when s'+
-  'tripping symbols, use -Xs-'#000+
-  '12014_E_Cannot extract symbol liveness information from program when w'+
-  'hen not linking'#000+
-  '12015_F_','Cannot find "$1" or "$2" to extract symbol liveness informat'+
-  'ion from linked program'#000+
-  '12016_E_Error during reading symbol liveness information produced by "'+
-  '$1"'#000+
-  '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+
-  'ion from lin','ked program'#000+
-  '12018_E_Collection of symbol liveness information can only help when u'+
-  'sing smart linking, use -CX -XX'#000+
-  '12019_E_Cannot create specified whole program optimisation feedback fi'+
-  'le "$1"'#000+
-  '13001_F_Can'#039't find package $1'#000+
-  '13002_U_PCP file f','or package $1 found'#000+
-  '13003_E_Duplicate package $1'#000+
-  '13004_E_Unit $1 can not be part of a package'#000+
-  '13005_N_Unit $1 is implicitly imported into package $2'#000+
-  '13006_F_Failed to create PCP file $2 for package $1'#000+
-  '13007_F_Failed to read PCP file for pac','kage $1'#000+
-  '13008_T_PCP loading $1'#000+
-  '13009_U_PCP Name: $1'#000+
-  '13010_U_PCP Flags: $1'#000+
-  '13011_U_PCP Crc: $1'#000+
-  '13012_U_PCP Time: $1'#000+
-  '13013_U_PCP File too short'#000+
-  '13014_U_PCP Invalid Header (no PCP at the begin)'#000+
-  '13015_U_PCP Invalid Version $1'#000+
-  '13016_U_PCP is com','piled for another processor'#000+
-  '13017_U_PCP is compiled for another target'#000+
-  '13018_U_Writing $1'#000+
-  '13019_F_Can'#039't Write PCP-File'#000+
-  '13020_F_Error reading PCP-File'#000+
-  '13021_F_Unexpected end of PCP-File'#000+
-  '13022_F_Invalid PCP-File entry: $1'#000+
-  '13023_U_Trying to us','e a unit which was compiled with a different FPU'+
-  ' mode'#000+
-  '13024_T_Packagesearch: $1'#000+
-  '13025_U_Required package $1'#000+
-  '13026_U_Contained unit $1'#000+
-  '13027_E_Unit $1 is already contained in package $2'#000+
-  '13028_W_Unit $1 is imported from indirectly required pa','ckage $2'#000+
-  '13029_U_PPL filename $1'#000+
-  '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
-  'CPU'#010+
-  'Copyright (c) 1993-2024 by Florian Klaempfl and others'#000+
-  '11024_Free Pascal Compiler version $FPCVERSION'#010+
-  #010+
-  'Compiler date      : $FPCDATE'#010,
-  'Compiler CPU target: $FPCCPU'#010+
-  #010+
-  'Supported targets (targets marked with '#039'{*}'#039' are under develop'+
-  'ment):'#010+
-  '  $OSTARGETS'#010+
-  #010+
-  'Supported CPU instruction sets:'#010+
-  '  $INSTRUCTIONSETS'#010+
-  #010+
-  'Supported FPU instruction sets:'#010+
-  '  $FPUINSTRUCTIONSETS'#010+
-  #010+
-  'Supported inline ass','embler modes:'#010+
-  '  $ASMMODES'#010+
-  #010+
-  'Recognized compiler and RTL features:'#010+
-  '  $FEATURELIST'#010+
-  #010+
-  'Recognized modeswitches:'#010+
-  '  $MODESWITCHES'#010+
-  #010+
-  'Supported ABI targets:'#010+
-  '  $ABITARGETS'#010+
-  #010+
-  'Supported Optimizations:'#010+
-  '  $OPTIMIZATIONS'#010+
-  #010+
-  'Supported Whole Program Optimization','s:'#010+
-  '  All'#010+
-  '  $WPOPTIMIZATIONS'#010+
-  #010+
-  'Code Generation Backend'#010+
-  '  $CODEGENERATIONBACKEND'#010+
-  #010+
-  'Supported LLVM/Xcode versions (only available with LLVM Code Generatio'+
-  'n Backend)'#010+
-  '  $LLVMVERSIONS'#010+
-  #010+
-  'Supported Microcontroller types:$\n  $CONTROLLERTYPES$\n'#010+
-  'This p','rogram comes under the GNU General Public Licence'#010+
-  'For more information read COPYING.v2'#010+
-  #010+
-  'Please report bugs in our bug tracker on:'#010+
-  '                 https://bugs.freepascal.org'#010+
-  #010+
-  'More information may be found on our WWW pages (including direct','ions'+
-  #010+
-  'for mailing lists useful for asking questions or discussing potential'#010+
-  'new features, etc.):'#010+
-  '                 https://www.freepascal.org'#000+
-  '11025_F*0*_Only options valid for the default or selected platform are'+
-  ' listed.'#010+
-  '**0*_Put + after a bo','olean switch option to enable it, - to disable '+
-  'it.'#010+
-  '**1@<x>_Read compiler options from <x> in addition to the default fpc.'+
-  'cfg'#010+
-  '**1a_The compiler does not delete the generated assembler file, automa'+
-  'tically switches to external assembler writer',#010+
-  '**2a5_Don'#039't generate Big Obj COFF files for GNU Binutils older tha'+
-  'n 2.25 (Windows, NativeNT)'#010+
-  '**2al_List sourcecode lines in assembler file'#010+
-  '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+
-  '**2ao_Add an extra option to external a','ssembler call (ignored for in'+
-  'ternal)'#010+
-  '*L2ap_Use pipes instead of creating temporary assembler files'#010+
-  '**2ar_List register allocation/release info in assembler file'#010+
-  '**2aR_List RTTI info in assembler file'#010+
-  '**2at_List temp allocation/release info ','in assembler file'#010+
-  '**1A<x>_Output format:'#010+
-  '**2Adefault_Use default assembler'#010+
-  '3*2Aas_Assemble using GNU AS'#010+
-  '3*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS'#010+
-  '3*2Acoff_COFF (Go32v2) using internal writer'#010+
-  '3*2Aelf_ELF (Linux) using internal write','r'#010+
-  '3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer'#010+
-  '3*2Amasm_Obj file using Masm (Microsoft)'#010+
-  '3*2Anasm_Assemble using Nasm'#010+
-  '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
-  '3*2Anasmdarwin_macho32 object file using Nasm (experimental)'#010+
-  '3*','2Anasmelf_ELF32 (Linux) file using Nasm'#010+
-  '3*2Anasmobj_Obj file using Nasm'#010+
-  '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
-  '3*2Anasmwin32_Win32 object file using Nasm'#010+
-  '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
-  '3*2Atasm_Obj file using Tas','m (Borland)'#010+
-  '3*2Awasm_Obj file using Wasm (Watcom)'#010+
-  '3*2Ayasm_Assemble using Yasm (experimental)'#010+
-  '4*2Aas_Assemble using GNU AS'#010+
-  '4*2Aas-darwin_Assemble Darwin Mach-O using GNU GAS'#010+
-  '4*2Aelf_ELF (Linux 64 bit) using internal writer'#010+
-  '4*2Agas_Assemble ','using GNU GAS'#010+
-  '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+
-  '4*2Anasm_Assemble using Nasm (experimental)'#010+
-  '4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experim'+
-  'ental)'#010+
-  '4*2Anasmelf_Assemble Linux 64 bit object file using Nas','m (experiment'+
-  'al)'#010+
-  '4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)'#010+
-  '4*2Apecoff_PE-COFF (Win64) using internal writer'#010+
-  '4*2Ayasm_Assemble using Yasm (experimental)'#010+
-  '6*2Aas_Unix o-file using GNU AS'#010+
-  '6*2Agas_GNU Motorola assembler'#010,
-  '6*2Amit_MIT Syntax (old GAS)'#010+
-  '6*2Amot_Standard Motorola assembler'#010+
-  '6*2Avasm_Use vasm to assemble'#010+
-  '8*2Anasm_Assemble using Nasm'#010+
-  '8*2Anasmobj_Assemble using Nasm'#010+
-  'A*2Aas_Assemble using GNU AS'#010+
-  'A*2Aas-darwin_Assemble using GNU AS for Darwin targets'#010,
-  'A*2Aclang_Assemble using clang'#010+
-  'A*2Aelf_Assemble using internal ELF writer'#010+
-  'a*2Aas_Assemble using GNU AS'#010+
-  'a*2Aas-clang_Assemble using clang for other targets'#010+
-  'a*2Aclang_Assemble using clang for darwin/ios targets'#010+
-  'P*2Aas_Assemble using GNU AS'#010+
-  'S*','2Aas_Assemble using GNU AS'#010+
-  's*2Aas_Assemble using GNU AS'#010+
-  'v*2Aas_Assemble using GNU AS'#010+
-  'W*2Awasm_Assemble using the internal object writer for wasm32 (experim'+
-  'ental)'#010+
-  'W*2Abinaryen_Assemble using GNU AS for wasm32 (wasm-as) (experimental)'+
-  #010+
-  'W*2Allv','m-mc-10_Assemble using llvm-mc-10'#010+
-  'W*2Allvm-mc-11_Assemble using llvm-mc-11'#010+
-  'W*2Allvm-mc-12_Assemble using llvm-mc-12'#010+
-  'W*2Allvm-mc-13_Assemble using llvm-mc-13'#010+
-  'W*2Allvm-mc_Assemble using llvm-mc (version 14 or later)'#010+
-  'W*2Awabt_Assemble using wa','sa (experimental)'#010+
-  'x*2Aas_Assemble using GNU AS'#010+
-  'Z*2Asdcc-sdasz80_Assemble using SDCC-SDASZ80'#010+
-  'Z*2Avasm_Assemble using Vasm'#010+
-  'Z*2Az80asm_Assemble using z80asm'#010+
-  '**1b_Generate browser info'#010+
-  '**2bl_Generate local symbol info'#010+
-  '**1B_Build all modules'#010+
-  '**1','C<x>_Code generation options:'#010+
-  '**2C3_Turn on IEEE error checking for constants'#010+
-  '**2Ca<x>_Select ABI; see fpc -i or fpc -ia for possible values'#010+
-  '**2Cb_Generate code for a big-endian variant of the target architectur'+
-  'e'#010+
-  '**2Cc<x>_Set default callin','g convention to <x>'#010+
-  'V*2Cd<x>_Discard selected RTL startup sections (use with caution)'#010+
-  'V*3Cdc_Discard initializing data. Data defaults to noinit section'#010+
-  'V*3Cdj_Discard jump to PASCALMAIN. Use only if PASCALMAIN follows dire'+
-  'ctly after startup',' code'#010+
-  'V*3Cds_Discard _START code. Use only if all interrupts are disabled'#010+
-  'V*3Cdz_Discard code initializing the zero register and stack pointer'#010+
-  '**2CD_Create also dynamic library (not supported)'#010+
-  '**2Ce_Compilation with emulated floating point ','opcodes'#010+
-  '**2CE_Generate FPU code which can raise exceptions'#010+
-  '**2Cf<x>_Select fpu instruction set to use; see fpc -i or fpc -if for '+
-  'possible values'#010+
-  '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+
-  '**2Cg_Generate PIC code'#010+
-  '**','2Ch<n>[,m]_<n> bytes min heap size (between 1023 and 67107840) and'+
-  ' optionally [m] max heap size'#010+
-  '**2Ci_IO-checking'#010+
-  'A*2CI<x>_Select instruction set on ARM: ARM or THUMB'#010+
-  'L*2Cl<x>_LLVM code generation options'#010+
-  'L*3Clflto_Enable Link-time optimisa','tion (needed both when compiling '+
-  'units and programs/libraries)'#010+
-  'L*3Clfltonosystem_Disable LTO for the system unit (needed with at leas'+
-  't Xcode 10.2 and earlier due to linker bugs)'#010+
-  'L*3Clflsanitize=address_Enable address sanitizer'#010+
-  'L*3Clv<x>_LLV','M target version: Xcode-10.1, 7.0, 8.0, .., 10.0'#010+
-  '**2Cn_Omit linking stage'#010+
-  'P*2CN_Generate nil-pointer checks (AIX-only)'#010+
-  '**2Co_Check overflow of integer operations'#010+
-  '**2CO_Check for possible overflow of integer operations'#010+
-  '**2Cp<x>_Select instru','ction set; see fpc -i or fpc -ic for possible '+
-  'values'#010+
-  '**2CP<x>=<y>_ packing settings'#010+
-  '**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMA'+
-  'L'#010+
-  '**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2,'+
-  ' 4, 8, 16 and ','32'#010+
-  '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
-  'and 8'#010+
-  '**2Cr_Range checking'#010+
-  '**2CR_Verify object method call validity'#010+
-  '**2Cs<n>_Set stack checking size to <n>'#010+
-  '**2Ct_Stack checking (for testing only, see manual)'#010+
-  '8*2CT<x','>_Target-specific code generation options'#010+
-  '3*2CT<x>_Target-specific code generation options'#010+
-  '4*2CT<x>_Target-specific code generation options'#010+
-  'p*2CT<x>_Target-specific code generation options'#010+
-  'P*2CT<x>_Target-specific code generation options'#010+
-  'J*','2CT<x>_Target-specific code generation options'#010+
-  'A*2CT<x>_Target-specific code generation options'#010+
-  'W*2CT<x>_Target-specific code generation options'#010+
-  'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
-  ' (AIX)'#010+
-  'P*3CTsmalltoc_ Gen','erate smaller TOCs at the expense of execution spe'+
-  'ed (AIX)'#010+
-  'J*3CTautogetterprefix=X_  Automatically create getters for properties '+
-  'with prefix X (empty string disables)'#010+
-  'J*3CTautosetterprefix=X_  Automatically create setters for properties '+
-  'wit','h prefix X (empty string disables)'#010+
-  '8*3CTcld_                 Emit a CLD instruction before using the x86 '+
-  'string instructions'#010+
-  '3*3CTcld_                 Emit a CLD instruction before using the x86 '+
-  'string instructions'#010+
-  '4*3CTcld_                ',' Emit a CLD instruction before using the x8'+
-  '6 string instructions'#010+
-  '8*3CTfarprocspushoddbp_       Increment BP before pushing it in the pr'+
-  'ologue of far functions'#010+
-  'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
-  'de for init','ializing integer array constants'#010+
-  'J*3CTenumfieldinit_       Initialize enumeration fields in constructor'+
-  's to enumtype(0), after calling inherited constructors'#010+
-  'J*3CTinitlocals_          Initialize local variables that trigger a JV'+
-  'M bytecode v','erification error if used uninitialized (slows down code'+
-  ')'#010+
-  'J*3CTlowercaseprocstart_  Lowercase the first character of procedure/f'+
-  'unction/method names'#010+
-  'A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possi'+
-  'ble'#010+
-  'W*3CTnoexceptions','_        Disable the exception support. Raising an '+
-  'exception will abort the program.'#010+
-  'W*3CTbfexceptions_        Enable the branchful exception support for W'+
-  'ebAssembly'#010+
-  'W*3CTjsexceptions_        Enable the JavaScript-based exception suppor'+
-  't fo','r WebAssembly (experimental)'#010+
-  'W*3CTwasmexceptions_      Enable the native WebAssembly exceptions sup'+
-  'port'#010+
-  'W*3CTwasmthreads_         Enable WebAssembly threads support (experime'+
-  'ntal)'#010+
-  'J*2Cv_Var/out parameter copy-out checking'#010+
-  'A*2CV<x>_Set secti','on threadvar model to <x>'#010+
-  '**2CX_Create also smartlinked library'#010+
-  '**1d<x>_Defines the symbol <x>'#010+
-  '**1D_Generate a DEF file'#010+
-  '**2Dd<x>_Set description to <x>'#010+
-  '**2DD<x>_Set the date string returned by %DATE% to x, it is not checke'+
-  'd for being a vali','d date string'#010+
-  '**2DT<x>_Set the time string returned by %TIME% to x, it is not checke'+
-  'd for being a valid time string'#010+
-  '**2Dv<x>_Set DLL version to <x>'#010+
-  '*O2Dw_PM application'#010+
-  '**1e<x>_Set path to executable'#010+
-  '**1E_Same as -Cn'#010+
-  '**1fPIC_Same as -Cg'#010+
-  '**1','F<x>_Set file names and paths:'#010+
-  '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
-  'sed'#010+
-  '**2Fc<x>_Set input codepage to <x>'#010+
-  '**2FC<x>_Set RC compiler binary name to <x>'#010+
-  '**2Fd_Disable the compiler'#039's internal directory cache'#010+
-  '**','2FD<x>_Set the directory where to search for compiler utilities'#010+
-  '**2Fe<x>_Redirect error output to <x>'#010+
-  '**2FE<x>_Set exe/unit output path to <x>'#010+
-  '**2Ff<x>_Add <x> to framework path (Darwin only), or set IDF path to <'+
-  'x> (Xtensa-FreeRTOS)'#010+
-  '**2FF_','Use fpcres as RC to RES compiler instead of windres or gorc'#010+
-  '**2Fi<x>_Add <x> to include path'#010+
-  '**2Fl<x>_Add <x> to library path'#010+
-  '**2FL<x>_Use <x> as dynamic linker'#010+
-  '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
-  'r'#010+
-  '**2FM<x','>_Set the directory where to search for unicode binary files'#010+
-  '**2FN<x>_Add <x> to list of default unit scopes (namespaces)'#010+
-  '**2Fo<x>_Add <x> to object path'#010+
-  '**2Fr<x>_Load error message file <x>'#010+
-  '**2FR<x>_Set resource (.res) linker to <x>'#010+
-  '**2Ft_','Do not search uppercased or 8.3 unit filenames on case sensiti'+
-  've filesystems.'#010+
-  '**2Fu<x>_Add <x> to unit path'#010+
-  '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
-  '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
-  'om <x>'#010+
-  '**2','FW<x>_Store generated whole-program optimization feedback in <x>'#010+
-  '*g1g_Generate debug information (default format for target)'#010+
-  '*g2gc_Generate checks for pointers (experimental, only available on so'+
-  'me targets, might generate false positive)'#010+
-  '*g','2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
-  '*g2gl_Use line info unit (show more info with backtraces)'#010+
-  '*g2gm_Generate Microsoft CodeView debug information (experimental)'#010+
-  '*g2go<x>_Set debug information options'#010+
-  '*g3godwarfcpp_',' Simulate C++ debug information in DWARF'#010+
-  '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
-  'ame'#010+
-  '*g3godwarfomflinnum_ Generate line number information in OMF LINNUM re'+
-  'cords in MS LINK format in addition to the DWARF debug ','information ('+
-  'Open Watcom Debugger/Linker compatibility)'#010+
-  '*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug information (bre'+
-  'aks gdb < 6.5)'#010+
-  '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
-  #010+
-  '*g2gp_Preserve case in stabs symbol ','names'#010+
-  '*g2gs_Generate Stabs debug information'#010+
-  '*g2gt_Trash local variables (to detect uninitialized uses; multiple '#039+
-  't'#039' changes the trashing value)'#010+
-  '*g2gv_Generates programs traceable with Valgrind'#010+
-  '*g2gw_Generate DWARFv2 debug information (same',' as -gw2)'#010+
-  '*g2gw2_Generate DWARFv2 debug information'#010+
-  '*g2gw3_Generate DWARFv3 debug information'#010+
-  '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
-  '**1i_Information'#010+
-  '**2ia_Return list of supported ABI targets'#010+
-  '**2ib_Return the used code ge','neration backend type'#010+
-  '**2ic_Return list of supported CPU instruction sets'#010+
-  '**2iD_Return compiler date'#010+
-  '**2if_Return list of supported FPU instruction sets'#010+
-  '**2ii_Return list of supported inline assembler modes'#010+
-  'L*2il_Return list of supported LL','VM/Xcode versions by the LLVM backe'+
-  'nd'#010+
-  '**2im_Return list of supported modeswitches'#010+
-  '**2io_Return list of supported optimizations'#010+
-  '**2ir_Return list of recognized compiler and RTL features'#010+
-  '**2iSO_Return compiler OS'#010+
-  '**2iSP_Return compiler host p','rocessor'#010+
-  '**2it_Return list of supported targets'#010+
-  '**2iTO_Return target OS'#010+
-  '**2iTP_Return target processor'#010+
-  '**2iu_Return list of supported microcontroller types'#010+
-  '**2iV_Return short compiler version'#010+
-  '**2iw_Return list of supported whole program opt','imizations'#010+
-  '**2iW_Return full compiler version'#010+
-  '**1I<x>_Add <x> to include path'#010+
-  '**1k<x>_Pass <x> to the linker'#010+
-  '**1l_Write logo'#010+
-  '**1M<x>_Set language mode to <x> / enable modeswitch <x> (see option -'+
-  'im)'#010+
-  '**2Mdelphi_Delphi 7 compatibility mode'#010+
-  '**','2Mdelphiunicode_Delphi 2009 and later compatibility mode'#010+
-  '**2Mextendedpascal_ISO 10206 mode'#010+
-  '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Miso_ISO 7185 mode'#010+
-  '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
-  '**2Mobjfpc_FPC mode with Object P','ascal support'#010+
-  '**2Mtp_TP/BP 7.0 compatibility mode'#010+
-  '**2*_Each mode (as listed above) enables its default set of modeswitch'+
-  'es.'#010+
-  '**2*_Other modeswitches are disabled and need to be enabled one by ano'+
-  'ther.'#010+
-  '**1M<x>-_Disable modeswitch <x> (see opt','ion -im)'#010+
-  '**1n_Do not read the default config files'#010+
-  '**1o<x>_Change the name of the executable produced to <x>'#010+
-  '**1O<x>_Optimizations:'#010+
-  '**2O-_Disable optimizations'#010+
-  '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
-  '**2O2_Level 2 optimiza','tions (-O1 + quick optimizations)'#010+
-  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
-  '**2O4_Level 4 optimizations (-O3 + optimizations which might have unex'+
-  'pected side effects)'#010+
-  '**2Oa<x>=<y>_Set alignment'#010+
-  '**2Oo[NO]<x>_Enable or disable op','timizations; see fpc -i or fpc -io '+
-  'for possible values'#010+
-  '**2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for poss'+
-  'ible values'#010+
-  '**2Os_Optimize for size rather than speed'#010+
-  '**2Ow<x>_Perform whole-program optimization <x>; see fpc -i o','r fpc -'+
-  'iw for possible values'#010+
-  '**2OW<x>_Generate whole-program optimization feedback for optimization'+
-  ' <x>; see fpc -i or fpc -iw for possible values'#010+
-  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
-  'F*1P<x>_Target CPU / compiler re','lated options:'#010+
-  'F*2PB_Show default compiler binary'#010+
-  'F*2PP_Show default target cpu'#010+
-  'F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipse'+
-  'l,powerpc,powerpc64,sparc,x86_64)'#010+
-  '**1R<x>_Assembler reading style:'#010+
-  '**2Rdefault_Use default',' assembler for target'#010+
-  '3*2Ratt_Read AT&T style assembler'#010+
-  '3*2Rintel_Read Intel style assembler'#010+
-  '4*2Ratt_Read AT&T style assembler'#010+
-  '4*2Rintel_Read Intel style assembler'#010+
-  '8*2Ratt_Read AT&T style assembler'#010+
-  '8*2Rintel_Read Intel style assembler'#010+
-  '6*2RM','OT_Read Motorola style assembler'#010+
-  '**1s_Do not call assembler and linker'#010+
-  '**2sh_Generate script to link on host, automatically switches to exter'+
-  'nal assembler writer'#010+
-  '**2sr_Skip register allocation phase (use with -alr), automatically sw'+
-  'itches t','o external assembler writer'#010+
-  '**2st_Generate script to assemble and link on target, automatically sw'+
-  'itches to external assembler writer'#010+
-  '**2sT_Generate script only to link on target'#010+
-  '**1S<x>_Syntax options:'#010+
-  '**2S2_Same as -Mobjfpc'#010+
-  '**2Sa_Turn on ','assertions'#010+
-  '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
-  '**2Sd_Same as -Mdelphi'#010+
-  '**2Se<x>_Error options. <x> is a combination of the following:'#010+
-  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
-  '**3*_h : Compiler also halts aft','er hints'#010+
-  '**3*_n : Compiler also halts after notes'#010+
-  '**3*_w : Compiler also halts after warnings'#010+
-  '**2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -'+
-  'ir for possible values)'#010+
-  '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Md','elphi)'#010+
-  '**2Sh_Use reference counted strings (ansistring by default) instead of'+
-  ' shortstrings'#010+
-  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
-  '**2SI<x>_Set interface style to <x>'#010+
-  '**3SIcom_COM compatible interface (default)'#010+
-  '*','*3SIcorba_CORBA compatible interface'#010+
-  '**2Sj_Allows typed constants to be writeable (default in all modes)'#010+
-  '**2Sk_Load fpcylix unit'#010+
-  '**2Sm_Support macros like C (global)'#010+
-  '**2So_Same as -Mtp'#010+
-  '**2Sr_Transparent file names in ISO mode'#010+
-  '**2Ss_Construc','tor name must be "Init" (destructor name must be "Done'+
-  '")'#010+
-  '**2Sv_Support vector processing (use CPU vector extensions if availabl'+
-  'e)'#010+
-  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
-  '**2Sy_@<pointer> returns a typed pointer, sam','e as $T+'#010+
-  '**1T<x>_Target operating system:'#010+
-  '3*2Tandroid_Android'#010+
-  '3*2Taros_AROS'#010+
-  '3*2Tbeos_BeOS'#010+
-  '3*2Tdarwin_Darwin/Mac OS X'#010+
-  '3*2Tembedded_Embedded'#010+
-  '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
-  '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Version 2 of DJ Delo','rie DOS extender'#010+
-  '3*2Thaiku_Haiku'#010+
-  '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdar'+
-  'win)'#010+
-  '3*2Tlinux_Linux'#010+
-  '3*2Tnativent_Native NT API (experimental)'#010+
-  '3*2Tnetbsd_NetBSD'#010+
-  '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2Tnetwlibc_No','vell Netware Module (libc)'#010+
-  '3*2Topenbsd_OpenBSD'#010+
-  '3*2Tos2_OS/2 / eComStation'#010+
-  '3*2Tsolaris_Solaris'#010+
-  '3*2Tsymbian_Symbian OS'#010+
-  '3*2Twatcom_Watcom compatible DOS extender'#010+
-  '3*2Twdosx_WDOSX DOS extender'#010+
-  '3*2Twin32_Windows 32 bit'#010+
-  '3*2Twince_Windows CE'#010+
-  '4*2Tan','droid_Android'#010+
-  '4*2Taros_AROS'#010+
-  '4*2Tdarwin_Darwin/Mac OS X'#010+
-  '4*2Tdragonfly_DragonFly BSD'#010+
-  '4*2Tembedded_Embedded'#010+
-  '4*2Tfreebsd_FreeBSD'#010+
-  '4*2Thaiku_Haiku'#010+
-  '4*2Tiphonesim_iPhoneSimulator'#010+
-  '4*2Tlinux_Linux'#010+
-  '4*2Tnetbsd_NetBSD'#010+
-  '4*2Topenbsd_OpenBSD'#010+
-  '4*2Tsolaris_Sol','aris'#010+
-  '4*2Twin64_Win64 (64 bit Windows systems)'#010+
-  '6*2Tamiga_Commodore Amiga'#010+
-  '6*2Tatari_Atari ST/STe/TT'#010+
-  '6*2Tembedded_Embedded'#010+
-  '6*2Thuman68k_Human 68k'#010+
-  '6*2Tlinux_Linux'#010+
-  '6*2Tnetbsd_NetBSD'#010+
-  '6*2Tmacosclassic_Classic Mac OS'#010+
-  '6*2Tpalmos_PalmOS'#010+
-  '6*2Tsinclairq','l_Sinclair QL'#010+
-  '8*2Tembedded_Embedded'#010+
-  '8*2Tmsdos_MS-DOS (and compatible)'#010+
-  '8*2Twin16_Windows 16 bit'#010+
-  'A*2Tandroid_Android'#010+
-  'A*2Taros_AROS'#010+
-  'A*2Tembedded_Embedded'#010+
-  'A*2Tfreertos_FreeRTOS'#010+
-  'A*2Tgba_Game Boy Advance'#010+
-  'A*2Tios_iOS'#010+
-  'A*2Tlinux_Linux'#010+
-  'A*2Tnds_Ninten','do DS'#010+
-  'A*2Tnetbsd_NetBSD'#010+
-  'A*2Tpalmos_PalmOS'#010+
-  'A*2Tsymbian_Symbian'#010+
-  'A*2Twince_Windows CE'#010+
-  'a*2Tandroid_Android'#010+
-  'a*2Tdarwin_Darwin/Mac OS X'#010+
-  'a*2Tfreebsd_FreeBSD'#010+
-  'a*2Tios_iOS'#010+
-  'a*2Tlinux_Linux'#010+
-  'a*2Twin64_Windows 64'#010+
-  'J*2Tandroid_Android'#010+
-  'J*2Tjava_Java'#010+
-  'l*2Tlin','ux_Linux'#010+
-  'm*2Tandroid_Android'#010+
-  'm*2Tembedded_Embedded'#010+
-  'm*2Tlinux_Linux'#010+
-  'M*2Tembedded_Embedded'#010+
-  'M*2Tlinux_Linux'#010+
-  'P*2Taix_AIX'#010+
-  'P*2Tamiga_AmigaOS'#010+
-  'P*2Tdarwin_Darwin/Mac OS X'#010+
-  'P*2Tembedded_Embedded'#010+
-  'P*2Tlinux_Linux'#010+
-  'P*2Tmacosclassic_Classic Mac OS'#010+
-  'P*2Tmorp','hos_MorphOS'#010+
-  'P*2Tnetbsd_NetBSD'#010+
-  'P*2Twii_Wii'#010+
-  'p*2Taix_AIX'#010+
-  'p*2Tdarwin_Darwin/Mac OS X'#010+
-  'p*2Tembedded_Embedded'#010+
-  'p*2Tlinux_Linux'#010+
-  'R*2Tembedded_Embedded'#010+
-  'R*2Tlinux_Linux'#010+
-  'r*2Tembedded_Embedded'#010+
-  'r*2Tlinux_Linux'#010+
-  'S*2Tlinux_Linux'#010+
-  'S*2Tsolaris_Solaris'#010+
-  's*2Tlinux','_Linux'#010+
-  'V*2Tembedded_Embedded'#010+
-  'x*2Tembedded_Embedded'#010+
-  'x*2Tfreertos_FreeRTOS'#010+
-  'x*2Tlinux_Linux'#010+
-  'Z*2Tembedded_Embedded'#010+
-  'Z*2Tamstradcpc_Amstrad CPC'#010+
-  'Z*2Tmsxdos_MSX-DOS'#010+
-  'Z*2Tzxspectrum_ZX Spectrum'#010+
-  'W*2Tembedded_Embedded'#010+
-  'W*2Twasi_The WebAssembly System In','terface (WASI)'#010+
-  '**1t<x>_Target architecture'#010+
-  '**2*_ * Defines FPC_SUBTARGET_<x> '#010+
-  '**2*_ * Defines FPC_SUBTARGET as <arg>'#010+
-  '**2*_ * Additionally reads config file fpc-<subtarget>.cfg'#010+
-  '**1u<x>_Undefines the symbol <x>'#010+
-  '**1U_Unit options:'#010+
-  '**2Un_Do not',' check where the unit name matches the file name'#010+
-  '**2Ur_Generate release unit files (never automatically recompiled)'#010+
-  '**2Us_Compile a system unit'#010+
-  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
-  '**2*_0 : Show nothing (except',' errors)'#010+
-  '**2*_a : Show everything'#010+
-  '**2*_b : Write file names messages with full path'#010+
-  '**2*_c : Show conditionals'#010+
-  '**2*_d : Show debug info'#010+
-  '**2*_e : Show errors (default)'#010+
-  '**2*_h : Show hints'#010+
-  '**2*_i : Show general info'#010+
-  '**2*_j : Always add main s','ource (useful when run in parallel make)'#010+
-  '**2*_l : Show linenumbers'#010+
-  '**2*_m<x>,<y> : Do not show messages numbered <x> and <y>'#010+
-  '**2*_n : Show notes'#010+
-  '**2*_p : Write tree.log with parse tree'#010+
-  '**2*_q : Show message numbers'#010+
-  '**2*_r : Rhide/GCC compat','ibility mode'#010+
-  '**2*_s : Show time stamps'#010+
-  '**2*_t : Show tried/used files'#010+
-  '**2*_u : Show unit info'#010+
-  '**2*_v : Write fpcdebug.txt with lots of debugging info'#010+
-  '**2*_w : Show warnings'#010+
-  '**2*_x : Show info about invoked tools'#010+
-  '**2*_z : Write output to std','err'#010+
-  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
-  'or version)'#010+
-  '**1W<x>_Target-specific options (targets)'#010+
-  '3*2WA_Specify native type application (Windows)'#010+
-  '4*2WA_Specify native type application (Windows)'#010+
-  'A*2WA_Specify native typ','e application (Windows)'#010+
-  '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'a*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'A*2Wb_Cr','eate a bundle instead of a library (Darwin)'#010+
-  '4*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
-  '3*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
-  '4*2WB_Create a relocatable image (Windows)',#010+
-  '4*2WB<x>_Set image base to <x> (Windows)'#010+
-  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
-  'A*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
-  'Z*2WB<x>_Set image base to <x> (ZX Spectrum)'#010+
-  '3*2WC_Specify console type application (EMX, OS/2, ','Windows)'#010+
-  '4*2WC_Specify console type application (Windows)'#010+
-  'A*2WC_Specify console type application (Windows)'#010+
-  'P*2WC_Specify console type application (Classic Mac OS)'#010+
-  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  '4*2WD_Use DEFFI','LE to export functions of DLL or EXE (Windows)'#010+
-  'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  '3*2We_Use external resources (Darwin)'#010+
-  '4*2We_Use external resources (Darwin)'#010+
-  'a*2We_Use external resources (Darwin)'#010+
-  'A*2We_Use externa','l resources (Darwin)'#010+
-  'P*2We_Use external resources (Darwin)'#010+
-  'p*2We_Use external resources (Darwin)'#010+
-  '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
-  '6*2WF<x>_Set TOS program flags to <x> (Atari)'#010+
-  '3*2WG_Specify graphic type application (EM','X, OS/2, Windows)'#010+
-  '4*2WG_Specify graphic type application (Windows)'#010+
-  'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
-  '3*2Wi_Use internal resources (Darwin)'#010+
-  '4*2Wi_Use internal resources (','Darwin)'#010+
-  'a*2Wi_Use internal resources (Darwin)'#010+
-  'A*2Wi_Use internal resources (Darwin)'#010+
-  'P*2Wi_Use internal resources (Darwin)'#010+
-  'p*2Wi_Use internal resources (Darwin)'#010+
-  '3*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  '4*2WI_Turn on/off the u','sage of import sections (Windows)'#010+
-  'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  '8*2Wh_Use huge code for units (ignored for models with CODE in a uniqu'+
-  'e segment)'#010+
-  '8*2Wm<x>_Set memory model'#010+
-  '8*3WmTiny_Tiny memory model'#010+
-  '8*3WmSmall_Sma','ll memory model (default)'#010+
-  '8*3WmMedium_Medium memory model'#010+
-  '8*3WmCompact_Compact memory model'#010+
-  '8*3WmLarge_Large memory model'#010+
-  '8*3WmHuge_Huge memory model'#010+
-  '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n)'#010+
-  '4*2WM<x>_Minimum ','Mac OS X deployment version: 10.4, 10.5.1, ... (Dar'+
-  'win)'#010+
-  'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n)'#010+
-  'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n)'#010+
-  '3*2WN_Do not generate relocation code,',' needed for debugging (Windows'+
-  ')'#010+
-  '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for poss','i'+
-  'ble values'#010+
-  'm*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
-  'le values'#010+
-  'R*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
-  'le values'#010+
-  'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for poss','i'+
-  'ble values'#010+
-  'x*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
-  'le values'#010+
-  '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
-  '4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'#010+
-  'a*2WP<x>_M','inimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)'#010+
-  'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
-  'x*2WP<x>_Esp8266-rtos-sdk or esp-idf version number: 3.3, 3.4 (esp8266'+
-  ') or 4.2, 4.3 (esp32)'#010+
-  '3*2WR_Generate relocation ','code (Windows)'#010+
-  '4*2WR_Generate relocation code (Windows)'#010+
-  'A*2WR_Generate relocation code (Windows)'#010+
-  '8*2Wt<x>_Set the target executable format'#010+
-  '8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+
-  '8*3Wtexe_Create a DOS .EXE file (default',')'#010+
-  '6*2Wt<x>_Set the target executable format (Atari)'#010+
-  '6*3Wttos_Create TOS executable file (default)'#010+
-  '6*3Wtmint_Create a MiNT executable file'#010+
-  'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
-  '6*2WQ<x>_Set executable metadata format (Sinc','lair QL)'#010+
-  '6*3WQqhdr_Set metadata to QDOS File Header style (default)'#010+
-  '6*3WQxtcc_Set metadata to XTcc style'#010+
-  '**2WX_Enable executable stack (Linux)'#010+
-  '**1x<suff>_Set suffix for compiler executable (fpc command only)'#010+
-  '**1X_Executable options:'#010+
-  '**2X9_G','enerate linkerscript for GNU Binutils ld older than version 2'+
-  '.19.1 (Linux)'#010+
-  '**2Xa_Generate code which allows to use more than 2 GB static data on '+
-  '64 bit targets (Linux)'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
-  'ux',')'#010+
-  '**2Xd_Do not search default library path (sometimes required for cross'+
-  '-compiling when not using -XR)'#010+
-  '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
-  '**2Xe_Use external linker'#010+
-  '**2Xf_Substitute pthread library name for l','inking (BSD)'#010+
-  '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
-  'to executable'#010+
-  '**2Xi_Use internal linker'#010+
-  'L*2XlS<x>_LLVM utilties suffix (e.g. -7 in case clang is called clang-'+
-  '7)'#010+
-  '**2XLA_Define library substitutions for link','ing'#010+
-  '**2XLD_Exclude default order of standard libraries'#010+
-  '**2XLO_Define order of library linking'#010+
-  '**2Xm_Generate link map'#010+
-  '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
-  's '#039'main'#039')'#010+
-  '**2Xn_Use target system native linker instead of G','NU ld (Solaris, AI'+
-  'X)'#010+
-  'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
-  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
-  'ile, see the ld manual for mor','e information) (BeOS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
-  '**2Xs_Strip all symbols from executable'#010+
-  '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
-  '**2Xt','_Link with static libraries (-static is passed to linker)'#010+
-  '**2Xu_Generate executable in UF2 format  (embedded targets only)'#010+
-  '**2Xv_Generate table for Virtual Entry calls'#010+
-  '**2XV_Use VLink as external linker       (default on Amiga, Atari, Sin'+
-  'cl','air QL)'#010+
-  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
-  '**1*_'#010+
-  '**1?_Show this help'#010+
-  '**1h_Shows this help without waiting'
-);

+ 56 - 23
compiler/nadd.pas

@@ -687,12 +687,12 @@ implementation
              (allowenumop(nodetype) or (nf_internal in flags))
              (allowenumop(nodetype) or (nf_internal in flags))
             ) or
             ) or
             (
             (
-             (lt = pointerconstn) and
+             (lt in [pointerconstn,niln]) and
              is_constintnode(right) and
              is_constintnode(right) and
              (nodetype in [addn,subn])
              (nodetype in [addn,subn])
             ) or
             ) or
             (
             (
-             (rt = pointerconstn) and
+             (rt in [pointerconstn,niln]) and
              is_constintnode(left) and
              is_constintnode(left) and
              (nodetype=addn)
              (nodetype=addn)
             ) or
             ) or
@@ -709,26 +709,9 @@ implementation
              t:=nil;
              t:=nil;
 
 
              { load values }
              { load values }
-             case lt of
-               ordconstn:
-                 lv:=tordconstnode(left).value;
-               pointerconstn:
-                 lv:=tpointerconstnode(left).value;
-               niln:
-                 lv:=0;
-               else
-                 internalerror(2002080202);
-             end;
-             case rt of
-               ordconstn:
-                 rv:=tordconstnode(right).value;
-               pointerconstn:
-                 rv:=tpointerconstnode(right).value;
-               niln:
-                 rv:=0;
-               else
-                 internalerror(2002080203);
-             end;
+             lv:=get_int_value(left);
+             rv:=get_int_value(right);
+
              { type checking already took care of multiplying      }
              { type checking already took care of multiplying      }
              { integer constants with pointeddef.size if necessary }
              { integer constants with pointeddef.size if necessary }
              case nodetype of
              case nodetype of
@@ -741,7 +724,7 @@ implementation
                        { Recover }
                        { Recover }
                        t:=genintconstnode(0)
                        t:=genintconstnode(0)
                      end
                      end
-                   else if (lt=pointerconstn) or (rt=pointerconstn) then
+                   else if is_constpointernode(left) or is_constpointernode(right) then
                      t := cpointerconstnode.create(qword(v),resultdef)
                      t := cpointerconstnode.create(qword(v),resultdef)
                    else
                    else
                      if is_integer(ld) then
                      if is_integer(ld) then
@@ -1756,6 +1739,56 @@ implementation
                    ;
                    ;
               end;
               end;
 
 
+            {
+              compile x < length(arr) as x <= high(arr)
+              compile x >= length(arr) as x > high(arr)
+
+              tested by tests/webtbs/tw40292.pp
+            }
+            if (nodetype in [ltn,gten]) and
+              (right.nodetype=inlinen) and (tinlinenode(right).inlinenumber=in_length_x) and
+              ((is_dynamic_array(tinlinenode(right).left.resultdef)) or
+               (is_open_array(tinlinenode(right).left.resultdef))
+              ) then
+              begin
+                case nodetype of
+                  ltn:
+                    result:=caddnode.create(lten,left,cinlinenode.create(in_high_x,false,tinlinenode(right).left));
+                  gten:
+                    result:=caddnode.create(gtn,left,cinlinenode.create(in_high_x,false,tinlinenode(right).left));
+                  else
+                    Internalerror(2024041701);
+                end;
+                left:=nil;
+                tinlinenode(right).left:=nil;
+                exit;
+              end;
+
+            {
+              compile length(arr) > x as high(arr) >= x
+              compile length(arr) <= x as high(arr) < x
+
+              tested by tests/webtbs/tw40292.pp
+            }
+            if (nodetype in [lten,gtn]) and
+              (left.nodetype=inlinen) and (tinlinenode(left).inlinenumber=in_length_x) and
+              ((is_dynamic_array(tinlinenode(left).left.resultdef)) or
+               (is_open_array(tinlinenode(left).left.resultdef))
+              ) then
+              begin
+                case nodetype of
+                  gtn:
+                    result:=caddnode.create(gten,cinlinenode.create(in_high_x,false,tinlinenode(left).left),right);
+                  lten:
+                    result:=caddnode.create(ltn,cinlinenode.create(in_high_x,false,tinlinenode(left).left),right);
+                  else
+                    Internalerror(2024041701);
+                end;
+                right:=nil;
+                tinlinenode(left).left:=nil;
+                exit;
+              end;
+
             { using sqr(x) for reals instead of x*x might reduces register pressure and/or
             { using sqr(x) for reals instead of x*x might reduces register pressure and/or
               memory accesses while sqr(<real>) has no drawback }
               memory accesses while sqr(<real>) has no drawback }
             if
             if

+ 243 - 159
compiler/nbas.pas

@@ -97,6 +97,11 @@ interface
 {$ifdef DEBUG_NODE_XML}
 {$ifdef DEBUG_NODE_XML}
           procedure XMLPrintNodeInfo(var T: Text); override;
           procedure XMLPrintNodeInfo(var T: Text); override;
           procedure XMLPrintNodeData(var T: Text); override;
           procedure XMLPrintNodeData(var T: Text); override;
+       protected
+          class procedure XMLPadString(var S: string; Len: Integer); static;
+
+          function XMLFormatOp(const Oper: POper): string; virtual;
+          procedure XMLProcessInstruction(var T: Text; p: tai); virtual;
 {$endif DEBUG_NODE_XML}
 {$endif DEBUG_NODE_XML}
        end;
        end;
        tasmnodeclass = class of tasmnode;
        tasmnodeclass = class of tasmnode;
@@ -112,15 +117,28 @@ interface
        end;
        end;
        tstatementnodeclass = class of tstatementnode;
        tstatementnodeclass = class of tstatementnode;
 
 
+       TBlockNodeFlag = (
+         bnf_strippable { Block node can be removed via simplify etc. }
+       );
+
+       TBlockNodeFlags = set of TBlockNodeFlag;
+
        tblocknode = class(tunarynode)
        tblocknode = class(tunarynode)
+          blocknodeflags : TBlockNodeFlags;
           constructor create(l : tnode);virtual;
           constructor create(l : tnode);virtual;
           destructor destroy; override;
           destructor destroy; override;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          function dogetcopy : tnode;override;
           function simplify(forinline : boolean) : tnode; override;
           function simplify(forinline : boolean) : tnode; override;
           function pass_1 : tnode;override;
           function pass_1 : tnode;override;
           function pass_typecheck:tnode;override;
           function pass_typecheck:tnode;override;
 {$ifdef state_tracking}
 {$ifdef state_tracking}
           function track_state_pass(exec_known:boolean):boolean;override;
           function track_state_pass(exec_known:boolean):boolean;override;
 {$endif state_tracking}
 {$endif state_tracking}
+{$ifdef DEBUG_NODE_XML}
+          procedure XMLPrintNodeInfo(var T: Text); override;
+{$endif DEBUG_NODE_XML}
           property statements : tnode read left write left;
           property statements : tnode read left write left;
        end;
        end;
        tblocknodeclass = class of tblocknode;
        tblocknodeclass = class of tblocknode;
@@ -206,7 +224,7 @@ interface
        { already been disposed and to make sure the coherency between temps and     }
        { already been disposed and to make sure the coherency between temps and     }
        { temp references is kept after a getcopy                                    }
        { temp references is kept after a getcopy                                    }
        ptempinfo = ^ttempinfo;
        ptempinfo = ^ttempinfo;
-       ttempinfo = object
+       ttempinfo = record
         private
         private
          flags                      : ttempinfoflags;
          flags                      : ttempinfoflags;
         public
         public
@@ -348,7 +366,7 @@ implementation
     uses
     uses
       verbose,globals,systems,
       verbose,globals,systems,
       ppu,
       ppu,
-      symconst,symdef,defutil,defcmp,
+      symsym,symconst,symdef,defutil,defcmp,
       pass_1,
       pass_1,
       nutils,nld,ncnv,
       nutils,nld,ncnv,
       procinfo
       procinfo
@@ -357,6 +375,12 @@ implementation
       ,
       ,
       cpubase,
       cpubase,
       cutils,
       cutils,
+{$ifdef arm}
+      agarmgas, { Needed for gas_shiftmode2str }
+{$endif arm}
+{$ifdef aarch64}
+      agcpugas, { Needed for gas_shiftmode2str }
+{$endif aarch64}
       itcpugas
       itcpugas
 {$endif jvm}
 {$endif jvm}
 {$endif DEBUG_NODE_XML}
 {$endif DEBUG_NODE_XML}
@@ -371,7 +395,8 @@ implementation
       begin
       begin
         { create dummy initial statement }
         { create dummy initial statement }
         laststatement := cstatementnode.create(cnothingnode.create,nil);
         laststatement := cstatementnode.create(cnothingnode.create,nil);
-        internalstatements := cblocknode.create(laststatement);
+        result := cblocknode.create(laststatement);
+        Include(result.blocknodeflags, bnf_strippable);
       end;
       end;
 
 
 
 
@@ -686,6 +711,7 @@ implementation
 
 
       begin
       begin
          inherited create(blockn,l);
          inherited create(blockn,l);
+         blocknodeflags:=[];
       end;
       end;
 
 
     destructor tblocknode.destroy;
     destructor tblocknode.destroy;
@@ -706,6 +732,27 @@ implementation
       end;
       end;
 
 
 
 
+    constructor tblocknode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.getset(tppuset1(blocknodeflags));
+      end;
+
+
+    procedure tblocknode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putset(tppuset1(blocknodeflags));
+      end;
+
+
+    function tblocknode.dogetcopy : tnode;
+      begin
+        Result:=inherited dogetcopy;
+        TBlockNode(Result).blocknodeflags:=blocknodeflags;
+      end;
+
+
     function NodesEqual(var n: tnode; arg: pointer): foreachnoderesult;
     function NodesEqual(var n: tnode; arg: pointer): foreachnoderesult;
       begin
       begin
         if n.IsEqual(tnode(arg)) then
         if n.IsEqual(tnode(arg)) then
@@ -716,8 +763,9 @@ implementation
 
 
 
 
     function tblocknode.simplify(forinline : boolean): tnode;
     function tblocknode.simplify(forinline : boolean): tnode;
-{$ifdef break_inlining}
       var
       var
+        n, p, first, last: tstatementnode;
+{$ifdef break_inlining}
         a : array[0..3] of tstatementnode;
         a : array[0..3] of tstatementnode;
 {$endif break_inlining}
 {$endif break_inlining}
       begin
       begin
@@ -727,32 +775,115 @@ implementation
           main program body, and those nodes should always be blocknodes
           main program body, and those nodes should always be blocknodes
           since that's what the compiler expects elsewhere. }
           since that's what the compiler expects elsewhere. }
 
 
-        if assigned(left) and
-           not assigned(tstatementnode(left).right) then
+        if assigned(left) then
           begin
           begin
-            case tstatementnode(left).left.nodetype of
-              blockn:
-                begin
-                  { if the current block contains only one statement, and
-                    this one statement only contains another block, replace
-                    this block with that other block.                       }
-                  result:=tstatementnode(left).left;
-                  tstatementnode(left).left:=nil;
-                  { make sure the nf_block_with_exit flag is safeguarded }
-                  result.flags:=result.flags+(flags*[nf_block_with_exit,nf_usercode_entry]);
-                  exit;
-                end;
-              nothingn:
-                begin
-                  { if the block contains only a statement with a nothing node,
-                    get rid of the statement }
-                  left.Free;
-                  left:=nil;
-                  exit;
+            if not assigned(tstatementnode(left).right) then
+              begin
+                { Block has a lone statement }
+                case tstatementnode(left).left.nodetype of
+                  blockn:
+                    begin
+                      { if the current block contains only one statement, and
+                        this one statement only contains another block, replace
+                        this block with that other block.                       }
+                      result:=tstatementnode(left).left;
+                      tstatementnode(left).left:=nil;
+                      { make sure the nf_block_with_exit flag is safeguarded }
+                      result.flags:=result.flags+(flags*[nf_block_with_exit,nf_usercode_entry]);
+                      exit;
+                    end;
+                  nothingn:
+                    begin
+                      { if the block contains only a statement with a nothing node,
+                        get rid of the statement }
+                      left.Free;
+                      left:=nil;
+                      exit;
+                    end;
+                  else
+                    ;
                 end;
                 end;
-              else
-                ;
-            end;
+              end
+            else if forinline or (cs_opt_level2 in current_settings.optimizerswitches) then
+              begin
+                n := TStatementNode(left);
+                while Assigned(n) do
+                  begin
+                    case n.left.nodetype of
+                      raisen, exitn, breakn, continuen, goton:
+                        { Remove all subsequent statements, stopping only at a
+                          label or asm block since code can theoretically jump
+                          to them.  Also, don't delete temp creates and deletes }
+                        begin
+                          last := n;
+                          p := TStatementNode(n.Next);
+                          while Assigned(p) do
+                            begin
+                              if (TStatementNode(p).left.nodetype in [labeln, asmn, tempcreaten, tempdeleten, blockn]) then
+                                Break;
+
+                              last := p;
+                              p := TStatementNode(p.Next);
+                            end;
+
+                          if (last <> n) then
+                            begin
+                              last.next := nil; { Make sure we stop one before p }
+                              n.next.Free;
+                              n.next := p;
+                              n := p;
+                              Continue;
+                            end;
+                        end;
+                      else
+                        ;
+                    end;
+
+                    { Look one statement ahead in case it can be deleted - we
+                      need the previous statement to stitch the tree correctly
+                    }
+                    p := TStatementNode(n.Next);
+                    if not Assigned(p) then
+                      Break;
+
+                    if Assigned(p.left) then
+                      begin
+                        case p.left.nodetype of
+                          blockn:
+                            if (bnf_strippable in TBlockNode(p.left).blocknodeflags) and
+                              ((p.left.flags * [nf_block_with_exit] = []) or no_exit_statement_in_block(p.left)) then
+                              begin
+                                { Attempt to merge this block into the main statement
+                                  set }
+
+                                { Find last statement }
+                                first := TStatementNode(TBlockNode(p.left).PruneKeepLeft());
+                                if Assigned(first) then
+                                  begin
+                                    last := first;
+                                    while Assigned(last.right) do
+                                      last := TStatementNode(last.right);
+
+                                    n.right := first;
+                                  end
+                                else
+                                  last := n;
+
+                                last.right := p.PruneKeepRight();
+
+                                { make sure the nf_usercode_entry flag is safeguarded }
+                                Flags := Flags + (p.left.flags * [nf_usercode_entry]);
+
+                                p.Free;
+                                Continue;
+                              end;
+                          else
+                            ;
+                        end;
+                      end;
+                    n := TStatementNode(n.Next);
+                  end;
+              end;
           end;
           end;
 {$ifdef break_inlining}
 {$ifdef break_inlining}
         { simple sequence of tempcreate, assign and return temp.? }
         { simple sequence of tempcreate, assign and return temp.? }
@@ -863,6 +994,30 @@ implementation
             end;
             end;
       end;
       end;
 {$endif state_tracking}
 {$endif state_tracking}
+{$ifdef DEBUG_NODE_XML}
+    procedure TBlockNode.XMLPrintNodeInfo(var T: Text);
+      var
+        i_bnf: TBlockNodeFlag;
+        First: Boolean;
+      begin
+        inherited XMLPrintNodeInfo(T);
+
+        First := True;
+        for i_bnf in blocknodeflags do
+          begin
+            if First then
+              begin
+                Write(T, ' blocknodeflags="', i_bnf);
+                First := False;
+              end
+            else
+              Write(T, ',', i_bnf)
+          end;
+
+        if not First then
+          write(T,'"');
+      end;
+{$endif DEBUG_NODE_XML}
 
 
 {*****************************************************************************
 {*****************************************************************************
                              TASMNODE
                              TASMNODE
@@ -1036,156 +1191,85 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TAsmNode.XMLPrintNodeData(var T: Text);
+    procedure TAsmNode.XMLProcessInstruction(var T: Text; p: tai);
+      var
+        ThisOp, ThisOper: string;
+        X: Integer;
+      begin
+        case p.typ of
+          { Instructions are handled on a per-platform basis }
 
 
-      procedure PadString(var S: string; Len: Integer);
-        var
-          X, C: Integer;
-        begin
-          C := Length(S);
-          if C < Len then
-            begin
-              SetLength(S, 7);
-              for X := C + 1 to Len do
-                S[X] := ' '
-            end;
-        end;
+          ait_label:
+            WriteLn(T, PrintNodeIndention, tai_label(p).labsym.name, ':');
 
 
-{$ifndef jvm}
-      function FormatOp(const Oper: POper): string;
-        begin
-          case Oper^.typ of
-            top_const:
-              begin
-                case Oper^.val of
-                  -15..15:
-                    Result := '$' + tostr(Oper^.val);
-                  $10..$FF:
-                    Result := '$0x' + hexstr(Oper^.val, 2);
-                  $100..$FFFF:
-                    Result := '$0x' + hexstr(Oper^.val, 4);
-                  $10000..$FFFFFFFF:
-                    Result := '$0x' + hexstr(Oper^.val, 8);
-                  else
-                    Result := '$0x' + hexstr(Oper^.val, 16);
-                end;
+          ait_const:
+            begin
+              case tai_const(p).consttype of
+                aitconst_64bit:
+                  WriteLn(T, PrintNodeIndention, '.quad 0x', hexstr(tai_const(p).value, 16));
+                aitconst_32bit:
+                  WriteLn(T, PrintNodeIndention, '.long 0x', hexstr(tai_const(p).value, 8));
+                aitconst_16bit:
+                  WriteLn(T, PrintNodeIndention, '.word 0x', hexstr(tai_const(p).value, 4));
+                aitconst_8bit:
+                  WriteLn(T, PrintNodeIndention, '.byte 0x', hexstr(tai_const(p).value, 2));
+                else
+                  WriteLn(T, PrintNodeIndention, '; (Other constant)');
               end;
               end;
-            top_reg:
-              Result := gas_regname(Oper^.reg);
-            top_ref:
-              with Oper^.ref^ do
-                begin
-{$if defined(x86)}
-                  if segment <> NR_NO then
-                    Result := gas_regname(segment) + ':'
-                  else
-{$endif defined(x86)}
-                    Result := '';
-
-                  if Assigned(symbol) then
-                    begin
-                      Result := Result + symbol.Name;
-                      if offset > 0 then
-                        Result := Result + '+';
-                    end;
-
-                  if offset <> 0 then
-                    Result := Result + tostr(offset)
-                  else
-                    Result := Result;
+            end;
 
 
-                  if (base <> NR_NO) or (index <> NR_NO) then
-                    begin
-                      Result := Result + '(';
+          ait_realconst:
+            WriteLn(T, PrintNodeIndention, '; (Real constant)');
 
 
-                      if base <> NR_NO then
-                        begin
-                          Result := Result + gas_regname(base);
-                          if index <> NR_NO then
-                            Result := Result + ',';
-                        end;
+          else
+            { Do nothing };
+        end;
+      end;
 
 
-                      if index <> NR_NO then
-                        Result := Result + gas_regname(index);
 
 
-                      if scalefactor <> 0 then
-                        Result := Result + ',' + tostr(scalefactor) + ')'
-                      else
-                        Result := Result + ')';
-                    end;
-                end;
-            top_bool:
-              begin
-                if Oper^.b then
-                  Result := 'TRUE'
-                else
-                  Result := 'FALSE';
-              end
-            else
-              Result := '';
+    class procedure TAsmNode.XMLPadString(var S: string; Len: Integer);
+      var
+        X, C: Integer;
+      begin
+        C := Length(S);
+        if C < Len then
+          begin
+            SetLength(S, Len);
+            for X := C + 1 to Len do
+              S[X] := ' '
           end;
           end;
-        end;
-
-{$if defined(x86)}
-      procedure ProcessInstruction(p: tai); inline;
-        var
-          ThisOp, ThisOper: string;
-          X: Integer;
-        begin
-          case p.typ of
-            ait_label:
-              WriteLn(T, PrintNodeIndention, tai_label(p).labsym.name);
-
-            ait_instruction:
-              begin
-                ThisOp := gas_op2str[taicpu(p).opcode]+cond2str[taicpu(p).condition];
-                if gas_needsuffix[taicpu(p).opcode] <> AttSufNONE then
-                  ThisOp := ThisOp + gas_opsize2str[taicpu(p).opsize];
+      end;
 
 
-                { Pad the opcode with spaces so the succeeding operands are aligned }
-                PadString(ThisOp, 7);
 
 
-                Write(T, PrintNodeIndention, '  ', ThisOp); { Extra indentation to account for label formatting }
-                for X := 0 to taicpu(p).ops - 1 do
-                  begin
-                    Write(T, ' ');
+    function TAsmNode.XMLFormatOp(const Oper: POper): string;
+      begin
+        case Oper^.typ of
+          top_reg:
+            Result := gas_regname(Oper^.reg);
 
 
-                    ThisOper := FormatOp(taicpu(p).oper[X]);
-                    if X < taicpu(p).ops - 1 then
-                      begin
-                        ThisOper := ThisOper + ',';
-                        PadString(ThisOper, 7);
-                      end;
+          top_local:
+            { Local variable }
+            Result := TSym(Oper^.localoper^.localsym).prettyname;
 
 
-                    Write(T, ThisOper);
-                  end;
-                WriteLn(T);
-              end;
-            else
-              { Do nothing };
-          end;
+          top_bool:
+            begin
+              if Oper^.b then
+                Result := 'TRUE'
+              else
+                Result := 'FALSE';
+            end;
+          else
+            Result := '(unk)';
         end;
         end;
+      end;
 
 
-      var
-        hp: tai;
+
+    procedure TAsmNode.XMLPrintNodeData(var T: Text);
       begin
       begin
         if not Assigned(p_asm) then
         if not Assigned(p_asm) then
           Exit;
           Exit;
 
 
-        hp := tai(p_asm.First);
-        while Assigned(hp) do
-          begin
-            ProcessInstruction(hp);
-            hp := tai(hp.Next);
-          end;
-{$else defined(x86)}
-      begin
         WriteLn(T, PrintNodeIndention, '(Assembler output not currently supported on this platform)');
         WriteLn(T, PrintNodeIndention, '(Assembler output not currently supported on this platform)');
-{$endif defined(x86)}
-{$else jvm}
-      begin
-        WriteLn(T, PrintNodeIndention, '(Should assembly language even be possible under JVM?)');
-{$endif jvm}
       end;
       end;
 {$endif DEBUG_NODE_XML}
 {$endif DEBUG_NODE_XML}
 
 

+ 1 - 0
compiler/ncal.pas

@@ -1867,6 +1867,7 @@ implementation
         if assigned(varargsparas) then
         if assigned(varargsparas) then
          begin
          begin
            n.varargsparas:=tvarargsparalist.create(true);
            n.varargsparas:=tvarargsparalist.create(true);
+           n.varargsparas.capacity:=varargsparas.count;
            for i:=0 to varargsparas.count-1 do
            for i:=0 to varargsparas.count-1 do
              begin
              begin
                hp:=tparavarsym(varargsparas[i]);
                hp:=tparavarsym(varargsparas[i]);

+ 41 - 7
compiler/ncginl.pas

@@ -757,18 +757,52 @@ implementation
     procedure tcginlinenode.second_abs_long;
     procedure tcginlinenode.second_abs_long;
       var
       var
         tempreg1, tempreg2: tregister;
         tempreg1, tempreg2: tregister;
+{$if not(defined(cpu64bitalu)) and not defined(cpuhighleveltarget)}
+        tempreg64: tregister64;
+{$endif not(defined(cpu64bitalu)) and not defined(cpuhighleveltarget)}
+        ovloc: tlocation;
       begin
       begin
         secondpass(left);
         secondpass(left);
-        hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
+        hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
         location:=left.location;
         location:=left.location;
-        location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
+{$if not(defined(cpu64bitalu)) and not defined(cpuhighleveltarget)}
+        if is_64bitint(left.resultdef) then
+          begin
+            location:=left.location;
+            location.register64.reglo:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
+            location.register64.reghi:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
+            cg64.a_load64_reg_reg(current_asmdata.CurrAsmList,left.location.register64,location.register64);
+            cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SAR,OS_32,31,left.location.register64.reghi);
+            tempreg64.reghi:=left.location.register64.reghi;
+            tempreg64.reglo:=left.location.register64.reghi;
+            cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,OP_XOR,def_cgsize(resultdef),tempreg64,location.register64);
+            if cs_check_overflow in current_settings.localswitches then
+              begin
+                cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,def_cgsize(resultdef),tempreg64,location.register64,location.register64,true,ovloc);
+                hlcg.g_overflowcheck_loc(current_asmdata.CurrAsmList,Location,resultdef,ovloc);
+              end
+            else
+              cg64.a_op64_reg_reg_reg(current_asmdata.CurrAsmList,OP_SUB,def_cgsize(resultdef),tempreg64,location.register64,location.register64);
+          end
+        else
+{$endif not(defined(cpu64bitalu)) and not defined(cpuhighleveltarget)}
+          begin
+            location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
+
+            tempreg1:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
+            tempreg2:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
 
 
-        tempreg1:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
-        tempreg2:=hlcg.getintregister(current_asmdata.CurrAsmList,left.resultdef);
+            hlcg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,left.resultdef,left.resultdef.size*8-1,left.location.register,tempreg1);
+            hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_XOR,left.resultdef,left.location.register,tempreg1,tempreg2);
 
 
-        hlcg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,left.resultdef,left.resultdef.size*8-1,left.location.register,tempreg1);
-        hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_XOR,left.resultdef,left.location.register,tempreg1,tempreg2);
-        hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmlist,OP_SUB,left.resultdef,tempreg1,tempreg2,location.register);
+            if cs_check_overflow in current_settings.localswitches then
+              begin
+                hlcg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmlist,OP_SUB,resultdef,tempreg1,tempreg2,location.register,true,ovloc);
+                hlcg.g_overflowcheck_loc(current_asmdata.CurrAsmList,Location,resultdef,ovloc);
+              end
+            else
+              hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmlist,OP_SUB,resultdef,tempreg1,tempreg2,location.register);
+          end;
       end;
       end;
 
 
 
 

+ 14 - 3
compiler/nflw.pas

@@ -553,7 +553,7 @@ implementation
       var
       var
         loopstatement, loopbodystatement: tstatementnode;
         loopstatement, loopbodystatement: tstatementnode;
         loopvar, stringvar: ttempcreatenode;
         loopvar, stringvar: ttempcreatenode;
-        stringindex, loopbody, forloopnode: tnode;
+        stringindex, loopbody, forloopnode, fromn, ton: tnode;
       begin
       begin
         { result is a block of statements }
         { result is a block of statements }
         result:=internalstatements(loopstatement);
         result:=internalstatements(loopstatement);
@@ -585,9 +585,20 @@ implementation
         { add the actual statement to the loop }
         { add the actual statement to the loop }
         addstatement(loopbodystatement,hloopbody);
         addstatement(loopbodystatement,hloopbody);
 
 
+        if tstringdef(expr.resultdef).stringtype=st_shortstring then
+          begin
+            fromn:=genintconstnode(1);
+            ton:=cinlinenode.create(in_length_x,false,ctemprefnode.create(stringvar));
+          end
+        else
+          begin
+             fromn:=cinlinenode.createintern(in_low_x,false,ctemprefnode.create(stringvar));
+             ton:= cinlinenode.create(in_high_x,false,ctemprefnode.create(stringvar));
+           end;
+
         forloopnode:=cfornode.create(ctemprefnode.create(loopvar),
         forloopnode:=cfornode.create(ctemprefnode.create(loopvar),
-          cinlinenode.createintern(in_low_x,false,ctemprefnode.create(stringvar)),
-          cinlinenode.create(in_high_x,false,ctemprefnode.create(stringvar)),
+          fromn,
+          ton,
           loopbody,
           loopbody,
           false);
           false);
 
 

+ 2 - 4
compiler/ngenutil.pas

@@ -1333,9 +1333,7 @@ implementation
              tcb.get_final_asmlist(sym,tabledef,sec_data,s,const_align(sizeof(pint))));
              tcb.get_final_asmlist(sym,tabledef,sec_data,s,const_align(sizeof(pint))));
            include(current_module.moduleflags,mf_threadvars);
            include(current_module.moduleflags,mf_threadvars);
            current_module.add_public_asmsym(sym);
            current_module.add_public_asmsym(sym);
-         end
-       else
-         s:='';
+         end;
        tcb.Free;
        tcb.Free;
     end;
     end;
 
 
@@ -1505,7 +1503,7 @@ implementation
     var
     var
       tcb: ttai_typedconstbuilder;
       tcb: ttai_typedconstbuilder;
     begin
     begin
-      if (target_res.id in [res_elf,res_macho,res_xcoff]) or
+      if (target_res.id in [res_elf,res_macho,res_xcoff,res_wasm]) or
          { generate the FPC_RESLOCATION symbol even when using external resources,
          { generate the FPC_RESLOCATION symbol even when using external resources,
            because in SysInit we can only reference it unconditionally }
            because in SysInit we can only reference it unconditionally }
          ((target_res.id=res_ext) and (target_info.system in systems_darwin)) then
          ((target_res.id=res_ext) and (target_info.system in systems_darwin)) then

+ 8 - 2
compiler/ninl.pas

@@ -4947,6 +4947,8 @@ implementation
            end;
            end;
 
 
          resultnode := hp.getcopy;
          resultnode := hp.getcopy;
+         { Remove "modify" flag from what will be an assignment destination }
+         Exclude(resultnode.flags, nf_modify);
 
 
          { avoid type errors from the addn/subn }
          { avoid type errors from the addn/subn }
          if not is_integer(resultnode.resultdef) then
          if not is_integer(resultnode.resultdef) then
@@ -4955,7 +4957,7 @@ implementation
              inserttypeconv_internal(hpp,sinttype);
              inserttypeconv_internal(hpp,sinttype);
            end;
            end;
 
 
-         { addition/substraction depending on inc/dec }
+         { addition/subtraction depending on inc/dec }
          if inlinenumber = in_inc_x then
          if inlinenumber = in_inc_x then
            hpp := caddnode.create_internal(addn,hp,hpp)
            hpp := caddnode.create_internal(addn,hp,hpp)
          else
          else
@@ -5541,7 +5543,11 @@ implementation
                      datan:=caddrnode.create_internal(ctemprefnode.create(datatemp));
                      datan:=caddrnode.create_internal(ctemprefnode.create(datatemp));
                    end
                    end
                  else
                  else
-                   datan:=caddrnode.create_internal(ctypeconvnode.create_internal(firstn,tarraydef(second).elementdef));
+                   begin
+                     datan:=firstn;
+                     inserttypeconv(datan,tarraydef(second).elementdef);
+                     datan:=caddrnode.create_internal(datan);
+                   end;
                  datacountn:=cordconstnode.create(1,sizesinttype,false);
                  datacountn:=cordconstnode.create(1,sizesinttype,false);
                end;
                end;
              procname:='fpc_dynarray_insert';
              procname:='fpc_dynarray_insert';

+ 5 - 3
compiler/nmat.pas

@@ -215,10 +215,12 @@ implementation
                 exit;
                 exit;
               end;
               end;
 
 
-            if is_constintnode(left) then
+            { pointer subtractions generate nodes dividing pointer (constants) }
+            if is_constintnode(left) or is_constpointernode(left) then
               begin
               begin
-                rv:=tordconstnode(right).value;
-                lv:=tordconstnode(left).value;
+                { load values }
+                lv:=get_int_value(left);
+                rv:=get_int_value(right);
 
 
                 case nodetype of
                 case nodetype of
                   modn:
                   modn:

+ 25 - 35
compiler/nobj.pas

@@ -668,17 +668,10 @@ implementation
           weight: longint;
           weight: longint;
           compintf: longint;
           compintf: longint;
         end;
         end;
-        { Max 1000 interface in the class header interfaces it's enough imho }
-        tcompintfs = array[0..1000] of tcompintfentry;
-        pcompintfs = ^tcompintfs;
-        tequals    = array[0..1000] of longint;
-        pequals    = ^tequals;
-        timpls    = array[0..1000] of longint;
-        pimpls    = ^timpls;
       var
       var
-        aequals: pequals;
-        compats: pcompintfs;
-        impls: pimpls;
+        aequals: array of longint;
+        compats: array of tcompintfentry;
+        impls: array of longint;
         ImplIntfCount,
         ImplIntfCount,
         w,i,j,k: longint;
         w,i,j,k: longint;
         ImplIntfI,
         ImplIntfI,
@@ -687,14 +680,14 @@ implementation
         cji: boolean;
         cji: boolean;
       begin
       begin
         ImplIntfCount:=_class.ImplementedInterfaces.count;
         ImplIntfCount:=_class.ImplementedInterfaces.count;
-        if ImplIntfCount>=High(tequals) then
-          Internalerror(200006135);
-        getmem(compats,sizeof(tcompintfentry)*ImplIntfCount);
-        getmem(aequals,sizeof(longint)*ImplIntfCount);
-        getmem(impls,sizeof(longint)*ImplIntfCount);
-        filldword(compats^,(sizeof(tcompintfentry) div sizeof(dword))*ImplIntfCount,dword(-1));
-        filldword(aequals^,ImplIntfCount,dword(-1));
-        filldword(impls^,ImplIntfCount,dword(-1));
+        if ImplIntfCount=0 then
+          exit;
+        SetLength(compats,ImplIntfCount);
+        SetLength(aequals,ImplIntfCount);
+        SetLength(impls,ImplIntfCount);
+        filldword(compats[0],(sizeof(tcompintfentry) div sizeof(dword))*ImplIntfCount,dword(-1));
+        filldword(aequals[0],ImplIntfCount,dword(-1));
+        filldword(impls[0],ImplIntfCount,dword(-1));
         { ismergepossible is a containing relation
         { ismergepossible is a containing relation
           meaning of ismergepossible(a,b,w) =
           meaning of ismergepossible(a,b,w) =
           if implementorfunction map of a is contained implementorfunction map of b
           if implementorfunction map of a is contained implementorfunction map of b
@@ -712,32 +705,32 @@ implementation
                 if cij and cji then { i equal j }
                 if cij and cji then { i equal j }
                   begin
                   begin
                     { get minimum index of equal }
                     { get minimum index of equal }
-                    if aequals^[j]=-1 then
-                      aequals^[j]:=i;
+                    if aequals[j]=-1 then
+                      aequals[j]:=i;
                   end
                   end
                 else if cij then
                 else if cij then
                   begin
                   begin
                     { get minimum index of maximum weight  }
                     { get minimum index of maximum weight  }
-                    if compats^[i].weight<w then
+                    if compats[i].weight<w then
                       begin
                       begin
-                        compats^[i].weight:=w;
-                        compats^[i].compintf:=j;
+                        compats[i].weight:=w;
+                        compats[i].compintf:=j;
                       end;
                       end;
                   end
                   end
                 else if cji then
                 else if cji then
                   begin
                   begin
                     { get minimum index of maximum weight  }
                     { get minimum index of maximum weight  }
-                    if (compats^[j].weight<w) then
+                    if (compats[j].weight<w) then
                       begin
                       begin
-                        compats^[j].weight:=w;
-                        compats^[j].compintf:=i;
+                        compats[j].weight:=w;
+                        compats[j].compintf:=i;
                       end;
                       end;
                   end;
                   end;
               end;
               end;
           end;
           end;
         { Reset, no replacements by default }
         { Reset, no replacements by default }
         for i:=0 to ImplIntfCount-1 do
         for i:=0 to ImplIntfCount-1 do
-          impls^[i]:=i;
+          impls[i]:=i;
         { Replace vtbls when equal or compat, repeat
         { Replace vtbls when equal or compat, repeat
           until there are no replacements possible anymore. This is
           until there are no replacements possible anymore. This is
           needed for the cases like:
           needed for the cases like:
@@ -748,10 +741,10 @@ implementation
           k:=0;
           k:=0;
           for i:=0 to ImplIntfCount-1 do
           for i:=0 to ImplIntfCount-1 do
             begin
             begin
-              if compats^[impls^[i]].compintf<>-1 then
-                impls^[i]:=compats^[impls^[i]].compintf
-              else if aequals^[impls^[i]]<>-1 then
-                impls^[i]:=aequals^[impls^[i]]
+              if compats[impls[i]].compintf<>-1 then
+                impls[i]:=compats[impls[i]].compintf
+              else if aequals[impls[i]]<>-1 then
+                impls[i]:=aequals[impls[i]]
               else
               else
                 inc(k);
                 inc(k);
             end;
             end;
@@ -760,11 +753,8 @@ implementation
         for i:=0 to ImplIntfCount-1 do
         for i:=0 to ImplIntfCount-1 do
           begin
           begin
             ImplIntfI:=TImplementedInterface(_class.ImplementedInterfaces[i]);
             ImplIntfI:=TImplementedInterface(_class.ImplementedInterfaces[i]);
-            ImplIntfI.VtblImplIntf:=TImplementedInterface(_class.ImplementedInterfaces[impls^[i]]);
+            ImplIntfI.VtblImplIntf:=TImplementedInterface(_class.ImplementedInterfaces[impls[i]]);
           end;
           end;
-        freemem(compats);
-        freemem(aequals);
-        freemem(impls);
       end;
       end;
 
 
 
 

+ 10 - 0
compiler/nset.pas

@@ -350,6 +350,7 @@ implementation
         t : tnode;
         t : tnode;
       begin
       begin
          result:=nil;
          result:=nil;
+
          { constant evaluation }
          { constant evaluation }
          if (left.nodetype=ordconstn) then
          if (left.nodetype=ordconstn) then
            begin
            begin
@@ -400,6 +401,15 @@ implementation
              typecheckpass(t);
              typecheckpass(t);
              result:=t;
              result:=t;
              exit;
              exit;
+           end
+         { ... in [] is always false }
+         else if is_emptyset(right) and
+           not(might_have_sideeffects(left,[mhs_exceptions])) then
+           begin
+             t:=cordconstnode.create(1, pasbool1type, false);
+             typecheckpass(t);
+             result:=t;
+             exit;
            end;
            end;
       end;
       end;
 
 

+ 18 - 0
compiler/nutils.pas

@@ -174,6 +174,9 @@ interface
     { returns true if the node has the int value l }
     { returns true if the node has the int value l }
     function is_constintvalue(p : tnode;l : Tconstexprint) : Boolean;
     function is_constintvalue(p : tnode;l : Tconstexprint) : Boolean;
 
 
+    { if the node is a constant node which can be an int value, this value is returned }
+    function get_int_value(p : tnode): Tconstexprint;
+
     { returns true if the node is an inline node of type i }
     { returns true if the node is an inline node of type i }
     function is_inlinefunction(p : tnode;i : tinlinenumber) : Boolean;
     function is_inlinefunction(p : tnode;i : tinlinenumber) : Boolean;
 
 
@@ -1629,6 +1632,21 @@ implementation
       end;
       end;
 
 
 
 
+    function get_int_value(p: tnode): Tconstexprint;
+      begin
+        case p.nodetype of
+          ordconstn:
+            result:=tordconstnode(p).value;
+          pointerconstn:
+            result:=tpointerconstnode(p).value;
+          niln:
+            result:=0;
+          else
+            internalerror(2002080202);
+        end;
+      end;
+
+
     function is_inlinefunction(p: tnode; i: tinlinenumber): Boolean;
     function is_inlinefunction(p: tnode; i: tinlinenumber): Boolean;
       begin
       begin
         Result:=(p.nodetype=inlinen) and (tinlinenode(p).inlinenumber=i);
         Result:=(p.nodetype=inlinen) and (tinlinenode(p).inlinenumber=i);

+ 1 - 0
compiler/ogbase.pas

@@ -3326,6 +3326,7 @@ implementation
           exit;
           exit;
         { create a list of symbols sorted by address }
         { create a list of symbols sorted by address }
         list:=TFPList.Create;
         list:=TFPList.Create;
+        list.Capacity:=ExeSymbolList.Count;
         for i:=0 to ExeSymbolList.Count-1 do
         for i:=0 to ExeSymbolList.Count-1 do
           list.Add(TExeSymbol(ExeSymbolList[i]).ObjSymbol);
           list.Add(TExeSymbol(ExeSymbolList[i]).ObjSymbol);
         list.Sort(@ByAddress);
         list.Sort(@ByAddress);

+ 10 - 8
compiler/ogcoff.pas

@@ -2551,16 +2551,14 @@ const pemagic : array[0..3] of byte = (
                     begin
                     begin
                       FCoffSyms.Read(boauxrec,sizeof(boauxrec));
                       FCoffSyms.Read(boauxrec,sizeof(boauxrec));
                       psecrec:=pcoffsectionrec(@boauxrec[0]);
                       psecrec:=pcoffsectionrec(@boauxrec[0]);
-		      secrec:=psecrec^;
-		      MaybeSwap(secrec);
                     end
                     end
                   else
                   else
                     begin
                     begin
                       FCoffSyms.Read(auxrec,sizeof(auxrec));
                       FCoffSyms.Read(auxrec,sizeof(auxrec));
                       psecrec:=pcoffsectionrec(@auxrec);
                       psecrec:=pcoffsectionrec(@auxrec);
-		      secrec:=psecrec^;
-		      MaybeSwap(secrec);
                     end;
                     end;
+                  secrec:=psecrec^;
+                  MaybeSwap(secrec);
 
 
                   case secrec.select of
                   case secrec.select of
                     IMAGE_COMDAT_SELECT_NODUPLICATES:
                     IMAGE_COMDAT_SELECT_NODUPLICATES:
@@ -2577,13 +2575,17 @@ const pemagic : array[0..3] of byte = (
                       comdatsel:=oscs_largest;
                       comdatsel:=oscs_largest;
                     else begin
                     else begin
                       comdatsel:=oscs_none;
                       comdatsel:=oscs_none;
-                      Message2(link_e_comdat_select_unsupported,inttostr(secrec.select),objsym.objsection.name);
+                      { there are object files out here that have comdat symbols
+                        including an associative section, but with a comdat selection
+                        of 0; it seems that other linkers just ignore those... }
+                      if secrec.select<>0 then
+                        Message2(link_e_comdat_select_unsupported,inttostr(secrec.select),objsym.objsection.name);
                     end;
                     end;
                   end;
                   end;
 
 
-                  if comdatsel in [oscs_associative,oscs_exact_match] then
+                  if comdatsel in [oscs_associative] then
                     { only temporary }
                     { only temporary }
-                    Comment(V_Error,'Associative or exact match COMDAT sections are not yet supported (symbol: '+objsym.objsection.Name+')')
+                    Comment(V_Error,'Associative COMDAT sections are not yet supported (symbol: '+objsym.objsection.Name+')')
                   else if (comdatsel=oscs_associative) and (secrec.assoc=0) then
                   else if (comdatsel=oscs_associative) and (secrec.assoc=0) then
                     Message1(link_e_comdat_associative_section_expected,objsym.objsection.name)
                     Message1(link_e_comdat_associative_section_expected,objsym.objsection.name)
                   else if (objsym.objsection.ComdatSelection<>oscs_none) and (comdatsel<>oscs_none) and (objsym.objsection.ComdatSelection<>comdatsel) then
                   else if (objsym.objsection.ComdatSelection<>oscs_none) and (comdatsel<>oscs_none) and (objsym.objsection.ComdatSelection<>comdatsel) then
@@ -2594,7 +2596,7 @@ const pemagic : array[0..3] of byte = (
 
 
                       if (secrec.assoc<>0) and not assigned(objsym.objsection.AssociativeSection) then
                       if (secrec.assoc<>0) and not assigned(objsym.objsection.AssociativeSection) then
                         begin
                         begin
-                          objsym.objsection.AssociativeSection:=GetSection(secrec.assoc);
+                          objsym.objsection.AssociativeSection:=GetSection(secrec.assoc-1);
                           if not assigned(objsym.objsection.AssociativeSection) then
                           if not assigned(objsym.objsection.AssociativeSection) then
                             Message1(link_e_comdat_associative_section_not_found,objsym.objsection.Name);
                             Message1(link_e_comdat_associative_section_not_found,objsym.objsection.Name);
                         end;
                         end;

+ 2 - 0
compiler/ogelf.pas

@@ -2271,6 +2271,7 @@ implementation
         newsections:=TFPHashObjectList.Create(false);
         newsections:=TFPHashObjectList.Create(false);
         allsections:=TFPList.Create;
         allsections:=TFPList.Create;
         { copy existing sections }
         { copy existing sections }
+        allsections.Capacity:=ExeSectionList.Count;
         for i:=0 to ExeSectionList.Count-1 do
         for i:=0 to ExeSectionList.Count-1 do
           allsections.add(ExeSectionList[i]);
           allsections.add(ExeSectionList[i]);
         inserts[0]:=FindExeSection('.comment');
         inserts[0]:=FindExeSection('.comment');
@@ -2688,6 +2689,7 @@ implementation
         if assigned(dynrelocsec) then
         if assigned(dynrelocsec) then
           begin
           begin
             { Append R_xx_COPY relocations }
             { Append R_xx_COPY relocations }
+            dynreloclist.capacity:=dynreloclist.count+dyncopysyms.count;
             for i:=0 to dyncopysyms.count-1 do
             for i:=0 to dyncopysyms.count-1 do
               begin
               begin
                 objsym:=TObjSymbol(dyncopysyms[i]);
                 objsym:=TObjSymbol(dyncopysyms[i]);

+ 20 - 3
compiler/ogwasm.pas

@@ -4632,14 +4632,31 @@ implementation
               internalerror(2024010107);
               internalerror(2024010107);
           end;
           end;
 
 
+        const
+          DataSections: array [1..3] of string = (
+            '.rodata',
+            '.data',
+            'fpc.resources');
         var
         var
           DataCount: Integer;
           DataCount: Integer;
+          DataSecName: string;
+          ExeSec: TExeSection;
         begin
         begin
-          DataCount:=2;
+          DataCount:=0;
+          for DataSecName in DataSections do
+            begin
+              ExeSec:=FindExeSection(DataSecName);
+              if Assigned(ExeSec) and (ExeSec.Size>0) then
+                Inc(DataCount);
+            end;
           WriteUleb(FWasmSections[wsiDataCount],DataCount);
           WriteUleb(FWasmSections[wsiDataCount],DataCount);
           WriteUleb(FWasmSections[wsiData],DataCount);
           WriteUleb(FWasmSections[wsiData],DataCount);
-          WriteExeSection(FindExeSection('.rodata'));
-          WriteExeSection(FindExeSection('.data'));
+          for DataSecName in DataSections do
+            begin
+              ExeSec:=FindExeSection(DataSecName);
+              if Assigned(ExeSec) and (ExeSec.Size>0) then
+                WriteExeSection(ExeSec);
+            end;
         end;
         end;
 
 
       procedure WriteTableAndElemSections;
       procedure WriteTableAndElemSections;

+ 16 - 11
compiler/optconstprop.pas

@@ -55,7 +55,7 @@ unit optconstprop;
   implementation
   implementation
 
 
     uses
     uses
-      globtype,
+      globtype, globals,
       pass_1,procinfo,compinnr,
       pass_1,procinfo,compinnr,
       symsym, symconst,
       symsym, symconst,
       nutils, nbas, ncnv, nld, nflw, ncal, ninl,
       nutils, nbas, ncnv, nld, nflw, ncal, ninl,
@@ -346,8 +346,11 @@ unit optconstprop;
                        (is_constintnode(a.right) or
                        (is_constintnode(a.right) or
                         is_constboolnode(a.right) or
                         is_constboolnode(a.right) or
                         is_constcharnode(a.right) or
                         is_constcharnode(a.right) or
+                        is_constwidecharnode(a.right) or
+                        is_constwidestringnode(a.right) or
                         is_constenumnode(a.right) or
                         is_constenumnode(a.right) or
-                        is_conststringnode(a.right)) then
+                        is_conststringnode(a.right) or
+                        is_constpointernode(a.right)) then
                       begin
                       begin
 {$ifdef DEBUG_CONSTPROP}
 {$ifdef DEBUG_CONSTPROP}
                         writeln('******************************* propagating ***********************************');
                         writeln('******************************* propagating ***********************************');
@@ -394,19 +397,21 @@ unit optconstprop;
 
 
     function do_optconstpropagate(var rootnode: tnode;var changed: boolean): tnode;
     function do_optconstpropagate(var rootnode: tnode;var changed: boolean): tnode;
       begin
       begin
+        repeat
 {$ifdef DEBUG_CONSTPROP}
 {$ifdef DEBUG_CONSTPROP}
-        writeln('************************ before constant propagation ***************************');
-        printnode(rootnode);
+          writeln('************************ before constant propagation ***************************');
+          printnode(rootnode);
 {$endif DEBUG_CONSTPROP}
 {$endif DEBUG_CONSTPROP}
-        changed:=false;
-        foreachnodestatic(pm_postandagain, rootnode, @propagate, @changed);
-        if changed then
-          doinlinesimplify(rootnode);
+          changed:=false;
+          foreachnodestatic(pm_postandagain, rootnode, @propagate, @changed);
+          if changed then
+            doinlinesimplify(rootnode);
 {$ifdef DEBUG_CONSTPROP}
 {$ifdef DEBUG_CONSTPROP}
-        writeln('************************ after constant propagation ***************************');
-        printnode(rootnode);
-        writeln('*******************************************************************************');
+          writeln('************************ after constant propagation ***************************');
+          printnode(rootnode);
+          writeln('*******************************************************************************');
 {$endif DEBUG_CONSTPROP}
 {$endif DEBUG_CONSTPROP}
+        until not(cs_opt_level3 in current_settings.optimizerswitches) or not(changed);
         result:=rootnode;
         result:=rootnode;
       end;
       end;
 
 

+ 5 - 4
compiler/optcse.pas

@@ -606,10 +606,11 @@ unit optcse;
     function CSEOnReference(n : tnode) : Boolean;
     function CSEOnReference(n : tnode) : Boolean;
       begin
       begin
         Result:=(n.nodetype=loadn) and (tloadnode(n).symtableentry.typ=staticvarsym)
         Result:=(n.nodetype=loadn) and (tloadnode(n).symtableentry.typ=staticvarsym)
-          and ((vo_is_thread_var in tstaticvarsym(tloadnode(n).symtableentry).varoptions)
-{$if defined(aarch64)}
+          and ((vo_is_thread_var in tstaticvarsym(tloadnode(n).symtableentry).varoptions) or
+            (cs_create_pic in current_settings.moduleswitches)
+{$if defined(aarch64) or defined(sparc) or defined(sparc64) or defined(riscv)}
             or (not(tabstractvarsym(tloadnode(n).symtableentry).is_regvar(false)))
             or (not(tabstractvarsym(tloadnode(n).symtableentry).is_regvar(false)))
-{$endif defined(aarch64)}
+{$endif defined(aarch64) or defined(sparc) or defined(sparc64) or defined(riscv)}
            );
            );
       end;
       end;
 
 
@@ -812,7 +813,7 @@ unit optcse;
                         createblock:=internalstatements(creates);
                         createblock:=internalstatements(creates);
                         deleteblock:=internalstatements(deletes);
                         deleteblock:=internalstatements(deletes);
                       end;
                       end;
-                     constentries[i].temp:=ctempcreatenode.create(voidpointertype,
+                     constentries[i].temp:=ctempcreatenode.create(cpointerdef.getreusable(constentries[i].valuenode.resultdef),
                        voidpointertype.size,tt_persistent,true);
                        voidpointertype.size,tt_persistent,true);
                      addstatement(creates,constentries[i].temp);
                      addstatement(creates,constentries[i].temp);
                      addstatement(creates,cassignmentnode.create_internal(ctemprefnode.create(constentries[i].temp),
                      addstatement(creates,cassignmentnode.create_internal(ctemprefnode.create(constentries[i].temp),

+ 22 - 14
compiler/options.pas

@@ -125,7 +125,7 @@ Type
     processorstr: TCmdStr;
     processorstr: TCmdStr;
     function ParseMacVersionMin(out minversion, invalidateversion: tversion; const compvarname, value: string; ios: boolean): boolean;
     function ParseMacVersionMin(out minversion, invalidateversion: tversion; const compvarname, value: string; ios: boolean): boolean;
     procedure MaybeSetDefaultMacVersionMacro;
     procedure MaybeSetDefaultMacVersionMacro;
-{$ifdef XTENSA}
+{$if defined(XTENSA) or defined(RISCV32)}
     function ParseVersionStr(out ver: longint; const compvarname, value: string): boolean;
     function ParseVersionStr(out ver: longint; const compvarname, value: string): boolean;
     procedure MaybeSetIdfVersionMacro;
     procedure MaybeSetIdfVersionMacro;
 {$endif}
 {$endif}
@@ -1293,7 +1293,7 @@ function TOption.ParseMacVersionMin(out minversion,
     result:=true;
     result:=true;
   end;
   end;
 
 
-{$ifdef XTENSA}
+{$if defined(XTENSA) or defined(RISCV32)}
 function TOption.ParseVersionStr(out ver: longint;
 function TOption.ParseVersionStr(out ver: longint;
   const compvarname, value: string): boolean;
   const compvarname, value: string): boolean;
 
 
@@ -1372,7 +1372,7 @@ function TOption.ParseVersionStr(out ver: longint;
         result:=true;
         result:=true;
       end;
       end;
 end;
 end;
-{$endif XTENSA}
+{$endif XTENSA or RISCV32}
 
 
 procedure TOption.MaybeSetDefaultMacVersionMacro;
 procedure TOption.MaybeSetDefaultMacVersionMacro;
 var
 var
@@ -1495,15 +1495,16 @@ begin
 end;
 end;
 {$endif AVR}
 {$endif AVR}
 
 
-{$ifdef XTENSA}
+{$if defined(XTENSA) or defined(RISCV32)}
 procedure TOption.MaybeSetIdfVersionMacro;
 procedure TOption.MaybeSetIdfVersionMacro;
 begin
 begin
-  if not(target_info.system=system_xtensa_freertos) then
+  if not(target_info.system in [system_xtensa_freertos,system_riscv32_freertos]) then
     exit;
     exit;
   if IdfVersionSet then
   if IdfVersionSet then
     exit;
     exit;
   { nothing specified -> defaults }
   { nothing specified -> defaults }
   case current_settings.controllertype of
   case current_settings.controllertype of
+{$ifdef XTENSA}
     ct_esp8266:
     ct_esp8266:
       begin
       begin
         set_system_compvar('IDF_VERSION','30300');
         set_system_compvar('IDF_VERSION','30300');
@@ -1514,6 +1515,14 @@ begin
         set_system_compvar('IDF_VERSION','40200');
         set_system_compvar('IDF_VERSION','40200');
         idf_version:=40200;
         idf_version:=40200;
       end;
       end;
+{$endif}
+{$ifdef RISCV32}
+    ct_esp32c3:
+      begin
+        set_system_compvar('IDF_VERSION','40400');
+        idf_version:=40400;
+      end;
+{$endif RISCV32}
     else
     else
       begin
       begin
         set_system_compvar('IDF_VERSION','00000');
         set_system_compvar('IDF_VERSION','00000');
@@ -1521,7 +1530,7 @@ begin
       end;
       end;
   end;
   end;
 end;
 end;
-{$endif XTENSA}
+{$endif XTENSA or RISCV32}
 
 
 procedure TOption.VerifyTargetProcessor;
 procedure TOption.VerifyTargetProcessor;
   begin
   begin
@@ -3027,7 +3036,7 @@ begin
           else
           else
             frameworksearchpath.AddPath(More,true)
             frameworksearchpath.AddPath(More,true)
 {$if defined(XTENSA) or defined(RISCV32)}
 {$if defined(XTENSA) or defined(RISCV32)}
-        else if (target_info.system=system_xtensa_freertos) then
+        else if (target_info.system in [system_xtensa_freertos,system_riscv32_freertos]) then
           idfpath:=FixPath(More,true)
           idfpath:=FixPath(More,true)
 {$endif defined(XTENSA) or defined(RISCV32)}
 {$endif defined(XTENSA) or defined(RISCV32)}
         else
         else
@@ -4034,13 +4043,13 @@ begin
              begin
              begin
                break;
                break;
              end
              end
-{$ifdef XTENSA}
-           else if (target_info.system in [system_xtensa_freertos]) and
+{$if defined(XTENSA) or defined(RISCV32)}
+           else if (target_info.system in [system_xtensa_freertos,system_riscv32_freertos]) and
               ParseVersionStr(idf_version,'IDF_VERSION',copy(More,2)) then
               ParseVersionStr(idf_version,'IDF_VERSION',copy(More,2)) then
              begin
              begin
                break;
                break;
              end
              end
-{$endif XTENSA}
+{$endif XTENSA or RISCV32}
            else
            else
              IllegalPara(opt);
              IllegalPara(opt);
          end;
          end;
@@ -4758,9 +4767,8 @@ procedure read_arguments(cmd:TCmdStr);
       {$endif i8086 or avr}
       {$endif i8086 or avr}
       { abs(long) is handled internally on all CPUs }
       { abs(long) is handled internally on all CPUs }
         def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
         def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
-      {$if defined(i8086) or defined(i386) or defined(x86_64) or defined(powerpc64) or defined(aarch64) or defined(arm)}
+      { abs(int64) is handled internally on all CPUs }
         def_system_macro('FPC_HAS_INTERNAL_ABS_INT64');
         def_system_macro('FPC_HAS_INTERNAL_ABS_INT64');
-      {$endif i8086 or i386 or x86_64 or powerpc64 or aarch64 or arm}
 
 
         def_system_macro('FPC_HAS_UNICODESTRING');
         def_system_macro('FPC_HAS_UNICODESTRING');
         def_system_macro('FPC_RTTI_PACKSET1');
         def_system_macro('FPC_RTTI_PACKSET1');
@@ -5239,10 +5247,10 @@ begin
   { set Mac OS X version default macros if not specified explicitly }
   { set Mac OS X version default macros if not specified explicitly }
   option.MaybeSetDefaultMacVersionMacro;
   option.MaybeSetDefaultMacVersionMacro;
 
 
-{$ifdef XTENSA}
+{$if defined(XTENSA) or defined(RISCV32)}
   { set ESP32 or ESP8266 default SDK versions }
   { set ESP32 or ESP8266 default SDK versions }
   option.MaybeSetIdfVersionMacro;
   option.MaybeSetIdfVersionMacro;
-{$endif XTENSA}
+{$endif defined(XTENSA) or defined(RISCV32)}
 
 
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
   { force fpu emulation on arm/wince, arm/gba, arm/embedded and arm/nds etc.
   { force fpu emulation on arm/wince, arm/gba, arm/embedded and arm/nds etc.

+ 2 - 2
compiler/pdecl.pas

@@ -174,7 +174,7 @@ implementation
                  information about the final type yet, we need to use safe
                  information about the final type yet, we need to use safe
                  values (mostly 0, except for (Bit)SizeOf()) }
                  values (mostly 0, except for (Bit)SizeOf()) }
                if not parse_generic then
                if not parse_generic then
-                 Message(parser_e_illegal_expression);
+                 Message(parser_e_cannot_evaluate_expression_at_compile_time);
                case tinlinenode(p).inlinenumber of
                case tinlinenode(p).inlinenumber of
                  in_sizeof_x:
                  in_sizeof_x:
                    begin
                    begin
@@ -289,7 +289,7 @@ implementation
                      caret, to support const s : ^string = nil }
                      caret, to support const s : ^string = nil }
                    block_type:=bt_const_type;
                    block_type:=bt_const_type;
                    consume(_COLON);
                    consume(_COLON);
-                   read_anon_type(hdef,false);
+                   read_anon_type(hdef,false,nil);
                    block_type:=bt_const;
                    block_type:=bt_const;
                    { create symbol }
                    { create symbol }
                    storetokenpos:=current_tokenpos;
                    storetokenpos:=current_tokenpos;

+ 24 - 1
compiler/pdecsub.pas

@@ -410,9 +410,10 @@ implementation
                 if (m_mac in current_settings.modeswitches) then
                 if (m_mac in current_settings.modeswitches) then
                   is_univ:=try_to_consume(_UNIV);
                   is_univ:=try_to_consume(_UNIV);
 
 
+                { this is not really working and generates internal errors
                 if try_to_consume(_TYPE) then
                 if try_to_consume(_TYPE) then
                   hdef:=ctypedformaltype
                   hdef:=ctypedformaltype
-                else
+                else }
                   begin
                   begin
                     block_type:=bt_var_type;
                     block_type:=bt_var_type;
                     single_type(hdef,[stoAllowSpecialization]);
                     single_type(hdef,[stoAllowSpecialization]);
@@ -554,6 +555,7 @@ implementation
         genericst: TSymtable;
         genericst: TSymtable;
         aprocsym : tprocsym;
         aprocsym : tprocsym;
         popclass : integer;
         popclass : integer;
+        parentdef : tobjectdef;
         ImplIntf : TImplementedInterface;
         ImplIntf : TImplementedInterface;
         old_parse_generic : boolean;
         old_parse_generic : boolean;
         old_current_structdef: tabstractrecorddef;
         old_current_structdef: tabstractrecorddef;
@@ -1052,6 +1054,27 @@ implementation
                     assigned(current_module.globalsymtable) then
                     assigned(current_module.globalsymtable) then
                    srsym:=tsym(current_module.globalsymtable.Find(sp));
                    srsym:=tsym(current_module.globalsymtable.Find(sp));
 
 
+                 { if the symbol isn't assigned, but we're parsing a class or
+                   object then check in the parent types for symbols of the same
+                   name that are generics and declare the new symbol as a generic
+                   dummy symbol }
+
+                 if not assigned(srsym) and is_class_or_object(astruct) then
+                   begin
+                     parentdef:=tobjectdef(astruct).childof;
+                     while assigned(parentdef) do
+                       begin
+                         srsym:=tsym(parentdef.symtable.Find(sp));
+                         if assigned(srsym) and (sp_generic_dummy in srsym.symoptions) then
+                           begin
+                             addgendummy:=true;
+                             break;
+                           end;
+                         parentdef:=parentdef.childof;
+                       end;
+                     srsym:=nil;
+                   end;
+
                  { Check if overloaded is a procsym }
                  { Check if overloaded is a procsym }
                  if assigned(srsym) then
                  if assigned(srsym) then
                    begin
                    begin

+ 20 - 4
compiler/pdecvar.pas

@@ -1454,7 +1454,7 @@ implementation
                read_gpc_name(sc);
                read_gpc_name(sc);
 {$endif}
 {$endif}
 
 
-             read_anon_type(hdef,false);
+             read_anon_type(hdef,false,nil);
              maybe_guarantee_record_typesym(hdef,symtablestack.top);
              maybe_guarantee_record_typesym(hdef,symtablestack.top);
              for i:=0 to sc.count-1 do
              for i:=0 to sc.count-1 do
                begin
                begin
@@ -1684,7 +1684,7 @@ implementation
          sc : TFPObjectList;
          sc : TFPObjectList;
          i  : longint;
          i  : longint;
          hs,sorg : string;
          hs,sorg : string;
-         hdef,casetype : tdef;
+         gendef,hdef,casetype : tdef;
          { maxsize contains the max. size of a variant }
          { maxsize contains the max. size of a variant }
          { startvarrec contains the start of the variant part of a record }
          { startvarrec contains the start of the variant part of a record }
          maxsize, startvarrecsize : asizeint;
          maxsize, startvarrecsize : asizeint;
@@ -1782,7 +1782,23 @@ implementation
 
 
              typepos:=current_filepos;
              typepos:=current_filepos;
 
 
-             read_anon_type(hdef,false);
+             { make sure that the correct genericdef is set up, especially if
+               we're dealing with anonymous type declarations }
+             gendef:=nil;
+             if df_specialization in current_structdef.defoptions then
+               begin
+                 srsymtable:=current_structdef.genericdef.getsymtable(gs_record);
+                 if not assigned(srsymtable) then
+                   internalerror(2024041204);
+                 srsym:=tsym(srsymtable.find(tabstractvarsym(sc[0]).name));
+                 if not assigned(srsym) then
+                   internalerror(2024041205);
+                 if srsym.typ<>fieldvarsym then
+                   internalerror(2024041206);
+                 gendef:=tfieldvarsym(srsym).vardef;
+               end;
+
+             read_anon_type(hdef,false,tstoreddef(gendef));
              maybe_guarantee_record_typesym(hdef,symtablestack.top);
              maybe_guarantee_record_typesym(hdef,symtablestack.top);
 {$ifdef wasm}
 {$ifdef wasm}
              if is_wasm_reference_type(hdef) then
              if is_wasm_reference_type(hdef) then
@@ -2001,7 +2017,7 @@ implementation
                       symtablestack.top.insertsym(fieldvs);
                       symtablestack.top.insertsym(fieldvs);
                     end;
                     end;
                 end;
                 end;
-              read_anon_type(casetype,true);
+              read_anon_type(casetype,true,nil);
               block_type:=bt_var;
               block_type:=bt_var;
               if assigned(fieldvs) then
               if assigned(fieldvs) then
                 begin
                 begin

+ 0 - 1
compiler/pexpr.pas

@@ -436,7 +436,6 @@ implementation
               p1:=comp_expr([ef_accept_equal]);
               p1:=comp_expr([ef_accept_equal]);
               consume(_RKLAMMER);
               consume(_RKLAMMER);
               if ((p1.nodetype<>typen) and
               if ((p1.nodetype<>typen) and
-
                  (
                  (
                   (is_object(p1.resultdef) and
                   (is_object(p1.resultdef) and
                    (oo_has_constructor in tobjectdef(p1.resultdef).objectoptions)) or
                    (oo_has_constructor in tobjectdef(p1.resultdef).objectoptions)) or

+ 2 - 0
compiler/pgentype.pas

@@ -81,10 +81,12 @@ var
   i : longint;
   i : longint;
 begin
 begin
   result:=tspecializationcontext.create;
   result:=tspecializationcontext.create;
+  result.paramlist.capacity:=paramlist.count;
   for i:=0 to paramlist.count-1 do
   for i:=0 to paramlist.count-1 do
     begin
     begin
       result.paramlist.add(paramlist[i]);
       result.paramlist.add(paramlist[i]);
     end;
     end;
+  result.poslist.capacity:=poslist.count;
   for i:=0 to poslist.count-1 do
   for i:=0 to poslist.count-1 do
     begin
     begin
       new(posinfo);
       new(posinfo);

+ 24 - 4
compiler/pgenutil.pas

@@ -167,7 +167,9 @@ uses
           result:=true
           result:=true
         { sets require stricter checks }
         { sets require stricter checks }
         else if is_set(param2) then
         else if is_set(param2) then
-          result:=equal_defs(param1,param2)
+          result:=equal_defs(param1,param2) or
+            { constant could be empty set }
+            not(assigned(tsetdef(param1).elementdef))
         else
         else
           result:=param1.typ=param2.typ;
           result:=param1.typ=param2.typ;
       end;
       end;
@@ -269,6 +271,9 @@ uses
         if hmodule=current_module then
         if hmodule=current_module then
           exit;
           exit;
 
 
+        if (hmodule.state = ms_load) and hmodule.interface_compiled then
+           Exit;
+
         if not (hmodule.state in [ms_compiled,ms_processed]) then
         if not (hmodule.state in [ms_compiled,ms_processed]) then
           begin
           begin
 {$ifdef DEBUG_UNITWAITING}
 {$ifdef DEBUG_UNITWAITING}
@@ -723,6 +728,8 @@ uses
           tmpparampos:=current_filepos;
           tmpparampos:=current_filepos;
           if genericparams.count<>genericdef.genericparas.count then
           if genericparams.count<>genericdef.genericparas.count then
             internalerror(2021020901);
             internalerror(2021020901);
+          poslist.capacity:=poslist.count+genericparams.count;
+          context.paramlist.capacity:=context.paramlist.count+genericparams.count;
           for i:=0 to genericparams.count-1 do
           for i:=0 to genericparams.count-1 do
             begin
             begin
               paramname:=generic_param_hash(ttypesym(genericdef.genericparas[i]).typedef);
               paramname:=generic_param_hash(ttypesym(genericdef.genericparas[i]).typedef);
@@ -1673,6 +1680,17 @@ uses
               end;
               end;
           end;
           end;
 
 
+      function has_generic_paras(adef: tstoreddef): boolean;
+        var
+          i: Integer;
+        begin
+          result:=False;
+          if adef.genericparas<>nil then
+            for i:=0 to adef.genericparas.Count-1 do
+              if sp_generic_para in tsym(adef.genericparas[i]).symoptions then
+                exit(true);
+        end;
+
       var
       var
         finalspecializename,
         finalspecializename,
         ufinalspecializename : tidstring;
         ufinalspecializename : tidstring;
@@ -2144,7 +2162,7 @@ uses
                 tdef(item).ChangeOwner(specializest);
                 tdef(item).ChangeOwner(specializest);
                 { for partial specializations we implicitely declare any methods as having their
                 { for partial specializations we implicitely declare any methods as having their
                   implementations although we'll not specialize them in reality }
                   implementations although we'll not specialize them in reality }
-                if parse_generic then
+                if parse_generic or has_generic_paras(tstoreddef(item)) then
                   unset_forwarddef(tdef(item));
                   unset_forwarddef(tdef(item));
               end;
               end;
 
 
@@ -2158,8 +2176,9 @@ uses
             specialization_done(state);
             specialization_done(state);
 
 
             { procdefs are only added once we know which overload we use }
             { procdefs are only added once we know which overload we use }
-            if not parse_generic and (result.typ<>procdef) then
-              current_module.pendingspecializations.add(result.typename,result);
+            if not parse_generic and (result.typ<>procdef) and
+              not has_generic_paras(tstoreddef(result)) then
+                  current_module.pendingspecializations.add(result.typename,result);
           end;
           end;
 
 
         generictypelist.free;
         generictypelist.free;
@@ -2900,6 +2919,7 @@ uses
         list:=tfpobjectlist.create(false);
         list:=tfpobjectlist.create(false);
         readdlist:=tfpobjectlist.create(false);
         readdlist:=tfpobjectlist.create(false);
 
 
+        list.Capacity:=current_module.pendingspecializations.Count;
         for i:=0 to current_module.pendingspecializations.Count-1 do
         for i:=0 to current_module.pendingspecializations.Count-1 do
           list.add(current_module.pendingspecializations.Items[i]);
           list.add(current_module.pendingspecializations.Items[i]);
 
 

+ 54 - 7
compiler/pmodules.pas

@@ -200,8 +200,10 @@ implementation
         if not load_ok then
         if not load_ok then
           { We must schedule a compile. }
           { We must schedule a compile. }
           task_handler.addmodule(hp);
           task_handler.addmodule(hp);
+
         { add to symtable stack }
         { add to symtable stack }
-        symtablestack.push(hp.globalsymtable);
+        if assigned(hp.globalsymtable) then
+          symtablestack.push(hp.globalsymtable);
         if (m_mac in current_settings.modeswitches) and
         if (m_mac in current_settings.modeswitches) and
             assigned(hp.globalmacrosymtable) then
             assigned(hp.globalmacrosymtable) then
            macrosymtablestack.push(hp.globalmacrosymtable);
            macrosymtablestack.push(hp.globalmacrosymtable);
@@ -383,6 +385,8 @@ implementation
         begin
         begin
           m:=AddUnit(curr,s,true);
           m:=AddUnit(curr,s,true);
           OK:=assigned(m) and (m.state in [ms_processed,ms_compiled]);
           OK:=assigned(m) and (m.state in [ms_processed,ms_compiled]);
+          if not ok then
+            Message2(unit_f_cant_find_ppu,s,curr.realmodulename^);
           Result:=ok and Result;
           Result:=ok and Result;
         end;
         end;
 
 
@@ -516,6 +520,18 @@ implementation
               else
               else
                 Comment(V_Warning, 'Unsupported esp-rtos version');
                 Comment(V_Warning, 'Unsupported esp-rtos version');
             end;
             end;
+{$endif XTENSA}
+{$ifdef RISCV32}
+        if not(curr.is_unit) and (target_info.system=system_riscv32_freertos) then
+          if (current_settings.controllertype=ct_esp32c3) then
+            begin
+              if idf_version>=50000 then
+                CheckAddUnit('esp32c3idf_50000')
+              else if idf_version>=40400 then
+                CheckAddUnit('esp32c3idf_40400')
+              else
+                Comment(V_Warning, 'Unsupported esp-idf version');
+            end;
 {$endif XTENSA}
 {$endif XTENSA}
       end;
       end;
 
 
@@ -824,6 +840,34 @@ implementation
 
 
 
 
     procedure free_unregistered_localsymtable_elements(curr : tmodule);
     procedure free_unregistered_localsymtable_elements(curr : tmodule);
+      procedure remove_from_procdeflist(adef: tdef);
+        var
+          i: Integer;
+          childdef: tdef;
+        begin
+          if adef=nil then exit;
+          if (adef.typ in [objectdef, recorddef]) and (adef is tabstractrecorddef) then
+            begin
+              if tabstractrecorddef(adef).symtable<>nil then
+                for i:=0 to tabstractrecorddef(adef).symtable.DefList.Count-1 do
+                  begin
+                    childdef:=tdef(tabstractrecorddef(adef).symtable.DefList[i]);
+                    remove_from_procdeflist(childdef);
+                  end;
+            end
+          else
+            if adef.typ=procdef then
+              begin
+                tprocsym(tprocdef(adef).procsym).ProcdefList.Remove(adef);
+                if tprocdef(adef).localst<>nil then
+                  for i:=0 to tprocdef(adef).localst.DefList.Count-1 do
+                    begin
+                      childdef:=tdef(tprocdef(adef).localst.DefList[i]);
+                      remove_from_procdeflist(childdef);
+                    end;
+              end;
+        end;
+
       var
       var
         i: longint;
         i: longint;
         def: tdef;
         def: tdef;
@@ -843,9 +887,7 @@ implementation
                   unless that sym hasn't been registered either (it's possible
                   unless that sym hasn't been registered either (it's possible
                   to have one overload in the interface and another in the
                   to have one overload in the interface and another in the
                   implementation) }
                   implementation) }
-                if (def.typ=procdef) and
-                   tprocdef(def).procsym.is_registered then
-                 tprocsym(tprocdef(def).procsym).ProcdefList.Remove(def);
+                remove_from_procdeflist(def);
                 curr.localsymtable.deletedef(def);
                 curr.localsymtable.deletedef(def);
               end;
               end;
           end;
           end;
@@ -1203,6 +1245,11 @@ type
             exit;
             exit;
           end;
           end;
 
 
+        { we need to be able to reference these in descendants,
+          so they must be generated and included in the interface }
+        if (target_cpu=tsystemcpu.cpu_wasm32) then
+          add_synthetic_interface_classes_for_st(curr.globalsymtable,true,false);
+
         { Our interface is compiled, generate CRC and switch to implementation }
         { Our interface is compiled, generate CRC and switch to implementation }
         if not(cs_compilesystem in current_settings.moduleswitches) and
         if not(cs_compilesystem in current_settings.moduleswitches) and
           (Errorcount=0) then
           (Errorcount=0) then
@@ -1476,8 +1523,8 @@ type
          // This needs to be done before we generate the VMTs
          // This needs to be done before we generate the VMTs
          if (target_cpu=tsystemcpu.cpu_wasm32) then
          if (target_cpu=tsystemcpu.cpu_wasm32) then
            begin
            begin
-           add_synthetic_interface_classes_for_st(module.globalsymtable);
-           add_synthetic_interface_classes_for_st(module.localsymtable);
+           add_synthetic_interface_classes_for_st(module.globalsymtable,false,true);
+           add_synthetic_interface_classes_for_st(module.localsymtable,true,true);
            end;
            end;
 
 
          { generate construction functions for all attributes in the unit:
          { generate construction functions for all attributes in the unit:
@@ -2542,7 +2589,7 @@ type
 
 
         { This needs to be done before we generate the VMTs }
         { This needs to be done before we generate the VMTs }
         if (target_cpu=tsystemcpu.cpu_wasm32) then
         if (target_cpu=tsystemcpu.cpu_wasm32) then
-          add_synthetic_interface_classes_for_st(curr.localsymtable);
+          add_synthetic_interface_classes_for_st(curr.localsymtable,true,true);
 
 
         { Generate VMTs }
         { Generate VMTs }
         if Errorcount=0 then
         if Errorcount=0 then

+ 1 - 1
compiler/pparautl.pas

@@ -649,7 +649,7 @@ implementation
                   { both must be defined now }
                   { both must be defined now }
                   if not((po_external in pd.procoptions) or
                   if not((po_external in pd.procoptions) or
                          (pd.typ=procvardef)) or
                          (pd.typ=procvardef)) or
-                     not(pd.proccalloption in (cdecl_pocalls + [pocall_stdcall])) then
+                     not(pd.proccalloption in cstylearrayofconst) then
                     Message(parser_e_varargs_need_cdecl_and_external);
                     Message(parser_e_varargs_need_cdecl_and_external);
                 end;
                 end;
              end;
              end;

+ 6 - 1
compiler/ppcaarch64.lpi

@@ -8,6 +8,7 @@
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
         <LRSInOutputDirectory Value="False"/>
         <LRSInOutputDirectory Value="False"/>
         <CompatibilityMode Value="True"/>
         <CompatibilityMode Value="True"/>
       </Flags>
       </Flags>
@@ -55,8 +56,8 @@
       <SyntaxOptions>
       <SyntaxOptions>
         <CStyleOperator Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <AllowLabel Value="False"/>
-        <CPPInline Value="False"/>
         <UseAnsiStrings Value="False"/>
         <UseAnsiStrings Value="False"/>
+        <CPPInline Value="False"/>
       </SyntaxOptions>
       </SyntaxOptions>
     </Parsing>
     </Parsing>
     <Other>
     <Other>
@@ -67,8 +68,12 @@
       </Verbosity>
       </Verbosity>
       <ConfigFile>
       <ConfigFile>
         <StopAfterErrCount Value="50"/>
         <StopAfterErrCount Value="50"/>
+        <WriteConfigFilePath Value="$(ProjOutDir)\fpclaz.cfg"/>
       </ConfigFile>
       </ConfigFile>
       <CustomOptions Value="-daarch64"/>
       <CustomOptions Value="-daarch64"/>
+      <ExecuteBefore>
+        <ScanForMakeMsgs Value="True"/>
+      </ExecuteBefore>
     </Other>
     </Other>
   </CompilerOptions>
   </CompilerOptions>
 </CONFIG>
 </CONFIG>

+ 1 - 0
compiler/procdefutil.pas

@@ -1698,6 +1698,7 @@ implementation
                   tocapture.add(sym);
                   tocapture.add(sym);
             end;
             end;
 
 
+          convertarg.mappings.capacity:=convertarg.mappings.count+tocapture.count;
           for i:=0 to tocapture.count-1 do
           for i:=0 to tocapture.count-1 do
             begin
             begin
               new(mapping);
               new(mapping);

+ 4 - 1
compiler/pstatmnt.pas

@@ -1387,7 +1387,10 @@ implementation
                   end;
                   end;
              end;
              end;
            _BEGIN :
            _BEGIN :
-             code:=statement_block(_BEGIN);
+             begin
+               code:=statement_block(_BEGIN);
+               Include(TBlockNode(code).blocknodeflags, bnf_strippable);
+             end;
            _IF :
            _IF :
              code:=if_statement;
              code:=if_statement;
            _CASE :
            _CASE :

+ 2 - 0
compiler/psub.pas

@@ -908,6 +908,8 @@ implementation
           an try...finally...end wrapper }
           an try...finally...end wrapper }
         current_filepos:=entrypos;
         current_filepos:=entrypos;
         newblock:=internalstatements(newstatement);
         newblock:=internalstatements(newstatement);
+        { Note - this is not strippable since it wraps the entire procedure }
+        Exclude(TBlockNode(newblock).blocknodeflags, bnf_strippable);
         { initialization is common for all cases }
         { initialization is common for all cases }
         addstatement(newstatement,loadpara_asmnode);
         addstatement(newstatement,loadpara_asmnode);
         addstatement(newstatement,stackcheck_asmnode);
         addstatement(newstatement,stackcheck_asmnode);

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません