summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
commit1903b037de2fb3e75826406b46f055acb70963fa (patch)
tree604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler
parentad1141d52f8353457053b925cd674fe1d5c4eafc (diff)
parent953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff)
downloadfpc-blocks.tar.gz
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler')
-rw-r--r--compiler/Makefile71
-rw-r--r--compiler/Makefile.fpc4
-rw-r--r--compiler/aarch64/a64att.inc1
-rw-r--r--compiler/aarch64/a64atts.inc1
-rw-r--r--compiler/aarch64/a64ins.dat2
-rw-r--r--compiler/aarch64/a64op.inc1
-rw-r--r--compiler/aarch64/cpuinfo.pas15
-rw-r--r--compiler/aarch64/cpupara.pas2
-rw-r--r--compiler/aasmbase.pas6
-rw-r--r--compiler/aasmdata.pas31
-rw-r--r--compiler/aasmtai.pas25
-rw-r--r--compiler/aggas.pas17
-rw-r--r--compiler/agjasmin.pas4
-rw-r--r--compiler/alpha/cpuinfo.pas23
-rw-r--r--compiler/aoptobj.pas3
-rw-r--r--compiler/arm/aasmcpu.pas20
-rw-r--r--compiler/arm/aoptcpu.pas102
-rw-r--r--compiler/arm/aoptcpub.pas13
-rw-r--r--compiler/arm/cgcpu.pas93
-rw-r--r--compiler/arm/cpuelf.pas44
-rw-r--r--compiler/arm/cpuinfo.pas7
-rw-r--r--compiler/arm/narmadd.pas46
-rw-r--r--compiler/arm/narmset.pas15
-rw-r--r--compiler/arm/raarmgas.pas1
-rw-r--r--compiler/arm/rgcpu.pas14
-rw-r--r--compiler/assemble.pas3
-rw-r--r--compiler/avr/aasmcpu.pas10
-rw-r--r--compiler/avr/agavrgas.pas10
-rw-r--r--compiler/avr/cpuinfo.pas6
-rw-r--r--compiler/avr/cpupara.pas8
-rw-r--r--compiler/avr/navradd.pas12
-rw-r--r--compiler/avr/navrmat.pas4
-rw-r--r--compiler/avr/raavrgas.pas2
-rw-r--r--compiler/cclasses.pas8
-rw-r--r--compiler/cfileutl.pas11
-rw-r--r--compiler/cgobj.pas12
-rw-r--r--compiler/compiler.pas3
-rw-r--r--compiler/compinnr.inc1
-rw-r--r--compiler/comprsrc.pas2
-rw-r--r--compiler/dbgdwarf.pas120
-rw-r--r--compiler/dbgstabs.pas16
-rw-r--r--compiler/defutil.pas40
-rw-r--r--compiler/expunix.pas2
-rw-r--r--compiler/fmodule.pas8
-rw-r--r--compiler/fppu.pas8
-rw-r--r--compiler/generic/cpuinfo.pas24
-rw-r--r--compiler/globals.pas84
-rw-r--r--compiler/globtype.pas12
-rw-r--r--compiler/hlcg2ll.pas1
-rw-r--r--compiler/htypechk.pas85
-rw-r--r--compiler/i386/cgcpu.pas7
-rw-r--r--compiler/i386/cpuelf.pas2
-rw-r--r--compiler/i386/cpuinfo.pas20
-rw-r--r--compiler/i386/cpupara.pas18
-rw-r--r--compiler/i386/cputarg.pas3
-rw-r--r--compiler/i386/n386add.pas148
-rw-r--r--compiler/i386/n386cal.pas38
-rw-r--r--compiler/i386/n386flw.pas15
-rw-r--r--compiler/i386/symcpu.pas59
-rw-r--r--compiler/i8086/cpuinfo.pas20
-rw-r--r--compiler/i8086/n8086add.pas5
-rw-r--r--compiler/i8086/n8086inl.pas46
-rw-r--r--compiler/i8086/n8086mat.pas1
-rw-r--r--compiler/i8086/n8086mem.pas50
-rw-r--r--compiler/i8086/n8086tcon.pas2
-rw-r--r--compiler/i8086/symcpu.pas93
-rw-r--r--compiler/ia64/cpuinfo.pas23
-rw-r--r--compiler/impdef.pas2
-rw-r--r--compiler/jvm/cpuinfo.pas20
-rw-r--r--compiler/jvm/dbgjasm.pas44
-rw-r--r--compiler/jvm/njvmflw.pas6
-rw-r--r--compiler/jvm/njvminl.pas6
-rw-r--r--compiler/jvm/njvmmem.pas2
-rw-r--r--compiler/jvm/njvmutil.pas3
-rw-r--r--compiler/jvm/tgcpu.pas8
-rw-r--r--compiler/m68k/aasmcpu.pas28
-rw-r--r--compiler/m68k/cgcpu.pas232
-rw-r--r--compiler/m68k/cpubase.pas9
-rw-r--r--compiler/m68k/cpuinfo.pas35
-rw-r--r--compiler/m68k/itcpugas.pas2
-rw-r--r--compiler/m68k/n68kadd.pas762
-rw-r--r--compiler/m68k/n68kcnv.pas8
-rw-r--r--compiler/m68k/n68kmat.pas9
-rw-r--r--compiler/m68k/ra68k.pas1
-rw-r--r--compiler/m68k/ra68kmot.pas4
-rw-r--r--compiler/m68k/rgcpu.pas140
-rw-r--r--compiler/m68k/symcpu.pas14
-rw-r--r--compiler/mips/aasmcpu.pas21
-rw-r--r--compiler/mips/aoptcpu.pas316
-rw-r--r--compiler/mips/cgcpu.pas131
-rw-r--r--compiler/mips/cpuelf.pas12
-rw-r--r--compiler/mips/cpugas.pas2
-rw-r--r--compiler/mips/cpuinfo.pas53
-rw-r--r--compiler/mips/ncpuadd.pas120
-rw-r--r--compiler/mips/ncpucnv.pas5
-rw-r--r--compiler/mips/rgcpu.pas42
-rw-r--r--compiler/msg/errorct.msg4
-rw-r--r--compiler/msg/errord.msg137
-rw-r--r--compiler/msg/errorda.msg4
-rw-r--r--compiler/msg/errordu.msg137
-rw-r--r--compiler/msg/errore.msg203
-rw-r--r--compiler/msg/errores.msg4
-rw-r--r--compiler/msg/errorf.msg4
-rw-r--r--compiler/msg/errorfi.msg2
-rw-r--r--compiler/msg/errorhe.msg2
-rw-r--r--compiler/msg/errorheu.msg2
-rw-r--r--compiler/msg/errorid.msg2
-rw-r--r--compiler/msg/erroriu.msg2
-rw-r--r--compiler/msg/errorn.msg2
-rw-r--r--compiler/msg/errorpl.msg4
-rw-r--r--compiler/msg/errorpli.msg4
-rw-r--r--compiler/msg/errorpt.msg6
-rw-r--r--compiler/msg/errorptu.msg6
-rw-r--r--compiler/msg/errorr.msg2
-rw-r--r--compiler/msg/errorru.msg2
-rw-r--r--compiler/msg/errorues.msg4
-rw-r--r--compiler/msgidx.inc14
-rw-r--r--compiler/msgtxt.inc1263
-rw-r--r--compiler/nadd.pas238
-rw-r--r--compiler/ncal.pas56
-rw-r--r--compiler/ncgcal.pas18
-rw-r--r--compiler/ncgcnv.pas10
-rw-r--r--compiler/ncgcon.pas2
-rw-r--r--compiler/ncgmat.pas25
-rw-r--r--compiler/ncgmem.pas14
-rw-r--r--compiler/ncgrtti.pas10
-rw-r--r--compiler/ncgutil.pas24
-rw-r--r--compiler/ncnv.pas34
-rw-r--r--compiler/nflw.pas9
-rw-r--r--compiler/ngenutil.pas16
-rw-r--r--compiler/ngtcon.pas31
-rw-r--r--compiler/ninl.pas207
-rw-r--r--compiler/nmat.pas22
-rw-r--r--compiler/nmem.pas66
-rw-r--r--compiler/nutils.pas37
-rw-r--r--compiler/ogbase.pas4
-rw-r--r--compiler/ogcoff.pas12
-rw-r--r--compiler/ogelf.pas12
-rw-r--r--compiler/optdfa.pas22
-rw-r--r--compiler/options.pas662
-rw-r--r--compiler/optloop.pas11
-rw-r--r--compiler/paramgr.pas12
-rw-r--r--compiler/parser.pas2
-rw-r--r--compiler/pdecl.pas2
-rw-r--r--compiler/pdecobj.pas5
-rw-r--r--compiler/pdecsub.pas94
-rw-r--r--compiler/pexpr.pas7
-rw-r--r--compiler/pgenutil.pas108
-rw-r--r--compiler/pinline.pas62
-rw-r--r--compiler/pmodules.pas5
-rw-r--r--compiler/powerpc/agppcvasm.pas2
-rw-r--r--compiler/powerpc/cpuinfo.pas20
-rw-r--r--compiler/powerpc/cpupara.pas6
-rw-r--r--compiler/powerpc/nppcadd.pas5
-rw-r--r--compiler/powerpc/nppcmat.pas1
-rw-r--r--compiler/powerpc/symcpu.pas14
-rw-r--r--compiler/powerpc64/cpuinfo.pas23
-rw-r--r--compiler/ppcgen/agppcgas.pas2
-rw-r--r--compiler/ppcgen/cgppc.pas24
-rw-r--r--compiler/ppu.pas2
-rw-r--r--compiler/psub.pas38
-rw-r--r--compiler/psystem.pas1
-rw-r--r--compiler/ptconst.pas15
-rw-r--r--compiler/ptype.pas68
-rw-r--r--compiler/raatt.pas3
-rw-r--r--compiler/rautils.pas66
-rw-r--r--compiler/rgobj.pas4
-rw-r--r--compiler/scanner.pas71
-rw-r--r--compiler/sparc/aoptcpu.pas2
-rw-r--r--compiler/sparc/cpuinfo.pas21
-rw-r--r--compiler/sparc/ncpuadd.pas12
-rw-r--r--compiler/symconst.pas4
-rw-r--r--compiler/symdef.pas175
-rw-r--r--compiler/symsym.pas34
-rw-r--r--compiler/symtable.pas65
-rw-r--r--compiler/systems.inc9
-rw-r--r--compiler/systems.pas7
-rw-r--r--compiler/systems/i_aros.pas169
-rw-r--r--compiler/systems/i_bsd.pas73
-rw-r--r--compiler/systems/i_linux.pas5
-rw-r--r--compiler/systems/i_nativent.pas2
-rw-r--r--compiler/systems/t_aix.pas23
-rw-r--r--compiler/systems/t_amiga.pas1
-rw-r--r--compiler/systems/t_aros.pas304
-rw-r--r--compiler/systems/t_bsd.pas9
-rw-r--r--compiler/systems/t_gba.pas1
-rw-r--r--compiler/systems/t_linux.pas1
-rw-r--r--compiler/systems/t_morph.pas2
-rw-r--r--compiler/systems/t_nds.pas142
-rw-r--r--compiler/systems/t_os2.pas8
-rw-r--r--compiler/systems/t_sunos.pas4
-rw-r--r--compiler/tgobj.pas4
-rw-r--r--compiler/tokens.pas2
-rw-r--r--compiler/utils/Makefile61
-rw-r--r--compiler/utils/fpc.pp14
-rw-r--r--compiler/utils/ppuutils/ppudump.pp25
-rw-r--r--compiler/utils/samplecfg2
-rw-r--r--compiler/version.pas4
-rw-r--r--compiler/vis/cpuinfo.pas23
-rw-r--r--compiler/x86/aasmcpu.pas197
-rw-r--r--compiler/x86/agx86att.pas24
-rw-r--r--compiler/x86/agx86nsm.pas2
-rw-r--r--compiler/x86/nx86add.pas27
-rw-r--r--compiler/x86/nx86mat.pas8
-rw-r--r--compiler/x86/rax86.pas28
-rw-r--r--compiler/x86/rax86att.pas4
-rw-r--r--compiler/x86/rax86int.pas63
-rw-r--r--compiler/x86/symx86.pas120
-rw-r--r--compiler/x86_64/cgcpu.pas31
-rw-r--r--compiler/x86_64/cpuelf.pas3
-rw-r--r--compiler/x86_64/cpuinfo.pas24
-rw-r--r--compiler/x86_64/cpupara.pas26
-rw-r--r--compiler/x86_64/nx64flw.pas8
-rw-r--r--compiler/x86_64/rax64att.pas1
-rw-r--r--compiler/x86_64/symcpu.pas2
215 files changed, 6549 insertions, 2881 deletions
diff --git a/compiler/Makefile b/compiler/Makefile
index a41b00864d..19be5a1b06 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -1,9 +1,9 @@
#
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
#
default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
UNIXs = linux $(BSDs) solaris qnx haiku aix
LIMIT83fs = go32v2 os2 emx watcom msdos
OSNeedsComspecToRunBatch = go32v2 watcom
@@ -326,7 +326,7 @@ FPCFPMAKE=$(FPC)
endif
endif
override PACKAGE_NAME=compiler
-override PACKAGE_VERSION=2.7.1
+override PACKAGE_VERSION=3.1.1
unexport FPC_VERSION FPC_COMPILERINFO
CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k armeb mipsel mips avr jvm i8086
ALLTARGETS=$(CYCLETARGETS)
@@ -525,7 +525,7 @@ override LOCALOPT+=-Fux86
endif
OPTWPOCOLLECT=-OWdevirtcalls,optvmts -FW$(BASEDIR)/pp1.wpo
OPTWPOPERFORM=-Owdevirtcalls,optvmts -Fw$(BASEDIR)/pp1.wpo
-ifneq ($(findstring $(OS_TARGET),darwin linux freebsd solaris),)
+ifneq ($(findstring $(OS_TARGET),darwin linux dragonfly freebsd solaris),)
ifdef LINKSMART
ifdef CREATESMART
OPTWPOCOLLECT+=-OWsymbolliveness -Xs-
@@ -614,6 +614,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override TARGET_DIRS+=utils
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_DIRS+=utils
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_DIRS+=utils
endif
@@ -701,6 +704,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_DIRS+=utils
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_DIRS+=utils
+endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_DIRS+=utils
endif
@@ -839,6 +845,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override TARGET_PROGRAMS+=pp
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_PROGRAMS+=pp
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_PROGRAMS+=pp
endif
@@ -926,6 +935,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_PROGRAMS+=pp
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_PROGRAMS+=pp
+endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_PROGRAMS+=pp
endif
@@ -1065,6 +1077,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
@@ -1152,6 +1167,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
endif
@@ -1290,6 +1308,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
@@ -1377,6 +1398,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
endif
@@ -1515,6 +1539,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_TARGETDIR+=.
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_TARGETDIR+=.
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_TARGETDIR+=.
endif
@@ -1602,6 +1629,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_TARGETDIR+=.
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_TARGETDIR+=.
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_TARGETDIR+=.
endif
@@ -1740,6 +1770,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
@@ -1827,6 +1860,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
endif
@@ -2138,6 +2174,12 @@ EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=lnx
endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
ifeq ($(OS_TARGET),freebsd)
BATCHEXT=.sh
EXEEXT=
@@ -2183,6 +2225,11 @@ EXEEXT=
SHAREDLIBEXT=.library
SHORTSUFFIX=amg
endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
ifeq ($(OS_TARGET),morphos)
EXEEXT=
SHAREDLIBEXT=.library
@@ -2604,6 +2651,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
REQUIRE_PACKAGES_RTL=1
endif
+ifeq ($(FULL_TARGET),i386-aros)
+REQUIRE_PACKAGES_RTL=1
+endif
ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1
endif
@@ -2691,6 +2741,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
REQUIRE_PACKAGES_RTL=1
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+REQUIRE_PACKAGES_RTL=1
+endif
ifeq ($(FULL_TARGET),arm-linux)
REQUIRE_PACKAGES_RTL=1
endif
@@ -2911,7 +2964,7 @@ endif
ifdef CREATESHARED
override FPCOPT+=-Cg
endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
ifeq ($(CPU_TARGET),x86_64)
override FPCOPT+=-Cg
endif
@@ -3461,6 +3514,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
TARGET_DIRS_UTILS=1
endif
+ifeq ($(FULL_TARGET),i386-aros)
+TARGET_DIRS_UTILS=1
+endif
ifeq ($(FULL_TARGET),m68k-linux)
TARGET_DIRS_UTILS=1
endif
@@ -3548,6 +3604,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
TARGET_DIRS_UTILS=1
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+TARGET_DIRS_UTILS=1
+endif
ifeq ($(FULL_TARGET),arm-linux)
TARGET_DIRS_UTILS=1
endif
diff --git a/compiler/Makefile.fpc b/compiler/Makefile.fpc
index f127ab66bb..61ac3c8880 100644
--- a/compiler/Makefile.fpc
+++ b/compiler/Makefile.fpc
@@ -4,7 +4,7 @@
[package]
name=compiler
-version=2.7.1
+version=3.1.1
[target]
programs=pp
@@ -300,7 +300,7 @@ OPTWPOCOLLECT=-OWdevirtcalls,optvmts -FW$(BASEDIR)/pp1.wpo
OPTWPOPERFORM=-Owdevirtcalls,optvmts -Fw$(BASEDIR)/pp1.wpo
# symbol liveness WPO requires nm, smart linking and no stripping (the latter
# is forced by the Makefile when necessary)
-ifneq ($(findstring $(OS_TARGET),darwin linux freebsd solaris),)
+ifneq ($(findstring $(OS_TARGET),darwin linux dragonfly freebsd solaris),)
ifdef LINKSMART
ifdef CREATESMART
OPTWPOCOLLECT+=-OWsymbolliveness -Xs-
diff --git a/compiler/aarch64/a64att.inc b/compiler/aarch64/a64att.inc
index 21ac05204d..ad0b8050df 100644
--- a/compiler/aarch64/a64att.inc
+++ b/compiler/aarch64/a64att.inc
@@ -1,5 +1,6 @@
{ don't edit, this file is generated from armins.dat }
(
+'nop',
'b',
'cb',
'tb',
diff --git a/compiler/aarch64/a64atts.inc b/compiler/aarch64/a64atts.inc
index 61cfb8663c..6b59b55a9d 100644
--- a/compiler/aarch64/a64atts.inc
+++ b/compiler/aarch64/a64atts.inc
@@ -129,5 +129,6 @@ attsufNONE,
attsufNONE,
attsufNONE,
attsufNONE,
+attsufNONE,
attsufNONE
);
diff --git a/compiler/aarch64/a64ins.dat b/compiler/aarch64/a64ins.dat
index 32d9054933..34fae63c02 100644
--- a/compiler/aarch64/a64ins.dat
+++ b/compiler/aarch64/a64ins.dat
@@ -1,3 +1,5 @@
+[NOP]
+
[B]
[CB]
diff --git a/compiler/aarch64/a64op.inc b/compiler/aarch64/a64op.inc
index bbaec48632..05faf81ab9 100644
--- a/compiler/aarch64/a64op.inc
+++ b/compiler/aarch64/a64op.inc
@@ -1,5 +1,6 @@
{ don't edit, this file is generated from armins.dat }
(
+A_NOP,
A_B,
A_CB,
A_TB,
diff --git a/compiler/aarch64/cpuinfo.pas b/compiler/aarch64/cpuinfo.pas
index 5b27b8a3fa..d253ed77f4 100644
--- a/compiler/aarch64/cpuinfo.pas
+++ b/compiler/aarch64/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = type extended;
@@ -47,6 +50,9 @@ Type
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false; (* Not yet at least ;-) *)
{# Size of native extended floating point type }
extended_size = 8;
{# Size of a multimedia register }
@@ -54,6 +60,15 @@ Const
{ target cpu string (used by compiler options) }
target_cpu_string = 'aarch64';
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/aarch64/cpupara.pas b/compiler/aarch64/cpupara.pas
index 9812fc3db2..e8f6d753d7 100644
--- a/compiler/aarch64/cpupara.pas
+++ b/compiler/aarch64/cpupara.pas
@@ -124,7 +124,7 @@ unit cpupara;
orddef:
getparaloc:=LOC_REGISTER;
floatdef:
- getparaloc:=LOC_MMREGISTER
+ getparaloc:=LOC_MMREGISTER;
enumdef:
getparaloc:=LOC_REGISTER;
pointerdef:
diff --git a/compiler/aasmbase.pas b/compiler/aasmbase.pas
index 38c0c27458..3ad293ec61 100644
--- a/compiler/aasmbase.pas
+++ b/compiler/aasmbase.pas
@@ -62,6 +62,8 @@ interface
const
asmlabeltypeprefix : array[TAsmLabeltype] of char = ('j','a','d','l','f','t','c');
+ asmsymbindname : array[TAsmsymbind] of string = ('none', 'external','common',
+ 'local','global','weak external','private external','lazy','import');
type
TAsmSectiontype=(sec_none,
@@ -197,7 +199,7 @@ interface
function EncodeUleb128(a: qword;out buf) : byte;
function EncodeSleb128(a: int64;out buf) : byte;
- function ReplaceForbiddenAsmSymbolChars(const s: string): string;
+ function ReplaceForbiddenAsmSymbolChars(const s: ansistring): ansistring;
{ dummy default noop callback }
procedure default_global_used;
@@ -348,7 +350,7 @@ implementation
end;
- function ReplaceForbiddenAsmSymbolChars(const s: string): string;
+ function ReplaceForbiddenAsmSymbolChars(const s: ansistring): ansistring;
var
i : longint;
rchar: char;
diff --git a/compiler/aasmdata.pas b/compiler/aasmdata.pas
index b81272c957..001b66009a 100644
--- a/compiler/aasmdata.pas
+++ b/compiler/aasmdata.pas
@@ -122,8 +122,6 @@ interface
type
TAsmList = class(tlinkedlist)
constructor create;
- constructor create_without_marker;
- function empty : boolean;
function getlasttaifilepos : pfileposinfo;
end;
@@ -284,20 +282,6 @@ implementation
constructor TAsmList.create;
begin
inherited create;
- { make sure the optimizer won't remove the first tai of this list}
- insert(tai_marker.create(mark_BlockStart));
- end;
-
- constructor TAsmList.create_without_marker;
- begin
- inherited create;
- end;
-
- function TAsmList.empty : boolean;
- begin
- { there is always a mark_BlockStart available,
- see TAsmList.create }
- result:=(count<=1);
end;
@@ -422,6 +406,21 @@ implementation
internalerror(200603261);
end;
hp.typ:=_typ;
+ { Changing bind from AB_GLOBAL to AB_LOCAL is wrong
+ if bind is already AB_GLOBAL or AB_EXTERNAL,
+ GOT might have been used, so change might be harmful. }
+ if (_bind<>hp.bind) and (hp.getrefs>0) then
+ begin
+{$ifdef extdebug}
+ { the changes that matter must become internalerrors, the rest
+ should be ignored; a used cannot change anything about this,
+ so printing a warning/hint is not useful }
+ if (_bind=AB_LOCAL) then
+ Message3(asmw_w_changing_bind_type,s,asmsymbindname[hp.bind],asmsymbindname[_bind])
+ else
+ Message3(asmw_h_changing_bind_type,s,asmsymbindname[hp.bind],asmsymbindname[_bind]);
+{$endif extdebug}
+ end;
hp.bind:=_bind;
end
else
diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas
index e0817beddd..841ce2555f 100644
--- a/compiler/aasmtai.pas
+++ b/compiler/aasmtai.pas
@@ -579,6 +579,8 @@ interface
constructor Create_type_name(_typ:taiconst_type;const name:string;_symtyp:Tasmsymtype;ofs:aint);
constructor Create_nil_codeptr;
constructor Create_nil_dataptr;
+ constructor Create_int_codeptr(_value: int64);
+ constructor Create_int_dataptr(_value: int64);
constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
procedure ppuwrite(ppufile:tcompilerppufile);override;
procedure derefimpl;override;
@@ -1748,6 +1750,18 @@ implementation
constructor tai_const.Create_nil_codeptr;
begin
+ self.Create_int_codeptr(0);
+ end;
+
+
+ constructor tai_const.Create_nil_dataptr;
+ begin
+ self.Create_int_dataptr(0);
+ end;
+
+
+ constructor tai_const.Create_int_codeptr(_value: int64);
+ begin
inherited Create;
typ:=ait_const;
{$ifdef i8086}
@@ -1759,11 +1773,11 @@ implementation
sym:=nil;
endsym:=nil;
symofs:=0;
- value:=0;
+ value:=_value;
end;
- constructor tai_const.Create_nil_dataptr;
+ constructor tai_const.Create_int_dataptr(_value: int64);
begin
inherited Create;
typ:=ait_const;
@@ -1776,7 +1790,7 @@ implementation
sym:=nil;
endsym:=nil;
symofs:=0;
- value:=0;
+ value:=_value;
end;
@@ -2173,7 +2187,10 @@ implementation
typ:=ait_stab;
stabtype:=_stabtype;
getmem(str,length(s)+1);
- move(s[1],str^,length(s)+1);
+ if length(s)>0 then
+ move(s[1],str^,length(s)+1)
+ else
+ str^:=#0;
end;
destructor tai_stab.destroy;
diff --git a/compiler/aggas.pas b/compiler/aggas.pas
index 2a882abf6f..52acf3b03f 100644
--- a/compiler/aggas.pas
+++ b/compiler/aggas.pas
@@ -843,7 +843,8 @@ implementation
asmwrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
asmwrite(',');
asmwrite(tostr(tai_datablock(hp).size)+',');
- asmwrite('_data.bss_');
+ asmwrite('_data.bss_,');
+ asmwriteln(tostr(last_align));
end;
end
else
@@ -1243,6 +1244,11 @@ implementation
end;
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
begin
+{$ifdef arm}
+ { do no change arm mode accidently, .globl seems to reset the mode }
+ if GenerateThumbCode or GenerateThumb2Code then
+ AsmWriteln(#9'.thumb_func'#9);
+{$endif arm}
AsmWrite('.globl'#9);
if replaceforbidden then
AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
@@ -1446,7 +1452,12 @@ implementation
begin
WriteDirectiveName(tai_directive(hp).directive);
if tai_directive(hp).name <>'' then
- AsmWrite(tai_directive(hp).name);
+ begin
+ if replaceforbidden then
+ AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_directive(hp).name))
+ else
+ AsmWrite(tai_directive(hp).name);
+ end;
AsmLn;
end;
@@ -1712,7 +1723,7 @@ implementation
{ "no executable stack" marker }
{ TODO: used by OpenBSD/NetBSD as well? }
- if (target_info.system in (systems_linux + systems_android + systems_freebsd)) and
+ if (target_info.system in (systems_linux + systems_android + systems_freebsd + systems_dragonfly)) and
not(cs_executable_stack in current_settings.moduleswitches) then
begin
AsmWriteLn('.section .note.GNU-stack,"",%progbits');
diff --git a/compiler/agjasmin.pas b/compiler/agjasmin.pas
index c33747f422..10fee0677a 100644
--- a/compiler/agjasmin.pas
+++ b/compiler/agjasmin.pas
@@ -526,6 +526,8 @@ implementation
i: longint;
toplevelowner: tsymtable;
begin
+ superclass:=nil;
+
{ JVM 1.5+ }
AsmWriteLn('.bytecode 49.0');
// include files are not support by Java, and the directory of the main
@@ -763,6 +765,8 @@ implementation
2:result:=tostr(smallint(csym.value.valueord.svalue));
4:result:=tostr(longint(csym.value.valueord.svalue));
8:result:=tostr(csym.value.valueord.svalue);
+ else
+ internalerror(2014082050);
end;
conststring:
result:=constastr(pchar(csym.value.valueptr),csym.value.len);
diff --git a/compiler/alpha/cpuinfo.pas b/compiler/alpha/cpuinfo.pas
index 4779b4a73a..cdf5a4ac3f 100644
--- a/compiler/alpha/cpuinfo.pas
+++ b/compiler/alpha/cpuinfo.pas
@@ -21,6 +21,9 @@ Unit CPUInfo;
Interface
+uses
+ globtype;
+
Type
{ Natural integer register type and size for the target machine }
{$ifdef FPC}
@@ -38,6 +41,9 @@ Type
TConstPtrUInt = qword;
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TExtended80Rec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -52,7 +58,15 @@ Type
ClassEV8
);
+ tcontrollertype =
+ (ct_none
+ );
+
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
{ Size of native extended type }
extended_size = 16;
{# Size of a pointer }
@@ -60,6 +74,15 @@ Const
{# Size of a multimedia register }
mmreg_size = 8;
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ target cpu string (used by compiler options) }
target_cpu_string = 'alpha';
diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas
index 818310a259..619e24e0c5 100644
--- a/compiler/aoptobj.pas
+++ b/compiler/aoptobj.pas
@@ -1041,6 +1041,9 @@ Unit AoptObj;
Repeat
While Assigned(StartPai) And
((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or
+{$if defined(MIPS) or defined(SPARC)}
+ ((startpai.typ=ait_instruction) and (taicpu(startpai).opcode=A_NOP)) or
+{$endif MIPS or SPARC}
((StartPai.typ = ait_label) and
Not(Tai_Label(StartPai).labsym.Is_Used))) Do
StartPai := Tai(StartPai.Next);
diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas
index 58b8010226..1086f17867 100644
--- a/compiler/arm/aasmcpu.pas
+++ b/compiler/arm/aasmcpu.pas
@@ -212,7 +212,7 @@ uses
function is_same_reg_move(regtype: Tregistertype):boolean; override;
function spilling_get_operation_type(opnr: longint): topertype;override;
-
+ function spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;override;
{ assembler }
public
{ the next will reset all instructions that can change in pass 2 }
@@ -777,6 +777,15 @@ implementation
end;
+ function taicpu.spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;
+ begin
+ result := operand_read;
+ if (oper[opnr]^.ref^.base = reg) and
+ (oper[opnr]^.ref^.addressmode in [AM_PREINDEXED,AM_POSTINDEXED]) then
+ result := operand_readwrite;
+ end;
+
+
procedure BuildInsTabCache;
var
i : longint;
@@ -1055,15 +1064,16 @@ implementation
(tai(hp).typ=ait_instruction) then
begin
case taicpu(hp).opcode of
- A_BX,
+ A_MOV,
A_LDR,
A_ADD:
{ approximation if we hit a case jump table }
if ((taicpu(hp).opcode in [A_ADD,A_LDR]) and not(GenerateThumbCode or GenerateThumb2Code) and
(taicpu(hp).oper[0]^.typ=top_reg) and
(taicpu(hp).oper[0]^.reg=NR_PC)) or
- ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and
- (taicpu(hp).oper[0]^.typ=top_reg))
+ ((taicpu(hp).opcode=A_MOV) and (GenerateThumbCode) and
+ (taicpu(hp).oper[0]^.typ=top_reg) and
+ (taicpu(hp).oper[0]^.reg=NR_PC))
then
begin
penalty:=multiplier;
@@ -1858,7 +1868,7 @@ implementation
ot:=OT_SHIFTEROP;
end;
else
- internalerror(200402261);
+ internalerror(2004022623);
end;
end;
end;
diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas
index 229a63816f..2cca31ec52 100644
--- a/compiler/arm/aoptcpu.pas
+++ b/compiler/arm/aoptcpu.pas
@@ -30,7 +30,7 @@ Unit aoptcpu;
Interface
-uses cgbase, cpubase, aasmtai, aasmcpu,aopt, aoptobj;
+uses cgbase, cgutils, cpubase, aasmtai, aasmcpu,aopt, aoptobj;
Type
TCpuAsmOptimizer = class(TAsmOptimizer)
@@ -49,7 +49,8 @@ Type
change in program flow.
If there is none, it returns false and
sets p1 to nil }
- Function GetNextInstructionUsingReg(Current: tai; Var Next: tai;reg : TRegister): Boolean;
+ Function GetNextInstructionUsingReg(Current: tai; Out Next: tai; reg: TRegister): Boolean;
+ Function GetNextInstructionUsingRef(Current: tai; Out Next: tai; const ref: TReference; StopOnStore: Boolean = true): Boolean;
{ outputs a debug message into the assembler file }
procedure DebugMsg(const s: string; p: tai);
@@ -79,7 +80,7 @@ Implementation
cutils,verbose,globtype,globals,
systems,
cpuinfo,
- cgobj,cgutils,procinfo,
+ cgobj,procinfo,
aasmbase,aasmdata;
function CanBeCond(p : tai) : boolean;
@@ -317,15 +318,46 @@ Implementation
RegLoadedWithNewValue(reg,p);
end;
-
function TCpuAsmOptimizer.GetNextInstructionUsingReg(Current: tai;
- var Next: tai; reg: TRegister): Boolean;
+ Out Next: tai; reg: TRegister): Boolean;
begin
Next:=Current;
repeat
Result:=GetNextInstruction(Next,Next);
- until not(cs_opt_level3 in current_settings.optimizerswitches) or not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
- (is_calljmp(taicpu(Next).opcode)) or (RegInInstruction(NR_PC,Next));
+ until not (Result) or
+ not(cs_opt_level3 in current_settings.optimizerswitches) or
+ (Next.typ<>ait_instruction) or
+ RegInInstruction(reg,Next) or
+ is_calljmp(taicpu(Next).opcode) or
+ RegModifiedByInstruction(NR_PC,Next);
+ end;
+
+ function TCpuAsmOptimizer.GetNextInstructionUsingRef(Current: tai;
+ Out Next: tai; const ref: TReference; StopOnStore: Boolean = true): Boolean;
+ begin
+ Next:=Current;
+ repeat
+ Result:=GetNextInstruction(Next,Next);
+ if Result and
+ (Next.typ=ait_instruction) and
+ (taicpu(Next).opcode in [A_LDR, A_STR]) and
+ (
+ ((taicpu(Next).ops = 2) and
+ (taicpu(Next).oper[1]^.typ = top_ref) and
+ RefsEqual(taicpu(Next).oper[1]^.ref^,ref)) or
+ ((taicpu(Next).ops = 3) and { LDRD/STRD }
+ (taicpu(Next).oper[2]^.typ = top_ref) and
+ RefsEqual(taicpu(Next).oper[2]^.ref^,ref))
+ ) then
+ {We've found an instruction LDR or STR with the same reference}
+ exit;
+ until not(Result) or
+ (Next.typ<>ait_instruction) or
+ not(cs_opt_level3 in current_settings.optimizerswitches) or
+ is_calljmp(taicpu(Next).opcode) or
+ (StopOnStore and (taicpu(Next).opcode in [A_STR, A_STM])) or
+ RegModifiedByInstruction(NR_PC,Next);
+ Result:=false;
end;
{$ifdef DEBUG_AOPTCPU}
@@ -482,7 +514,8 @@ Implementation
hp1 : tai;
begin
Result:=false;
- if (p.oper[1]^.ref^.addressmode=AM_OFFSET) and
+ if (p.oper[1]^.typ = top_ref) and
+ (p.oper[1]^.ref^.addressmode=AM_OFFSET) and
(p.oper[1]^.ref^.index=NR_NO) and
(p.oper[1]^.ref^.offset=0) and
GetNextInstructionUsingReg(p, hp1, p.oper[1]^.ref^.base) and
@@ -538,6 +571,7 @@ Implementation
TmpUsedRegs: TAllUsedRegs;
tempop: tasmop;
oldreg: tregister;
+ dealloc: tai_regalloc;
function IsPowerOf2(const value: DWord): boolean; inline;
begin
@@ -607,12 +641,17 @@ Implementation
str reg1,ref
mov reg2,reg1
}
- if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
+ if (taicpu(p).oper[1]^.typ = top_ref) and
+ (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
(taicpu(p).oppostfix=PF_None) and
- GetNextInstruction(p,hp1) and
- MatchInstruction(hp1, A_LDR, [taicpu(p).condition, C_None], [PF_None]) and
- RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
- (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
+ (taicpu(p).condition=C_None) and
+ GetNextInstructionUsingRef(p,hp1,taicpu(p).oper[1]^.ref^) and
+ MatchInstruction(hp1, A_LDR, [taicpu(p).condition], [PF_None]) and
+ (taicpu(hp1).oper[1]^.typ=top_ref) and
+ (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) and
+ not(RegModifiedBetween(taicpu(p).oper[0]^.reg, p, hp1)) and
+ ((taicpu(hp1).oper[1]^.ref^.index=NR_NO) or not (RegModifiedBetween(taicpu(hp1).oper[1]^.ref^.index, p, hp1))) and
+ ((taicpu(hp1).oper[1]^.ref^.base=NR_NO) or not (RegModifiedBetween(taicpu(hp1).oper[1]^.ref^.base, p, hp1))) then
begin
if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
begin
@@ -633,7 +672,7 @@ Implementation
str reg1,ref
str reg2,ref
into
- strd reg1,ref
+ strd reg1,reg2,ref
}
else if (GenerateARMCode or GenerateThumb2Code) and
(CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
@@ -654,6 +693,9 @@ Implementation
begin
DebugMsg('Peephole StrStr2Strd done', p);
taicpu(p).oppostfix:=PF_D;
+ taicpu(p).loadref(2,taicpu(p).oper[1]^.ref^);
+ taicpu(p).loadreg(1, taicpu(hp1).oper[0]^.reg);
+ taicpu(p).ops:=3;
asml.remove(hp1);
hp1.free;
result:=true;
@@ -667,7 +709,8 @@ Implementation
ldr reg2,ref
into ...
}
- if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
+ if (taicpu(p).oper[1]^.typ = top_ref) and
+ (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
GetNextInstruction(p,hp1) and
{ ldrd is not allowed here }
MatchInstruction(hp1, A_LDR, [taicpu(p).condition, C_None], [taicpu(p).oppostfix,PF_None]-[PF_D]) then
@@ -700,7 +743,7 @@ Implementation
end
{
...
- ldrd reg1,ref
+ ldrd reg1,reg1+1,ref
}
else if (GenerateARMCode or GenerateThumb2Code) and
(CPUARM_HAS_EDSP in cpu_capabilities[current_settings.cputype]) and
@@ -718,6 +761,9 @@ Implementation
AlignedToQWord(taicpu(p).oper[1]^.ref^) then
begin
DebugMsg('Peephole LdrLdr2Ldrd done', p);
+ taicpu(p).loadref(2,taicpu(p).oper[1]^.ref^);
+ taicpu(p).loadreg(1, taicpu(hp1).oper[0]^.reg);
+ taicpu(p).ops:=3;
taicpu(p).oppostfix:=PF_D;
asml.remove(hp1);
hp1.free;
@@ -1200,6 +1246,7 @@ Implementation
(taicpu(p).oppostfix = PF_NONE) and
GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
MatchInstruction(hp1, [A_LDR, A_STR], [taicpu(p).condition], []) and
+ (taicpu(hp1).oper[1]^.typ = top_ref) and
{ We can change the base register only when the instruction uses AM_OFFSET }
((taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg) or
((taicpu(hp1).oper[1]^.ref^.addressmode = AM_OFFSET) and
@@ -1222,6 +1269,13 @@ Implementation
if taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg then
taicpu(hp1).oper[1]^.ref^.index := taicpu(p).oper[1]^.reg;
+ dealloc:=FindRegDeAlloc(taicpu(p).oper[1]^.reg, taicpu(p.Next));
+ if Assigned(dealloc) then
+ begin
+ asml.remove(dealloc);
+ asml.InsertAfter(dealloc,hp1);
+ end;
+
GetNextInstruction(p, hp1);
asml.remove(p);
p.free;
@@ -1583,13 +1637,14 @@ Implementation
and reg1,reg0,2^n-1
mov reg2,reg1, lsl imm1
=>
- mov reg2,reg1, lsl imm1
+ mov reg2,reg0, lsl imm1
if imm1>i
}
- else if i>32-taicpu(hp1).oper[2]^.shifterop^.shiftimm then
+ else if (i>32-taicpu(hp1).oper[2]^.shifterop^.shiftimm) and
+ not(RegModifiedBetween(taicpu(p).oper[1]^.reg, p, hp1)) then
begin
DebugMsg('Peephole AndLsl2Lsl done', p);
- taicpu(hp1).oper[1]^.reg:=taicpu(p).oper[0]^.reg;
+ taicpu(hp1).oper[1]^.reg:=taicpu(p).oper[1]^.reg;
GetNextInstruction(p, hp1);
asml.Remove(p);
p.free;
@@ -1616,6 +1671,7 @@ Implementation
while GetNextInstructionUsingReg(hp1, hp1, taicpu(p).oper[0]^.reg) and
{ we cannot check NR_DEFAULTFLAGS for modification yet so don't allow a condition }
MatchInstruction(hp1, [A_LDR, A_STR], [C_None], []) and
+ (taicpu(hp1).oper[1]^.typ = top_ref) and
(taicpu(hp1).oper[1]^.ref^.base=taicpu(p).oper[0]^.reg) and
{ don't optimize if the register is stored/overwritten }
(taicpu(hp1).oper[0]^.reg<>taicpu(p).oper[1]^.reg) and
@@ -2389,7 +2445,7 @@ Implementation
begin
result:=true;
- list:=TAsmList.create_without_marker;
+ list:=TAsmList.create;
p:=BlockStart;
while p<>BlockEnd Do
begin
@@ -2410,6 +2466,7 @@ Implementation
) or
{ try to prove that the memory accesses don't overlapp }
((taicpu(p).opcode in [A_STRB,A_STRH,A_STR]) and
+ (taicpu(p).oper[1]^.typ = top_ref) and
(taicpu(p).oper[1]^.ref^.base=taicpu(hp1).oper[1]^.ref^.base) and
(taicpu(p).oppostfix=PF_None) and
(taicpu(hp1).oppostfix=PF_None) and
@@ -2435,7 +2492,10 @@ Implementation
{ first instruction might not change the register used as index }
((taicpu(hp1).oper[1]^.ref^.index=NR_NO) or
not(RegModifiedByInstruction(taicpu(hp1).oper[1]^.ref^.index,p))
- ) then
+ ) and
+ { if we modify the basereg AND the first instruction used that reg, we can not schedule }
+ ((taicpu(hp1).oper[1]^.ref^.addressmode = AM_OFFSET) or
+ not(instructionLoadsFromReg(taicpu(hp1).oper[1]^.ref^.base,p))) then
begin
hp3:=tai(p.Previous);
hp5:=tai(p.next);
diff --git a/compiler/arm/aoptcpub.pas b/compiler/arm/aoptcpub.pas
index aa60bfd624..28451ca028 100644
--- a/compiler/arm/aoptcpub.pas
+++ b/compiler/arm/aoptcpub.pas
@@ -124,11 +124,14 @@ Implementation
begin
result:=false;
for i:=0 to taicpu(p1).ops-1 do
- if (taicpu(p1).oper[i]^.typ=top_reg) and (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
- begin
- result:=true;
- exit;
- end;
+ case taicpu(p1).oper[i]^.typ of
+ top_reg:
+ if (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
+ exit(true);
+ top_ref:
+ if (taicpu(p1).spilling_get_operation_type_ref(i,Reg)<>operand_read) then
+ exit(true);
+ end;
end;
End.
diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas
index a41aef9a0b..82884fae57 100644
--- a/compiler/arm/cgcpu.pas
+++ b/compiler/arm/cgcpu.pas
@@ -71,6 +71,8 @@ unit cgcpu;
procedure g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister); override;
+ procedure g_profilecode(list : TAsmList); override;
+
procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override;
procedure g_proc_exit(list : TAsmList;parasize : longint;nostackframe:boolean); override;
procedure g_maybe_got_init(list : TAsmList); override;
@@ -182,6 +184,8 @@ unit cgcpu;
procedure g_adjust_self_value(list:TAsmList;procdef: tprocdef;ioffset: tcgint); override;
function handle_load_store(list: TAsmList; op: tasmop; oppostfix: toppostfix; reg: tregister; ref: treference): treference; override;
+
+ procedure g_external_wrapper(list : TAsmList; procdef : tprocdef; const externalname : string); override;
end;
tthumbcg64farm = class(tbasecg64farm)
@@ -1794,6 +1798,16 @@ unit cgcpu;
list.concat(setcondition(taicpu.op_reg_const(A_MOV,reg,0),inverse_cond(flags_to_cond(f))));
end;
+ procedure tbasecgarm.g_profilecode(list : TAsmList);
+ begin
+ if target_info.system = system_arm_linux then
+ begin
+ list.concat(taicpu.op_regset(A_PUSH,R_INTREGISTER,R_SUBWHOLE,[RS_R14]));
+ a_call_name(list,'__gnu_mcount_nc',false);
+ end
+ else
+ internalerror(2014091201);
+ end;
procedure tbasecgarm.g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);
var
@@ -3201,6 +3215,7 @@ unit cgcpu;
if (href.offset in [0..124]) and ((href.offset mod 4)=0) then
begin
list.concat(taicpu.op_regset(A_PUSH,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
+ list.concat(taicpu.op_reg_reg(A_MOV,NR_R0,NR_R12));
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_R0);
list.concat(taicpu.op_reg_reg(A_MOV,NR_R12,NR_R0));
list.concat(taicpu.op_regset(A_POP,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
@@ -3218,20 +3233,21 @@ unit cgcpu;
tmpref.symbol:=l;
tmpref.base:=NR_PC;
list.concat(taicpu.op_reg_ref(A_LDR,NR_R1,tmpref));
+ list.concat(taicpu.op_reg_reg(A_MOV,NR_R0,NR_R12));
href.offset:=0;
+ href.base:=NR_R0;
href.index:=NR_R1;
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_R0);
list.concat(taicpu.op_reg_reg(A_MOV,NR_R12,NR_R0));
list.concat(taicpu.op_regset(A_POP,R_INTREGISTER,R_SUBWHOLE,[RS_R0,RS_R1]));
end;
- list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R12));
end
else
begin
reference_reset_base(href,NR_R12,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),sizeof(pint));
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_R12);
- list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R12));
end;
+ list.concat(taicpu.op_reg(A_BX,NR_R12));
end;
var
@@ -3248,6 +3264,9 @@ unit cgcpu;
if procdef.owner.symtabletype<>ObjectSymtable then
Internalerror(200109191);
+ if GenerateThumbCode or GenerateThumb2Code then
+ list.concat(tai_thumb_func.create);
+
make_global:=false;
if (not current_module.is_unit) or
create_smartlink or
@@ -3293,7 +3312,7 @@ unit cgcpu;
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,tmpref,NR_R0);
list.concat(taicpu.op_reg_reg(A_MOV,NR_R12,NR_R0));
list.concat(taicpu.op_regset(A_POP,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
- list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R12));
+ list.concat(taicpu.op_reg(A_BX,NR_R12));
end
else
list.concat(taicpu.op_sym(A_B,current_asmdata.RefAsmSymbol(procdef.mangledname)));
@@ -4050,18 +4069,36 @@ unit cgcpu;
tmpreg : TRegister;
begin
href:=ref;
- if (op in [A_STR,A_STRB,A_STRH]) and
- (abs(ref.offset)>124) then
- begin
- tmpreg:=getintregister(list,OS_ADDR);
- a_loadaddr_ref_reg(list,ref,tmpreg);
-
- reference_reset_base(href,tmpreg,0,ref.alignment);
- end
- else if (op=A_LDR) and
- (oppostfix in [PF_None]) and
- (ref.base<>NR_STACK_POINTER_REG) and
- (abs(ref.offset)>124) then
+ if { LDR/STR limitations }
+ (
+ (((op=A_LDR) and (oppostfix=PF_None)) or
+ ((op=A_STR) and (oppostfix=PF_None))) and
+ (ref.base<>NR_STACK_POINTER_REG) and
+ (abs(ref.offset)>124)
+ ) or
+ { LDRB/STRB limitations }
+ (
+ (((op=A_LDR) and (oppostfix=PF_B)) or
+ ((op=A_LDRB) and (oppostfix=PF_None)) or
+ ((op=A_STR) and (oppostfix=PF_B)) or
+ ((op=A_STRB) and (oppostfix=PF_None))) and
+ ((ref.base=NR_STACK_POINTER_REG) or
+ (ref.index=NR_STACK_POINTER_REG) or
+ (abs(ref.offset)>31)
+ )
+ ) or
+ { LDRH/STRH limitations }
+ (
+ (((op=A_LDR) and (oppostfix=PF_H)) or
+ ((op=A_LDRH) and (oppostfix=PF_None)) or
+ ((op=A_STR) and (oppostfix=PF_H)) or
+ ((op=A_STRH) and (oppostfix=PF_None))) and
+ ((ref.base=NR_STACK_POINTER_REG) or
+ (ref.index=NR_STACK_POINTER_REG) or
+ (abs(ref.offset)>62) or
+ ((abs(ref.offset) mod 2)<>0)
+ )
+ ) then
begin
tmpreg:=getintregister(list,OS_ADDR);
a_loadaddr_ref_reg(list,ref,tmpreg);
@@ -4274,6 +4311,32 @@ unit cgcpu;
end;
+ procedure tthumbcgarm.g_external_wrapper(list: TAsmList; procdef: tprocdef; const externalname: string);
+ var
+ tmpref : treference;
+ l : tasmlabel;
+ begin
+ { there is no branch instruction on thumb which allows big distances and which leaves LR as it is
+ and which allows to switch the instruction set }
+
+ { create const entry }
+ reference_reset(tmpref,4);
+ current_asmdata.getjumplabel(l);
+ tmpref.symbol:=l;
+ tmpref.base:=NR_PC;
+ list.concat(taicpu.op_regset(A_PUSH,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
+ list.concat(taicpu.op_reg_ref(A_LDR,NR_R0,tmpref));
+ list.concat(taicpu.op_reg_reg(A_MOV,NR_R12,NR_R0));
+ list.concat(taicpu.op_regset(A_POP,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
+ list.concat(taicpu.op_reg(A_BX,NR_R12));
+
+ { append const entry }
+ list.Concat(tai_align.Create(4));
+ list.Concat(tai_label.create(l));
+ list.concat(tai_const.Create_sym(current_asmdata.RefAsmSymbol(externalname)));
+ end;
+
+
procedure tthumb2cgarm.init_register_allocators;
begin
inherited init_register_allocators;
diff --git a/compiler/arm/cpuelf.pas b/compiler/arm/cpuelf.pas
index f42ea3d9fd..c912955f89 100644
--- a/compiler/arm/cpuelf.pas
+++ b/compiler/arm/cpuelf.pas
@@ -561,6 +561,7 @@ implementation
rotation:longint;
residual,g_n:longword;
curloc: aword;
+ bit_S,bit_I1,bit_I2: aint;
begin
data:=objsec.data;
for i:=0 to objsec.ObjRelocations.Count-1 do
@@ -660,7 +661,16 @@ implementation
2) when target is unresolved weak symbol, CALL must be changed to NOP,
while JUMP24 behavior is unspecified. }
tmp:=sarlongint((address and $00FFFFFF) shl 8,6);
- tmp:=tmp+relocval-curloc;
+ tmp:=tmp+relocval;
+ if odd(tmp) then { dest is Thumb? }
+ begin
+ if (reltyp=R_ARM_CALL) then
+ { change BL to BLX, dest bit 1 goes to instruction bit 24 }
+ address:=(address and $FE000000) or (((tmp-curloc) and 2) shl 23) or $10000000
+ else
+ InternalError(2014092001);
+ end;
+ tmp:=tmp-curloc;
// TODO: check overflow
address:=(address and $FF000000) or ((tmp and $3FFFFFE) shr 2);
end;
@@ -829,6 +839,38 @@ implementation
address:=address or (1 shl 23);
end;
+ R_ARM_THM_CALL:
+ begin
+ if (not ElfTarget.relocs_use_addend) then
+ begin
+ address:=((address and $ffff) shl 16) or word(address shr 16);
+ bit_S:=(address shr 26) and 1;
+ bit_I1:=(bit_S xor ((address shr 13) and 1)) xor 1;
+ bit_I2:=(bit_S xor ((address shr 11) and 1)) xor 1;
+ tmp:=((-bit_S) shl 24) or (bit_I1 shl 23) or (bit_I2 shl 22) or (((address shr 16) and $3ff) shl 12) or ((address and $7ff) shl 1);
+ end
+ else { TODO: must read the instruction anyway }
+ tmp:=address;
+ tmp:=tmp+relocval; { dest address }
+ if odd(tmp) then { if it's Thumb code, change possible BLX to BL }
+ address:=address or $1800;
+ tmp:=tmp-curloc; { now take PC-relative }
+ { TODO: overflow check, different limit for Thumb and Thumb-2 }
+
+ { now encode this mess back }
+ if (address and $5000)=$4000 then
+ tmp:=(tmp+2) and (not 3);
+
+ bit_S:=(tmp shr 31) and 1;
+ address:=(address and $F800D000) or
+ (bit_S shl 26) or
+ (((tmp shr 12) and $3ff) shl 16) or
+ ((tmp shr 1) and $7FF) or
+ ((((tmp shr 23) and 1) xor 1 xor bit_S) shl 13) or
+ ((((tmp shr 22) and 1) xor 1 xor bit_S) shl 11);
+ address:=((address and $ffff) shl 16) or word(address shr 16);
+ end;
+
R_ARM_TLS_IE32:
begin
relocval:=relocval-tlsseg.mempos+align_aword(TCB_SIZE,tlsseg.align);
diff --git a/compiler/arm/cpuinfo.pas b/compiler/arm/cpuinfo.pas
index 52277fccea..05ea89d9e3 100644
--- a/compiler/arm/cpuinfo.pas
+++ b/compiler/arm/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = type extended;
@@ -338,8 +341,10 @@ Type
ct_thumb2bare
);
-
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = true;
{# Size of native extended floating point type }
extended_size = 12;
{# Size of a multimedia register }
diff --git a/compiler/arm/narmadd.pas b/compiler/arm/narmadd.pas
index 7083067a42..4e26f71736 100644
--- a/compiler/arm/narmadd.pas
+++ b/compiler/arm/narmadd.pas
@@ -85,6 +85,8 @@ interface
GetResFlags:=F_LT;
gten:
GetResFlags:=F_LE;
+ else
+ internalerror(201408203);
end
else
case NodeType of
@@ -96,6 +98,8 @@ interface
GetResFlags:=F_GT;
gten:
GetResFlags:=F_GE;
+ else
+ internalerror(201408204);
end;
end
else
@@ -110,6 +114,8 @@ interface
GetResFlags:=F_CC;
gten:
GetResFlags:=F_LS;
+ else
+ internalerror(201408205);
end
else
case NodeType of
@@ -121,6 +127,8 @@ interface
GetResFlags:=F_HI;
gten:
GetResFlags:=F_CS;
+ else
+ internalerror(201408206);
end;
end;
end;
@@ -144,6 +152,8 @@ interface
result:=F_GT;
gten:
result:=F_GE;
+ else
+ internalerror(201408207);
end;
end;
@@ -379,13 +389,13 @@ interface
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
if right.location.loc = LOC_CONSTANT then
begin
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_AND,tmpreg,left.location.register,right.location.value));
+ cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_AND,OS_32,right.location.value,left.location.register,tmpreg);
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,tmpreg,right.location.value));
end
else
begin
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_AND,tmpreg,left.location.register,right.location.register));
+ cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_AND,OS_32,left.location.register,right.location.register,tmpreg);
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,tmpreg,right.location.register));
end;
@@ -403,6 +413,8 @@ interface
oldnodetype : tnodetype;
dummyreg : tregister;
l: tasmlabel;
+ const
+ lt_zero_swapped: array[boolean] of tnodetype = (ltn, gtn);
begin
unsigned:=not(is_signed(left.resultdef)) or
not(is_signed(right.resultdef));
@@ -411,20 +423,34 @@ interface
{ pass_left_right moves possible consts to the right, the only
remaining case with left consts (currency) can take this path too (KB) }
- if (nodetype in [equaln,unequaln]) and
- (right.nodetype=ordconstn) and (tordconstnode(right).value=0) then
+ if (right.nodetype=ordconstn) and
+ (tordconstnode(right).value=0) and
+ ((nodetype in [equaln,unequaln]) or
+ (not(GenerateThumbCode) and is_signed(left.resultdef) and (nodetype = lt_zero_swapped[nf_swapped in Flags]))
+ ) then
begin
location_reset(location,LOC_FLAGS,OS_NO);
- location.resflags:=getresflags(unsigned);
if not(left.location.loc in [LOC_CREGISTER,LOC_REGISTER]) then
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
- dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
- cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
- if GenerateThumbCode then
- cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reglo,left.location.register64.reghi,dummyreg)
+ cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
+ { Optimize for the common case of int64 < 0 }
+ if nodetype in [ltn, gtn] then
+ begin
+ {Just check for the MSB in reghi to be set or not, this is independed from nf_swapped}
+ location.resflags:=F_NE;
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_TST,left.location.register64.reghi, aint($80000000)));
+ end
else
- current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S));
+ begin
+ location.resflags:=getresflags(unsigned);
+ dummyreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
+
+ if GenerateThumbCode then
+ cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reglo,left.location.register64.reghi,dummyreg)
+ else
+ current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg_reg(A_ORR,dummyreg,left.location.register64.reglo,left.location.register64.reghi),PF_S));
+ end;
end
else
begin
diff --git a/compiler/arm/narmset.pas b/compiler/arm/narmset.pas
index 35b34321a3..e1a99f2dbb 100644
--- a/compiler/arm/narmset.pas
+++ b/compiler/arm/narmset.pas
@@ -141,6 +141,7 @@ implementation
procedure tarmcasenode.genjumptable(hp : pcaselabel;min_,max_ : aint);
var
last : TConstExprInt;
+ tmpreg,
basereg,
indexreg : tregister;
href : treference;
@@ -222,7 +223,7 @@ implementation
begin
if cs_create_pic in current_settings.moduleswitches then
internalerror(2013082102);
- cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_+1,indexreg,indexreg);
+ cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_ADDR,min_,indexreg,indexreg);
current_asmdata.getaddrlabel(tablelabel);
cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SHL,OS_ADDR,2,indexreg);
@@ -231,9 +232,15 @@ implementation
reference_reset_symbol(href,tablelabel,0,4);
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList, href, basereg);
- cg.a_op_reg_reg(current_asmdata.CurrAsmList, OP_ADD, OS_ADDr, indexreg, basereg);
-
- current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_BX, basereg));
+ reference_reset(href,0);
+ href.base:=basereg;
+ href.index:=indexreg;
+
+ tmpreg:=cg.getintregister(current_asmdata.CurrAsmList, OS_ADDR);
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList, OS_ADDR, OS_ADDR, href, tmpreg);
+
+ { do not use BX here to avoid switching into arm mode }
+ current_asmdata.CurrAsmList.Concat(taicpu.op_reg_reg(A_MOV, NR_PC, tmpreg));
cg.a_label(current_asmdata.CurrAsmList,tablelabel);
{ generate jump table }
diff --git a/compiler/arm/raarmgas.pas b/compiler/arm/raarmgas.pas
index 64f330a213..e7de7b8d71 100644
--- a/compiler/arm/raarmgas.pas
+++ b/compiler/arm/raarmgas.pas
@@ -1043,6 +1043,7 @@ Unit raarmgas;
hreg : tregister;
flags : tspecialregflags;
begin
+ hreg:=NR_NO;
case actasmtoken of
AS_REGISTER:
begin
diff --git a/compiler/arm/rgcpu.pas b/compiler/arm/rgcpu.pas
index fdb9e0df9e..ca55f59f2c 100644
--- a/compiler/arm/rgcpu.pas
+++ b/compiler/arm/rgcpu.pas
@@ -290,6 +290,10 @@ unit rgcpu;
if abs(spilltemp.offset)>4095 then
exit;
+ { ldr can't set the flags }
+ if instr.oppostfix=PF_S then
+ exit;
+
if GenerateThumbCode and
(abs(spilltemp.offset)>1020) then
exit;
@@ -304,6 +308,11 @@ unit rgcpu;
(get_alias(getsupreg(oper[0]^.reg))=orgreg) and
(get_alias(getsupreg(oper[1]^.reg))<>orgreg) then
begin
+ { do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
+ if GenerateThumbCode and
+ (getsupreg(oper[1]^.reg)>RS_R7) then
+ exit;
+
{ str expects the register in oper[0] }
instr.loadreg(0,oper[1]^.reg);
instr.loadref(1,spilltemp);
@@ -314,6 +323,11 @@ unit rgcpu;
(get_alias(getsupreg(oper[1]^.reg))=orgreg) and
(get_alias(getsupreg(oper[0]^.reg))<>orgreg) then
begin
+ { do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
+ if GenerateThumbCode and
+ (getsupreg(oper[0]^.reg)>RS_R7) then
+ exit;
+
instr.loadref(1,spilltemp);
opcode:=A_LDR;
result:=true;
diff --git a/compiler/assemble.pas b/compiler/assemble.pas
index 609877e342..f3539291b9 100644
--- a/compiler/assemble.pas
+++ b/compiler/assemble.pas
@@ -1736,7 +1736,8 @@ Implementation
if not(tf_section_threadvars in target_info.flags) then
exclude(to_do,al_threadvars);
for i:=low(TasmlistType) to high(TasmlistType) do
- if (i in to_do) and (current_asmdata.asmlists[i]<>nil) then
+ if (i in to_do) and (current_asmdata.asmlists[i]<>nil) and
+ (not current_asmdata.asmlists[i].empty) then
addlist(current_asmdata.asmlists[i]);
if SmartAsm then
diff --git a/compiler/avr/aasmcpu.pas b/compiler/avr/aasmcpu.pas
index 274e06af9d..4bb7284ea8 100644
--- a/compiler/avr/aasmcpu.pas
+++ b/compiler/avr/aasmcpu.pas
@@ -246,11 +246,11 @@ implementation
begin
result:=operand_read;
case opcode of
- A_CLR,
- A_MOV, A_MOVW:
- if opnr=0 then
- result:=operand_write;
- A_CP,A_CPC,A_CPI,A_PUSH :
+ A_CLR,A_LDD,A_LD,A_LDI,A_LDS,
+ A_MOV,A_MOVW:
+ if opnr=0 then
+ result:=operand_write;
+ A_CP,A_CPC,A_CPI,A_PUSH,A_ST,A_STD,A_STS:
;
else
begin
diff --git a/compiler/avr/agavrgas.pas b/compiler/avr/agavrgas.pas
index 2e0d5bc0fc..94973eb0f6 100644
--- a/compiler/avr/agavrgas.pas
+++ b/compiler/avr/agavrgas.pas
@@ -81,6 +81,7 @@ unit agavrgas;
var
s : string;
begin
+ s:='';
with ref do
begin
{$ifdef extdebug}
@@ -95,9 +96,8 @@ unit agavrgas;
else if base<>NR_NO then
begin
if addressmode=AM_PREDRECEMENT then
- s:='-'
- else
- s:='';
+ s:='-';
+
case base of
NR_R26:
s:=s+'X';
@@ -119,9 +119,7 @@ unit agavrgas;
else if assigned(symbol) or (offset<>0) then
begin
if assigned(symbol) then
- s:=ReplaceForbiddenAsmSymbolChars(symbol.name)
- else
- s:='';
+ s:=ReplaceForbiddenAsmSymbolChars(symbol.name);
if offset<0 then
s:=s+tostr(offset)
diff --git a/compiler/avr/cpuinfo.pas b/compiler/avr/cpuinfo.pas
index e15fadfc0f..eec89b73a2 100644
--- a/compiler/avr/cpuinfo.pas
+++ b/compiler/avr/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = type extended;
@@ -61,6 +64,9 @@ Type
);
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = true;
{# Size of native extended floating point type }
extended_size = 12;
{# Size of a multimedia register }
diff --git a/compiler/avr/cpupara.pas b/compiler/avr/cpupara.pas
index 73b8fde17d..d1353ff7bb 100644
--- a/compiler/avr/cpupara.pas
+++ b/compiler/avr/cpupara.pas
@@ -201,13 +201,13 @@ unit cpupara;
begin
{ In case of po_delphi_nested_cc, the parent frame pointer
is always passed on the stack. }
- if (nextintreg>RS_R8) and
+ if (nextintreg>RS_R7) and
(not(vo_is_parentfp in hp.varoptions) or
not(po_delphi_nested_cc in p.procoptions)) then
begin
paraloc^.loc:=LOC_REGISTER;
paraloc^.register:=newreg(R_INTREGISTER,nextintreg,R_SUBWHOLE);
- inc(nextintreg);
+ dec(nextintreg);
end
else
begin
@@ -251,8 +251,8 @@ unit cpupara;
begin
paradef:=getpointerdef(paradef);
loc:=LOC_REGISTER;
- paracgsize := OS_ADDR;
- paralen := tcgsize2size[OS_ADDR];
+ paracgsize:=OS_ADDR;
+ paralen:=tcgsize2size[OS_ADDR];
end
else
begin
diff --git a/compiler/avr/navradd.pas b/compiler/avr/navradd.pas
index 3cf3270466..8a54171cab 100644
--- a/compiler/avr/navradd.pas
+++ b/compiler/avr/navradd.pas
@@ -77,6 +77,8 @@ interface
GetResFlags:=F_LT;
gten:
GetResFlags:=F_NotPossible;
+ else
+ internalerror(2014082020);
end
else
case NodeType of
@@ -88,6 +90,8 @@ interface
GetResFlags:=F_NotPossible;
gten:
GetResFlags:=F_GE;
+ else
+ internalerror(2014082021);
end;
end
else
@@ -102,6 +106,8 @@ interface
GetResFlags:=F_CC;
gten:
GetResFlags:=F_NotPossible;
+ else
+ internalerror(2014082022);
end
else
case NodeType of
@@ -113,6 +119,8 @@ interface
GetResFlags:=F_NotPossible;
gten:
GetResFlags:=F_CS;
+ else
+ internalerror(2014082023);
end;
end;
end;
@@ -220,7 +228,7 @@ interface
function tavraddnode.pass_1 : tnode;
begin
result:=inherited pass_1;
-{
+{$ifdef dummy}
if not(assigned(result)) then
begin
unsigned:=not(is_signed(left.resultdef)) or
@@ -240,7 +248,7 @@ interface
is_dynamic_array(left.resultdef)
) then
expectloc:=LOC_FLAGS;
-}
+{$endif dummy}
end;
diff --git a/compiler/avr/navrmat.pas b/compiler/avr/navrmat.pas
index b724b76383..802e3d0443 100644
--- a/compiler/avr/navrmat.pas
+++ b/compiler/avr/navrmat.pas
@@ -165,7 +165,7 @@ implementation
secondpass(right);
location_copy(location,left.location);
-{
+{$ifdef dummy}
{ put numerator in register }
size:=def_cgsize(left.resultdef);
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,
@@ -201,7 +201,7 @@ implementation
{ simple comparison with 0) }
if is_signed(right.resultdef) then
cg.g_overflowcheck(current_asmdata.CurrAsmList,location,resultdef);
-}
+{$endif dummy}
end;
{*****************************************************************************
diff --git a/compiler/avr/raavrgas.pas b/compiler/avr/raavrgas.pas
index 64b8d1a80c..169da45d6e 100644
--- a/compiler/avr/raavrgas.pas
+++ b/compiler/avr/raavrgas.pas
@@ -617,7 +617,7 @@ Unit raavrgas;
actopcode:=A_NONE;
for j:=maxlen downto 1 do
begin
- actopcode:=tasmop(PtrInt(iasmops.Find(copy(hs,1,j))));
+ actopcode:=tasmop(PtrUInt(iasmops.Find(copy(hs,1,j))));
if actopcode<>A_NONE then
begin
actasmtoken:=AS_OPCODE;
diff --git a/compiler/cclasses.pas b/compiler/cclasses.pas
index 0930634cb4..7fda9b697c 100644
--- a/compiler/cclasses.pas
+++ b/compiler/cclasses.pas
@@ -508,14 +508,14 @@ type
destructor Destroy; override;
procedure Clear;
{ finds an entry by key }
- function Find(Key: Pointer; KeyLen: Integer): PHashSetItem;
+ function Find(Key: Pointer; KeyLen: Integer): PHashSetItem;virtual;
{ finds an entry, creates one if not exists }
function FindOrAdd(Key: Pointer; KeyLen: Integer;
- var Found: Boolean): PHashSetItem;
+ var Found: Boolean): PHashSetItem;virtual;
{ finds an entry, creates one if not exists }
- function FindOrAdd(Key: Pointer; KeyLen: Integer): PHashSetItem;
+ function FindOrAdd(Key: Pointer; KeyLen: Integer): PHashSetItem;virtual;
{ returns Data by given Key }
- function Get(Key: Pointer; KeyLen: Integer): TObject;
+ function Get(Key: Pointer; KeyLen: Integer): TObject;virtual;
{ removes an entry, returns False if entry wasn't there }
function Remove(Entry: PHashSetItem): Boolean;
property Count: LongWord read FCount;
diff --git a/compiler/cfileutl.pas b/compiler/cfileutl.pas
index 049bde3646..caaeb4f02f 100644
--- a/compiler/cfileutl.pas
+++ b/compiler/cfileutl.pas
@@ -23,7 +23,9 @@ unit cfileutl;
{$i fpcdefs.inc}
+{$ifndef DragonFly}
{$define usedircache}
+{$endif DragonFly}
interface
@@ -124,6 +126,7 @@ interface
function GetShortName(const n:TCmdStr):TCmdStr;
function maybequoted(const s:string):string;
function maybequoted(const s:ansistring):ansistring;
+ function maybequoted_for_script(const s:ansistring; quote_script: tscripttype):ansistring;
procedure InitFileUtils;
procedure DoneFileUtils;
@@ -140,7 +143,7 @@ interface
{ * Since native Amiga commands can't handle Unix-style relative paths used by the compiler,
and some GNU tools, Unix2AmigaPath is needed to handle such situations (KB) * }
-{$IF DEFINED(MORPHOS) OR DEFINED(AMIGA)}
+{$IFDEF HASAMIGA}
{ * PATHCONV is implemented in the Amiga/MorphOS system unit * }
{$NOTE TODO Amiga: implement PathConv() in System unit, which works with AnsiString}
function Unix2AmigaPath(path: ShortString): ShortString; external name 'PATHCONV';
@@ -187,7 +190,7 @@ implementation
DirCache : TDirectoryCache;
-{$IF NOT (DEFINED(MORPHOS) OR DEFINED(AMIGA))}
+{$IFNDEF HASAMIGA}
{ Stub function for Unix2Amiga Path conversion functionality, only available in
Amiga/MorphOS RTL. I'm open for better solutions. (KB) }
function Unix2AmigaPath(path: String): String;{$IFDEF USEINLINE}inline;{$ENDIF}
@@ -537,7 +540,7 @@ end;
{$if defined(unix)}
if (length(s)>0) and (s[1] in AllowDirectorySeparators) then
result:=true;
-{$elseif defined(amiga) or defined(morphos)}
+{$elseif defined(hasamiga)}
(* An Amiga path is absolute, if it has a volume/device name in it (contains ":"),
otherwise it's always a relative path, no matter if it starts with a directory
separator or not. (KB) *)
@@ -1077,7 +1080,7 @@ end;
currPath:=FixPath(ExpandFileName(currpath),false);
if (CurrentDir<>'') and (Copy(currPath,1,length(CurrentDir))=CurrentDir) then
begin
-{$if defined(amiga) and defined(morphos)}
+{$ifdef hasamiga}
currPath:= CurrentDir+Copy(currPath,length(CurrentDir)+1,length(currPath));
{$else}
currPath:= CurDirRelPath(source_info)+Copy(currPath,length(CurrentDir)+1,length(currPath));
diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas
index 473f673c8a..49a164effb 100644
--- a/compiler/cgobj.pas
+++ b/compiler/cgobj.pas
@@ -815,8 +815,15 @@ implementation
procedure tcg.translate_register(var reg : tregister);
+ var
+ rt: tregistertype;
begin
- rg[getregtype(reg)].translate_register(reg);
+ { Getting here without assigned rg is possible for an "assembler nostackframe"
+ function returning x87 float, compiler tries to translate NR_ST which is used for
+ result. }
+ rt:=getregtype(reg);
+ if assigned(rg[rt]) then
+ rg[rt].translate_register(reg);
end;
@@ -828,7 +835,8 @@ implementation
procedure tcg.a_reg_dealloc(list : TAsmList;r : tregister);
begin
- list.concat(tai_regalloc.dealloc(r,nil));
+ if (r<>NR_NO) then
+ list.concat(tai_regalloc.dealloc(r,nil));
end;
diff --git a/compiler/compiler.pas b/compiler/compiler.pas
index 45f29688e8..ad9278dab7 100644
--- a/compiler/compiler.pas
+++ b/compiler/compiler.pas
@@ -65,6 +65,9 @@ uses
{$ifdef android}
,i_android
{$endif android}
+{$ifdef aros}
+ ,i_aros
+{$endif}
{$ifdef atari}
,i_atari
{$endif atari}
diff --git a/compiler/compinnr.inc b/compiler/compinnr.inc
index e6059fb540..65515d1fd8 100644
--- a/compiler/compinnr.inc
+++ b/compiler/compinnr.inc
@@ -88,6 +88,7 @@ const
in_unbox_x_y = 78; { manage platforms: extract from class instance }
in_popcnt_x = 79;
in_aligned_x = 80;
+ in_setstring_x_y_z = 81;
{ Internal constant functions }
in_const_sqr = 100;
diff --git a/compiler/comprsrc.pas b/compiler/comprsrc.pas
index dbbc2f5827..1c3629140f 100644
--- a/compiler/comprsrc.pas
+++ b/compiler/comprsrc.pas
@@ -377,7 +377,7 @@ procedure TWinLikeResourceFile.Collect(const fn: ansistring);
begin
if fResScript=nil then
fResScript:=TScript.Create(fScriptName);
- fResScript.Add(MaybeQuoted(fn));
+ fResScript.Add(maybequoted_for_script(fn,script_fpcres));
inc(fCollectCount);
end;
diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas
index 4592094753..4d7cf22890 100644
--- a/compiler/dbgdwarf.pas
+++ b/compiler/dbgdwarf.pas
@@ -375,7 +375,7 @@ interface
procedure appendsym_property(list:TAsmList;sym:tpropertysym);override;
function symdebugname(sym:tsym): String; virtual;
- function symname(sym:tsym): String; virtual;
+ function symname(sym: tsym; manglename: boolean): String; virtual;
procedure append_visibility(vis: tvisibility);
procedure enum_membersyms_callback(p:TObject;arg:pointer);
@@ -931,10 +931,10 @@ implementation
begin
if not assigned(def.typesym) then
internalerror(200610011);
- def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)),AT_DATA);
- def.dwarf_ref_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym)),AT_DATA);
+ def.dwarf_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym, true)),AT_DATA);
+ def.dwarf_ref_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym, true)),AT_DATA);
if is_class_or_interface_or_dispinterface(def) or is_objectpascal_helper(def) then
- tobjectdef(def).dwarf_struct_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)),AT_DATA);
+ tobjectdef(def).dwarf_struct_lab:=current_asmdata.RefAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym, true)),AT_DATA);
def.dbg_state:=dbg_state_written;
end
else
@@ -945,10 +945,10 @@ implementation
(def.owner.symtabletype=globalsymtable) and
(def.owner.iscurrentunit) then
begin
- def.dwarf_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
- def.dwarf_ref_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
+ def.dwarf_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG',def.owner,symname(def.typesym, true)),AB_GLOBAL,AT_DATA);
+ def.dwarf_ref_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBGREF',def.owner,symname(def.typesym, true)),AB_GLOBAL,AT_DATA);
if is_class_or_interface_or_dispinterface(def) or is_objectpascal_helper(def) then
- tobjectdef(def).dwarf_struct_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym)),AB_GLOBAL,AT_DATA);
+ tobjectdef(def).dwarf_struct_lab:=current_asmdata.DefineAsmSymbol(make_mangledname('DBG2',def.owner,symname(def.typesym, true)),AB_GLOBAL,AT_DATA);
include(def.defstates,ds_dwarf_dbg_info_written);
end
else
@@ -1371,7 +1371,7 @@ implementation
{ base type such as byte/shortint/word/... }
if assigned(def.typesym) then
append_entry(DW_TAG_base_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_encoding,DW_FORM_data1,sign,
DW_AT_byte_size,DW_FORM_data1,fullbytesize])
else
@@ -1385,7 +1385,7 @@ implementation
{ to be always clipped to s32bit for some reason }
if assigned(def.typesym) then
append_entry(DW_TAG_subrange_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_lower_bound,signform,int64(def.low),
DW_AT_upper_bound,signform,int64(def.high)
])
@@ -1544,7 +1544,7 @@ implementation
if assigned(def.typesym) then
begin
append_entry(DW_TAG_base_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_encoding,DW_FORM_data1,DW_ATE_float,
DW_AT_byte_size,DW_FORM_data1,def.size
]);
@@ -1569,7 +1569,7 @@ implementation
{ we should use DW_ATE_signed_fixed, however it isn't supported yet by GDB (FK) }
if assigned(def.typesym) then
append_entry(DW_TAG_base_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_encoding,DW_FORM_data1,DW_ATE_signed,
DW_AT_byte_size,DW_FORM_data1,8
])
@@ -1581,7 +1581,7 @@ implementation
s64comp:
if assigned(def.typesym) then
append_entry(DW_TAG_base_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_encoding,DW_FORM_data1,DW_ATE_signed,
DW_AT_byte_size,DW_FORM_data1,8
])
@@ -1604,7 +1604,7 @@ implementation
begin
if assigned(def.typesym) then
append_entry(DW_TAG_enumeration_type,true,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_byte_size,DW_FORM_data1,def.size
])
else
@@ -1625,7 +1625,7 @@ implementation
if hp.value>def.maxval then
break;
append_entry(DW_TAG_enumerator,false,[
- DW_AT_name,DW_FORM_string,symname(hp)+#0,
+ DW_AT_name,DW_FORM_string,symname(hp, false)+#0,
DW_AT_const_value,DW_FORM_data4,hp.value
]);
finish_entry;
@@ -1668,7 +1668,7 @@ implementation
{ no known size, no known upper bound }
if assigned(def.typesym) then
append_entry(DW_TAG_array_type,true,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0
])
else
append_entry(DW_TAG_array_type,true,[]);
@@ -1685,7 +1685,7 @@ implementation
size:=def.size;
if assigned(def.typesym) then
append_entry(DW_TAG_array_type,true,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_byte_size,DW_FORM_udata,size
])
else
@@ -1867,7 +1867,7 @@ implementation
begin
if assigned(def.typesym) then
append_entry(DW_TAG_subroutine_type,true,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_prototyped,DW_FORM_flag,true
])
else
@@ -1882,7 +1882,7 @@ implementation
for i:=0 to def.paras.count-1 do
begin
append_entry(DW_TAG_formal_parameter,false,[
- DW_AT_name,DW_FORM_string,symname(tsym(def.paras[i]))+#0
+ DW_AT_name,DW_FORM_string,symname(tsym(def.paras[i]), false)+#0
]);
append_labelentry_ref(DW_AT_type,def_dwarf_lab(tparavarsym(def.paras[i]).vardef));
finish_entry;
@@ -2017,7 +2017,7 @@ implementation
begin
current_asmdata.getaddrlabel(TAsmLabel(pointer(labsym)));
append_entry(DW_TAG_typedef,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0
]);
append_labelentry_ref(DW_AT_type,labsym);
finish_entry;
@@ -2114,7 +2114,7 @@ implementation
current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Procdef '+def.fullprocname(true))));
if not is_objc_class_or_protocol(def.struct) then
append_entry(DW_TAG_subprogram,true,
- [DW_AT_name,DW_FORM_string,symname(def.procsym)+#0
+ [DW_AT_name,DW_FORM_string,symname(def.procsym, false)+#0
{ data continues below }
{ problem: base reg isn't known here
DW_AT_frame_base,DW_FORM_block1,1
@@ -2318,7 +2318,7 @@ implementation
procedure TDebugInfoDwarf.appendsym_var(list:TAsmList;sym:tabstractnormalvarsym);
begin
- appendsym_var_with_name_type_offset(list,sym,symname(sym),sym.vardef,0,[]);
+ appendsym_var_with_name_type_offset(list,sym,symname(sym, false),sym.vardef,0,[]);
end;
@@ -2404,7 +2404,12 @@ implementation
if (vo_is_thread_var in sym.varoptions) then
begin
{ TODO: !!! FIXME: dwarf for thread vars !!!}
- blocksize:=0;
+{ This is only a minimal change to at least be able to get a value
+ in only one thread is present PM 2014-11-21, like for stabs format }
+ templist.concat(tai_const.create_8bit(ord(DW_OP_addr)));
+ templist.concat(tai_const.Create_type_name(aitconst_ptr,sym.mangledname,
+ offset+sizeof(pint)));
+ blocksize:=1+sizeof(puint);
end
else
begin
@@ -2554,7 +2559,7 @@ implementation
procedure TDebugInfoDwarf.appendsym_fieldvar(list:TAsmList;sym: tfieldvarsym);
begin
- appendsym_fieldvar_with_name_offset(list,sym,symname(sym),sym.vardef,0);
+ appendsym_fieldvar_with_name_offset(list,sym,symname(sym, false),sym.vardef,0);
end;
@@ -2601,7 +2606,7 @@ implementation
if (target_info.endian=endian_little) then
bitoffset:=(fieldnatsize*8)-bitoffset-sym.vardef.packedbitsize;
append_entry(DW_TAG_member,false,[
- DW_AT_name,DW_FORM_string,symname(sym)+#0,
+ DW_AT_name,DW_FORM_string,symname(sym, false)+#0,
{ gcc also generates both a bit and byte size attribute }
{ we don't support ordinals >= 256 bits }
DW_AT_byte_size,DW_FORM_data1,fieldnatsize,
@@ -2642,7 +2647,7 @@ implementation
if ismember then
append_entry(DW_TAG_member,false,[
- DW_AT_name,DW_FORM_string,symname(sym)+#0,
+ DW_AT_name,DW_FORM_string,symname(sym, false)+#0,
{ The DW_AT_declaration tag is invalid according to the DWARF specifications.
But gcc adds this to static const members and gdb checks
for this flag. So we have to set it also.
@@ -2652,7 +2657,7 @@ implementation
])
else
append_entry(DW_TAG_variable,false,[
- DW_AT_name,DW_FORM_string,symname(sym)+#0
+ DW_AT_name,DW_FORM_string,symname(sym, false)+#0
]);
{ for string constants, constdef isn't set because they have no real type }
case sym.consttyp of
@@ -2821,10 +2826,10 @@ implementation
begin
if (tosym.typ=fieldvarsym) then
internalerror(2009031404);
- appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),sym.propdef,offset,[])
+ appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym, false),sym.propdef,offset,[])
end
else
- appendsym_fieldvar_with_name_offset(list,tfieldvarsym(tosym),symname(sym),sym.propdef,offset)
+ appendsym_fieldvar_with_name_offset(list,tfieldvarsym(tosym),symname(sym, false),sym.propdef,offset)
end;
@@ -2883,7 +2888,7 @@ implementation
flags:=[];
if (sym.owner.symtabletype=localsymtable) then
include(flags,dvf_force_local_var);
- appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),tabstractvarsym(sym).vardef,offset,flags);
+ appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym, false),tabstractvarsym(sym).vardef,offset,flags);
end;
templist.free;
exit;
@@ -2893,7 +2898,7 @@ implementation
end;
append_entry(DW_TAG_variable,false,[
- DW_AT_name,DW_FORM_string,symname(sym)+#0,
+ DW_AT_name,DW_FORM_string,symname(sym, false)+#0,
{
DW_AT_decl_file,DW_FORM_data1,0,
DW_AT_decl_line,DW_FORM_data1,
@@ -2914,7 +2919,7 @@ implementation
procedure TDebugInfoDwarf.beforeappendsym(list:TAsmList;sym:tsym);
begin
- current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Symbol '+symname(sym))));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Symbol '+symname(sym, true))));
end;
@@ -3270,7 +3275,7 @@ implementation
end;
- function TDebugInfoDwarf.symname(sym: tsym): String;
+ function TDebugInfoDwarf.symname(sym: tsym; manglename: boolean): String;
begin
if (sym.typ=paravarsym) and
(vo_is_self in tparavarsym(sym).varoptions) then
@@ -3290,9 +3295,20 @@ implementation
else if (ds_dwarf_method_class_prefix in current_settings.debugswitches) and
(sym.typ=procsym) and
(tprocsym(sym).owner.symtabletype in [objectsymtable,recordsymtable]) then
- result:=tprocsym(sym).owner.name^+'__'+symdebugname(sym)
+ begin
+ result:=tprocsym(sym).owner.name^+'__';
+ if manglename then
+ result := result + sym.name
+ else
+ result := result + symdebugname(sym);
+ end
else
- result:=symdebugname(sym);
+ begin
+ if manglename then
+ result := sym.name
+ else
+ result := symdebugname(sym);
+ end;
end;
@@ -3316,6 +3332,7 @@ implementation
currfileinfo,
lastfileinfo : tfileposinfo;
currfuncname : pshortstring;
+ currstatement: boolean;
currsectype : TAsmSectiontype;
hp, hpend : tai;
infile : tinputfile;
@@ -3334,6 +3351,7 @@ implementation
currfuncname:=nil;
currsectype:=sec_code;
hp:=Tai(list.first);
+ currstatement:=true;
prevcolumn := 0;
prevline := 1;
prevfileidx := 1;
@@ -3365,8 +3383,7 @@ implementation
end;
if (currsectype=sec_code) and
- (hp.typ=ait_instruction) and
- (nolineinfolevel=0) then
+ (hp.typ=ait_instruction) then
begin
currfileinfo:=tailineinfo(hp).fileinfo;
{ file changed ? (must be before line info) }
@@ -3397,8 +3414,12 @@ implementation
end;
end;
+ { Set the line-nr to 0 if the code does not corresponds to a particular line }
+ if nolineinfolevel>0 then
+ currfileinfo.line := 0;
+
{ line changed ? }
- if (lastfileinfo.line<>currfileinfo.line) and (currfileinfo.line<>0) then
+ if (lastfileinfo.line<>currfileinfo.line) and ((currfileinfo.line<>0) or (nolineinfolevel>0)) then
begin
{ set address }
current_asmdata.getlabel(currlabel, alt_dbgline);
@@ -3431,6 +3452,19 @@ implementation
prevcolumn := currfileinfo.column;
end;
+ { set statement }
+ if (currfileinfo.line=0) and currstatement then
+ begin
+ currstatement := false;
+ asmline.concat(tai_const.create_8bit(DW_LNS_negate_stmt));
+ end;
+
+ if not currstatement and (currfileinfo.line>0) then
+ begin
+ currstatement := true;
+ asmline.concat(tai_const.create_8bit(DW_LNS_negate_stmt));
+ end;
+
{ set line }
diffline := currfileinfo.line - prevline;
if (diffline >= LINE_BASE) and (OPCODE_BASE + diffline - LINE_BASE <= 255) then
@@ -3517,7 +3551,7 @@ implementation
file recs. are less than 1k so using data2 is enough }
if assigned(def.typesym) then
append_entry(DW_TAG_structure_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_byte_size,DW_FORM_udata,def.size
])
else
@@ -3660,7 +3694,7 @@ implementation
if assigned(def.typesym) then
append_entry(DW_TAG_set_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_byte_size,DW_FORM_data2,def.size
])
else
@@ -3696,7 +3730,7 @@ implementation
{ info of modules that contain set tags }
if assigned(def.typesym) then
append_entry(DW_TAG_base_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_encoding,DW_FORM_data1,DW_ATE_unsigned,
DW_AT_byte_size,DW_FORM_data2,def.size
])
@@ -3764,7 +3798,7 @@ implementation
if assigned(def.typesym) then
append_entry(DW_TAG_array_type,true,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_data_location,DW_FORM_block1,2
])
else
@@ -3935,7 +3969,7 @@ implementation
begin
if assigned(def.typesym) then
append_entry(DW_TAG_file_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0,
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0,
DW_AT_byte_size,DW_FORM_data2,def.size
])
else
@@ -4073,7 +4107,7 @@ implementation
{ ??? can a undefined def have a typename ? }
if assigned(def.typesym) then
append_entry(DW_TAG_unspecified_type,false,[
- DW_AT_name,DW_FORM_string,symname(def.typesym)+#0
+ DW_AT_name,DW_FORM_string,symname(def.typesym, false)+#0
])
else
append_entry(DW_TAG_unspecified_type,false,[
diff --git a/compiler/dbgstabs.pas b/compiler/dbgstabs.pas
index d2c5c48b74..325ef21abe 100644
--- a/compiler/dbgstabs.pas
+++ b/compiler/dbgstabs.pas
@@ -1408,20 +1408,16 @@ implementation
if target_info.system in systems_dotted_function_names then
mangledname:='.'+mangledname;
// LBRAC
- ss:=tostr(STABS_N_LBRAC)+',0,0,'+mangledname;
- if not(af_stabs_use_function_absolute_addresses in target_asm.flags) then
- begin
- ss:=ss+'-';
- ss:=ss+mangledname;
- end;
+ if af_stabs_use_function_absolute_addresses in target_asm.flags then
+ ss:=tostr(STABS_N_LBRAC)+',0,0,'+mangledname
+ else
+ ss:=tostr(STABS_N_LBRAC)+',0,0,0';
result.concat(Tai_stab.Create_ansistr(stab_stabn,ss));
+
// RBRAC
ss:=tostr(STABS_N_RBRAC)+',0,0,'+stabsendlabel.name;
if not(af_stabs_use_function_absolute_addresses in target_asm.flags) then
- begin
- ss:=ss+'-';
- ss:=ss+mangledname;
- end;
+ ss:=ss+'-'+mangledname;
result.concat(Tai_stab.Create_ansistr(stab_stabn,ss));
{ the stabsendlabel must come after all other stabs for this }
diff --git a/compiler/defutil.pas b/compiler/defutil.pas
index 60b58e4188..79eb223413 100644
--- a/compiler/defutil.pas
+++ b/compiler/defutil.pas
@@ -334,21 +334,6 @@ interface
{ returns true if def is a C "block" }
function is_block(def: tdef): boolean;
- {# returns the appropriate int type for pointer arithmetic with the given pointer type.
- When adding or subtracting a number to/from a pointer, this function returns the
- int type to which that number has to be converted, before the operation can be performed.
- Normally, this is sinttype, except on i8086, where it takes into account the
- special i8086 pointer types (near, far, huge). }
- function get_int_type_for_pointer_arithmetic(p : tdef) : tdef;
-
-{$ifdef i8086}
- {# Returns true if p is a far pointer def }
- function is_farpointer(p : tdef) : boolean;
-
- {# Returns true if p is a huge pointer def }
- function is_hugepointer(p : tdef) : boolean;
-{$endif i8086}
-
implementation
uses
@@ -1449,29 +1434,4 @@ implementation
result:=(def.typ=procvardef) and (po_is_block in tprocvardef(def).procoptions)
end;
-
- function get_int_type_for_pointer_arithmetic(p : tdef) : tdef;
- begin
-{$ifdef i8086}
- if is_hugepointer(p) then
- result:=s32inttype
- else
-{$endif i8086}
- result:=sinttype;
- end;
-
-{$ifdef i8086}
- { true if p is a far pointer def }
- function is_farpointer(p : tdef) : boolean;
- begin
- result:=(p.typ=pointerdef) and (tcpupointerdef(p).x86pointertyp=x86pt_far);
- end;
-
- { true if p is a huge pointer def }
- function is_hugepointer(p : tdef) : boolean;
- begin
- result:=(p.typ=pointerdef) and (tcpupointerdef(p).x86pointertyp=x86pt_huge);
- end;
-{$endif i8086}
-
end.
diff --git a/compiler/expunix.pas b/compiler/expunix.pas
index 06e95c7b7d..be85f2e009 100644
--- a/compiler/expunix.pas
+++ b/compiler/expunix.pas
@@ -154,7 +154,7 @@ begin
current_asmdata.asmlists[al_procedures].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
if (cs_create_pic in current_settings.moduleswitches) and
{ other targets need to be checked how it works }
- (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris,system_i386_android]) then
+ (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris,system_i386_android,system_x86_64_dragonfly]) then
begin
{$ifdef x86}
sym:=current_asmdata.RefAsmSymbol(pd.mangledname);
diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas
index 2404f478ed..1146f3924d 100644
--- a/compiler/fmodule.pas
+++ b/compiler/fmodule.pas
@@ -44,7 +44,7 @@ interface
uses
cutils,cclasses,cfileutl,
globtype,finput,ogbase,
- symbase,symsym,
+ symbase,symconst,symsym,symcpu,
wpobase,
aasmbase,aasmtai,aasmdata;
@@ -142,7 +142,7 @@ interface
checkforwarddefs,
deflist,
symlist : TFPObjectList;
- ptrdefs : THashSet; { list of pointerdefs created in this module so we can reuse them (not saved/restored) }
+ ptrdefs : tPtrDefHashSet; { list of pointerdefs created in this module so we can reuse them (not saved/restored) }
arraydefs : THashSet; { list of single-element-arraydefs created in this module so we can reuse them (not saved/restored) }
ansistrdef : tobject; { an ansistring def redefined for the current module }
wpoinfo : tunitwpoinfobase; { whole program optimization-related information that is generated during the current run for this unit }
@@ -567,7 +567,7 @@ implementation
derefdataintflen:=0;
deflist:=TFPObjectList.Create(false);
symlist:=TFPObjectList.Create(false);
- ptrdefs:=THashSet.Create(64,true,false);
+ ptrdefs:=cPtrDefHashSet.Create;
arraydefs:=THashSet.Create(64,true,false);
ansistrdef:=nil;
wpoinfo:=nil;
@@ -744,7 +744,7 @@ implementation
symlist.free;
symlist:=TFPObjectList.Create(false);
ptrdefs.free;
- ptrdefs:=THashSet.Create(64,true,false);
+ ptrdefs:=cPtrDefHashSet.Create;
arraydefs.free;
arraydefs:=THashSet.Create(64,true,false);
wpoinfo.free;
diff --git a/compiler/fppu.pas b/compiler/fppu.pas
index 82638fdb01..bb2077dac3 100644
--- a/compiler/fppu.pas
+++ b/compiler/fppu.pas
@@ -836,7 +836,13 @@ var
end;
end
else
- temp:=' not available';
+ begin
+ { still register the source module for proper error messages
+ since source_avail for the module is still false, this should not hurt }
+ sourcefiles.register_file(tdosinputfile.create(hs));
+
+ temp:=' not available';
+ end;
if is_main then
begin
mainsource:=hs;
diff --git a/compiler/generic/cpuinfo.pas b/compiler/generic/cpuinfo.pas
index 28b762da7b..c864c8032b 100644
--- a/compiler/generic/cpuinfo.pas
+++ b/compiler/generic/cpuinfo.pas
@@ -22,6 +22,13 @@ Interface
Type
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+{$ifdef FPC_HAS_TYPE_EXTENDED}
+ bestrealrec = TExtended80Rec;
+{$else}
+ bestrealrec = TDoubleRec;
+{$endif}
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = type extended;
@@ -42,7 +49,24 @@ Type
fpu_soft
);
+ tcontrollertype =
+ (ct_none
+ );
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
cputypestr : array[tcputype] of string[8] = ('none');
fputypestr : array[tfputype] of string[6] = ('none','soft');
diff --git a/compiler/globals.pas b/compiler/globals.pas
index 6c2bc91a9f..47abece55c 100644
--- a/compiler/globals.pas
+++ b/compiler/globals.pas
@@ -41,7 +41,6 @@ interface
{$ELSE}
fksysutl,
{$ENDIF}
-
{ comphook pulls in sysutils anyways }
cutils,cclasses,cfileutl,
cpuinfo,
@@ -52,7 +51,7 @@ interface
[m_delphi,m_class,m_objpas,m_result,m_string_pchar,
m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
m_out,m_default_para,m_duplicate_names,m_hintdirective,
- m_property,m_default_inline,m_except,m_advanced_records];
+ m_property,m_default_inline,m_except,m_advanced_records,m_type_helpers];
delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring];
fpcmodeswitches =
[m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,
@@ -84,23 +83,23 @@ interface
treelogfilename = 'tree.log';
{$if defined(CPUARM) and defined(FPUFPA)}
- MathQNaN : tdoublerec = (bytes : (0,0,252,255,0,0,0,0));
- MathInf : tdoublerec = (bytes : (0,0,240,127,0,0,0,0));
- MathNegInf : tdoublerec = (bytes : (0,0,240,255,0,0,0,0));
- MathPi : tdoublerec = (bytes : (251,33,9,64,24,45,68,84));
+ MathQNaN : tcompdoublerec = (bytes : (0,0,252,255,0,0,0,0));
+ MathInf : tcompdoublerec = (bytes : (0,0,240,127,0,0,0,0));
+ MathNegInf : tcompdoublerec = (bytes : (0,0,240,255,0,0,0,0));
+ MathPi : tcompdoublerec = (bytes : (251,33,9,64,24,45,68,84));
{$else}
{$ifdef FPC_LITTLE_ENDIAN}
- MathQNaN : tdoublerec = (bytes : (0,0,0,0,0,0,252,255));
- MathInf : tdoublerec = (bytes : (0,0,0,0,0,0,240,127));
- MathNegInf : tdoublerec = (bytes : (0,0,0,0,0,0,240,255));
- MathPi : tdoublerec = (bytes : (24,45,68,84,251,33,9,64));
- MathPiExtended : textendedrec = (bytes : (53,194,104,33,162,218,15,201,0,64));
+ MathQNaN : tcompdoublerec = (bytes : (0,0,0,0,0,0,252,255));
+ MathInf : tcompdoublerec = (bytes : (0,0,0,0,0,0,240,127));
+ MathNegInf : tcompdoublerec = (bytes : (0,0,0,0,0,0,240,255));
+ MathPi : tcompdoublerec = (bytes : (24,45,68,84,251,33,9,64));
+ MathPiExtended : tcompextendedrec = (bytes : (53,194,104,33,162,218,15,201,0,64));
{$else FPC_LITTLE_ENDIAN}
- MathQNaN : tdoublerec = (bytes : (255,252,0,0,0,0,0,0));
- MathInf : tdoublerec = (bytes : (127,240,0,0,0,0,0,0));
- MathNegInf : tdoublerec = (bytes : (255,240,0,0,0,0,0,0));
- MathPi : tdoublerec = (bytes : (64,9,33,251,84,68,45,24));
- MathPiExtended : textendedrec = (bytes : (64,0,201,15,218,162,33,104,194,53));
+ MathQNaN : tcompdoublerec = (bytes : (255,252,0,0,0,0,0,0));
+ MathInf : tcompdoublerec = (bytes : (127,240,0,0,0,0,0,0));
+ MathNegInf : tcompdoublerec = (bytes : (255,240,0,0,0,0,0,0));
+ MathPi : tcompdoublerec = (bytes : (64,9,33,251,84,68,45,24));
+ MathPiExtended : tcompextendedrec = (bytes : (64,0,201,15,218,162,33,104,194,53));
{$endif FPC_LITTLE_ENDIAN}
{$endif}
@@ -163,9 +162,8 @@ interface
{$endif defined(ARM)}
{ CPU targets with microcontroller support can add a controller specific unit }
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
controllertype : tcontrollertype;
-{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)}
+
{ WARNING: this pointer cannot be written as such in record token }
pmessage : pmessagestaterecord;
end;
@@ -238,7 +236,9 @@ interface
paralinkoptions : TCmdStr;
paradynamiclinker : string;
paraprintnodetree : byte;
+{$ifdef PREPROCWRITE}
parapreprocess : boolean;
+{$endif PREPROCWRITE}
printnodefile : text;
{ typical cross compiling params}
@@ -411,7 +411,7 @@ interface
{$endif i8086}
maxfpuregisters : 0;
-{ Note: GENERIC_CPU is sued together with generic subdirectory to
+{ Note: GENERIC_CPU is used together with generic subdirectory to
be able to compile some of the units without any real CPU.
This is used to generate a CPU independant PPUDUMP utility. PM }
{$ifdef GENERIC_CPU}
@@ -502,9 +502,7 @@ interface
{$if defined(ARM)}
instructionset : is_arm;
{$endif defined(ARM)}
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
controllertype : ct_none;
-{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)}
pmessage : nil;
);
@@ -536,9 +534,7 @@ interface
function Setoptimizecputype(const s:string;var a:tcputype):boolean;
function Setcputype(const s:string;var a:tsettings):boolean;
function SetFpuType(const s:string;var a:tfputype):boolean;
-{$if defined(arm) or defined(avr) or defined(mipsel)}
function SetControllerType(const s:string;var a:tcontrollertype):boolean;
-{$endif defined(arm) or defined(avr) or defined(mipsel)}
function IncludeFeature(const s : string) : boolean;
function SetMinFPConstPrec(const s: string; var a: tfloattype) : boolean;
@@ -838,6 +834,13 @@ implementation
Replace(s,'$FPCTARGET',target_os_string)
else
Replace(s,'$FPCTARGET',target_full_string);
+ Replace(s,'$FPCSUBARCH',lower(cputypestr[init_settings.cputype]));
+ Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name));
+{$ifdef i8086}
+ Replace(s,'$FPCMEMORYMODEL',lower(x86memorymodelstr[init_settings.x86memorymodel]));
+{$else i8086}
+ Replace(s,'$FPCMEMORYMODEL','flat');
+{$endif i8086}
{$ifdef mswindows}
ReplaceSpecialFolder('$LOCAL_APPDATA',CSIDL_LOCAL_APPDATA);
ReplaceSpecialFolder('$APPDATA',CSIDL_APPDATA);
@@ -968,7 +971,7 @@ implementation
result := -1;
end;
- function convertdoublerec(d : tdoublerec) : tdoublerec;{$ifdef USEINLINE}inline;{$endif}
+ function convertdoublerec(d : tcompdoublerec) : tcompdoublerec;{$ifdef USEINLINE}inline;{$endif}
{$ifdef CPUARM}
var
i : longint;
@@ -1177,23 +1180,34 @@ implementation
end;
-{$if defined(arm) or defined(avr) or defined(mipsel)}
function SetControllerType(const s:string;var a:tcontrollertype):boolean;
var
t : tcontrollertype;
hs : string;
begin
- result:=false;
- hs:=Upper(s);
- for t:=low(tcontrollertype) to high(tcontrollertype) do
- if embedded_controllers[t].controllertypestr=hs then
- begin
- a:=t;
- result:=true;
- break;
- end;
+{ The following check allows to reduce amount of code for platforms }
+{ not supporting microcontrollers due to evaluation at compile time. }
+{$PUSH}
+ {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
+ if ControllerSupport then
+ begin
+ result:=false;
+ hs:=Upper(s);
+ for t:=low(tcontrollertype) to high(tcontrollertype) do
+ if embedded_controllers[t].controllertypestr=hs then
+ begin
+ a:=t;
+ result:=true;
+ break;
+ end;
+ end
+ else
+ begin
+ a := ct_none;
+ Result := true;
+ end;
+{$POP}
end;
-{$endif defined(arm) or defined(avr) or defined(mipsel)}
function IncludeFeature(const s : string) : boolean;
diff --git a/compiler/globtype.pas b/compiler/globtype.pas
index 95efa1b07f..f0f9249b2b 100644
--- a/compiler/globtype.pas
+++ b/compiler/globtype.pas
@@ -110,12 +110,12 @@ interface
{$endif i8086}
{ Use a variant record to be sure that the array if aligned correctly }
- tdoublerec=record
+ tcompdoublerec=record
case byte of
0 : (bytes:array[0..7] of byte);
1 : (value:double);
end;
- textendedrec=record
+ tcompextendedrec=record
case byte of
0 : (bytes:array[0..9] of byte);
1 : (value:extended);
@@ -707,6 +707,14 @@ interface
type
tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge);
+ const
+ x86memorymodelstr : array[tx86memorymodel] of string[7]=(
+ 'TINY',
+ 'SMALL',
+ 'MEDIUM',
+ 'COMPACT',
+ 'LARGE',
+ 'HUGE');
{ hide Sysutils.ExecuteProcess in units using this one after SysUtils}
const
diff --git a/compiler/hlcg2ll.pas b/compiler/hlcg2ll.pas
index 2d2e6e39cf..6d50fd9d14 100644
--- a/compiler/hlcg2ll.pas
+++ b/compiler/hlcg2ll.pas
@@ -656,6 +656,7 @@ implementation
internalerror(2012071226);
tocgsize:=getintmmcgsize(reg,def_cgmmsize(tosize));
case loc.loc of
+ LOC_CONSTANT,
LOC_SUBSETREG,LOC_CSUBSETREG,
LOC_SUBSETREF,LOC_CSUBSETREF:
begin
diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas
index 8296712769..2d93bc4ec3 100644
--- a/compiler/htypechk.pas
+++ b/compiler/htypechk.pas
@@ -26,7 +26,7 @@ unit htypechk;
interface
uses
- cclasses,tokens,cpuinfo,
+ cclasses,cmsgs,tokens,cpuinfo,
node,globtype,
symconst,symtype,symdef,symsym,symbase;
@@ -178,6 +178,8 @@ interface
arrays, records and objects are checked recursively }
function is_valid_for_default(def:tdef):boolean;
+ procedure UninitializedVariableMessage(pos : tfileposinfo;warning,local,managed : boolean;name : TMsgStr);
+
implementation
uses
@@ -1092,6 +1094,23 @@ implementation
end;
+ procedure UninitializedVariableMessage(pos : tfileposinfo;warning,local,managed : boolean;name : TMsgStr);
+ const
+ msg : array[false..true,false..true,false..true] of dword = (
+ (
+ (sym_h_uninitialized_variable,sym_h_uninitialized_managed_variable),
+ (sym_h_uninitialized_local_variable,sym_h_uninitialized_managed_local_variable)
+ ),
+ (
+ (sym_w_uninitialized_variable,sym_w_uninitialized_managed_variable),
+ (sym_w_uninitialized_local_variable,sym_w_uninitialized_managed_local_variable)
+ )
+ );
+ begin
+ CGMessagePos1(pos,msg[warning,local,managed],name);
+ end;
+
+
procedure set_varstate(p:tnode;newstate:tvarstate;varstateflags:tvarstateflags);
const
vstrans: array[tvarstate,tvarstate] of tvarstate = (
@@ -1197,32 +1216,29 @@ implementation
if (vo_is_funcret in hsym.varoptions) then
begin
if (vsf_use_hints in varstateflags) then
- CGMessagePos(p.fileinfo,sym_h_function_result_uninitialized)
- else
- CGMessagePos(p.fileinfo,sym_w_function_result_uninitialized)
- end
- else
- begin
- if tloadnode(p).symtable.symtabletype=localsymtable then
begin
- { on the JVM, an uninitialized var-parameter
- is just as fatal as a nil pointer dereference }
- if (vsf_use_hints in varstateflags) and
- not(target_info.system in systems_jvm) then
- CGMessagePos1(p.fileinfo,sym_h_uninitialized_local_variable,hsym.realname)
+ if is_managed_type(hsym.vardef) then
+ CGMessagePos(p.fileinfo,sym_h_managed_function_result_uninitialized)
else
- CGMessagePos1(p.fileinfo,sym_w_uninitialized_local_variable,hsym.realname);
+ CGMessagePos(p.fileinfo,sym_h_function_result_uninitialized);
end
else
begin
- { on the JVM, an uninitialized var-parameter
- is just as fatal as a nil pointer dereference }
- if (vsf_use_hints in varstateflags) and
- not(target_info.system in systems_jvm) then
- CGMessagePos1(p.fileinfo,sym_h_uninitialized_variable,hsym.realname)
+ if is_managed_type(hsym.vardef) then
+ CGMessagePos(p.fileinfo,sym_w_managed_function_result_uninitialized)
else
- CGMessagePos1(p.fileinfo,sym_w_uninitialized_variable,hsym.realname);
+ CGMessagePos(p.fileinfo,sym_w_function_result_uninitialized);
end;
+ end
+ else
+ begin
+ UninitializedVariableMessage(p.fileinfo,
+ { on the JVM, an uninitialized var-parameter
+ is just as fatal as a nil pointer dereference }
+ not((vsf_use_hints in varstateflags) and not(target_info.system in systems_jvm)),
+ tloadnode(p).symtable.symtabletype=localsymtable,
+ is_managed_type(tloadnode(p).resultdef),
+ hsym.realname);
end;
end;
end
@@ -2227,7 +2243,7 @@ implementation
break;
end;
if is_objectpascal_helper(structdef) and
- (tobjectdef(structdef).typ in [recorddef,objectdef]) then
+ (tobjectdef(structdef).extendeddef.typ in [recorddef,objectdef]) then
begin
{ search methods in the extended type as well }
srsym:=tprocsym(tabstractrecorddef(tobjectdef(structdef).extendeddef).symtable.FindWithHash(hashedid));
@@ -2583,7 +2599,8 @@ implementation
def_to : tdef;
currpt,
pt : tcallparanode;
- eq : tequaltype;
+ eq,
+ mineq : tequaltype;
convtype : tconverttype;
pdtemp,
pdoper : tprocdef;
@@ -2763,6 +2780,30 @@ implementation
eq:=compare_defs_ext(n.resultdef,def_to,n.nodetype,convtype,pdoper,cdoptions);
n.free;
end
+ else if is_open_array(def_to) and
+ is_class_or_interface_or_dispinterface_or_objc_or_java(tarraydef(def_to).elementdef) and
+ is_array_constructor(currpt.left.resultdef) and
+ assigned(tarrayconstructornode(currpt.left).left) then
+ begin
+ { ensure that [nil] can be converted to "array of tobject",
+ because if we just try to convert "array of pointer" to
+ "array of tobject", we get type conversion errors in
+ non-Delphi modes }
+ n:=currpt.left;
+ mineq:=te_exact;
+ repeat
+ if tarrayconstructornode(n).left.nodetype=arrayconstructorrangen then
+ eq:=te_incompatible
+ else
+ eq:=compare_defs_ext(tarrayconstructornode(n).left.resultdef,tarraydef(def_to).elementdef,tarrayconstructornode(n).left.nodetype,convtype,pdoper,cdoptions);
+ if eq<mineq then
+ mineq:=eq;
+ if eq=te_incompatible then
+ break;
+ n:=tarrayconstructornode(n).right;
+ until not assigned(n);
+ eq:=mineq;
+ end
else
{ generic type comparision }
begin
diff --git a/compiler/i386/cgcpu.pas b/compiler/i386/cgcpu.pas
index 21e715860c..de73fc0b05 100644
--- a/compiler/i386/cgcpu.pas
+++ b/compiler/i386/cgcpu.pas
@@ -314,6 +314,13 @@ unit cgcpu;
end;
begin
+ { Release PIC register }
+ if (cs_create_pic in current_settings.moduleswitches) and
+ (tf_pic_uses_got in target_info.flags) and
+ (pi_needs_got in current_procinfo.flags) and
+ not(target_info.system in systems_darwin) then
+ list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
+
{ MMX needs to call EMMS }
if assigned(rg[R_MMXREGISTER]) and
(rg[R_MMXREGISTER].uses_registers) then
diff --git a/compiler/i386/cpuelf.pas b/compiler/i386/cpuelf.pas
index f61e83f05a..fd171e3ed0 100644
--- a/compiler/i386/cpuelf.pas
+++ b/compiler/i386/cpuelf.pas
@@ -509,7 +509,7 @@ implementation
system_i386_openbsd,system_i386_netbsd,
system_i386_Netware,system_i386_netwlibc,
system_i386_solaris,system_i386_embedded,
- system_i386_android];
+ system_i386_android,system_i386_aros];
flags : [af_outputbinary,af_smartlink_sections,af_supports_dwarf];
labelprefix : '.L';
comment : '';
diff --git a/compiler/i386/cpuinfo.pas b/compiler/i386/cpuinfo.pas
index 97894c14ac..ced7496d15 100644
--- a/compiler/i386/cpuinfo.pas
+++ b/compiler/i386/cpuinfo.pas
@@ -30,6 +30,9 @@ Interface
Type
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TExtended80Rec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -66,8 +69,25 @@ Type
fpu_avx2
);
+ tcontrollertype =
+ (ct_none
+ );
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/i386/cpupara.pas b/compiler/i386/cpupara.pas
index 5cfed2c1dc..41b83a892c 100644
--- a/compiler/i386/cpupara.pas
+++ b/compiler/i386/cpupara.pas
@@ -114,6 +114,23 @@ unit cpupara;
end;
end;
end;
+ system_i386_os2,
+ system_i386_emx:
+ begin
+ case def.typ of
+ recorddef :
+ begin
+ { EMX port of GCC returns small records in the FUNCTION_RETURN_REG up to 4 bytes in registers. }
+ if ((pd.proccalloption in [pocall_cdecl,pocall_cppdecl]) and
+ (def.size>0) and
+ (def.size<=4)) then
+ begin
+ result:=false;
+ exit;
+ end;
+ end;
+ end;
+ end;
system_i386_freebsd,
system_i386_openbsd,
system_i386_darwin,
@@ -243,6 +260,7 @@ unit cpupara;
pocall_safecall,
pocall_stdcall,
pocall_cdecl,
+ pocall_syscall,
pocall_cppdecl,
pocall_mwpascal :
result:=[RS_EAX,RS_EDX,RS_ECX];
diff --git a/compiler/i386/cputarg.pas b/compiler/i386/cputarg.pas
index 64cd649c87..427cc1196b 100644
--- a/compiler/i386/cputarg.pas
+++ b/compiler/i386/cputarg.pas
@@ -86,6 +86,9 @@ implementation
{$ifndef NOTARGETEMBEDDED}
,t_embed
{$endif}
+ {$ifndef NOTARGETAROS}
+ ,t_aros
+ {$endif}
{**************************************
Assemblers
diff --git a/compiler/i386/n386add.pas b/compiler/i386/n386add.pas
index 3f42b639c8..b75b18d83d 100644
--- a/compiler/i386/n386add.pas
+++ b/compiler/i386/n386add.pas
@@ -229,8 +229,7 @@ interface
procedure ti386addnode.second_cmp64bit;
var
- hregister,
- hregister2 : tregister;
+ hlab : tasmlabel;
href : treference;
unsigned : boolean;
@@ -247,10 +246,12 @@ interface
case nodetype of
ltn,gtn:
begin
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
+ if (hlab<>current_procinfo.CurrTrueLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
{ cheat a little bit for the negative test }
toggleflag(nf_swapped);
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
+ if (hlab<>current_procinfo.CurrFalseLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
toggleflag(nf_swapped);
end;
lten,gten:
@@ -260,13 +261,15 @@ interface
nodetype:=ltn
else
nodetype:=gtn;
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
+ if (hlab<>current_procinfo.CurrTrueLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
{ cheat for the negative test }
if nodetype=ltn then
nodetype:=gtn
else
nodetype:=ltn;
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
+ if (hlab<>current_procinfo.CurrFalseLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
nodetype:=oldnodetype;
end;
equaln:
@@ -309,24 +312,46 @@ interface
((right.resultdef.typ=orddef) and
(torddef(right.resultdef).ordtype=u64bit));
+ { we have LOC_JUMP as result }
+ location_reset(location,LOC_JUMP,OS_NO);
+
+ { Relational compares against constants having low dword=0 can omit the
+ second compare based on the fact that any unsigned value is >=0 }
+ hlab:=nil;
+ if (right.location.loc=LOC_CONSTANT) and
+ (lo(right.location.value64)=0) then
+ begin
+ case getresflags(true) of
+ F_AE: hlab:=current_procinfo.CurrTrueLabel;
+ F_B: hlab:=current_procinfo.CurrFalseLabel;
+ end;
+ end;
+
+ if (right.location.loc=LOC_CONSTANT) and
+ (left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
+ begin
+ tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,left.location.reference);
+ href:=left.location.reference;
+ inc(href.offset,4);
+ emit_const_ref(A_CMP,S_L,aint(hi(right.location.value64)),href);
+ firstjmp64bitcmp;
+ if assigned(hlab) then
+ cg.a_jmp_always(current_asmdata.CurrAsmList,hlab)
+ else
+ begin
+ emit_const_ref(A_CMP,S_L,aint(lo(right.location.value64)),left.location.reference);
+ secondjmp64bitcmp;
+ end;
+ location_freetemp(current_asmdata.CurrAsmList,left.location);
+ exit;
+ end;
+
{ left and right no register? }
{ then one must be demanded }
- if (left.location.loc<>LOC_REGISTER) then
+ if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
begin
- if (right.location.loc<>LOC_REGISTER) then
- begin
- { we can reuse a CREGISTER for comparison }
- if (left.location.loc<>LOC_CREGISTER) then
- begin
- hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
- hregister2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
- cg64.a_load64_loc_reg(current_asmdata.CurrAsmList,left.location,joinreg64(hregister,hregister2));
- location_freetemp(current_asmdata.CurrAsmList,left.location);
- location_reset(left.location,LOC_REGISTER,left.location.size);
- left.location.register64.reglo:=hregister;
- left.location.register64.reghi:=hregister2;
- end;
- end
+ if not (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true)
else
begin
location_swap(left.location,right.location);
@@ -334,51 +359,44 @@ interface
end;
end;
- { at this point, left.location.loc should be LOC_REGISTER }
- if right.location.loc=LOC_REGISTER then
- begin
- emit_reg_reg(A_CMP,S_L,right.location.register64.reghi,left.location.register64.reghi);
- firstjmp64bitcmp;
- emit_reg_reg(A_CMP,S_L,right.location.register64.reglo,left.location.register64.reglo);
- secondjmp64bitcmp;
- end
+ { at this point, left.location.loc should be LOC_[C]REGISTER }
+ case right.location.loc of
+ LOC_REGISTER,
+ LOC_CREGISTER :
+ begin
+ emit_reg_reg(A_CMP,S_L,right.location.register64.reghi,left.location.register64.reghi);
+ firstjmp64bitcmp;
+ emit_reg_reg(A_CMP,S_L,right.location.register64.reglo,left.location.register64.reglo);
+ secondjmp64bitcmp;
+ end;
+ LOC_CREFERENCE,
+ LOC_REFERENCE :
+ begin
+ tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,right.location.reference);
+ href:=right.location.reference;
+ inc(href.offset,4);
+ emit_ref_reg(A_CMP,S_L,href,left.location.register64.reghi);
+ firstjmp64bitcmp;
+ emit_ref_reg(A_CMP,S_L,right.location.reference,left.location.register64.reglo);
+ secondjmp64bitcmp;
+ location_freetemp(current_asmdata.CurrAsmList,right.location);
+ end;
+ LOC_CONSTANT :
+ begin
+ current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(hi(right.location.value64)),left.location.register64.reghi));
+ firstjmp64bitcmp;
+ if assigned(hlab) then
+ cg.a_jmp_always(current_asmdata.CurrAsmList,hlab)
+ else
+ begin
+ current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(lo(right.location.value64)),left.location.register64.reglo));
+ secondjmp64bitcmp;
+ end;
+ end;
else
- begin
- case right.location.loc of
- LOC_CREGISTER :
- begin
- emit_reg_reg(A_CMP,S_L,right.location.register64.reghi,left.location.register64.reghi);
- firstjmp64bitcmp;
- emit_reg_reg(A_CMP,S_L,right.location.register64.reglo,left.location.register64.reglo);
- secondjmp64bitcmp;
- end;
- LOC_CREFERENCE,
- LOC_REFERENCE :
- begin
- tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,right.location.reference);
- href:=right.location.reference;
- inc(href.offset,4);
- emit_ref_reg(A_CMP,S_L,href,left.location.register64.reghi);
- firstjmp64bitcmp;
- emit_ref_reg(A_CMP,S_L,right.location.reference,left.location.register64.reglo);
- secondjmp64bitcmp;
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
- location_freetemp(current_asmdata.CurrAsmList,right.location);
- end;
- LOC_CONSTANT :
- begin
- current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(hi(right.location.value64)),left.location.register64.reghi));
- firstjmp64bitcmp;
- current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(lo(right.location.value64)),left.location.register64.reglo));
- secondjmp64bitcmp;
- end;
- else
- internalerror(200203282);
- end;
- end;
+ internalerror(200203282);
+ end;
- { we have LOC_JUMP as result }
- location_reset(location,LOC_JUMP,OS_NO)
end;
@@ -424,6 +442,8 @@ interface
begin
pass_left_right;
+ reg:=NR_NO;
+ reference_reset(ref,sizeof(pint));
{ Mul supports registers and references, so if not register/reference,
load the location into a register.
diff --git a/compiler/i386/n386cal.pas b/compiler/i386/n386cal.pas
index d032174611..052359c4c8 100644
--- a/compiler/i386/n386cal.pas
+++ b/compiler/i386/n386cal.pas
@@ -28,13 +28,16 @@ interface
{ $define AnsiStrRef}
uses
- nx86cal;
+ nx86cal,ncal;
type
ti386callnode = class(tx86callnode)
protected
+ procedure gen_syscall_para(para: tcallparanode); override;
procedure pop_parasize(pop_size:longint);override;
procedure extra_interrupt_code;override;
+ public
+ procedure do_syscall;override;
end;
@@ -46,7 +49,8 @@ implementation
cgbase,cgutils,
cpubase,paramgr,
aasmtai,aasmdata,aasmcpu,
- ncal,nbas,nmem,nld,ncnv,
+ nbas,nmem,nld,ncnv,
+ symdef,symsym,symcpu,
cga,cgobj,cpuinfo;
@@ -55,6 +59,36 @@ implementation
*****************************************************************************}
+ procedure ti386callnode.do_syscall;
+ var
+ tmpref: treference;
+ begin
+ case target_info.system of
+ system_i386_aros:
+ begin
+ // one syscall convention for AROS
+ current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('AROS SysCall')));
+ reference_reset(tmpref,sizeof(pint));
+ tmpref.symbol:=current_asmdata.RefAsmSymbol(tstaticvarsym(tcpuprocdef(procdefinition).libsym).mangledname);
+ cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,tmpref,NR_EAX);
+ reference_reset_base(tmpref,NR_EAX,-tprocdef(procdefinition).extnumber,sizeof(pint));
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,tmpref,NR_EAX);
+ cg.a_call_reg(current_asmdata.CurrAsmList,NR_EAX);
+ cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_EAX);
+ end;
+ else
+ internalerror(2014081801);
+ end;
+ end;
+
+
+ procedure ti386callnode.gen_syscall_para(para: tcallparanode);
+ begin
+ { lib parameter has no special type but proccalloptions must be a syscall }
+ para.left:=cloadnode.create(tcpuprocdef(procdefinition).libsym,tcpuprocdef(procdefinition).libsym.owner);
+ end;
+
procedure ti386callnode.extra_interrupt_code;
begin
if not(target_info.system in [system_i386_darwin,system_i386_iphonesim,system_i386_android]) then
diff --git a/compiler/i386/n386flw.pas b/compiler/i386/n386flw.pas
index dee3320a9d..624b35423b 100644
--- a/compiler/i386/n386flw.pas
+++ b/compiler/i386/n386flw.pas
@@ -316,6 +316,7 @@ procedure ti386tryfinallynode.pass_generate_code;
breakfinallylabel:=nil;
exceptlabel:=nil;
safecalllabel:=nil;
+ hreg:=NR_NO;
is_safecall:=implicitframe and (current_procinfo.procdef.proccalloption=pocall_safecall);
{ check if child nodes do a break/continue/exit }
@@ -489,6 +490,12 @@ procedure ti386tryexceptnode.pass_generate_code;
end;
location_reset(location,LOC_VOID,OS_NO);
+ exceptflowcontrol:=[];
+ breakexceptlabel:=nil;
+ continueexceptlabel:=nil;
+ breaktrylabel:=nil;
+ continuetrylabel:=nil;
+
oldflowcontrol:=flowcontrol;
flowcontrol:=[fc_inflowcontrol];
{ this can be called recursivly }
@@ -528,7 +535,7 @@ procedure ti386tryexceptnode.pass_generate_code;
{ start of scope }
if assigned(right) then
begin
- current_asmdata.getdatalabel(filterlabel);
+ current_asmdata.getaddrlabel(filterlabel);
emit_scope_start(
current_asmdata.RefAsmSymbol('__FPC_on_handler'),
filterlabel);
@@ -602,8 +609,7 @@ procedure ti386tryexceptnode.pass_generate_code;
begin
if hnode.nodetype<>onn then
InternalError(2011103101);
- { TODO: make it done without using global label }
- current_asmdata.getglobaljumplabel(onlabel);
+ current_asmdata.getjumplabel(onlabel);
hlist.concat(tai_const.create_sym(current_asmdata.RefAsmSymbol(tonnode(hnode).excepttype.vmt_mangledname,AT_DATA)));
hlist.concat(tai_const.create_sym(onlabel));
cg.a_label(current_asmdata.CurrAsmList,onlabel);
@@ -619,8 +625,7 @@ procedure ti386tryexceptnode.pass_generate_code;
inc(onnodecount.value);
end;
{ now move filter table to permanent list all at once }
- maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
- current_asmdata.asmlists[al_typedconsts].concatlist(hlist);
+ current_procinfo.aktlocaldata.concatlist(hlist);
hlist.free;
end;
diff --git a/compiler/i386/symcpu.pas b/compiler/i386/symcpu.pas
index 9fbc65bab5..6e4ab4bd78 100644
--- a/compiler/i386/symcpu.pas
+++ b/compiler/i386/symcpu.pas
@@ -26,7 +26,7 @@ unit symcpu;
interface
uses
- symtype,symdef,symsym,symx86,symi86;
+ symconst,symtype,symdef,symsym,symx86,symi86;
type
{ defs }
@@ -91,6 +91,15 @@ type
tcpuprocvardefclass = class of tcpuprocvardef;
tcpuprocdef = class(ti86procdef)
+ procedure ppuload_platform(ppufile: tcompilerppufile); override;
+ procedure ppuwrite_platform(ppufile: tcompilerppufile); override;
+ public
+ { library symbol for AROS }
+ libsym : tsym;
+ libsymderef : tderef;
+ function getcopyas(newtyp: tdeftyp; copytyp: tproccopytyp): tstoreddef; override;
+ procedure buildderef; override;
+ procedure deref; override;
end;
tcpuprocdefclass = class of tcpuprocdef;
@@ -170,6 +179,52 @@ const
implementation
+{****************************************************************************
+ tcpuprocdef
+****************************************************************************}
+
+ procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
+ begin
+ inherited;
+ if po_syscall_has_libsym in procoptions then
+ ppufile.getderef(libsymderef);
+ end;
+
+
+ procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
+ begin
+ inherited;
+ if po_syscall_has_libsym in procoptions then
+ ppufile.putderef(libsymderef);
+ end;
+
+
+ function tcpuprocdef.getcopyas(newtyp: tdeftyp; copytyp: tproccopytyp): tstoreddef;
+ begin
+ result:=inherited;
+ if newtyp=procdef then
+ tcpuprocdef(result).libsym:=libsym;
+ end;
+
+
+ procedure tcpuprocdef.buildderef;
+ begin
+ inherited;
+ if po_syscall_has_libsym in procoptions then
+ libsymderef.build(libsym);
+ end;
+
+
+ procedure tcpuprocdef.deref;
+ begin
+ inherited;
+ if po_syscall_has_libsym in procoptions then
+ libsym:=tsym(libsymderef.resolve)
+ else
+ libsym:=nil;
+ end;
+
+
begin
{ used tdef classes }
cfiledef:=tcpufiledef;
@@ -207,5 +262,7 @@ begin
cconstsym:=tcpuconstsym;
cenumsym:=tcpuenumsym;
csyssym:=tcpusyssym;
+
+ cPtrDefHashSet:=tx86PtrDefHashSet;
end.
diff --git a/compiler/i8086/cpuinfo.pas b/compiler/i8086/cpuinfo.pas
index d68369b947..ef971a94ad 100644
--- a/compiler/i8086/cpuinfo.pas
+++ b/compiler/i8086/cpuinfo.pas
@@ -30,6 +30,9 @@ Interface
Type
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TExtended80Rec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -66,8 +69,25 @@ Type
fpu_avx2
);
+ tcontrollertype =
+ (ct_none
+ );
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/i8086/n8086add.pas b/compiler/i8086/n8086add.pas
index bc1feed76b..d090b996f4 100644
--- a/compiler/i8086/n8086add.pas
+++ b/compiler/i8086/n8086add.pas
@@ -55,7 +55,7 @@ interface
uses
globtype,systems,
cutils,verbose,globals,constexp,pass_1,
- symconst,symdef,symtype,paramgr,defutil,
+ symconst,symdef,symtype,symcpu,paramgr,defutil,
aasmbase,aasmtai,aasmdata,aasmcpu,
cgbase,procinfo,
ncal,ncon,nset,cgutils,tgobj,
@@ -960,6 +960,9 @@ interface
asmops: array[boolean] of tasmop = (A_IMUL, A_MUL);
begin
+ reg:=NR_NO;
+ reference_reset(ref,sizeof(pint));
+
pass_left_right;
{ MUL is faster than IMUL on the 8086 & 8088 (and equal in speed on 286+),
diff --git a/compiler/i8086/n8086inl.pas b/compiler/i8086/n8086inl.pas
index e369f53c7f..cb7d08ed8c 100644
--- a/compiler/i8086/n8086inl.pas
+++ b/compiler/i8086/n8086inl.pas
@@ -37,6 +37,7 @@ interface
function first_seg: tnode; override;
procedure second_seg; override;
procedure second_get_frame;override;
+ function first_IncDec: tnode;override;
procedure second_incdec;override;
end;
@@ -51,10 +52,10 @@ implementation
symconst,
defutil,
aasmbase,aasmtai,aasmdata,aasmcpu,
- symtype,symdef,
- cgbase,pass_2,
+ symtype,symdef,symcpu,
+ cgbase,pass_1,pass_2,
cpuinfo,cpubase,paramgr,
- nbas,ncon,ncal,ncnv,nld,ncgutil,
+ nbas,nadd,ncon,ncal,ncnv,nld,ncgutil,
tgobj,
cga,cgutils,cgx86,cgobj,hlcgobj,
htypechk,procinfo;
@@ -138,6 +139,45 @@ implementation
inherited second_get_frame;
end;
+ function ti8086inlinenode.first_IncDec: tnode;
+ var
+ procname:string;
+ elesize: Tconstexprint;
+ hp: tnode;
+ begin
+ if is_hugepointer(tcallparanode(left).left.resultdef) then
+ begin
+ case inlinenumber of
+ in_inc_x:
+ procname:='fpc_hugeptr_inc_longint';
+ in_dec_x:
+ procname:='fpc_hugeptr_dec_longint';
+ else
+ internalerror(2014121001);
+ end;
+ if cs_hugeptr_arithmetic_normalization in current_settings.localswitches then
+ procname:=procname+'_normalized';
+
+ if is_void(tpointerdef(tcallparanode(left).left.resultdef).pointeddef) then
+ elesize:=1
+ else
+ elesize:=tpointerdef(tcallparanode(left).left.resultdef).pointeddef.size;
+
+ hp := cordconstnode.create(elesize,s32inttype,false);
+ { extra parameter? }
+ if assigned(tcallparanode(left).right) then
+ hp:=caddnode.create(muln,hp,tcallparanode(tcallparanode(left).right).left.getcopy);
+
+ result:=ccallnode.createintern(procname,
+ ccallparanode.create(hp,
+ ccallparanode.create(tcallparanode(left).left.getcopy,nil)));
+ typecheckpass(result);
+ firstpass(result);
+ end
+ else
+ result:=inherited;
+ end;
+
procedure ti8086inlinenode.second_incdec;
const
addsubop:array[in_inc_x..in_dec_x] of TOpCG=(OP_ADD,OP_SUB);
diff --git a/compiler/i8086/n8086mat.pas b/compiler/i8086/n8086mat.pas
index 869efa8220..74057962ec 100644
--- a/compiler/i8086/n8086mat.pas
+++ b/compiler/i8086/n8086mat.pas
@@ -398,6 +398,7 @@ implementation
hreg64hi:=left.location.register64.reghi;
hreg64lo:=left.location.register64.reglo;
+ v:=0;
if right.nodetype=ordconstn then
v:=Tordconstnode(right).value and 63;
diff --git a/compiler/i8086/n8086mem.pas b/compiler/i8086/n8086mem.pas
index 478c35c7ff..7d12ef9223 100644
--- a/compiler/i8086/n8086mem.pas
+++ b/compiler/i8086/n8086mem.pas
@@ -43,21 +43,23 @@ interface
{ tx86vecnode doesn't work for i8086, so we inherit tcgvecnode }
ti8086vecnode = class(tcgvecnode)
+ protected
+ function first_arraydef: tnode;override;
procedure update_reference_reg_mul(maybe_const_reg:tregister;l:aint);override;
end;
implementation
uses
- systems,globals,
+ systems,globals,constexp,
cutils,verbose,
- symbase,symconst,symdef,symtable,symtype,symsym,symcpu,
+ symbase,symconst,symdef,symtable,symtype,symsym,symx86,symcpu,
parabase,paramgr,
aasmtai,aasmdata,
- nld,ncon,nadd,
+ nld,ncon,nadd,ncal,ncnv,
cgutils,cgobj,
defutil,hlcgobj,
- pass_2,ncgutil;
+ pass_1,pass_2,ncgutil;
{*****************************************************************************
TI8086ADDRNODE
@@ -170,6 +172,46 @@ implementation
TI8086VECNODE
*****************************************************************************}
+ function ti8086vecnode.first_arraydef: tnode;
+ var
+ arraydef: tcpuarraydef;
+ procname:string;
+ begin
+ if tcpuarraydef(left.resultdef).is_huge then
+ begin
+ arraydef:=tcpuarraydef(left.resultdef);
+
+ if not (ado_IsConvertedPointer in arraydef.arrayoptions) then
+ internalerror(2014080701);
+
+ if left.nodetype<>typeconvn then
+ internalerror(2014080702);
+
+ procname:='fpc_hugeptr_add_longint';
+ if cs_hugeptr_arithmetic_normalization in current_settings.localswitches then
+ procname:=procname+'_normalized';
+
+ if arraydef.elementdef.size>1 then
+ right:=caddnode.create(muln,right,
+ cordconstnode.create(arraydef.elementdef.size,s32inttype,true));
+
+ result:=ccallnode.createintern(procname,
+ ccallparanode.create(right,
+ ccallparanode.create(ttypeconvnode(left).left,nil)));
+ inserttypeconv_internal(result,getx86pointerdef(arraydef.elementdef,x86pt_huge));
+ result:=cderefnode.create(result);
+
+ ttypeconvnode(left).left:=nil;
+ ttypeconvnode(left).free;
+ left := nil;
+ right := nil;
+ firstpass(result);
+ end
+ else
+ result:=inherited;
+ end;
+
+
procedure ti8086vecnode.update_reference_reg_mul(maybe_const_reg:tregister;l:aint);
var
saveseg: TRegister;
diff --git a/compiler/i8086/n8086tcon.pas b/compiler/i8086/n8086tcon.pas
index 0d4a735322..4a10b94615 100644
--- a/compiler/i8086/n8086tcon.pas
+++ b/compiler/i8086/n8086tcon.pas
@@ -42,7 +42,7 @@ interface
implementation
uses
- ncnv,defcmp,defutil,aasmtai;
+ ncnv,defcmp,defutil,aasmtai,symcpu;
{ ti8086typedconstbuilder }
diff --git a/compiler/i8086/symcpu.pas b/compiler/i8086/symcpu.pas
index 9c47c46117..9617a45160 100644
--- a/compiler/i8086/symcpu.pas
+++ b/compiler/i8086/symcpu.pas
@@ -57,6 +57,7 @@ type
tcpupointerdef = class(tx86pointerdef)
class function default_x86_data_pointer_type: tx86pointertyp; override;
+ function pointer_arithmetic_int_type:tdef; override;
function pointer_subtraction_result_type:tdef; override;
end;
tcpupointerdefclass = class of tcpupointerdef;
@@ -77,7 +78,19 @@ type
end;
tcpuclassrefdefclass = class of tcpuclassrefdef;
+ { tcpuarraydef }
+
tcpuarraydef = class(tarraydef)
+ private
+ huge: Boolean;
+ protected
+ procedure ppuload_platform(ppufile: tcompilerppufile); override;
+ procedure ppuwrite_platform(ppufile: tcompilerppufile); override;
+ public
+ constructor create_from_pointer(def:tpointerdef);override;
+ function getcopy: tstoreddef; override;
+ function GetTypeName:string;override;
+ property is_huge: Boolean read huge write huge;
end;
tcpuarraydefclass = class of tcpuarraydef;
@@ -197,11 +210,16 @@ const
function is_proc_far(p: tabstractprocdef): boolean;
+ {# Returns true if p is a far pointer def }
+ function is_farpointer(p : tdef) : boolean;
+
+ {# Returns true if p is a huge pointer def }
+ function is_hugepointer(p : tdef) : boolean;
implementation
uses
- globals, cpuinfo, verbose;
+ globals, cpuinfo, verbose, fmodule;
function is_proc_far(p: tabstractprocdef): boolean;
@@ -214,6 +232,68 @@ implementation
internalerror(2014041301);
end;
+ { true if p is a far pointer def }
+ function is_farpointer(p : tdef) : boolean;
+ begin
+ result:=(p.typ=pointerdef) and (tcpupointerdef(p).x86pointertyp=x86pt_far);
+ end;
+
+ { true if p is a huge pointer def }
+ function is_hugepointer(p : tdef) : boolean;
+ begin
+ result:=(p.typ=pointerdef) and (tcpupointerdef(p).x86pointertyp=x86pt_huge);
+ end;
+
+{****************************************************************************
+ tcpuarraydef
+****************************************************************************}
+
+ constructor tcpuarraydef.create_from_pointer(def: tpointerdef);
+ begin
+ if tcpupointerdef(def).x86pointertyp=x86pt_huge then
+ begin
+ huge:=true;
+ { use -1 so that the elecount will not overflow }
+ self.create(0,high(asizeint)-1,s32inttype);
+ arrayoptions:=[ado_IsConvertedPointer];
+ setelementdef(def.pointeddef);
+ end
+ else
+ begin
+ huge:=false;
+ inherited create_from_pointer(def);
+ end;
+ end;
+
+
+ function tcpuarraydef.getcopy: tstoreddef;
+ begin
+ result:=inherited;
+ tcpuarraydef(result).huge:=huge;
+ end;
+
+
+ function tcpuarraydef.GetTypeName: string;
+ begin
+ Result:=inherited;
+ if is_huge then
+ Result:='Huge '+Result;
+ end;
+
+
+ procedure tcpuarraydef.ppuload_platform(ppufile: tcompilerppufile);
+ begin
+ inherited;
+ huge:=(ppufile.getbyte<>0);
+ end;
+
+
+ procedure tcpuarraydef.ppuwrite_platform(ppufile: tcompilerppufile);
+ begin
+ inherited;
+ ppufile.putbyte(byte(huge));
+ end;
+
{****************************************************************************
tcpuprocdef
@@ -312,6 +392,15 @@ implementation
end;
+ function tcpupointerdef.pointer_arithmetic_int_type:tdef;
+ begin
+ if x86pointertyp=x86pt_huge then
+ result:=s32inttype
+ else
+ result:=inherited;
+ end;
+
+
function tcpupointerdef.pointer_subtraction_result_type:tdef;
begin
case x86pointertyp of
@@ -381,5 +470,7 @@ begin
cconstsym:=tcpuconstsym;
cenumsym:=tcpuenumsym;
csyssym:=tcpusyssym;
+
+ cPtrDefHashSet:=tx86PtrDefHashSet;
end.
diff --git a/compiler/ia64/cpuinfo.pas b/compiler/ia64/cpuinfo.pas
index 1d9232c830..5d0a8d0c1b 100644
--- a/compiler/ia64/cpuinfo.pas
+++ b/compiler/ia64/cpuinfo.pas
@@ -30,6 +30,9 @@ uses
Type
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TExtended80Rec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -49,7 +52,25 @@ Type
fpu_itanium
);
-const
+ tcontrollertype =
+ (ct_none
+ );
+
+
+Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/impdef.pas b/compiler/impdef.pas
index dbbe56327f..d70e5e79bc 100644
--- a/compiler/impdef.pas
+++ b/compiler/impdef.pas
@@ -121,7 +121,7 @@ const
{$ifdef unix}
DirSep = '/';
{$else}
- {$if defined(amiga) or defined(morphos)}
+ {$ifdef hasamiga}
DirSep = '/';
{$else}
DirSep = '\';
diff --git a/compiler/jvm/cpuinfo.pas b/compiler/jvm/cpuinfo.pas
index e4918dc954..62b89fcd1f 100644
--- a/compiler/jvm/cpuinfo.pas
+++ b/compiler/jvm/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -44,8 +47,25 @@ Type
fpu_standard
);
+ tcontrollertype =
+ (ct_none
+ );
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc
diff --git a/compiler/jvm/dbgjasm.pas b/compiler/jvm/dbgjasm.pas
index 2b76bbc1ca..40c971ad74 100644
--- a/compiler/jvm/dbgjasm.pas
+++ b/compiler/jvm/dbgjasm.pas
@@ -38,9 +38,10 @@ interface
TDebugInfoJasmin=class(TDebugInfo)
protected
fcurrprocstart,
+ fcurrprocafterstart,
fcurrprocend: tasmsymbol;
- procedure appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym);
+ procedure appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym; startlab: tasmsymbol);
procedure appendsym_paravar(list:TAsmList;sym:tparavarsym);override;
procedure appendsym_localvar(list:TAsmList;sym:tlocalvarsym);override;
@@ -65,7 +66,7 @@ implementation
TDebugInfoJasmin
****************************************************************************}
- procedure TDebugInfoJasmin.appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym);
+ procedure TDebugInfoJasmin.appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym; startlab: tasmsymbol);
var
jvar: tai_jvar;
proc: tprocdef;
@@ -75,20 +76,20 @@ implementation
if not(sym.localloc.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
exit;
proc:=tprocdef(sym.owner.defowner);
- jvar:=tai_jvar.create(sym.localloc.reference.offset,jvmmangledbasename(sym,true),fcurrprocstart,fcurrprocend);
+ jvar:=tai_jvar.create(sym.localloc.reference.offset,jvmmangledbasename(sym,true),startlab,fcurrprocend);
tcpuprocdef(proc).exprasmlist.InsertAfter(jvar,proc.procstarttai);
end;
procedure TDebugInfoJasmin.appendsym_paravar(list: TAsmList; sym: tparavarsym);
begin
- appendsym_localsym(list,sym);
+ appendsym_localsym(list,sym,fcurrprocstart);
end;
procedure TDebugInfoJasmin.appendsym_localvar(list: TAsmList; sym: tlocalvarsym);
begin
- appendsym_localsym(list,sym);
+ appendsym_localsym(list,sym,fcurrprocafterstart);
end;
@@ -100,7 +101,11 @@ implementation
procedure TDebugInfoJasmin.appendprocdef(list: TAsmList; def: tprocdef);
var
procstartlabel,
- procendlabel : tasmlabel;
+ procendlabel,
+ afterprocstartlabel : tasmlabel;
+ hp,
+ afterproccodestart : tai;
+ instrcount : longint;
begin
{ insert debug information for local variables and parameters, but only
for routines implemented in the Pascal code }
@@ -113,6 +118,33 @@ implementation
tcpuprocdef(def).exprasmlist.insertbefore(tai_label.create(procendlabel),def.procendtai);
fcurrprocstart:=procstartlabel;
+ { set the start label for local variables after the first instruction,
+ because javac's code completion support assumes that all info at
+ bytecode position 0 is for parameters }
+ instrcount:=0;
+ afterproccodestart:=def.procstarttai;
+ while assigned(afterproccodestart.next) do
+ begin
+ afterproccodestart:=tai(afterproccodestart.next);
+ if (afterproccodestart.typ=ait_instruction) then
+ break;
+ end;
+ { must be followed by at least one more instruction }
+ hp:=tai(afterproccodestart.next);
+ while assigned(hp) do
+ begin
+ if hp.typ=ait_instruction then
+ break;
+ hp:=tai(hp.next);
+ end;
+ if assigned(hp) then
+ begin
+ current_asmdata.getlabel(afterprocstartlabel,alt_dbgtype);
+ tcpuprocdef(def).exprasmlist.insertafter(tai_label.create(afterprocstartlabel),afterproccodestart);
+ fcurrprocafterstart:=afterprocstartlabel;
+ end
+ else
+ fcurrprocafterstart:=procstartlabel;
fcurrprocend:=procendlabel;
write_symtable_parasyms(list,def.paras);
diff --git a/compiler/jvm/njvmflw.pas b/compiler/jvm/njvmflw.pas
index 966a57a23d..25f9d11fb0 100644
--- a/compiler/jvm/njvmflw.pas
+++ b/compiler/jvm/njvmflw.pas
@@ -340,6 +340,12 @@ implementation
reasonbuf,
exceptreg: tregister;
begin
+ oldBreakLabel:=nil;
+ oldContinueLabel:=nil;
+ finallycodecopy:=nil;
+ continuefinallylabel:=nil;
+ breakfinallylabel:=nil;
+
{ not necessary on a garbage-collected platform }
if implicitframe then
internalerror(2011031803);
diff --git a/compiler/jvm/njvminl.pas b/compiler/jvm/njvminl.pas
index e4176fc838..3141b48016 100644
--- a/compiler/jvm/njvminl.pas
+++ b/compiler/jvm/njvminl.pas
@@ -87,13 +87,13 @@ implementation
function tjvminlinenode.typecheck_length(var handled: boolean): tnode;
begin
+ result:=nil;
typecheckpass(left);
if is_open_array(left.resultdef) or
is_dynamic_array(left.resultdef) or
is_array_of_const(left.resultdef) then
begin
resultdef:=s32inttype;
- result:=nil;
handled:=true;
end;
end;
@@ -101,6 +101,7 @@ implementation
function tjvminlinenode.typecheck_high(var handled: boolean): tnode;
begin
+ result:=nil;
typecheckpass(left);
if is_dynamic_array(left.resultdef) or
is_open_array(left.resultdef) or
@@ -120,6 +121,7 @@ implementation
para: tcallparanode;
elemdef: tdef;
begin
+ result:=nil;
{ normally never exists; used by the JVM backend to create new
arrays because it requires special opcodes }
tcallparanode(left).get_paratype;
@@ -150,7 +152,6 @@ implementation
para:=tcallparanode(para.right);
elemdef:=tarraydef(elemdef).elementdef;
end;
- result:=nil;
resultdef:=left.resultdef;
handled:=true;
end;
@@ -289,6 +290,7 @@ implementation
var
handled: boolean;
begin
+ result:=nil;
handled:=false;
case inlinenumber of
in_length_x:
diff --git a/compiler/jvm/njvmmem.pas b/compiler/jvm/njvmmem.pas
index a93902a3f5..a65a070077 100644
--- a/compiler/jvm/njvmmem.pas
+++ b/compiler/jvm/njvmmem.pas
@@ -361,6 +361,8 @@ implementation
newsize: tcgsize;
isjump: boolean;
begin
+ otl:=nil;
+ ofl:=nil;
if left.resultdef.typ=stringdef then
internalerror(2011052702);
diff --git a/compiler/jvm/njvmutil.pas b/compiler/jvm/njvmutil.pas
index 72df2627b2..ad61b5099c 100644
--- a/compiler/jvm/njvmutil.pas
+++ b/compiler/jvm/njvmutil.pas
@@ -75,6 +75,9 @@ implementation
paras: tcallparanode;
proc: string;
begin
+ result:=nil;
+ proc:='';
+ temp:=nil;
if not assigned(p.resultdef) then
typecheckpass(p);
if ((p.resultdef.typ=stringdef) and
diff --git a/compiler/jvm/tgcpu.pas b/compiler/jvm/tgcpu.pas
index 012f90d80d..12f163226b 100644
--- a/compiler/jvm/tgcpu.pas
+++ b/compiler/jvm/tgcpu.pas
@@ -46,7 +46,7 @@ unit tgcpu;
public
procedure setfirsttemp(l : longint); override;
procedure getlocal(list: TAsmList; size: longint; alignment: shortint; def: tdef; var ref: treference); override;
- procedure gethltemp(list: TAsmList; def: tdef; forcesize: aint; temptype: ttemptype; out ref: treference); override;
+ procedure gethltemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference); override;
procedure gethltemptyped(list: TAsmList; def: tdef; temptype: ttemptype; out ref: treference); override;
end;
@@ -145,8 +145,8 @@ unit tgcpu;
if tprocsym(sym).procdeflist.Count<>1 then
internalerror(2011062801);
pd:=tprocdef(tprocsym(sym).procdeflist[0]);
+ hlcg.a_call_name(list,pd,pd.mangledname,nil,false);
end;
- hlcg.a_call_name(list,pd,pd.mangledname,nil,false);
{ static calls method replaces parameter with set instance
-> no change in stack height }
end
@@ -202,8 +202,8 @@ unit tgcpu;
if tprocsym(sym).procdeflist.Count<>1 then
internalerror(2011052404);
pd:=tprocdef(tprocsym(sym).procdeflist[0]);
+ hlcg.a_call_name(list,pd,pd.mangledname,nil,false);
end;
- hlcg.a_call_name(list,pd,pd.mangledname,nil,false);
{ static calls method replaces parameter with string instance
-> no change in stack height }
{ store reference to instance }
@@ -245,7 +245,7 @@ unit tgcpu;
end;
- procedure ttgjvm.gethltemp(list: TAsmList; def: tdef; forcesize: aint; temptype: ttemptype; out ref: treference);
+ procedure ttgjvm.gethltemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference);
begin
if not getifspecialtemp(list,def,forcesize,temptype,ref) then
inherited;
diff --git a/compiler/m68k/aasmcpu.pas b/compiler/m68k/aasmcpu.pas
index c9689eea24..f2d0f34104 100644
--- a/compiler/m68k/aasmcpu.pas
+++ b/compiler/m68k/aasmcpu.pas
@@ -464,6 +464,7 @@ type
result:=operand_read;
case opcode of
+ // CPU opcodes
A_MOVE, A_MOVEQ, A_MOVEA, A_MVZ, A_MVS, A_MOV3Q, A_LEA:
if opnr=1 then
result:=operand_write;
@@ -479,10 +480,21 @@ type
A_CLR, A_SXX, A_SEQ, A_SNE, A_SLT, A_SLE, A_SGT, A_SGE, A_SCS, A_SCC,
A_SMI, A_SPL, A_SF, A_ST, A_SVS, A_SVC, A_SHI, A_SLS:
result:=operand_write;
- A_NEG, A_NEGX, A_EXT, A_EXTB, A_NOT:
+ A_NEG, A_NEGX, A_EXT, A_EXTB, A_NOT, A_SWAP:
result:=operand_readwrite;
A_TST,A_CMP,A_CMPI:
begin end; { Do nothing, default operand_read is fine here. }
+
+ // FPU opcodes
+ A_FMOVE:
+ if opnr=1 then
+ result:=operand_write;
+ A_FADD, A_FSUB, A_FMUL, A_FDIV:
+ if opnr=1 then
+ result:=operand_readwrite;
+ A_FCMP:
+ begin end; { operand_read }
+
else begin
internalerror(2004040903);
end;
@@ -508,17 +520,17 @@ type
function spilling_create_store(r:tregister; const ref:treference):Taicpu;
begin
- case getregtype(r) of
- R_INTREGISTER :
- result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
- R_ADDRESSREGISTER :
- result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
- R_FPUREGISTER :
+ case getregtype(r) of
+ R_INTREGISTER :
+ result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
+ R_ADDRESSREGISTER :
+ result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
+ R_FPUREGISTER :
// no need to handle sizes here
result:=taicpu.op_reg_ref(A_FMOVE,S_FS,r,ref);
else
internalerror(200602012);
- end;
+ end;
end;
diff --git a/compiler/m68k/cgcpu.pas b/compiler/m68k/cgcpu.pas
index 39b38ceaf0..2d0220c16a 100644
--- a/compiler/m68k/cgcpu.pas
+++ b/compiler/m68k/cgcpu.pas
@@ -108,6 +108,7 @@ unit cgcpu;
tcg64f68k = class(tcg64f32)
procedure a_op64_reg_reg(list : TAsmList;op:TOpCG; size: tcgsize; regsrc,regdst : tregister64);override;
procedure a_op64_const_reg(list : TAsmList;op:TOpCG; size: tcgsize; value : int64;regdst : tregister64);override;
+ procedure a_op64_ref_reg(list : TAsmList;op:TOpCG;size : tcgsize;const ref : treference;reg : tregister64);override;
end;
{ This function returns true if the reference+offset is valid.
@@ -377,8 +378,9 @@ unit cgcpu;
if use_push(cgpara) then
begin
{ Record copy? }
- if (cgpara.size in [OS_NO,OS_F64]) or (size=OS_NO) then
+ if (cgpara.size in [OS_NO,OS_F64]) or (size in [OS_NO,OS_F64]) then
begin
+ //list.concat(tai_comment.create(strpnew('a_load_ref_cgpara: g_concatcopy')));
cgpara.check_simple_location;
len:=align(cgpara.intsize,cgpara.alignment);
g_stackpointer_alloc(list,len);
@@ -751,7 +753,11 @@ unit cgcpu;
list.concat(taicpu.op_reg(A_CLR,S_L,register))
else
begin
- if (longint(a) >= low(shortint)) and (longint(a) <= high(shortint)) then
+ { Prefer MOV3Q if applicable, it allows replacement spilling for register }
+ if (current_settings.cputype in [cpu_isa_b,cpu_isa_c]) and
+ ((longint(a)=-1) or ((longint(a)>0) and (longint(a)<8))) then
+ list.concat(taicpu.op_const_reg(A_MOV3Q,S_L,longint(a),register))
+ else if (longint(a) >= low(shortint)) and (longint(a) <= high(shortint)) then
list.concat(taicpu.op_const_reg(A_MOVEQ,S_L,longint(a),register))
else
begin
@@ -786,11 +792,18 @@ unit cgcpu;
hreg : tregister;
href : treference;
begin
+ a:=longint(a);
href:=ref;
fixref(list,href);
+ if (a=0) and not (current_settings.cputype = cpu_mc68000) then
+ list.concat(taicpu.op_ref(A_CLR,tcgsize2opsize[tosize],href))
+ else if (tcgsize2opsize[tosize]=S_L) and
+ (current_settings.cputype in [cpu_isa_b,cpu_isa_c]) and
+ ((a=-1) or ((a>0) and (a<8))) then
+ list.concat(taicpu.op_const_ref(A_MOV3Q,S_L,a,href))
{ for coldfire we need to go through a temporary register if we have a
offset, index or symbol given }
- if (current_settings.cputype in cpu_coldfire) and
+ else if (current_settings.cputype in cpu_coldfire) and
(
(href.offset<>0) or
{ TODO : check whether we really need this second condition }
@@ -902,10 +915,13 @@ unit cgcpu;
var
instr : taicpu;
begin
- { move to destination register }
- instr:=taicpu.op_reg_reg(A_MOVE,TCGSize2OpSize[fromsize],reg1,reg2);
- add_move_instruction(instr);
- list.concat(instr);
+ { move to destination register }
+ if (reg1<>reg2) then
+ begin
+ instr:=taicpu.op_reg_reg(A_MOVE,TCGSize2OpSize[fromsize],reg1,reg2);
+ add_move_instruction(instr);
+ list.concat(instr);
+ end;
sign_extend(list, fromsize, reg2);
end;
@@ -923,17 +939,25 @@ unit cgcpu;
size:=tosize;
list.concat(taicpu.op_ref_reg(A_MOVE,TCGSize2OpSize[size],href,register));
{ extend the value in the register }
- sign_extend(list, fromsize, register);
+ sign_extend(list, size, register);
end;
procedure tcg68k.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
var
href : treference;
+ hreg : tregister;
begin
href:=ref;
fixref(list, href);
- list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
+ if not isaddressregister(r) then
+ begin
+ hreg:=getaddressregister(list);
+ list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
+ a_load_reg_reg(list, OS_ADDR, OS_ADDR, hreg, r);
+ end
+ else
+ list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
end;
@@ -941,20 +965,16 @@ unit cgcpu;
var
instr : taicpu;
begin
- { in emulation mode, only 32-bit single is supported }
- if (cs_fp_emulation in current_settings.moduleswitches) or (current_settings.fputype=fpu_soft) then
- instr:=taicpu.op_reg_reg(A_MOVE,S_L,reg1,reg2)
- else
- instr:=taicpu.op_reg_reg(A_FMOVE,tcgsize2opsize[tosize],reg1,reg2);
- add_move_instruction(instr);
- list.concat(instr);
+ instr:=taicpu.op_reg_reg(A_FMOVE,S_FX,reg1,reg2);
+ add_move_instruction(instr);
+ list.concat(instr);
end;
procedure tcg68k.a_loadfpu_ref_reg(list: TAsmList; fromsize, tosize: tcgsize; const ref: treference; reg: tregister);
- var
- opsize : topsize;
- href : treference;
+ var
+ opsize : topsize;
+ href : treference;
begin
opsize := tcgsize2opsize[fromsize];
{ extended is not supported, since it is not available on Coldfire }
@@ -962,50 +982,44 @@ unit cgcpu;
internalerror(20020729);
href := ref;
fixref(list,href);
- { in emulation mode, only 32-bit single is supported }
- if (cs_fp_emulation in current_settings.moduleswitches) or (current_settings.fputype=fpu_soft) then
- list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,reg))
- else
- begin
- list.concat(taicpu.op_ref_reg(A_FMOVE,opsize,href,reg));
- if (tosize < fromsize) then
- a_loadfpu_reg_reg(list,fromsize,tosize,reg,reg);
- end;
+ list.concat(taicpu.op_ref_reg(A_FMOVE,opsize,href,reg));
end;
procedure tcg68k.a_loadfpu_reg_ref(list: TAsmList; fromsize,tosize: tcgsize; reg: tregister; const ref: treference);
var
- opsize : topsize;
+ opsize : topsize;
+ href : treference;
begin
opsize := tcgsize2opsize[tosize];
{ extended is not supported, since it is not available on Coldfire }
if opsize = S_FX then
internalerror(20020729);
- { in emulation mode, only 32-bit single is supported }
- if (cs_fp_emulation in current_settings.moduleswitches) or (current_settings.fputype=fpu_soft) then
- list.concat(taicpu.op_reg_ref(A_MOVE,S_L,reg, ref))
- else
- list.concat(taicpu.op_reg_ref(A_FMOVE,opsize,reg, ref));
+ href := ref;
+ fixref(list,href);
+ list.concat(taicpu.op_reg_ref(A_FMOVE,opsize,reg,href));
end;
procedure tcg68k.a_loadfpu_ref_cgpara(list : TAsmList; size : tcgsize;const ref : treference;const cgpara : TCGPara);
begin
- case cgpara.location^.loc of
- LOC_REFERENCE,LOC_CREFERENCE:
- begin
- case size of
- OS_F64:
- cg64.a_load64_ref_cgpara(list,ref,cgpara);
- OS_F32:
- a_load_ref_cgpara(list,size,ref,cgpara);
- else
- internalerror(2013021201);
+ if current_settings.fputype = fpu_soft then
+ case cgpara.location^.loc of
+ LOC_REFERENCE,LOC_CREFERENCE:
+ begin
+ case size of
+ OS_F64:
+ cg64.a_load64_ref_cgpara(list,ref,cgpara);
+ OS_F32:
+ a_load_ref_cgpara(list,size,ref,cgpara);
+ else
+ internalerror(2013021201);
+ end;
end;
- end;
- else
- inherited a_loadfpu_ref_cgpara(list,size,ref,cgpara);
- end;
+ else
+ inherited a_loadfpu_ref_cgpara(list,size,ref,cgpara);
+ end
+ else
+ inherited a_loadfpu_ref_cgpara(list,size,ref,cgpara);
end;
@@ -1100,10 +1114,41 @@ unit cgcpu;
begin
scratch_reg := force_to_dataregister(list, size, reg);
sign_extend(list, size, scratch_reg);
- if (a >= 1) and (a <= 8) then
+
+ { some special cases which can generate smarter code
+ using the SWAP instruction }
+ if (a = 16) then
+ begin
+ if (op = OP_SHL) then
+ begin
+ list.concat(taicpu.op_reg(A_SWAP,S_NO,scratch_reg));
+ list.concat(taicpu.op_reg(A_CLR,S_W,scratch_reg));
+ end
+ else if (op = OP_SHR) then
+ begin
+ list.concat(taicpu.op_reg(A_CLR,S_W,scratch_reg));
+ list.concat(taicpu.op_reg(A_SWAP,S_NO,scratch_reg));
+ end
+ else if (op = OP_SAR) then
+ begin
+ list.concat(taicpu.op_reg(A_SWAP,S_NO,scratch_reg));
+ list.concat(taicpu.op_reg(A_EXT,S_L,scratch_reg));
+ end
+ else if (op = OP_ROR) or (op = OP_ROL) then
+ list.concat(taicpu.op_reg(A_SWAP,S_NO,scratch_reg))
+ end
+ else if (a >= 1) and (a <= 8) then
begin
list.concat(taicpu.op_const_reg(opcode, S_L, a, scratch_reg));
end
+ else if (a >= 9) and (a < 16) then
+ begin
+ { Use two ops instead of const -> reg + shift with reg, because
+ this way is the same in length and speed but has less register
+ pressure }
+ list.concat(taicpu.op_const_reg(opcode, S_L, 8, scratch_reg));
+ list.concat(taicpu.op_const_reg(opcode, S_L, a-8, scratch_reg));
+ end
else
begin
{ move const to a register first }
@@ -1398,6 +1443,13 @@ unit cgcpu;
procedure tcg68k.a_cmp_reg_reg_label(list : TAsmList;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel);
begin
+ if (current_settings.cputype in cpu_coldfire-[cpu_isa_b,cpu_isa_c]) then
+ begin
+ sign_extend(list,size,reg1);
+ sign_extend(list,size,reg2);
+ size:=OS_INT;
+ end;
+
list.concat(taicpu.op_reg_reg(A_CMP,tcgsize2opsize[size],reg1,reg2));
{ emit the actual jump to the label }
a_jmp_cond(list,cmp_op,l);
@@ -1473,10 +1525,8 @@ unit cgcpu;
hp2 : treference;
hl : tasmlabel;
srcref,dstref : treference;
- orglen : tcgint;
begin
hregister := getintregister(list,OS_INT);
- orglen:=len;
{ from 12 bytes movs is being used }
if ((len<=8) or (not(cs_opt_size in current_settings.optimizerswitches) and (len<=12))) then
@@ -1568,7 +1618,28 @@ unit cgcpu;
end;
procedure tcg68k.g_overflowcheck(list: TAsmList; const l:tlocation; def:tdef);
+ var
+ hl : tasmlabel;
+ ai : taicpu;
+ cond : TAsmCond;
begin
+ if not(cs_check_overflow in current_settings.localswitches) then
+ exit;
+ current_asmdata.getjumplabel(hl);
+ if not ((def.typ=pointerdef) or
+ ((def.typ=orddef) and
+ (torddef(def).ordtype in [u64bit,u16bit,u32bit,u8bit,uchar,
+ pasbool8,pasbool16,pasbool32,pasbool64]))) then
+ cond:=C_VC
+ else
+ cond:=C_CC;
+ ai:=Taicpu.Op_Sym(A_Bxx,S_NO,hl);
+ ai.SetCondition(cond);
+ ai.is_jmp:=true;
+ list.concat(ai);
+
+ a_call_name(list,'FPC_OVERFLOW',false);
+ a_label(list,hl);
end;
procedure tcg68k.g_proc_entry(list: TAsmList; localsize: longint; nostackframe:boolean);
@@ -1582,13 +1653,13 @@ unit cgcpu;
if (localsize < 0) then
internalerror(2006122601);
- { Not to complicate the code generator too much, and since some }
- { of the systems only support this format, the localsize cannot }
- { exceed 32K in size. }
if (localsize > high(smallint)) then
- CGMessage(cg_e_localsize_too_big);
-
- list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,-localsize));
+ begin
+ list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,0));
+ list.concat(taicpu.op_const_reg(A_SUBA,S_L,localsize,NR_STACK_POINTER_REG));
+ end
+ else
+ list.concat(taicpu.op_reg_const(A_LINK,S_W,NR_FRAME_POINTER_REG,-localsize));
end;
end;
@@ -1698,6 +1769,7 @@ unit cgcpu;
{ calculate temp. size }
size:=0;
+ hreg:=NR_NO;
for r:=low(saved_standard_registers) to high(saved_standard_registers) do
if saved_standard_registers[r] in rg[R_INTREGISTER].used_in_proc then
begin
@@ -1724,9 +1796,16 @@ unit cgcpu;
include(current_procinfo.flags,pi_has_saved_regs);
{ Copy registers to temp }
+ { NOTE: virtual registers allocated here won't be translated --> no higher-level stuff. }
href:=current_procinfo.save_regs_ref;
+ if (href.offset<low(smallint)) and (current_settings.cputype in cpu_coldfire) then
+ begin
+ list.concat(taicpu.op_reg_reg(A_MOVE,S_L,href.base,NR_A0));
+ list.concat(taicpu.op_const_reg(A_ADDA,S_L,href.offset,NR_A0));
+ reference_reset_base(href,NR_A0,0,sizeof(pint));
+ end;
if size = sizeof(aint) then
- a_load_reg_ref(list, OS_32, OS_32, hreg, href)
+ list.concat(taicpu.op_reg_ref(A_MOVE,S_L,hreg,href))
else
list.concat(taicpu.op_regset_ref(A_MOVEM,S_L,dataregs,addrregs,href));
end;
@@ -1750,6 +1829,7 @@ unit cgcpu;
exit;
{ Copy registers from temp }
size:=0;
+ hreg:=NR_NO;
for r:=low(saved_standard_registers) to high(saved_standard_registers) do
if saved_standard_registers[r] in rg[R_INTREGISTER].used_in_proc then
begin
@@ -1777,8 +1857,14 @@ unit cgcpu;
{ Restore registers from temp }
href:=current_procinfo.save_regs_ref;
+ if (href.offset<low(smallint)) and (current_settings.cputype in cpu_coldfire) then
+ begin
+ list.concat(taicpu.op_reg_reg(A_MOVE,S_L,href.base,NR_A0));
+ list.concat(taicpu.op_const_reg(A_ADDA,S_L,href.offset,NR_A0));
+ reference_reset_base(href,NR_A0,0,sizeof(pint));
+ end;
if size = sizeof(aint) then
- a_load_ref_reg(list, OS_32, OS_32, href, hreg)
+ list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,hreg))
else
list.concat(taicpu.op_ref_regset(A_MOVEM,S_L,href,dataregs,addrregs));
@@ -2097,6 +2183,34 @@ unit cgcpu;
end;
+ procedure tcg64f68k.a_op64_ref_reg(list : TAsmList;op:TOpCG;size : tcgsize;const ref : treference;reg : tregister64);
+ var
+ tempref : treference;
+ begin
+ case op of
+ OP_NEG,OP_NOT:
+ begin
+ a_load64_ref_reg(list,ref,reg);
+ a_op64_reg_reg(list,op,size,reg,reg);
+ end;
+
+ OP_AND,OP_OR:
+ begin
+ tempref:=ref;
+ tcg68k(cg).fixref(list,tempref);
+ inc(tempref.offset,4);
+ list.concat(taicpu.op_ref_reg(topcg2tasmop[op],S_L,tempref,reg.reglo));
+ dec(tempref.offset,4);
+ list.concat(taicpu.op_ref_reg(topcg2tasmop[op],S_L,tempref,reg.reghi));
+ end;
+ else
+ { XOR does not allow reference for source; ADD/SUB do not allow reference for
+ high dword, although low dword can still be handled directly. }
+ inherited a_op64_ref_reg(list,op,size,ref,reg);
+ end;
+ end;
+
+
procedure tcg64f68k.a_op64_const_reg(list : TAsmList;op:TOpCG;size: tcgsize; value : int64;regdst : tregister64);
var
lowvalue : cardinal;
diff --git a/compiler/m68k/cpubase.pas b/compiler/m68k/cpubase.pas
index 0d777f32ea..021e7d32fd 100644
--- a/compiler/m68k/cpubase.pas
+++ b/compiler/m68k/cpubase.pas
@@ -67,7 +67,7 @@ unit cpubase;
{ mc64040 instructions }
a_move16,
{ coldfire v4 instructions }
- a_mov3q,a_mvz,a_mvs,a_sats,
+ a_mov3q,a_mvz,a_mvs,a_sats,a_byterev,a_ff1,
{ fpu processor instructions - directly supported only. }
{ ieee aware and misc. condition codes not supported }
a_fabs,a_fadd,
@@ -153,7 +153,7 @@ unit cpubase;
{ registers which may be destroyed by calls }
VOLATILE_INTREGISTERS = [RS_D0,RS_D1];
- VOLATILE_FPUREGISTERS = [];
+ VOLATILE_FPUREGISTERS = [RS_FP0,RS_FP1];
VOLATILE_ADDRESSREGISTERS = [RS_A0,RS_A1];
type
@@ -311,6 +311,7 @@ unit cpubase;
}
saved_standard_registers : array[0..5] of tsuperregister = (RS_D2,RS_D3,RS_D4,RS_D5,RS_D6,RS_D7);
saved_address_registers : array[0..4] of tsuperregister = (RS_A2,RS_A3,RS_A4,RS_A5,RS_A6);
+ saved_fpu_registers : array[0..5] of tsuperregister = (RS_FP2,RS_FP3,RS_FP4,RS_FP5,RS_FP6,RS_FP7);
{ this is only for the generic code which is not used for this architecture }
saved_mm_registers : array[0..0] of tsuperregister = (RS_INVALID);
@@ -471,7 +472,9 @@ implementation
R_INTREGISTER :
result:=OS_32;
R_FPUREGISTER :
- result:=OS_F64;
+ { 68881 & compatibles -> 80 bit }
+ { CF FPU -> 64 bit, but that's unsupported for now }
+ result:=OS_F80;
else
internalerror(200303181);
end;
diff --git a/compiler/m68k/cpuinfo.pas b/compiler/m68k/cpuinfo.pas
index 38f6f79a49..80f09b4f29 100644
--- a/compiler/m68k/cpuinfo.pas
+++ b/compiler/m68k/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -48,7 +51,25 @@ Type
fpu_68881
);
+ tcontrollertype =
+ (ct_none
+ );
+
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
@@ -107,19 +128,21 @@ type
(CPUM68K_HAS_DBRA, { CPU supports the DBRA instruction }
CPUM68K_HAS_CAS, { CPU supports the CAS instruction }
CPUM68K_HAS_TAS, { CPU supports the TAS instruction }
- CPUM68K_HAS_BRAL { CPU supports the BRA.L/Bcc.L instructions }
+ CPUM68K_HAS_BRAL, { CPU supports the BRA.L/Bcc.L instructions }
+ CPUM68K_HAS_ROLROR, { CPU supports the ROL/ROR and ROXL/ROXR instructions }
+ CPUM68K_HAS_BYTEREV { CPU supports the BYTEREV instruction }
);
const
cpu_capabilities : array[tcputype] of set of tcpuflags =
( { cpu_none } [],
- { cpu_68000 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_TAS],
- { cpu_68020 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_CAS,CPUM68K_HAS_TAS,CPUM68K_HAS_BRAL],
- { cpu_68040 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_CAS,CPUM68K_HAS_TAS,CPUM68K_HAS_BRAL],
+ { cpu_68000 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_TAS,CPUM68K_HAS_ROLROR],
+ { cpu_68020 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_CAS,CPUM68K_HAS_TAS,CPUM68K_HAS_BRAL,CPUM68K_HAS_ROLROR],
+ { cpu_68040 } [CPUM68K_HAS_DBRA,CPUM68K_HAS_CAS,CPUM68K_HAS_TAS,CPUM68K_HAS_BRAL,CPUM68K_HAS_ROLROR],
{ cpu_isaa } [],
- { cpu_isaap } [CPUM68K_HAS_BRAL],
+ { cpu_isaap } [CPUM68K_HAS_BRAL,CPUM68K_HAS_BYTEREV],
{ cpu_isab } [CPUM68K_HAS_TAS,CPUM68K_HAS_BRAL],
- { cpu_isac } [CPUM68K_HAS_TAS]
+ { cpu_isac } [CPUM68K_HAS_TAS,CPUM68K_HAS_BYTEREV]
);
{ all CPUs commonly called "coldfire" }
diff --git a/compiler/m68k/itcpugas.pas b/compiler/m68k/itcpugas.pas
index cfe77aae22..4e134a3e70 100644
--- a/compiler/m68k/itcpugas.pas
+++ b/compiler/m68k/itcpugas.pas
@@ -61,7 +61,7 @@ interface
{ mc64040 instructions }
'move16',
{ coldfire v4 instructions }
- 'mov3q','mvz','mvs','sats',
+ 'mov3q','mvz','mvs','sats','byterev','ff1',
{ fpu processor instructions - directly supported only. }
{ ieee aware and misc. condition codes not supported }
'fabs','fadd',
diff --git a/compiler/m68k/n68kadd.pas b/compiler/m68k/n68kadd.pas
index a812a2ee5e..84c88e3202 100644
--- a/compiler/m68k/n68kadd.pas
+++ b/compiler/m68k/n68kadd.pas
@@ -32,23 +32,13 @@ interface
type
t68kaddnode = class(tcgaddnode)
private
- function cmp64_lt(left_reg,right_reg:tregister64):tregister;
- function cmp64_le(left_reg,right_reg:tregister64):tregister;
- function cmp64_eq(left_reg,right_reg:tregister64):tregister;
- function cmp64_ne(left_reg,right_reg:tregister64):tregister;
- function cmp64_ltu(left_reg,right_reg:tregister64):tregister;
- function cmp64_leu(left_reg,right_reg:tregister64):tregister;
-
function getresflags(unsigned: boolean) : tresflags;
- function getres64_register(unsigned:boolean;left_reg,right_reg:tregister64):tregister;
protected
procedure second_addfloat;override;
procedure second_cmpfloat;override;
procedure second_cmpordinal;override;
procedure second_cmpsmallset;override;
procedure second_cmp64bit;override;
- public
- function pass_1:tnode;override;
end;
@@ -62,198 +52,12 @@ implementation
cpuinfo,pass_1,pass_2,regvars,
cpupara,cgutils,procinfo,
ncon,nset,
- ncgutil,tgobj,rgobj,rgcpu,cgobj,hlcgobj,cg64f32;
+ ncgutil,tgobj,rgobj,rgcpu,cgobj,cgcpu,hlcgobj,cg64f32;
{*****************************************************************************
Helpers
*****************************************************************************}
- function t68kaddnode.cmp64_lt(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64_1,labelcmp64_2 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- current_asmdata.getjumplabel(labelcmp64_1);
- current_asmdata.getjumplabel(labelcmp64_2);
-
- { check whether left_reg.reghi is less than right_reg.reghi }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,right_reg.reghi,left_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_LT,S_NO,labelcmp64_2));
-
- { are left_reg.reghi and right_reg.reghi equal? }
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64_1));
-
- { is left_reg.reglo less than right_reg.reglo? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,right_reg.reglo,left_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_2));
-
- current_asmdata.currasmlist.concat(Taicpu.op_sym(A_BRA,S_NO,labelcmp64_1));
- cg.a_label(current_asmdata.currasmlist,labelcmp64_2);
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_1);
- result:=tmpreg;
- end;
-
- function t68kaddnode.cmp64_le(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64_1,labelcmp64_2 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- current_asmdata.getjumplabel(labelcmp64_1);
- current_asmdata.getjumplabel(labelcmp64_2);
-
- { check whether right_reg.reghi is less than left_reg.reghi }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reghi,right_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_LT,S_NO,labelcmp64_1));
-
- { are left_reg.reghi and right_reg.reghi equal? }
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64_2));
-
- { is right_reg.reglo less than left_reg.reglo? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reglo,right_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_1));
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_2);
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_1);
- result:=tmpreg;
- end;
-
- function t68kaddnode.cmp64_eq(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
- current_asmdata.getjumplabel(labelcmp64);
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- { is the high order longword equal? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reghi,right_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64));
-
- { is the low order longword equal? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reglo,right_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64));
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64);
- result:=tmpreg;
- end;
-
- function t68kaddnode.cmp64_ne(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
- current_asmdata.getjumplabel(labelcmp64);
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- { is the high order longword equal? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reghi,right_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64));
-
- { is the low order longword equal? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reglo,right_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64));
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64);
- result:=tmpreg;
- end;
-
- function t68kaddnode.cmp64_ltu(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64_1,labelcmp64_2 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- current_asmdata.getjumplabel(labelcmp64_1);
- current_asmdata.getjumplabel(labelcmp64_2);
-
- { check whether left_reg.reghi is less than right_reg.reghi }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,right_reg.reghi,left_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_2));
-
- { are left_reg.reghi and right_reg.reghi equal? }
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64_1));
-
- { is left_reg.reglo less than right_reg.reglo? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,right_reg.reglo,left_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_2));
-
- current_asmdata.currasmlist.concat(Taicpu.op_sym(A_BRA,S_NO,labelcmp64_1));
- cg.a_label(current_asmdata.currasmlist,labelcmp64_2);
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_1);
- result:=tmpreg;
- end;
-
- function t68kaddnode.cmp64_leu(left_reg,right_reg:tregister64):tregister;
- var
- labelcmp64_1,labelcmp64_2 : tasmlabel;
- tmpreg : tregister;
- begin
- tmpreg:=cg.getintregister(current_asmdata.currasmlist,OS_INT);
-
- { load the value for "false" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,0,tmpreg);
-
- current_asmdata.getjumplabel(labelcmp64_1);
- current_asmdata.getjumplabel(labelcmp64_2);
-
- { check whether right_reg.reghi is less than left_reg.reghi }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reghi,right_reg.reghi));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_1));
-
- { are left_reg.reghi and right_reg.reghi equal? }
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_NE,S_NO,labelcmp64_2));
-
- { is right_reg.reglo less than left_reg.reglo? }
- current_asmdata.currasmlist.concat(taicpu.op_reg_reg(A_CMP,S_L,left_reg.reglo,right_reg.reglo));
- current_asmdata.currasmlist.concat(taicpu.op_cond_sym(A_BXX,C_CS,S_NO,labelcmp64_1));
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_2);
-
- { load the value for "true" }
- cg.a_load_const_reg(current_asmdata.currasmlist,OS_INT,1,tmpreg);
-
- cg.a_label(current_asmdata.currasmlist,labelcmp64_1);
- result:=tmpreg;
- end;
-
function t68kaddnode.getresflags(unsigned : boolean) : tresflags;
begin
case nodetype of
@@ -268,6 +72,8 @@ implementation
lten : getresflags:=F_GE;
gtn : getresflags:=F_L;
gten : getresflags:=F_LE;
+ else
+ internalerror(2014082030);
end
else
case nodetype of
@@ -275,6 +81,8 @@ implementation
lten : getresflags:=F_LE;
gtn : getresflags:=F_G;
gten : getresflags:=F_GE;
+ else
+ internalerror(2014082031);
end;
end
else
@@ -285,6 +93,8 @@ implementation
lten : getresflags:=F_AE;
gtn : getresflags:=F_B;
gten : getresflags:=F_BE;
+ else
+ internalerror(2014082032);
end
else
case nodetype of
@@ -292,71 +102,13 @@ implementation
lten : getresflags:=F_BE;
gtn : getresflags:=F_A;
gten : getresflags:=F_AE;
+ else
+ internalerror(2014082033);
end;
end;
end;
end;
- function t68kaddnode.getres64_register(unsigned:boolean;left_reg,right_reg:tregister64):tregister;
- begin
- case nodetype of
- equaln:
- result:=cmp64_eq(left_reg,right_reg);
- unequaln:
- result:=cmp64_ne(left_reg,right_reg);
- else
- if not unsigned then
- begin
- if nf_swapped in flags then
- case nodetype of
- ltn:
- result:=cmp64_lt(right_reg,left_reg);
- lten:
- result:=cmp64_le(right_reg,left_reg);
- gtn:
- result:=cmp64_lt(left_reg,right_reg);
- gten:
- result:=cmp64_le(left_reg,right_reg);
- end
- else
- case nodetype of
- ltn:
- result:=cmp64_lt(left_reg,right_reg);
- lten:
- result:=cmp64_le(left_reg,right_reg);
- gtn:
- result:=cmp64_lt(right_reg,left_reg);
- gten:
- result:=cmp64_le(right_reg,left_reg);
- end;
- end
- else
- begin
- if nf_swapped in Flags then
- case nodetype of
- ltn:
- result:=cmp64_ltu(right_reg,left_reg);
- lten:
- result:=cmp64_leu(right_reg,left_reg);
- gtn:
- result:=cmp64_ltu(left_reg,right_reg);
- gten:
- result:=cmp64_leu(left_reg,right_reg);
- end
- else
- case nodetype of
- ltn:
- result:=cmp64_ltu(left_reg,right_reg);
- lten:
- result:=cmp64_leu(left_reg,right_reg);
- gtn:
- result:=cmp64_ltu(right_reg,left_reg);
- gten:
- result:=cmp64_leu(right_reg,left_reg);
- end;
- end;
- end;
- end;
{*****************************************************************************
AddFloat
@@ -386,56 +138,53 @@ implementation
if nf_swapped in flags then
swapleftright;
- // put both operands in a register
- hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
- hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
+ case current_settings.fputype of
+ fpu_68881:
+ begin
+ // put both operands in a register
+ hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
+ hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
- // initialize de result
- location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
- if left.location.loc = LOC_FPUREGISTER then
- location.register := left.location.register
- else if right.location.loc = LOC_FPUREGISTER then
- location.register := right.location.register
- else
- location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
-
- // emit the actual operation
- {
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,
- location.register,left.location.register,
- right.location.register))
- }
+ // initialize the result
+ location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
+ location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
+
+ // emit the actual operation
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FMOVE,S_FX,left.location.register,location.register));
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_FX,right.location.register,location.register));
+ end;
+ else
+ // softfpu should be handled in pass1, others are not yet supported...
+ internalerror(2015010201);
+ end;
end;
procedure t68kaddnode.second_cmpfloat;
begin
pass_left_right;
-
-{
if (nf_swapped in flags) then
swapleftright;
-}
- { force fpureg as location, left right doesn't matter
- as both will be in a fpureg }
- hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
- hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
- location_reset(location,LOC_FLAGS,OS_NO);
- location.resflags:=getresflags(true);
-{
- if nodetype in [equaln,unequaln] then
- current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_CMF,
- left.location.register,right.location.register),
- cgsize2fpuoppostfix[def_cgsize(resultdef)]))
- else
- current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_CMFE,
- left.location.register,right.location.register),
- cgsize2fpuoppostfix[def_cgsize(resultdef)]));
+ case current_settings.fputype of
+ fpu_68881:
+ begin
+ location_reset(location,LOC_FLAGS,OS_NO);
- location_reset(location,LOC_FLAGS,OS_NO);
- location.resflags:=getresflags(false);
-}
+ { force fpureg as location, left right doesn't matter
+ as both will be in a fpureg }
+ hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
+ hlcg.location_force_fpureg(current_asmdata.CurrAsmList,right.location,right.resultdef,true);
+
+ // emit compare
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FCMP,S_FX,right.location.register,left.location.register));
+
+ location.resflags:=getresflags(false);
+ end;
+ else
+ // softfpu should be handled in pass1, others are not yet supported...
+ internalerror(2015010201);
+ end;
end;
@@ -500,111 +249,92 @@ implementation
procedure t68kaddnode.second_cmpordinal;
var
unsigned : boolean;
- useconst : boolean;
tmpreg : tregister;
opsize : topsize;
cmpsize : tcgsize;
+ href: treference;
begin
- pass_left_right;
- { set result location }
- location_reset(location,LOC_JUMP,OS_NO);
-
- { ToDo : set "allowconstants" to True, but this seems to upset Coldfire
- a bit for the CMP instruction => check manual and implement
- exception accordingly below }
- { load values into registers (except constants) }
- force_reg_left_right(true, false);
-
{ determine if the comparison will be unsigned }
unsigned:=not(is_signed(left.resultdef)) or
not(is_signed(right.resultdef));
+ { this puts constant operand (if any) to the right }
+ pass_left_right;
+ { tentatively assume left size (correct for possible TST, will fix later) }
+ cmpsize:=def_cgsize(left.resultdef);
+ opsize:=tcgsize2opsize[cmpsize];
- // get the constant on the right if there is one
- if (left.location.loc = LOC_CONSTANT) then
- swapleftright;
- // can we use an immediate, or do we have to load the
- // constant in a register first?
- if (right.location.loc = LOC_CONSTANT) then
- begin
-{$ifdef extdebug}
- if (right.location.size in [OS_64,OS_S64]) and (hi(right.location.value64)<>0) and ((hi(right.location.value64)<>-1) or unsigned) then
- internalerror(2002080301);
-{$endif extdebug}
- if (nodetype in [equaln,unequaln]) then
- if (unsigned and
- (right.location.value > high(word))) or
- (not unsigned and
- (longint(right.location.value) < low(smallint)) or
- (longint(right.location.value) > high(smallint))) then
- { we can then maybe use a constant in the 'othersigned' case
- (the sign doesn't matter for // equal/unequal)}
- unsigned := not unsigned;
-
- if (unsigned and
- ((right.location.value) <= high(word))) or
- (not(unsigned) and
- (longint(right.location.value) >= low(smallint)) and
- (longint(right.location.value) <= high(smallint))) then
- useconst := true
- else
- begin
- useconst := false;
- tmpreg := cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
- cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,
- aword(right.location.value),tmpreg);
- end
- end
- else
- useconst := false;
- location.loc := LOC_FLAGS;
- location.resflags := getresflags(unsigned);
- if tcgsize2size[right.location.size]=tcgsize2size[left.location.size] then
- cmpsize:=left.location.size
- else
- { ToDo : zero/sign extend??? }
- if tcgsize2size[right.location.size]<tcgsize2size[left.location.size] then
- cmpsize:=left.location.size
- else
- cmpsize:=right.location.size;
- opsize:=tcgsize2opsize[cmpsize];
- if opsize=S_NO then
- internalerror(2013090301);
- { Attention: The RIGHT(!) operand is substracted from and must be a
- register! }
- if (right.location.loc = LOC_CONSTANT) then
- if useconst then
- current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,opsize,
- longint(right.location.value),left.location.register))
- else
- begin
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,opsize,
- tmpreg,left.location.register));
- end
- else
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,opsize,
- right.location.register,left.location.register));
- end;
+ { set result location }
+ location_reset(location,LOC_FLAGS,OS_NO);
+ { see if we can optimize into TST }
+ if (right.location.loc=LOC_CONSTANT) and (right.location.value=0) then
+ begin
+ { Unsigned <0 or >=0 should not reach pass2, most likely }
+ case left.location.loc of
+ LOC_REFERENCE,
+ LOC_CREFERENCE:
+ begin
+ href:=left.location.reference;
+ tcg68k(cg).fixref(current_asmdata.CurrAsmList,href);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,opsize,href));
+ location_freetemp(current_asmdata.CurrAsmList,left.location);
+ end;
+ else
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,opsize,left.location.register));
+ end;
+ location.resflags := getresflags(unsigned);
+ exit;
+ end;
- function t68kaddnode.pass_1:tnode;
- var
- ld,rd : tdef;
- begin
- result:=inherited pass_1;
+ { Coldfire supports byte/word compares only starting with ISA_B,
+ !!see remark about Qemu weirdness in tcg68k.a_cmp_const_reg_label }
+ if (opsize<>S_L) and (current_settings.cputype in cpu_coldfire{-[cpu_isa_b,cpu_isa_c]}) then
+ begin
+ { 1) Extension is needed for LOC_REFERENCE, but what about LOC_REGISTER ? Perhaps after fixing cg we can assume
+ that high bits of registers are correct.
+ 2) Assuming that extension depends only on source signedness --> destination OS_32 is acceptable. }
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,cgsize_orddef(OS_32),false);
+ if (right.location.loc<>LOC_CONSTANT) then
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,cgsize_orddef(OS_32),false);
+ opsize:=S_L;
+ end
+ else if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+ begin
+ if not (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true)
+ else
+ begin
+ location_swap(left.location,right.location);
+ toggleflag(nf_swapped);
+ end;
+ end;
+ { left is now in register }
+ case right.location.loc of
+ LOC_CONSTANT:
+ current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,opsize,
+ longint(right.location.value),left.location.register));
+ LOC_REFERENCE,
+ LOC_CREFERENCE:
+ begin
+ href:=right.location.reference;
+ tcg68k(cg).fixref(current_asmdata.CurrAsmList,href);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(A_CMP,opsize,href,
+ left.location.register));
+ end;
+ LOC_REGISTER,
+ LOC_CREGISTER:
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,opsize,
+ right.location.register,left.location.register));
+ else
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,true);
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,opsize,
+ right.location.register,left.location.register));
+ end;
- { for 64 bit operations we return the resulting value in a register }
- if not assigned(result) then
- begin
- rd:=right.resultdef;
- ld:=left.resultdef;
- if (nodetype in [ltn,lten,gtn,gten,equaln,unequaln]) and
- (
- ((ld.typ=orddef) and (torddef(ld).ordtype in [u64bit,s64bit,scurrency])) or
- ((rd.typ=orddef) and (torddef(rd).ordtype in [u64bit,s64bit,scurrency]))
- ) then
- expectloc:=LOC_REGISTER;
- end;
- end;
+ { update location because sides could have been swapped }
+ location.resflags:=getresflags(unsigned);
+ end;
{*****************************************************************************
@@ -613,123 +343,167 @@ implementation
procedure t68kaddnode.second_cmp64bit;
var
+ hlab: tasmlabel;
unsigned : boolean;
- tmp_left_reg : tregister;
+ href: treference;
+
+ procedure firstjmp64bitcmp;
+ var
+ oldnodetype : tnodetype;
+ begin
+ case nodetype of
+ ltn,gtn:
+ begin
+ if (hlab<>current_procinfo.CurrTrueLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
+ { cheat a little bit for the negative test }
+ toggleflag(nf_swapped);
+ if (hlab<>current_procinfo.CurrFalseLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
+ toggleflag(nf_swapped);
+ end;
+ lten,gten:
+ begin
+ oldnodetype:=nodetype;
+ if nodetype=lten then
+ nodetype:=ltn
+ else
+ nodetype:=gtn;
+ if (hlab<>current_procinfo.CurrTrueLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
+ { cheat for the negative test }
+ if nodetype=ltn then
+ nodetype:=gtn
+ else
+ nodetype:=ltn;
+ if (hlab<>current_procinfo.CurrFalseLabel) then
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
+ nodetype:=oldnodetype;
+ end;
+ equaln:
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
+ unequaln:
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
+ end;
+ end;
+
+ procedure secondjmp64bitcmp;
+ begin
+ case nodetype of
+ ltn,gtn,lten,gten:
+ begin
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel);
+ cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
+ end;
+ equaln:
+ begin
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
+ cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
+ end;
+ unequaln:
+ begin
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
+ cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
+ end;
+ end;
+ end;
+
begin
+ { This puts constant operand (if any) to the right }
pass_left_right;
- force_reg_left_right(false,false);
unsigned:=not(is_signed(left.resultdef)) or
not(is_signed(right.resultdef));
- location_reset(location,LOC_REGISTER,OS_INT);
- location.register:=getres64_register(unsigned,left.location.register64,right.location.register64);
-
- { keep the below code for now, as we could optimize the =/<> code later
- on based on it }
-
- // writeln('second_cmp64bit');
-// pass_left_right;
+ location_reset(location,LOC_JUMP,OS_NO);
+ { Relational compares against constants having low dword=0 can omit the
+ second compare based on the fact that any unsigned value is >=0 }
+ hlab:=nil;
+ if (right.location.loc=LOC_CONSTANT) and
+ (lo(right.location.value64)=0) then
+ begin
+ case getresflags(true) of
+ F_AE: hlab:=current_procinfo.CurrTrueLabel;
+ F_B: hlab:=current_procinfo.CurrFalseLabel;
+ end;
+ end;
-// load_left_right(true,false);
-(*
- case nodetype of
- ltn,lten,
- gtn,gten:
- begin
- emit_cmp64_hi;
- firstjmp64bitcmp;
- emit_cmp64_lo;
- secondjmp64bitcmp;
- end;
- equaln,unequaln:
- begin
- // instead of doing a complicated compare, do
- // (left.hi xor right.hi) or (left.lo xor right.lo)
- // (somewhate optimized so that no superfluous 'mr's are
- // generated)
- if (left.location.loc = LOC_CONSTANT) then
- swapleftright;
- if (right.location.loc = LOC_CONSTANT) then
- begin
- if left.location.loc = LOC_REGISTER then
- begin
- tempreg64.reglo := left.location.register64.reglo;
- tempreg64.reghi := left.location.register64.reghi;
- end
- else
- begin
- if (aword(right.location.valueqword) <> 0) then
- tempreg64.reglo := cg.getintregister(current_asmdata.CurrAsmList)
- else
- tempreg64.reglo := left.location.register64.reglo;
- if ((right.location.valueqword shr 32) <> 0) then
- tempreg64.reghi := cg.getintregister(current_asmdata.CurrAsmList)
- else
- tempreg64.reghi := left.location.register64.reghi;
- end;
-
- if (aword(right.location.valueqword) <> 0) then
- { negative values can be handled using SUB, }
- { positive values < 65535 using XOR. }
- if (longint(right.location.valueqword) >= -32767) and
- (longint(right.location.valueqword) < 0) then
- cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_INT,
- aword(right.location.valueqword),
- left.location.register64.reglo,tempreg64.reglo)
- else
- cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_INT,
- aword(right.location.valueqword),
- left.location.register64.reglo,tempreg64.reglo);
-
- if ((right.location.valueqword shr 32) <> 0) then
- if (longint(right.location.valueqword shr 32) >= -32767) and
- (longint(right.location.valueqword shr 32) < 0) then
- cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,OS_INT,
- aword(right.location.valueqword shr 32),
- left.location.register64.reghi,tempreg64.reghi)
- else
- cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_XOR,OS_INT,
- aword(right.location.valueqword shr 32),
- left.location.register64.reghi,tempreg64.reghi);
- end
- else
- begin
- tempreg64.reglo := cg.getintregister(current_asmdata.CurrAsmList);
- tempreg64.reghi := cg.getintregister(current_asmdata.CurrAsmList);
- cg64.a_op64_reg_reg_reg(current_asmdata.CurrAsmList,OP_XOR,
- left.location.register64,right.location.register64,
- tempreg64);
- end;
-
- cg.a_reg_alloc(current_asmdata.CurrAsmList,R_0);
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_OR_,R_0,
- tempreg64.reglo,tempreg64.reghi));
- cg.a_reg_dealloc(current_asmdata.CurrAsmList,R_0);
- if (tempreg64.reglo <> left.location.register64.reglo) then
- cg.ungetregister(current_asmdata.CurrAsmList,tempreg64.reglo);
- if (tempreg64.reghi <> left.location.register64.reghi) then
- cg.ungetregister(current_asmdata.CurrAsmList,tempreg64.reghi);
-
- location_reset(location,LOC_FLAGS,OS_NO);
- location.resflags := getresflags;
+ if (right.location.loc=LOC_CONSTANT) and (right.location.value64=0) and
+ (nodetype in [equaln,unequaln]) then
+ begin
+ case left.location.loc of
+ LOC_REFERENCE,
+ LOC_CREFERENCE:
+ begin
+ href:=left.location.reference;
+ tcg68k(cg).fixref(current_asmdata.CurrAsmList,href);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,S_L,href));
+ firstjmp64bitcmp;
+ inc(href.offset,4);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,S_L,href));
+ secondjmp64bitcmp;
+ location_freetemp(current_asmdata.CurrAsmList,left.location);
end;
- else
- internalerror(2002072803);
+ else
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,S_L,left.location.register64.reglo));
+ firstjmp64bitcmp;
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,S_L,left.location.register64.reghi));
+ secondjmp64bitcmp;
end;
+ exit;
+ end;
+ { left and right no register? }
+ { then one must be demanded }
+ if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+ begin
+ if not (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true)
+ else
+ begin
+ location_swap(left.location,right.location);
+ toggleflag(nf_swapped);
+ end;
+ end;
- { set result location }
- { (emit_compare sets it to LOC_FLAGS for compares, so set the }
- { real location only now) (JM) }
- if cmpop and
- not(nodetype in [equaln,unequaln]) then
- location_reset(location,LOC_JUMP,OS_NO);
-*)
- // location_reset(location,LOC_JUMP,OS_NO);
- // writeln('second_cmp64_exit');
- end;
+ { left is now in register }
+ case right.location.loc of
+ LOC_REGISTER,LOC_CREGISTER:
+ begin
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,right.location.register64.reghi,left.location.register64.reghi));
+ firstjmp64bitcmp;
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,S_L,right.location.register64.reglo,left.location.register64.reglo));
+ secondjmp64bitcmp;
+ end;
+ LOC_REFERENCE,LOC_CREFERENCE:
+ begin
+ href:=right.location.reference;
+ tcg68k(cg).fixref(current_asmdata.CurrAsmList,href);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(A_CMP,S_L,href,left.location.register64.reghi));
+ firstjmp64bitcmp;
+ inc(href.offset,4);
+ current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(A_CMP,S_L,href,left.location.register64.reglo));
+ secondjmp64bitcmp;
+ location_freetemp(current_asmdata.CurrAsmList,right.location);
+ end;
+ LOC_CONSTANT:
+ begin
+ current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(hi(right.location.value64)),left.location.register64.reghi));
+ firstjmp64bitcmp;
+ if assigned(hlab) then
+ cg.a_jmp_always(current_asmdata.CurrAsmList,hlab)
+ else
+ begin
+ current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_CMP,S_L,aint(lo(right.location.value64)),left.location.register64.reglo));
+ secondjmp64bitcmp;
+ end;
+ end;
+ else
+ InternalError(2014072501);
+ end;
+ end;
begin
diff --git a/compiler/m68k/n68kcnv.pas b/compiler/m68k/n68kcnv.pas
index f49769e169..0158536efe 100644
--- a/compiler/m68k/n68kcnv.pas
+++ b/compiler/m68k/n68kcnv.pas
@@ -68,8 +68,14 @@ implementation
end
else
{ converting a 64bit integer to a float requires a helper }
- if is_64bitint(left.resultdef) then
+ if is_64bitint(left.resultdef) or
+ is_currency(left.resultdef) then
begin
+ { hack to avoid double division by 10000, as it's
+ already done by typecheckpass.resultdef_int_to_real }
+ if is_currency(left.resultdef) then
+ left.resultdef := s64inttype;
+
if is_signed(left.resultdef) then
fname := 'fpc_int64_to_double'
else
diff --git a/compiler/m68k/n68kmat.pas b/compiler/m68k/n68kmat.pas
index 8314498f9b..623e5f18a6 100644
--- a/compiler/m68k/n68kmat.pas
+++ b/compiler/m68k/n68kmat.pas
@@ -70,8 +70,7 @@ implementation
procedure tm68knotnode.second_boolean;
var
hreg: tregister;
- opsize : tcgsize;
- loc : tcgloc;
+ opsize : tcgsize;
begin
if not handle_locjump then
begin
@@ -154,10 +153,8 @@ implementation
procedure tm68kmoddivnode.emit_mod_reg_reg(signed: boolean;denum,num : tregister);
- var tmpreg : tregister;
- continuelabel : tasmlabel;
- signlabel : tasmlabel;
- reg_d0,reg_d1 : tregister;
+ var
+ tmpreg : tregister;
begin
if current_settings.cputype=cpu_MC68020 then
begin
diff --git a/compiler/m68k/ra68k.pas b/compiler/m68k/ra68k.pas
index 7dff294853..a28cf942af 100644
--- a/compiler/m68k/ra68k.pas
+++ b/compiler/m68k/ra68k.pas
@@ -328,6 +328,7 @@ unit ra68k;
function TM68kInstruction.ConcatLabeledInstr(p : TAsmList):tai;
begin
+ result:=nil;
if ((opcode >= A_BCC) and (opcode <= A_BVS)) or
(opcode = A_BRA) or (opcode = A_BSR) or
(opcode = A_JMP) or (opcode = A_JSR) or
diff --git a/compiler/m68k/ra68kmot.pas b/compiler/m68k/ra68kmot.pas
index 01d775ca7a..aedfed306a 100644
--- a/compiler/m68k/ra68kmot.pas
+++ b/compiler/m68k/ra68kmot.pas
@@ -616,6 +616,7 @@ const
l : longint;
errorflag: boolean;
begin
+ BuildExpression:=0;
errorflag := FALSE;
expr := '';
tempstr := '';
@@ -986,6 +987,7 @@ const
l: longint;
code: integer;
begin
+ str:='';
Consume(AS_STAR);
if (oper.opr.ref.scalefactor <> 0)
and (oper.opr.ref.scalefactor <> 1) then
@@ -1180,6 +1182,7 @@ const
code: integer;
str: string;
begin
+ str:='';
Consume(AS_LPAREN);
case actasmtoken of
{ // (reg ... // }
@@ -1309,6 +1312,7 @@ const
dataregset := [];
addrregset := [];
tempstr := '';
+ r:=NR_NO;
case actasmtoken of
{ // Memory reference // }
AS_LPAREN:
diff --git a/compiler/m68k/rgcpu.pas b/compiler/m68k/rgcpu.pas
index a981d73a75..0c0ab7957c 100644
--- a/compiler/m68k/rgcpu.pas
+++ b/compiler/m68k/rgcpu.pas
@@ -27,14 +27,150 @@ unit rgcpu;
interface
uses
- aasmbase,aasmtai,aasmdata,
- cpubase,
+ aasmbase,aasmtai,aasmdata,aasmcpu,
+ cgbase,cgutils,cpubase,
rgobj;
type
trgcpu = class(trgobj)
+ procedure do_spill_read(list:tasmlist;pos:tai;const spilltemp:treference;tempreg:tregister);override;
+ procedure do_spill_written(list:tasmlist;pos:tai;const spilltemp:treference;tempreg:tregister);override;
+ function do_spill_replace(list:TAsmList;instr:taicpu;orgreg:tsuperregister;const spilltemp:treference):boolean;override;
end;
implementation
+ uses
+ cutils,cgobj,verbose,globtype,globals,cpuinfo;
+
+ { returns True if source operand of MOVE can be replaced with spilltemp when its destination is ref^. }
+ function isvalidmovedest(ref: preference): boolean; inline;
+ begin
+ { The following is for Coldfire, for other CPUs it maybe can be relaxed. }
+ result:=(ref^.symbol=nil) and (ref^.scalefactor<=1) and
+ (ref^.index=NR_NO) and (ref^.base<>NR_NO) and (ref^.offset>=low(smallint)) and
+ (ref^.offset<=high(smallint));
+ end;
+
+
+ procedure trgcpu.do_spill_read(list:tasmlist;pos:tai;const spilltemp:treference;tempreg:tregister);
+ var
+ helpins : tai;
+ tmpref : treference;
+ helplist : tasmlist;
+ hreg : tregister;
+ begin
+ if (abs(spilltemp.offset)>32767) and (current_settings.cputype in (cpu_coldfire + [cpu_mc68000])) then
+ begin
+ helplist:=tasmlist.create;
+
+ if getregtype(tempreg)=R_INTREGISTER then
+ hreg:=tempreg
+ else
+ hreg:=cg.getintregister(helplist,OS_ADDR);
+{$ifdef DEBUG_SPILLING}
+ helplist.concat(tai_comment.Create(strpnew('Spilling: Read, large offset')));
+{$endif}
+
+ helplist.concat(taicpu.op_const_reg(A_MOVE,S_L,spilltemp.offset,hreg));
+ reference_reset_base(tmpref,spilltemp.base,0,sizeof(aint));
+ tmpref.index:=hreg;
+
+ helpins:=spilling_create_load(tmpref,tempreg);
+ helplist.concat(helpins);
+ list.insertlistafter(pos,helplist);
+ helplist.free;
+ end
+ else
+ inherited do_spill_read(list,pos,spilltemp,tempreg);
+ end;
+
+
+ procedure trgcpu.do_spill_written(list:tasmlist;pos:tai;const spilltemp:treference;tempreg:tregister);
+ var
+ tmpref : treference;
+ helplist : tasmlist;
+ hreg : tregister;
+ begin
+ if (abs(spilltemp.offset)>32767) and (current_settings.cputype in (cpu_coldfire + [cpu_mc68000])) then
+ begin
+ helplist:=tasmlist.create;
+
+ if getregtype(tempreg)=R_INTREGISTER then
+ hreg:=getregisterinline(helplist,[R_SUBWHOLE])
+ else
+ hreg:=cg.getintregister(helplist,OS_ADDR);
+{$ifdef DEBUG_SPILLING}
+ helplist.concat(tai_comment.Create(strpnew('Spilling: Write, large offset')));
+{$endif}
+
+ helplist.concat(taicpu.op_const_reg(A_MOVE,S_L,spilltemp.offset,hreg));
+ reference_reset_base(tmpref,spilltemp.base,0,sizeof(aint));
+ tmpref.index:=hreg;
+
+ helplist.concat(spilling_create_store(tempreg,tmpref));
+ if getregtype(tempreg)=R_INTREGISTER then
+ ungetregisterinline(helplist,hreg);
+
+ list.insertlistafter(pos,helplist);
+ helplist.free;
+ end
+ else
+ inherited do_spill_written(list,pos,spilltemp,tempreg);
+ end;
+
+
+ function trgcpu.do_spill_replace(list:TAsmList;instr:taicpu;orgreg:tsuperregister;const spilltemp:treference):boolean;
+ var
+ opidx: longint;
+ begin
+ result:=false;
+ opidx:=-1;
+ if (abs(spilltemp.offset)>32767) and (current_settings.cputype in cpu_coldfire) then
+ exit;
+ case instr.ops of
+ 1:
+ begin
+ if (instr.oper[0]^.typ=top_reg) and (getregtype(instr.oper[0]^.reg)=regtype) and
+ ((instr.opcode=A_TST) or (instr.opcode=A_CLR)) then
+ begin
+ if get_alias(getsupreg(instr.oper[0]^.reg))<>orgreg then
+ InternalError(2014080101);
+ opidx:=0;
+ end;
+ end;
+ 2:
+ begin
+ if (instr.oper[0]^.typ=top_reg) and (getregtype(instr.oper[0]^.reg)=regtype) and
+ (get_alias(getsupreg(instr.oper[0]^.reg))=orgreg) then
+ begin
+ { source can be replaced if dest is register... }
+ if ((instr.oper[1]^.typ=top_reg) and (instr.opcode in [A_MOVE,A_ADD,A_SUB,A_AND,A_OR,A_CMP])) or
+ {... or a "simple" reference in case of MOVE }
+ ((instr.opcode=A_MOVE) and (instr.oper[1]^.typ=top_ref) and isvalidmovedest(instr.oper[1]^.ref)) then
+ opidx:=0;
+ end
+ else if (instr.oper[1]^.typ=top_reg) and (getregtype(instr.oper[1]^.reg)=regtype) and
+ (get_alias(getsupreg(instr.oper[1]^.reg))=orgreg) and
+ (
+ (instr.opcode in [A_MOVE,A_ADD,A_SUB,A_AND,A_OR]) and
+ (instr.oper[0]^.typ=top_reg)
+ ) or
+ (instr.opcode in [A_ADDQ,A_SUBQ,A_MOV3Q]) then
+ opidx:=1;
+ end;
+ end;
+
+ if (opidx<0) then
+ exit;
+ instr.oper[opidx]^.typ:=top_ref;
+ new(instr.oper[opidx]^.ref);
+ instr.oper[opidx]^.ref^:=spilltemp;
+ case instr.opsize of
+ S_B: inc(instr.oper[opidx]^.ref^.offset,3);
+ S_W: inc(instr.oper[opidx]^.ref^.offset,2);
+ end;
+ result:=true;
+ end;
+
end.
diff --git a/compiler/m68k/symcpu.pas b/compiler/m68k/symcpu.pas
index 93702598cb..cb467ba937 100644
--- a/compiler/m68k/symcpu.pas
+++ b/compiler/m68k/symcpu.pas
@@ -186,14 +186,16 @@ implementation
procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
begin
inherited;
- ppufile.getderef(libsymderef);
+ if po_syscall_has_libsym in procoptions then
+ ppufile.getderef(libsymderef);
end;
procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
begin
inherited;
- ppufile.putderef(libsymderef);
+ if po_syscall_has_libsym in procoptions then
+ ppufile.putderef(libsymderef);
end;
@@ -208,14 +210,18 @@ implementation
procedure tcpuprocdef.buildderef;
begin
inherited;
- libsymderef.build(libsym);
+ if po_syscall_has_libsym in procoptions then
+ libsymderef.build(libsym);
end;
procedure tcpuprocdef.deref;
begin
inherited;
- libsym:=tsym(libsymderef.resolve);
+ if po_syscall_has_libsym in procoptions then
+ libsym:=tsym(libsymderef.resolve)
+ else
+ libsym:=nil;
end;
begin
diff --git a/compiler/mips/aasmcpu.pas b/compiler/mips/aasmcpu.pas
index 6a6ac39edf..08a63e7bc9 100644
--- a/compiler/mips/aasmcpu.pas
+++ b/compiler/mips/aasmcpu.pas
@@ -33,9 +33,9 @@ uses
const
{ "mov reg,reg" source operand number }
- O_MOV_SOURCE = 0;
+ O_MOV_SOURCE = 1;
{ "mov reg,reg" source operand number }
- O_MOV_DEST = 1;
+ O_MOV_DEST = 0;
type
{ taicpu }
@@ -401,13 +401,22 @@ end;
A_SNE,
A_EXT,
A_INS,
- A_MFC0];
+ A_MFC0,
+ A_SEB,
+ A_SEH];
begin
result := operand_read;
- if opcode in op_write_set then
- if opnr = 0 then
- result := operand_write;
+ case opcode of
+ A_DIV, { these have 3 operands if used as macros }
+ A_DIVU:
+ if (ops=3) and (opnr=0) then
+ result:=operand_write;
+ else
+ if opcode in op_write_set then
+ if opnr = 0 then
+ result := operand_write;
+ end;
end;
diff --git a/compiler/mips/aoptcpu.pas b/compiler/mips/aoptcpu.pas
index 8ae44180c2..451d0e040d 100644
--- a/compiler/mips/aoptcpu.pas
+++ b/compiler/mips/aoptcpu.pas
@@ -28,15 +28,18 @@ unit aoptcpu;
Interface
uses
- cgbase, cpubase, aoptobj, aoptcpub, aopt, aasmtai;
+ cgbase, cpubase, aoptobj, aoptcpub, aopt, aasmtai, aasmcpu;
Type
+ TAsmOpSet = set of TAsmOp;
+
TCpuAsmOptimizer = class(TAsmOptimizer)
+ function RegModifiedByInstruction(Reg: TRegister; p1: tai): boolean; override;
function GetNextInstructionUsingReg(Current: tai;
var Next: tai; reg: TRegister): Boolean;
- function RegUsedAfterInstruction(reg: Tregister; p: tai;
- var AllUsedRegs: TAllUsedRegs): Boolean;
function TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
+ function TryRemoveMovToRefIndex(var p: tai; next: taicpu): boolean;
+ function TryRemoveMovBeforeStore(var p: tai; next: taicpu; const storeops: TAsmOpSet): boolean;
function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
procedure PeepHoleOptPass2; override;
End;
@@ -44,7 +47,7 @@ unit aoptcpu;
Implementation
uses
- globals,aasmbase,aasmcpu,cpuinfo,verbose;
+ cutils,globtype,globals,aasmbase,cpuinfo,verbose;
function MatchInstruction(const instr: tai; const op: TAsmOp): boolean;
@@ -93,10 +96,15 @@ unit aoptcpu;
end;
- function CanBeCMOV(p: tai): boolean;
+ function CanBeCMOV(p: tai; condreg: tregister): boolean;
begin
result:=assigned(p) and (p.typ=ait_instruction) and
- (taicpu(p).opcode in [A_MOV_D,A_MOV_S,A_MOVE]);
+ ((taicpu(p).opcode in [A_MOV_D,A_MOV_S]) or
+ (
+ { register with condition must not be overwritten }
+ (taicpu(p).opcode=A_MOVE) and
+ (taicpu(p).oper[0]^.reg<>condreg)
+ ));
end;
@@ -170,6 +178,20 @@ unit aoptcpu;
end;
+ function TCpuAsmOptimizer.RegModifiedByInstruction(Reg: TRegister; p1: tai): boolean;
+ var
+ i : Longint;
+ begin
+ result:=false;
+ for i:=0 to taicpu(p1).ops-1 do
+ if (taicpu(p1).oper[i]^.typ=top_reg) and (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
+ begin
+ result:=true;
+ exit;
+ end;
+ end;
+
+
function TCpuAsmOptimizer.GetNextInstructionUsingReg(Current: tai;
var Next: tai; reg: TRegister): Boolean;
begin
@@ -178,7 +200,7 @@ unit aoptcpu;
Result:=GetNextInstruction(Next,Next);
until {not(cs_opt_level3 in current_settings.optimizerswitches) or} not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
(is_calljmp(taicpu(Next).opcode));
- if Result and is_calljmp(taicpu(next).opcode) then
+ if Result and (next.typ=ait_instruction) and is_calljmp(taicpu(next).opcode) then
begin
result:=false;
next:=nil;
@@ -186,21 +208,6 @@ unit aoptcpu;
end;
- function TCpuAsmOptimizer.RegUsedAfterInstruction(reg: Tregister; p: tai;
- var AllUsedRegs: TAllUsedRegs): Boolean;
- begin
- AllUsedRegs[getregtype(reg)].Update(tai(p.Next),true);
- RegUsedAfterInstruction :=
- AllUsedRegs[getregtype(reg)].IsUsed(reg) and
- not(regLoadedWithNewValue(reg,p)) and
- (
- not(GetNextInstruction(p,p)) or
- instructionLoadsFromReg(reg,p) or
- not(regLoadedWithNewValue(reg,p))
- );
- end;
-
-
function TCpuAsmOptimizer.TryRemoveMov(var p: tai; opcode: TAsmOp): boolean;
var
next,hp1: tai;
@@ -215,7 +222,7 @@ unit aoptcpu;
opcode may be A_MOVE, A_MOV_s, A_MOV_d, etc.
}
result:=false;
- if (taicpu(p).ops>1) and
+ if (taicpu(p).ops>0) and
GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
MatchInstruction(next,opcode) and
MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) and
@@ -256,21 +263,96 @@ unit aoptcpu;
taicpu(p).loadreg(0,taicpu(next).oper[0]^.reg);
asml.remove(next);
next.free;
+ result:=true;
+ end
+ else // no dealloc found
+ begin
+ { try to optimize the typical call sequence
+ lw $reg, (whatever)
+ <alloc volatile registers>
+ move $t9,$reg
+ jalr $t9
+ Do not do so if the used register might contain a
+ register variable. }
+ if (opcode=A_MOVE) and
+ not(cs_opt_regvar in current_settings.optimizerswitches) and
+ (taicpu(next).oper[0]^.reg=NR_R25) and
+ GetNextInstruction(next,hp1) and
+ MatchInstruction(hp1,A_JALR) and
+ MatchOperand(taicpu(hp1).oper[0]^,NR_R25) then
+ begin
+ taicpu(p).loadreg(0,taicpu(next).oper[0]^.reg);
+ asml.remove(next);
+ next.free;
+ result:=true;
+ end;
end;
end;
end;
+ function TCpuAsmOptimizer.TryRemoveMovBeforeStore(var p: tai; next: taicpu; const storeops: TAsmOpSet): boolean;
+ begin
+ result:=(next.opcode in storeops) and
+ MatchOperand(next.oper[0]^,taicpu(p).oper[0]^.reg) and
+ { Ry cannot be modified between move and store }
+ (not RegModifiedBetween(taicpu(p).oper[1]^.reg,p,next)) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next)));
+ if result then
+ begin
+ next.loadreg(0,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
+ end;
+
+
+ function TCpuAsmOptimizer.TryRemoveMovToRefIndex(var p: tai; next: taicpu): boolean;
+ begin
+ result:=(next.oper[1]^.typ=top_ref) and
+ (next.oper[1]^.ref^.base=taicpu(p).oper[0]^.reg) and
+ (not RegModifiedBetween(taicpu(p).oper[1]^.reg,p,next)) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next)));
+ if result then
+ begin
+ next.oper[1]^.ref^.base:=taicpu(p).oper[1]^.reg;
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
+ end;
+
+
function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
var
next,next2: tai;
- TmpUsedRegs: TAllUsedRegs;
begin
result:=false;
case p.typ of
ait_instruction:
begin
case taicpu(p).opcode of
+ A_SEH:
+ begin
+ if GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
+ MatchInstruction(next,A_SH) and
+ MatchOperand(taicpu(next).oper[0]^,taicpu(p).oper[0]^.reg) and
+ (not RegUsedBetween(taicpu(p).oper[1]^.reg,p,next)) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
+ begin
+ taicpu(next).loadreg(0,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end
+ else
+ TryRemoveMov(p,A_MOVE);
+ end;
+ A_SEB:
+ { TODO: can be handled similar to A_SEH, but it's almost never encountered }
+ TryRemoveMov(p,A_MOVE);
+
A_SLL:
begin
{ if this is a sign extension... }
@@ -289,10 +371,7 @@ unit aoptcpu;
{ the initial register may not be reused }
(not RegUsedBetween(taicpu(p).oper[1]^.reg,next,next2)) then
begin
- CopyUsedRegs(TmpUsedRegs);
- UpdateUsedRegs(TmpUsedRegs, tai(p.next));
- UpdateUsedRegs(TmpUsedRegs, tai(next.next));
- if not RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,next2,TmpUsedRegs) then
+ if Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next2.next))) then
begin
taicpu(next2).loadreg(0,taicpu(p).oper[1]^.reg);
asml.remove(p);
@@ -301,7 +380,6 @@ unit aoptcpu;
next.free;
p:=next2;
end;
- ReleaseUsedRegs(TmpUsedRegs);
end
else
TryRemoveMov(p,A_MOVE);
@@ -309,6 +387,7 @@ unit aoptcpu;
A_SRL:
begin
+ { TODO: also kill sign-extensions that follow, both SLL+SRA and SEB/SEH versions }
{ Remove 'andi' in sequences
srl Rx,Ry,16
andi Rx,Rx,65535
@@ -368,37 +447,184 @@ unit aoptcpu;
((taicpu(p).oper[2]^.val=255) and MatchInstruction(next,A_SB)) or
((taicpu(p).oper[2]^.val=65535) and MatchInstruction(next,A_SH)) and
(taicpu(next).oper[0]^.typ=top_reg) and
- (taicpu(next).oper[0]^.reg=taicpu(p).oper[0]^.reg) then
+ (taicpu(next).oper[0]^.reg=taicpu(p).oper[0]^.reg) and
+ assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
begin
- CopyUsedRegs(TmpUsedRegs);
- UpdateUsedRegs(TmpUsedRegs, tai(p.next));
- if not RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,next,TmpUsedRegs) then
+ taicpu(next).loadreg(0,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end
+ else
+ TryRemoveMov(p,A_MOVE);
+ end;
+
+ A_MOV_S:
+ begin
+ if GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
+ (next.typ=ait_instruction) then
+ begin
+ if TryRemoveMovBeforeStore(p,taicpu(next),[A_SWC1]) then
+ { optimization successful };
+ end;
+ end;
+
+ A_MOV_D:
+ begin
+ if GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
+ (next.typ=ait_instruction) then
+ begin
+ if TryRemoveMovBeforeStore(p,taicpu(next),[A_SDC1]) then
+ { optimization successful };
+ end;
+ end;
+
+ A_MOVE:
+ begin
+ if GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
+ (next.typ=ait_instruction) and
+ (not RegModifiedBetween(taicpu(p).oper[1]^.reg,p,next)) then
+ begin
+ { MOVE Rx,Ry; store Rx,(ref); dealloc Rx ==> store Ry,(ref) }
+ if TryRemoveMovBeforeStore(p,taicpu(next),[A_SB,A_SH,A_SW]) then
+ { optimization successful }
+ else if TryRemoveMovToRefIndex(p,taicpu(next)) then
+ { successful as well }
+ { MOVE Rx,Ry; opcode Rx,Rx,any ==> opcode Rx,Ry,any
+ MOVE Rx,Ry; opcode Rx,Rz,Rx ==> opcode Rx,Rz,Ry }
+ else if (taicpu(next).opcode in [A_ADD,A_ADDU,A_ADDI,A_ADDIU,A_SUB,A_SUBU]) and
+ MatchOperand(taicpu(next).oper[0]^,taicpu(p).oper[0]^.reg) then
begin
- taicpu(next).loadreg(0,taicpu(p).oper[1]^.reg);
- asml.remove(p);
- p.free;
- p:=next;
+ if MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
+ begin
+ taicpu(next).loadreg(1,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end
+ { TODO: if Ry=NR_R0, this effectively changes instruction into MOVE,
+ providing further optimization possibilities }
+ else if MatchOperand(taicpu(next).oper[2]^,taicpu(p).oper[0]^.reg) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
+ begin
+ taicpu(next).loadreg(2,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
+ end
+ { MOVE Rx,Ry; opcode Rz,Rx,any; dealloc Rx ==> opcode Rz,Ry,any }
+ else if (taicpu(next).opcode in [A_ADD,A_ADDU,A_ADDI,A_ADDIU,A_SUB,A_SUBU,A_SLT,A_SLTU,A_DIV,A_DIVU]) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
+ begin
+ if MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) then
+ begin
+ taicpu(next).loadreg(1,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end
+ else if MatchOperand(taicpu(next).oper[2]^,taicpu(p).oper[0]^.reg) then
+ begin
+ taicpu(next).loadreg(2,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
+ end
+ { MULT[U] must be handled separately due to different operand numbers }
+ else if (taicpu(next).opcode in [A_MULT,A_MULTU]) and
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) then
+ begin
+ if MatchOperand(taicpu(next).oper[0]^,taicpu(p).oper[0]^.reg) then
+ begin
+ taicpu(next).loadreg(0,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end
+ else if MatchOperand(taicpu(next).oper[1]^,taicpu(p).oper[0]^.reg) then
+ begin
+ taicpu(next).loadreg(1,taicpu(p).oper[1]^.reg);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
+ end
+ else if TryRemoveMov(p,A_MOVE) then
+ begin
+ { Ended up with move between same register? Suicide then. }
+ if (taicpu(p).oper[0]^.reg=taicpu(p).oper[1]^.reg) then
+ begin
+ GetNextInstruction(p,next);
+ asml.remove(p);
+ p.free;
+ p:=next;
+ end;
end;
- ReleaseUsedRegs(TmpUsedRegs);
+ { TODO: MOVE Rx,Ry; Bcc Rx,Rz,label; dealloc Rx ==> Bcc Ry,Rz,label }
+ end;
+ end;
+
+ A_ADDIU:
+ begin
+ { ADDIU Rx,Ry,const; load/store Rz,(Rx); dealloc Rx ==> load/store Rz,const(Ry)
+ ADDIU Rx,Ry,%lo(sym); load/store Rz,(Rx); dealloc Rx ==> load/store Rz,%lo(sym)(Ry)
+ ADDIU Rx,Ry,const; load Rx,(Rx) ==> load Rx,const(Ry)
+ ADDIU Rx,Ry,%lo(sym); load Rx,(Rx) ==> load Rx,%lo(sym)(Ry) }
+ if GetNextInstructionUsingReg(p,next,taicpu(p).oper[0]^.reg) and
+ (next.typ=ait_instruction) and
+ (taicpu(next).opcode in [A_LB,A_LBU,A_LH,A_LHU,A_LW,A_SB,A_SH,A_SW]) and
+ (taicpu(p).oper[0]^.reg=taicpu(next).oper[1]^.ref^.base) and
+ (taicpu(next).oper[1]^.ref^.offset=0) and
+ (taicpu(next).oper[1]^.ref^.symbol=nil) and
+ (
+ Assigned(FindRegDealloc(taicpu(p).oper[0]^.reg,tai(next.next))) or
+ (
+ (taicpu(p).oper[0]^.reg=taicpu(next).oper[0]^.reg) and
+ (taicpu(next).opcode in [A_LB,A_LBU,A_LH,A_LHU,A_LW])
+ )
+ ) and
+ (not RegModifiedBetween(taicpu(p).oper[1]^.reg,p,next)) then
+ begin
+ case taicpu(p).oper[2]^.typ of
+ top_const:
+ taicpu(next).oper[1]^.ref^.offset:=taicpu(p).oper[2]^.val;
+
+ top_ref:
+ taicpu(next).oper[1]^.ref^:=taicpu(p).oper[2]^.ref^;
+ else
+ InternalError(2014100401);
+ end;
+ taicpu(next).oper[1]^.ref^.base:=taicpu(p).oper[1]^.reg;
+ asml.remove(p);
+ p.free;
+ p:=next;
+ result:=true;
end
else
- TryRemoveMov(p,A_MOVE);
+ result:=TryRemoveMov(p,A_MOVE);
end;
+ A_LB,A_LBU,A_LH,A_LHU,A_LW,
A_ADD,A_ADDU,
- A_ADDI,A_ADDIU,
+ A_ADDI,
A_SUB,A_SUBU,
A_SRA,A_SRAV,
A_SRLV,
A_SLLV,
+ A_MFLO,A_MFHI,
A_AND,A_OR,A_XOR,A_ORI,A_XORI:
TryRemoveMov(p,A_MOVE);
+ A_LWC1,
A_ADD_s, A_SUB_s, A_MUL_s, A_DIV_s,
A_ABS_s, A_NEG_s, A_SQRT_s,
A_CVT_s_w, A_CVT_s_l, A_CVT_s_d:
TryRemoveMov(p,A_MOV_s);
+ A_LDC1,
A_ADD_d, A_SUB_d, A_MUL_d, A_DIV_d,
A_ABS_d, A_NEG_d, A_SQRT_d,
A_CVT_d_w, A_CVT_d_l, A_CVT_d_s:
@@ -452,7 +678,7 @@ unit aoptcpu;
}
l:=0;
GetNextInstruction(p, hp1);
- while CanBeCMOV(hp1) do // CanBeCMOV returns False for nil or labels
+ while CanBeCMOV(hp1,condreg) do // CanBeCMOV returns False for nil or labels
begin
inc(l);
GetNextInstruction(hp1,hp1);
@@ -470,7 +696,7 @@ unit aoptcpu;
repeat
ChangeToCMOV(taicpu(hp1),condition,condreg);
GetNextInstruction(hp1,hp1);
- until not CanBeCMOV(hp1);
+ until not CanBeCMOV(hp1,condreg);
{ wait with removing else GetNextInstruction could
ignore the label if it was the only usage in the
jump moved away }
@@ -508,7 +734,7 @@ unit aoptcpu;
l:=0;
{ skip hp1 to <several moves 2> }
GetNextInstruction(hp1, hp1);
- while CanBeCMOV(hp1) do
+ while CanBeCMOV(hp1,condreg) do
begin
inc(l);
GetNextInstruction(hp1, hp1);
@@ -524,7 +750,7 @@ unit aoptcpu;
repeat
ChangeToCMOV(taicpu(hp1),condition,condreg);
GetNextInstruction(hp1,hp1);
- until not CanBeCMOV(hp1);
+ until not CanBeCMOV(hp1,condreg);
{ hp2 is still at b yyy }
GetNextInstruction(hp2,hp1);
{ hp2 is now at xxx: }
@@ -534,7 +760,7 @@ unit aoptcpu;
repeat
ChangeToCMOV(taicpu(hp1),condition,condreg);
GetNextInstruction(hp1,hp1);
- until not CanBeCMOV(hp1);
+ until not CanBeCMOV(hp1,condreg);
{ remove bCC }
tasmlabel(taicpu(hp3).oper[taicpu(hp3).ops-1]^.ref^.symbol).decrefs;
RemoveDelaySlot(hp3);
diff --git a/compiler/mips/cgcpu.pas b/compiler/mips/cgcpu.pas
index cdc8d213b2..79e4a68975 100644
--- a/compiler/mips/cgcpu.pas
+++ b/compiler/mips/cgcpu.pas
@@ -197,16 +197,9 @@ begin
{ PIC global symbol }
ref.symbol:=nil;
- if (ref.offset=0) then
- exit;
-
if (ref.offset>=simm16lo) and
(ref.offset<=simm16hi-sizeof(pint)) then
- begin
- list.concat(taicpu.op_reg_reg_const(A_ADDIU,ref.base,ref.base,ref.offset));
- ref.offset:=0;
- exit;
- end;
+ exit;
{ fallthrough to the case of large offset }
end;
@@ -295,10 +288,6 @@ begin
[RS_F0,RS_F2,RS_F4,RS_F6, RS_F8,RS_F10,RS_F12,RS_F14,
RS_F16,RS_F18,RS_F20,RS_F22, RS_F24,RS_F26,RS_F28,RS_F30],
first_fpu_imreg, []);
-
- { needs at least one element for rgobj not to crash }
- rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBNONE,
- [RS_R0],first_mm_imreg,[]);
end;
@@ -307,7 +296,6 @@ procedure TCGMIPS.done_register_allocators;
begin
rg[R_INTREGISTER].Free;
rg[R_FPUREGISTER].Free;
- rg[R_MMREGISTER].Free;
inherited done_register_allocators;
end;
@@ -441,7 +429,7 @@ end;
procedure TCGMIPS.a_load_const_reg(list: tasmlist; size: TCGSize; a: tcgint; reg: TRegister);
begin
if (a = 0) then
- list.concat(taicpu.op_reg_reg(A_MOVE, reg, NR_R0))
+ a_load_reg_reg(list, OS_INT, OS_INT, NR_R0, reg)
else if (a >= simm16lo) and (a <= simm16hi) then
list.concat(taicpu.op_reg_reg_const(A_ADDIU, reg, NR_R0, a))
else if (a>=0) and (a <= 65535) then
@@ -546,13 +534,23 @@ begin
done:=false;
OS_S8:
begin
- list.concat(taicpu.op_reg_reg_const(A_SLL, reg2, reg1, 24));
- list.concat(taicpu.op_reg_reg_const(A_SRA, reg2, reg2, 24));
+ if (CPUMIPS_HAS_ISA32R2 in cpu_capabilities[current_settings.cputype]) then
+ list.concat(taicpu.op_reg_reg(A_SEB,reg2,reg1))
+ else
+ begin
+ list.concat(taicpu.op_reg_reg_const(A_SLL, reg2, reg1, 24));
+ list.concat(taicpu.op_reg_reg_const(A_SRA, reg2, reg2, 24));
+ end;
end;
OS_S16:
begin
- list.concat(taicpu.op_reg_reg_const(A_SLL, reg2, reg1, 16));
- list.concat(taicpu.op_reg_reg_const(A_SRA, reg2, reg2, 16));
+ if (CPUMIPS_HAS_ISA32R2 in cpu_capabilities[current_settings.cputype]) then
+ list.concat(taicpu.op_reg_reg(A_SEH,reg2,reg1))
+ else
+ begin
+ list.concat(taicpu.op_reg_reg_const(A_SLL, reg2, reg1, 16));
+ list.concat(taicpu.op_reg_reg_const(A_SRA, reg2, reg2, 16));
+ end;
end;
else
internalerror(2002090901);
@@ -820,6 +818,7 @@ var
hreg: TRegister;
asmop: TAsmOp;
begin
+ a:=aint(a);
ovloc.loc := LOC_VOID;
optimize_op_const(size,op,a);
signed:=(size in [OS_S8,OS_S16,OS_S32]);
@@ -935,23 +934,30 @@ begin
end;
OP_MUL,OP_IMUL:
begin
- list.concat(taicpu.op_reg_reg(TOpCg2AsmOp[op], src2, src1));
- list.concat(taicpu.op_reg(A_MFLO, dst));
- if setflags then
+ if (CPUMIPS_HAS_ISA32R2 in cpu_capabilities[current_settings.cputype]) and
+ (not setflags) then
+ { NOTE: MUL is actually mips32r1 instruction; on older cores it is handled as macro }
+ list.concat(taicpu.op_reg_reg_reg(A_MUL,dst,src2,src1))
+ else
begin
- current_asmdata.getjumplabel(hl);
- hreg:=GetIntRegister(list,OS_INT);
- list.concat(taicpu.op_reg(A_MFHI,hreg));
- if (op=OP_IMUL) then
+ list.concat(taicpu.op_reg_reg(TOpCg2AsmOp[op], src2, src1));
+ list.concat(taicpu.op_reg(A_MFLO, dst));
+ if setflags then
begin
- hreg2:=GetIntRegister(list,OS_INT);
- list.concat(taicpu.op_reg_reg_const(A_SRA,hreg2,dst,31));
- a_cmp_reg_reg_label(list,OS_INT,OC_EQ,hreg2,hreg,hl);
- end
- else
- a_cmp_reg_reg_label(list,OS_INT,OC_EQ,hreg,NR_R0,hl);
- list.concat(taicpu.op_const(A_BREAK,6));
- a_label(list,hl);
+ current_asmdata.getjumplabel(hl);
+ hreg:=GetIntRegister(list,OS_INT);
+ list.concat(taicpu.op_reg(A_MFHI,hreg));
+ if (op=OP_IMUL) then
+ begin
+ hreg2:=GetIntRegister(list,OS_INT);
+ list.concat(taicpu.op_reg_reg_const(A_SRA,hreg2,dst,31));
+ a_cmp_reg_reg_label(list,OS_INT,OC_EQ,hreg2,hreg,hl);
+ end
+ else
+ a_cmp_reg_reg_label(list,OS_INT,OC_EQ,hreg,NR_R0,hl);
+ list.concat(taicpu.op_const(A_BREAK,6));
+ a_label(list,hl);
+ end;
end;
end;
OP_AND,OP_OR,OP_XOR:
@@ -1071,7 +1077,28 @@ end;
procedure TCGMIPS.a_jmp_flags(list: tasmlist; const f: TResFlags; l: tasmlabel);
+ var
+ ai: taicpu;
begin
+ case f.reg1 of
+ NR_FCC0..NR_FCC7:
+ begin
+ if (f.reg1=NR_FCC0) then
+ ai:=taicpu.op_sym(A_BC,l)
+ else
+ ai:=taicpu.op_reg_sym(A_BC,f.reg1,l);
+ list.concat(ai);
+ { delay slot }
+ list.concat(taicpu.op_none(A_NOP));
+ case f.cond of
+ OC_NE: ai.SetCondition(C_COP1TRUE);
+ OC_EQ: ai.SetCondition(C_COP1FALSE);
+ else
+ InternalError(2014082901);
+ end;
+ exit;
+ end;
+ end;
if f.use_const then
a_cmp_const_reg_label(list,OS_INT,f.cond,f.value,f.reg1,l)
else
@@ -1083,7 +1110,33 @@ procedure TCGMIPS.g_flags2reg(list: tasmlist; size: tcgsize; const f: tresflags;
var
left,right: tregister;
unsigned: boolean;
+ hl: tasmlabel;
begin
+ case f.reg1 of
+ NR_FCC0..NR_FCC7:
+ begin
+ if (current_settings.cputype>=cpu_mips4) then
+ begin
+ a_load_const_reg(list,size,1,reg);
+ case f.cond of
+ OC_NE: list.concat(taicpu.op_reg_reg_reg(A_MOVF,reg,NR_R0,f.reg1));
+ OC_EQ: list.concat(taicpu.op_reg_reg_reg(A_MOVT,reg,NR_R0,f.reg1));
+ else
+ InternalError(2014082902);
+ end;
+ end
+ else
+ begin
+ { TODO: still possible to do branchless by extracting appropriate bit from FCSR? }
+ current_asmdata.getjumplabel(hl);
+ a_load_const_reg(list,size,1,reg);
+ a_jmp_flags(list,f,hl);
+ a_load_const_reg(list,size,0,reg);
+ a_label(list,hl);
+ end;
+ exit;
+ end;
+ end;
if (f.cond in [OC_EQ,OC_NE]) then
begin
left:=reg;
@@ -1212,7 +1265,6 @@ var
largeoffs : boolean;
begin
list.concat(tai_directive.create(asd_ent,current_procinfo.procdef.mangledname));
- a_reg_alloc(list,NR_STACK_POINTER_REG);
if nostackframe then
begin
@@ -1221,9 +1273,6 @@ begin
exit;
end;
- if (pi_needs_stackframe in current_procinfo.flags) then
- a_reg_alloc(list,NR_FRAME_POINTER_REG);
-
helplist:=TAsmList.Create;
reference_reset(href,0);
@@ -1236,7 +1285,7 @@ begin
begin
if reg in (rg[R_FPUREGISTER].used_in_proc-paramanager.get_volatile_registers_fpu(pocall_stdcall)) then
begin
- fmask:=fmask or (1 shl ord(reg));
+ fmask:=fmask or (longword(1) shl ord(reg));
href.offset:=nextoffset;
lastfpuoffset:=nextoffset;
helplist.concat(taicpu.op_reg_ref(A_SWC1,newreg(R_FPUREGISTER,reg,R_SUBFS),href));
@@ -1266,7 +1315,7 @@ begin
begin
if reg in saveregs then
begin
- mask:=mask or (1 shl ord(reg));
+ mask:=mask or (longword(1) shl ord(reg));
href.offset:=nextoffset;
lastintoffset:=nextoffset;
if (reg=RS_FRAME_POINTER_REG) then
@@ -1282,8 +1331,8 @@ begin
//list.concat(Taicpu.Op_reg_reg_const(A_ADDIU,NR_FRAME_POINTER_REG,NR_STACK_POINTER_REG,current_procinfo.para_stack_size));
list.concat(Taicpu.op_none(A_P_SET_NOMIPS16));
list.concat(Taicpu.op_reg_const_reg(A_P_FRAME,current_procinfo.framepointer,LocalSize,NR_R31));
- list.concat(Taicpu.op_const_const(A_P_MASK,mask,-(LocalSize-lastintoffset)));
- list.concat(Taicpu.op_const_const(A_P_FMASK,Fmask,-(LocalSize-lastfpuoffset)));
+ list.concat(Taicpu.op_const_const(A_P_MASK,aint(mask),-(LocalSize-lastintoffset)));
+ list.concat(Taicpu.op_const_const(A_P_FMASK,aint(Fmask),-(LocalSize-lastfpuoffset)));
list.concat(Taicpu.op_none(A_P_SET_NOREORDER));
if (cs_create_pic in current_settings.moduleswitches) and
(pi_needs_got in current_procinfo.flags) then
diff --git a/compiler/mips/cpuelf.pas b/compiler/mips/cpuelf.pas
index b3d0dcf7ad..1c2de17e0c 100644
--- a/compiler/mips/cpuelf.pas
+++ b/compiler/mips/cpuelf.pas
@@ -207,6 +207,8 @@ implementation
result:=R_MIPS_NONE;
RELOC_ABSOLUTE:
result:=R_MIPS_32;
+ RELOC_GOTOFF: {For case jumptables only }
+ result:=R_MIPS_GPREL32;
else
result:=0;
InternalError(2012110602);
@@ -739,15 +741,15 @@ implementation
if (lowreloc.ftype=R_MIPS_LO16) then
begin;
found:=true;
+ objsec.Data.Seek(objreloc.DataOffset);
+ objsec.Data.Read(hipart,sizeof(hipart));
+ objsec.Data.Seek(lowreloc.DataOffset);
+ objsec.Data.Read(lopart,sizeof(lopart));
break;
end;
end;
if not found then
InternalError(2013030102);
- objsec.Data.Seek(objreloc.DataOffset);
- objsec.Data.Read(hipart,sizeof(hipart));
- objsec.Data.Seek(lowreloc.DataOffset);
- objsec.Data.Read(lopart,sizeof(lopart));
if (source_info.endian<>target_info.endian) then
begin
hipart:=swapendian(hipart);
@@ -809,7 +811,7 @@ implementation
else
reltyp:=objreloc.ftype;
- if ElfTarget.relocs_use_addend then
+ if (oso_rela_relocs in objsec.SecOptions) then
address:=objreloc.orgsize
else
begin
diff --git a/compiler/mips/cpugas.pas b/compiler/mips/cpugas.pas
index f6397270a5..65a884a52b 100644
--- a/compiler/mips/cpugas.pas
+++ b/compiler/mips/cpugas.pas
@@ -225,7 +225,7 @@ unit cpugas;
not (ai.condition in [C_EQ,C_NE,C_GTZ,C_GEZ,C_LTZ,C_LEZ,C_COP1TRUE,C_COP1FALSE])) {or (op=A_JAL)}
or (op=A_REM) or (op=A_REMU)
{ DIV and DIVU are normally macros, but use $zero as first arg to generate a CPU instruction. }
- or ((op=A_DIV) or (op=A_DIVU) and
+ or (((op=A_DIV) or (op=A_DIVU)) and
((ai.ops<>3) or (ai.oper[0]^.typ<>top_reg) or (ai.oper[0]^.reg<>NR_R0)))
or (op=A_MULO) or (op=A_MULOU)
{ A_LI is only a macro if the immediate is not in thez 16-bit range }
diff --git a/compiler/mips/cpuinfo.pas b/compiler/mips/cpuinfo.pas
index 01accd5f85..91355b99b1 100644
--- a/compiler/mips/cpuinfo.pas
+++ b/compiler/mips/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = type double;
@@ -87,7 +90,7 @@ Const
fputypestr : array[tfputype] of string[9] = ('',
'SOFT',
- 'FPU_MIPS2','FPU_MIPS3'
+ 'MIPS2','MIPS3'
);
{ abi strings as accepted by
@@ -104,23 +107,49 @@ Const
mips_abi : tabitype = abi_default;
-{$ifdef MIPSEL}
type
- tcpuflags=(CPUMIPS_HAS_XXXX); //Todo: Does this need to be filled?
+ tcpuflags=(
+ CPUMIPS_HAS_CMOV, { conditional move instructions (mips4+) }
+ CPUMIPS_HAS_ISA32R2 { mips32r2 instructions (also on PIC32) }
+ );
const
cpu_capabilities : array[tcputype] of set of tcpuflags =
- ( { cpu_none } [],
- { cpu_mips1 } [],
- { cpu_mips2 } [],
- { cpu_mips3 } [],
- { cpu_mips4 } [],
- { cpu_mips5 } [],
- { cpu_mips32 } [],
- { cpu_mips32r2 } [],
- { cpu_pic32mx } []
+ ( { cpu_none } [],
+ { cpu_mips1 } [],
+ { cpu_mips2 } [],
+ { cpu_mips3 } [],
+ { cpu_mips4 } [CPUMIPS_HAS_CMOV],
+ { cpu_mips5 } [CPUMIPS_HAS_CMOV],
+ { cpu_mips32 } [CPUMIPS_HAS_CMOV],
+ { cpu_mips32r2 } [CPUMIPS_HAS_CMOV,CPUMIPS_HAS_ISA32R2],
+ { cpu_pic32mx } [CPUMIPS_HAS_CMOV,CPUMIPS_HAS_ISA32R2]
);
+{$ifndef MIPSEL}
+type
+ tcontrollertype =
+ (ct_none
+ );
+
+
+Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+{$ELSE MIPSEL}
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = true;
type
tcontrollertype =
diff --git a/compiler/mips/ncpuadd.pas b/compiler/mips/ncpuadd.pas
index e1c17336e4..f55c89f452 100644
--- a/compiler/mips/ncpuadd.pas
+++ b/compiler/mips/ncpuadd.pas
@@ -37,27 +37,30 @@ type
procedure cmp64_lt(left_reg, right_reg: TRegister64;unsigned:boolean);
procedure cmp64_le(left_reg, right_reg: TRegister64;unsigned:boolean);
procedure second_generic_cmp32(unsigned: boolean);
+ procedure second_mul64bit;
protected
procedure second_addfloat; override;
procedure second_cmpfloat; override;
procedure second_cmpboolean; override;
procedure second_cmpsmallset; override;
+ procedure second_add64bit; override;
procedure second_cmp64bit; override;
procedure second_cmpordinal; override;
procedure second_addordinal; override;
public
- function pass_1: tnode; override;
function use_generic_mul32to64: boolean; override;
+ function use_generic_mul64bit: boolean; override;
end;
implementation
uses
- systems,
+ systems, globtype, globals,
cutils, verbose,
paramgr,
aasmtai, aasmcpu, aasmdata,
defutil,
+ cpuinfo,
{cgbase,} cgcpu, cgutils,
cpupara,
procinfo,
@@ -91,6 +94,15 @@ begin
end;
+procedure tmipsaddnode.second_add64bit;
+begin
+ if (nodetype=muln) then
+ second_mul64bit
+ else
+ inherited second_add64bit;
+end;
+
+
const
cmpops: array[boolean] of TOpCmp = (OC_LT,OC_B);
@@ -185,21 +197,6 @@ begin
end;
-function tmipsaddnode.pass_1 : tnode;
- begin
- result:=inherited pass_1;
-
- if not(assigned(result)) then
- begin
- if (nodetype in [ltn,lten,gtn,gten,equaln,unequaln]) then
- begin
- if (left.resultdef.typ=floatdef) or (right.resultdef.typ=floatdef) then
- expectloc:=LOC_JUMP;
- end;
- end;
- end;
-
-
procedure tmipsaddnode.second_addfloat;
var
op: TAsmOp;
@@ -273,7 +270,7 @@ begin
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, left.location, left.resultdef, True);
hlcg.location_force_fpureg(current_asmdata.CurrAsmList, right.location, right.resultdef, True);
- location_reset(location, LOC_JUMP, OS_NO);
+ location_reset(location, LOC_FLAGS, OS_NO);
op:=ops_cmpfloat[left.location.size=OS_F64,nodetype];
@@ -289,14 +286,11 @@ begin
end;
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,lreg,rreg));
- ai:=taicpu.op_sym(A_BC,current_procinfo.CurrTrueLabel);
+ location.resflags.reg1:=NR_FCC0;
if (nodetype=unequaln) then
- ai.SetCondition(C_COP1FALSE)
+ location.resflags.cond:=OC_EQ
else
- ai.SetCondition(C_COP1TRUE);
- current_asmdata.CurrAsmList.concat(ai);
- current_asmdata.CurrAsmList.concat(TAiCpu.Op_none(A_NOP));
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
+ location.resflags.cond:=OC_NE;
end;
@@ -345,12 +339,90 @@ begin
inherited second_addordinal;
end;
+procedure tmipsaddnode.second_mul64bit;
+var
+ list: TAsmList;
+ hreg1,hreg2,tmpreg: TRegister;
+begin
+ list:=current_asmdata.CurrAsmList;
+ pass_left_right;
+ location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+ hlcg.location_force_reg(list,left.location,left.resultdef,left.resultdef,true);
+ { calculate 32-bit terms lo(right)*hi(left) and hi(left)*lo(right) }
+ hreg1:=NR_NO;
+ hreg2:=NR_NO;
+ tmpreg:=NR_NO;
+ if (right.location.loc=LOC_CONSTANT) then
+ begin
+ { Omit zero terms, if any }
+ if hi(right.location.value64)<>0 then
+ begin
+ hreg2:=cg.getintregister(list,OS_INT);
+ tmpreg:=cg.getintregister(list,OS_INT);
+ cg.a_load_const_reg(list,OS_INT,longint(hi(right.location.value64)),tmpreg);
+ list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg2,tmpreg,left.location.register64.reglo));
+ end;
+ tmpreg:=NR_NO;
+ if lo(right.location.value64)<>0 then
+ begin
+ hreg1:=cg.getintregister(list,OS_INT);
+ tmpreg:=cg.getintregister(list,OS_INT);
+ cg.a_load_const_reg(list,OS_INT,longint(lo(right.location.value64)),tmpreg);
+ list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg1,tmpreg,left.location.register64.reghi));
+ end;
+ end
+ else
+ begin
+ hlcg.location_force_reg(list,right.location,right.resultdef,right.resultdef,true);
+ tmpreg:=right.location.register64.reglo;
+ hreg1:=cg.getintregister(list,OS_INT);
+ hreg2:=cg.getintregister(list,OS_INT);
+ list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg1,right.location.register64.reglo,left.location.register64.reghi));
+ list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg2,right.location.register64.reghi,left.location.register64.reglo));
+ end;
+
+ { At this point, tmpreg is either lo(right) or NR_NO if lo(left)*lo(right) is zero }
+ if (tmpreg=NR_NO) then
+ begin
+ if (hreg2<>NR_NO) and (hreg1<>NR_NO) then
+ begin
+ location.register64.reghi:=cg.getintregister(list,OS_INT);
+ list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,hreg1,hreg2));
+ end
+ else if (hreg2<>NR_NO) then
+ location.register64.reghi:=hreg2
+ else if (hreg1<>NR_NO) then
+ location.register64.reghi:=hreg1
+ else
+ InternalError(2014122701);
+ location.register64.reglo:=NR_R0;
+ end
+ else
+ begin
+ list.concat(taicpu.op_reg_reg(A_MULTU,left.location.register64.reglo,tmpreg));
+ location.register64.reghi:=cg.getintregister(list,OS_INT);
+ location.register64.reglo:=cg.getintregister(list,OS_INT);
+ current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_MFLO,location.register64.reglo));
+ current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_MFHI,location.register64.reghi));
+ if (hreg2<>NR_NO) then
+ list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,location.register64.reghi,hreg2));
+ if (hreg1<>NR_NO) then
+ list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,location.register64.reghi,hreg1));
+ end;
+end;
function tmipsaddnode.use_generic_mul32to64: boolean;
begin
result:=false;
end;
+function tmipsaddnode.use_generic_mul64bit: boolean;
+begin
+ result:=(cs_check_overflow in current_settings.localswitches) or
+ (not (CPUMIPS_HAS_ISA32R2 in cpu_capabilities[current_settings.cputype]));
+end;
+
+
begin
caddnode := tmipsaddnode;
end.
diff --git a/compiler/mips/ncpucnv.pas b/compiler/mips/ncpucnv.pas
index de219edec9..4101753442 100644
--- a/compiler/mips/ncpucnv.pas
+++ b/compiler/mips/ncpucnv.pas
@@ -156,12 +156,11 @@ begin
current_asmdata.getdatalabel(l1);
current_asmdata.getjumplabel(l2);
reference_reset_symbol(href, l1, 0, sizeof(aint));
- hregister := cg.getintregister(current_asmdata.CurrAsmList, OS_32);
- hlcg.a_load_loc_reg(current_asmdata.CurrAsmList, left.resultdef, u32inttype, left.location, hregister);
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
{ Always load into 64-bit FPU register }
loadsigned(s64real);
- cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_INT, OC_GTE, 0, hregister, l2);
+ cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_INT, OC_GTE, 0, left.location.register, l2);
case tfloatdef(resultdef).floattype of
{ converting dword to s64real first and cut off at the end avoids precision loss }
diff --git a/compiler/mips/rgcpu.pas b/compiler/mips/rgcpu.pas
index b022cd5c7c..2378045de0 100644
--- a/compiler/mips/rgcpu.pas
+++ b/compiler/mips/rgcpu.pas
@@ -131,22 +131,50 @@ implementation
result:=false;
{ Replace 'move orgreg,src' with 'sw src,spilltemp'
and 'move dst,orgreg' with 'lw dst,spilltemp' }
- { TODO: A_MOV_S and A_MOV_D for float registers are also replaceable }
- if (instr.opcode<>A_MOVE) or (abs(spilltemp.offset)>32767) then
+
+ if (not (instr.opcode in [A_MOVE,A_MOV_S,A_MOV_D,A_MTC1])) or (abs(spilltemp.offset)>32767) then
exit;
if (instr.ops<>2) or
(instr.oper[0]^.typ<>top_reg) or
- (instr.oper[1]^.typ<>top_reg) or
- (getregtype(instr.oper[0]^.reg)<>regtype) or
- (getregtype(instr.oper[1]^.reg)<>regtype) then
+ (instr.oper[1]^.typ<>top_reg) then
InternalError(2013061001);
+ if (getregtype(instr.oper[0]^.reg)<>regtype) or
+ (getregtype(instr.oper[1]^.reg)<>regtype) then
+ begin
+ if (instr.opcode=A_MTC1) then
+ begin
+ { TODO: MTC1 src,orgreg ==> SW src,0/4(spilltemp) (endian-dependent!!) }
+ if (regtype=R_FPUREGISTER) then
+ exit;
+ end
+ else
+ InternalError(2013061003);
+ end;
if get_alias(getsupreg(instr.oper[1]^.reg))=orgreg then
begin
- instr.opcode:=A_LW;
+ case instr.opcode of
+ A_MOVE: instr.opcode:=A_LW;
+ A_MOV_S: instr.opcode:=A_LWC1;
+ A_MOV_D: instr.opcode:=A_LDC1;
+ else
+ InternalError(2013061004);
+ end;
end
else if get_alias(getsupreg(instr.oper[0]^.reg))=orgreg then
begin
- instr.opcode:=A_SW;
+ case instr.opcode of
+ A_MOVE: instr.opcode:=A_SW;
+ A_MOV_S: instr.opcode:=A_SWC1;
+ A_MOV_D: instr.opcode:=A_SDC1;
+ A_MTC1:
+ begin
+ if (getregtype(instr.oper[0]^.reg)<>R_INTREGISTER) then
+ InternalError(2013061006);
+ instr.opcode:=A_LWC1;
+ end
+ else
+ InternalError(2013061005);
+ end;
instr.oper[0]^:=instr.oper[1]^;
end
else
diff --git a/compiler/msg/errorct.msg b/compiler/msg/errorct.msg
index 64bec8f5d5..2b96dcdddc 100644
--- a/compiler/msg/errorct.msg
+++ b/compiler/msg/errorct.msg
@@ -264,7 +264,7 @@ scan_e_unsupported_asmmode_specifier=02050_E_L'estil d'assemblador especificat "
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_No es permet el commutador de lector d'ASM dins d'una declaració ASM, "$1" serà efectiu a continuació
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statements only.
scan_e_wrong_switch_toggle=02052_E_El modificador del commutador és erroni, utilitzeu ON/OFF o +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2100,7 +2100,7 @@ option_code_page_not_available=11039_E_La pàgina del codi no està disponible
#
option_logo=11023_[
Free Pascal Compiler versió $FPCFULLVERSION [$FPCDATE] per $FPCCPU
-Copyright (c) 1993-2014 per Florian Klaempfl
+Copyright (c) 1993-2015 per Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errord.msg b/compiler/msg/errord.msg
index 41a5b8dc6d..9c48289be5 100644
--- a/compiler/msg/errord.msg
+++ b/compiler/msg/errord.msg
@@ -3,7 +3,7 @@
# Latest updates contributed by Karl-Michael Schindler aka mischi
# <karl-michael.schindler at web.de>
#
-# Based on errore.msg of SVN revision 28127
+# Based on errore.msg of SVN revision 29129
#
# This file is part of the Free Pascal Compiler
# Copyright (c) 1998-2014 by the Free Pascal Development team
@@ -181,9 +181,9 @@ scan_n_ignored_switch=02008_N_Compilerschalter $1 wurde ignoriert
scan_w_illegal_switch=02009_W_Compilerschalter $1 ist ungltig
% You included a compiler switch (i.e. \var{\{\$... \}}) which the compiler
% does not recognise.
-scan_w_switch_is_global=02010_W_Dieser Compilerschalter hat globale Auswirkung
-% The compiler switch is misplaced, and should be located at
-% the start of the unit or program.
+scan_w_switch_is_global=02010_W_Dieser globale Compilerschalter ist an der falschen Stelle und wird deshalb ignoriert
+% The compiler switch is misplaced. It must be located at
+% the start of the compilation unit, before the uses clause or any declaration.
scan_e_illegal_char_const=02011_E_Ungltige Char-Konstante
% This happens when you specify a character with its ASCII code, as in
% \var{\#96}, but the number is either illegal, or out of range.
@@ -411,8 +411,9 @@ scan_w_invalid_stacksize=02096_W_Die spezifizierte Gr”áe des Stack ist auáerhalb
scan_w_heapmax_lessthan_heapmin=02097_W_Die spezifizierte GrӇe des HeapMax ist kleiner als der des HeapMin. Setzen der GrӇe des HeapMax ignoriert.
% The HeapMax value (if specified) must be greater than or equal to the HeapMin
% value. Otherwise, the HeapMax value is ignored.
-scan_w_hugepointernormalization_not_support=02098_W_HUGEPOINTERNORMALIZATION wird auf der Zielplatform nicht untersttzt
-% The \var{\{\$HUGEPOINTERNORMALIZATION\}} directive is not supported by the target platform.
+scan_e_illegal_hugepointernormalization=02098_E_Illegales Argument fr HUGEPOINTERNORMALIZATION
+% The only allowed values for HUGEPOINTERNORMALIZATION are BORLANDC, MICROSOFTC
+% and WATCOMC.%
%
% \end{description}
# EndOfTeX
@@ -876,7 +877,7 @@ parser_e_self_in_non_message_handler=03146_E_SELF darf nur in Message-Handlern e
% The \var{Self} parameter can only be passed explicitly to a method which
% is declared as message method handler
parser_e_threadvars_only_sg=03147_E_Threadvariablen k”nnen nur statisch oder global sein
-% Threadvars must be static or global; you can't declare a thread
+% Threadvars must be static or global; you cannot declare a thread
% local to a procedure. Local variables are always local to a thread,
% because every thread has its own stack and local variables
% are stored on the stack.
@@ -893,7 +894,7 @@ parser_e_no_object_override=03150_E_OVERRIDE darf in Objekten nicht verwendet we
parser_e_cant_use_inittable_here=03151_E_Datentypen, die ein Initialiserung oder Finalisierung ben”tigen, k”nnen in varianten Records nicht verwendet werden
% Some data types (e.g. \var{ansistring}) need initialization/finalization
% code which is implicitly generated by the compiler. Such data types
-% can't be used in the variant part of a record.
+% cannot be used in the variant part of a record.
parser_e_resourcestring_only_sg=03152_E_Resourcestrings drfen nur statisch oder global sein
% Resourcestring cannot be declared local, only global or using the static
% directive.
@@ -981,7 +982,7 @@ parser_w_skipped_fields_before=03175_W_Einige Felder vor dem Feld "$1" sind nich
% In Delphi mode, not all fields of a typed constant record have to be
% initialized, but the compiler warns you when it detects such situations.
parser_e_skipped_fields_before=03176_E_Einige Felder vor dem Feld "$1" sind nicht initialisiert
-% In all syntax modes but Delphi mode, you can't leave some fields uninitialized
+% In all syntax modes but Delphi mode, you cannot leave some fields uninitialized
% in the middle of a typed constant record.
parser_w_skipped_fields_after=03177_W_Einige Felder nach dem Feld "$1" sind nicht initialisiert
% You can leave some fields at the end of a type constant record uninitialized
@@ -1972,7 +1973,7 @@ type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhel
type_e_procedure_must_be_far=04121_E_Prozedur oder Funktion muss weit ("far") sein, damit seine Adresse verwendet werden kann: "$1"
% In certain i8086 memory models (medium, large and huge), procedures and functions
% have to be declared 'far' in order to allow their address to be taken.
-type_w_instance_abstract_class=04122_-W_Erzeugung einer Instanz der abstrakten Klasse "$1"
+type_w_instance_abstract_class=04122_W_Erzeugung einer Instanz der abstrakten Klasse "$1"
% The specified class is declared as \var{abstract} and thus no instance of this class
% should be created. This is merely a warning for Delphi compatibility.
%
@@ -2317,7 +2318,7 @@ cg_e_cannot_call_cons_dest_inside_with=06037_E_Konstruktoren und Destruktoren k”
% Inside a \var{With} clause you cannot call a constructor or destructor for the
% object you have in the \var{with} clause.
cg_e_cannot_call_message_direct=06038_E_Kann Messagehandler-Methode nicht direkt aufrufen
-% A message method handler method can't be called directly if it contains an
+% A message method handler method cannot be called directly if it contains an
% explicit \var{Self} argument.
cg_e_goto_inout_of_exception_block=06039_E_Sprung in- oder aus dem Exceptionblock heraus
% It is not allowed to jump in or outside of an exception block like \var{try..finally..end;}.
@@ -2713,6 +2714,9 @@ asmr_e_invalid_ref_register=07125_E_Ungltiges Register in Speicherreferenzausdr
% FPU, vector and sometimes integer registers cannot be used in memory reference
% expressions, due to limitations of the cpu architecture or simple because
% it is not meaningful.
+%
+% \end{description}
+# EndOfTeX
#
# Assembler/binary writers
@@ -2761,6 +2765,9 @@ asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangeh
asmw_f_too_many_relocations=08026_F_Relocationz„hler fr Sektion $1 bersteigt 65535
% Legacy COFF targets limit number of relocations per section to 65535 because they use a 2-byte field
% to store the relocation count. Targets using newer PECOFF format do not have this limitation.
+%
+% \end{description}
+# EndOfTeX
#
# Executing linker/assembler
@@ -3361,7 +3368,7 @@ wpo_cant_create_feedback_file=12019_E_Die angegebene Feedback-Eingabe-Datei "$1"
#
option_logo=11023_[
Free Pascal Compiler Version $FPCFULLVERSION [$FPCDATE] fr $FPCTARGET
-Copyright (c) 1993-2014 Florian Kl„mpfl und andere
+Copyright (c) 1993-2015 Florian Kl„mpfl und andere
]
#
@@ -3370,10 +3377,10 @@ Copyright (c) 1993-2014 Florian Kl„mpfl und andere
option_info=11024_[
Free Pascal Compiler Version $FPCVERSION
-Compiler Datum: $FPCDATE
-Compiler Zielsystem: $FPCCPU
+Compiler-Datum: $FPCDATE
+Compiler-Zielsystem: $FPCCPU
-Untersttzte Zielbetriebssysteme:
+Untersttzte Zielbetriebssysteme (Mit '{*}' markierte Ziele sind in Entwicklung):
$OSTARGETS
Untersttzte CPU Instruktionen:
@@ -3385,6 +3392,9 @@ Untersttzte FPU Instruktionen:
Untersttzte Inline-Assembler Modi:
$ASMMODES
+Bekannte Compiler und RTL Feature:
+ $FEATURELIST
+
Untersttzte ABI Ziele:
$ABITARGETS
@@ -3395,7 +3405,7 @@ Untersttzte Gesamtprogramm-Optimierungen:
All
$WPOPTIMIZATIONS
-Untersttzte Microcontroller:
+Untersttzte Mikro-Kontroller:
$CONTROLLERTYPES
Dieses Programm unterliegt der GNU General Public Licence
@@ -3404,7 +3414,7 @@ Weitere Informationen sind in COPYING.v2 zu finden
Fehlerberichte bitte senden an:
http://bugs.freepascal.org
-Weiter Information stehen auf unseren WWW Seiten (einschlieálich Links zu
+Weitere Informationen stehen auf unseren WWW Seiten (einschlieálich Links zu
Mailing-Listen, auf denen Fragen gestellt und potentielle neue Features
diskutiert werden k”nnen, usw.):
http://www.freepascal.org
@@ -3423,9 +3433,14 @@ diskutiert werden k”nnen, usw.):
# A = ARM
# e = in extended debug mode only
# F = help for the 'fpc' binary (independent of the target compiler)
+# I = VIS
+# J = JVM
+# M = MIPS (MIPSEB) targets
+# m = MIPSEL targets
# P = PowerPC targets
+# p = PowerPC64 targets
# S = Sparc targets
-# V = Virtual machine targets
+# V = AVR
# The second character also indicates who will display this line,
# (if the above character was TRUE) the current possibilities are :
# * = everyone
@@ -3435,8 +3450,10 @@ diskutiert werden k”nnen, usw.):
# The third character represents the indentation level.
#
option_help_pages=11025_[
+F*0*_Es werden nur Optionen aufgelistet, die fr die voreingestellte oder ausgew„hlte Platform gltig sind.
**0*_Nach booleschen Optionen geben Sie + zum Ein- bzw. - zum Ausschalten an
-**1a_L”sche die erzeugte Assembler-Datei nicht
+**1@<x>_Lese zus„tzlich zu den voreingestellten Compiler-Optionen aus fpc.cfg auch die aus <x>
+**1a_Erzeugte Assembler-Datei nicht l”schen
**2al_Liste Quellcode-Zeilen in der Assembler-Datei
**2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
**2ao_Fge eine zus„tzliche Option zum Aufruf des externen Assemblers hinzu (ignoriert fr den internen Assembler)
@@ -3486,12 +3503,12 @@ S*2Aas_Assembliere mit Hilfe von GNU AS
**1B_Erzeuge alle Module (Build)
**1C<x>_Optionen fr Code-Erzeugung:
**2C3<x>_Schalte ieee-Prfung von Konstanten ein
-**2Ca<x>_W„hle ABI aus; fpc -i gibt die m”glichen Werte aus
+**2Ca<x>_W„hle ABI aus; fpc -i oder fpc -ia geben die m”glichen Werte aus
**2Cb_Erzeuge Code fr die "big-endian"-Variante der Zielarchitektur
**2Cc<x>_Setze "default calling convention" zu <x>
**2CD_Erzeuge auch eine dynamische Bibliothek (nicht untersttzt)
**2Ce_šbersetze mit emulierten Fliesskomma opcodes
-**2Cf<x>_W„hle den Fliesskomma-Instruction-Set aus; fpc -i gibt die m”glichen Werte aus
+**2Cf<x>_W„hle den Fliesskomma-Instruction-Set aus; fpc -i oder fpc -if geben die m”glichen Werte aus
**2CF<x>_Minimale Pr„zission von Fliesskommakonstanten (default, 32, 64)
**2Cg_Erzeuge PIC code
**2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
@@ -3501,7 +3518,7 @@ A*2CI<x>_W„hle den Instruction-Set fr ARM aus: ARM oder THUMB
P*2CN_Erzeuge šberprfungen auf Nil-Zeiger (nur AIX)
**2Co_Prfe auf šberlauf von Integer-Operationen
**2CO_Prfe auf m”glichen šberlauf von Integer-Operationen
-**2Cp<x>_W„hle Instruction-Set aus; fpc -i gibt die m”glichen Werte aus
+**2Cp<x>_W„hle Instruction-Set aus; fpc -i oder fpc -ic geben die m”glichen Werte aus
**2CP<x>=<y>_ Einstellungen fr packing
**3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
**2Cr_Fhre Bereichsprfung durch
@@ -3568,20 +3585,29 @@ J*2Cv_Var/out Parameter copy-out šberprfung
*g3godwarfmethodclassprefix_ Stelle Methodennamen in DWARF den Namen der Klasse voran
*g2gp_Erhalte Gross/Kleinschreibung in Stabs-Symbolnamen
*g2gs_Erzeuge Stabs-Debug-Informationen
-*g2gt_L”sche lokale Variablen (um eine Verwendung ohne Initialisierung zu finden)
+*g2gt_L”sche lokale Variablen (um eine Verwendung ohne Initialisierung zu finden; mehrere 't' „ndern den Wert, mit dem berschrieben wird)
*g2gv_Erzeuge ein mit Valgrind verfolgbares (traceable) Programm
*g2gw_Erzeuge DWARFv2-Debug-Informationen (wie -gw2)
*g2gw2_Erzeuge DWARFv2-Debug-Informationen
*g2gw3_Erzeuge DWARFv3-Debug-Informationen
-*g2gw4_Generate DWARFv4-Debug-Informationen (experimentell)
+*g2gw4_Erzeuge DWARFv4-Debug-Informationen (experimentell)
**1i_Zeige alle Informationen ber den Compiler
**2iD_Zeige Compilerdatum
-**2iV_Zeige Compilerversion
-**2iW_Zeige vollst„ndige Compilerversion
**2iSO_Zeige Compilerbetriebssystem
**2iSP_Zeige Compilerprozessor
**2iTO_Zeige Zielbetriebssystem
**2iTP_Zeige Zielprozessor
+**2iV_Zeige kurze Compilerversion
+**2iW_Zeige vollst„ndige Compilerversion
+**2ia_Zeige Liste der untersttzten ABI-Ziele
+**2ic_Zeige Liste der untersttzten CPU-Instruction-Sets
+**2if_Zeige Liste der untersttzten Fliesskomma-Instruction-Sets
+**2ii_Zeige Liste der untersttzten Inline-Assembler-Modi
+**2io_Zeige Liste der untersttzten Optimierungen
+**2ir_Zeige Liste der erkannten Compiler- und RTL-Feature
+**2it_Zeige Liste der untersttzten Ziele
+**2iu_Zeige Liste der untersttzten Mikro-Kontrollertypen
+**2iw_Zeige Liste der untersttzten Gesamtprogramm-Optimierungen
**1I<x>_Erg„nze <x> zum Include-Pfad
**1k<x>_šbergebe <x> an den Linker
**1l_Zeige Logo
@@ -3600,16 +3626,16 @@ J*2Cv_Var/out Parameter copy-out šberprfung
**2O3_Level 3 Optimierung (-O2 + langsame Optimierungen)
**2O4_Level 4 Optimierung (-O3 + Optimierungen, die unerwartete Nebeneffekte haben k”nnen)
**2Oa<x>=<y>_Ausrichtung (alignment) von Mengen
-**2Oo[NO]<x>_Optimierungen ein- oder ausschalten; fpc -i gibt die m”glichen Werte aus
-**2Op<x>_Setze Zielprozessor fr die Optimierung; fpc -i gibt die m”glichen Werte aus
-**2OW<x>_Erzeuge Feedback fr die Gesamtprogramm-Optimierung fr Optimierung <x>, siehe fpc -i fr m”gliche Werte
-**2Ow<x>_Fhre die Gesamtprogramm-Optimierung durch <x>, siehe fpc -i fr m”gliche Werte
+**2Oo[NO]<x>_Optimierungen ein- oder ausschalten; fpc -i oder fpc -io geben die m”glichen Werte aus
+**2Op<x>_Setze Zielprozessor fr die Optimierung; fpc -i oder fpc -ic geben die m”glichen Werte aus
+**2OW<x>_Erzeuge Feedback fr die Gesamtprogramm-Optimierung fr Optimierung <x>; fpc -i oder fpc -iw geben die m”glichen Werte aus
+**2Ow<x>_Fhre die Gesamtprogramm-Optimierung durch <x>; fpc -i oder fpc -iw geben die m”glichen Werte aus
**2Os_Erzeuge krzeren Code
**1pg_Erzeuge Profiler-Code fr gprof
F*1P<x>_Ziel CPU / Compiler bezogene Optionen:
F*2PB_Zeige die voreingestellte Compilerbin„rdatei
F*2PP_Zeige die voreingestellte Ziel-CPU
-F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, sparc, x86_64)
+F*2P<x>_Setze die Ziel-CPU (arm, avr, i386, jvm, m68k, mips, mipsel, powerpc, powerpc64, sparc, x86_64)
**1R<x>_Assembler Code-Format:
**2Rdefault_Benutze den voreingestellten Assembler
3*2Ratt_Lese Assembler Code im AT&T-Format
@@ -3625,6 +3651,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**3*_w : Compiler h„lt auch nach Warnungen
**3*_n : Compiler h„lt auch nach Anmerkungen
**3*_h : Compiler h„lt auch nach Hinweisen
+**2Sf_Schalte bestimmte Feature in Compiler und RTL ein; fpc -i oder fpc -ir geben die m”glichen Werte aus
**2Sg_Erlaube LABEL und GOTO
**2Sh_Benutze ANSI-Strings
**2Si_Benutze C++ artige INLINE
@@ -3635,6 +3662,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**2Sm_Untersttze Makros wie in C (global)
**2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
**2Ss_Konstruktor- und Destruktorname mssen "Init" und "Done" sein
+**2Sv_Untersttze Vektor-Verarbeitung (soweit vorhanden benutze CPU-Vektorerweiterungen)
**2Sx_Exception Schlsselw”rter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
**2Sy_@<pointer> gibt einen typisierten Zeiger zurck, genau wie $T+
**1s_Rufe weder Assembler noch Linker auf (nur mit -a)
@@ -3642,10 +3670,15 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**2st_Erzeuge Script um auf dem Zielsystem zu linken
**2sr_šberspringe die Phase der "register allocation" (mit -alr benutzen)
**1T<x>_Zielbetriebssystem::
+3*2Tandroid_Android
+3*2Taros_AROS
+3*2Tbeos_BeOS
3*2Tdarwin_Darwin/Mac OS X
+3*2Tembedded_Embedded
3*2Temx_OS/2 via EMX (einschliesslich EMX/RSX extender)
3*2Tfreebsd_FreeBSD
3*2Tgo32v2_Version 2 des DJ Delorie DOS extender
+3*2Thaiku_Haiku
3*2Tlinux_Linux
3*2Tnativent_Native NT API (experimentell)
3*2Tnetbsd_NetBSD
@@ -3661,22 +3694,45 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
3*2Twin32_Windows 32 Bit
3*2Twince_Windows CE
4*2Tdarwin_Darwin/Mac OS X
+4*2Tfreebsd_FreeBSD
4*2Tlinux_Linux
-4*2Twin64_Win64 (64 bit Windows systems)
+4*2Tnetbsd_NetBSD
+4*2Topenbsd_OpenBSD
+4*2Tsolaris_Solaris
+4*2Twin64_Win64 (64 bit Windows Systeme)
6*2Tamiga_Commodore Amiga
6*2Tatari_Atari ST/STe/TT
6*2Tlinux_Linux
6*2Tpalmos_PalmOS
+8*2Tmsdos_MS-DOS (und kompatible)
+A*2Tandroid_Android
A*2Tdarwin_Darwin/iPhoneOS/iOS
+A*2Tembedded_Embedded
+A*2Tgba_Game Boy Advance
A*2Tlinux_Linux
+A*2Tnds_Nintendo DS
+A*2Tsymbian_Symbian
A*2Twince_Windows CE
+J*2Tandroid_Android
+J*2Tjava_Java
+m*2Tembedded_Embedded
+M*2Tandroid_Android
+M*2Tembedded_Embedded
+M*2Tlinux_Linux
+P*2Taix_AIX
P*2Tamiga_AmigaOS
P*2Tdarwin_Darwin und Mac OS X
P*2Tlinux_Linux
P*2Tmacos_Mac OS (classic)
P*2Tmorphos_MorphOS
+P*2Tnetbsd_NetBSD
+P*2Twii_Wii
+p*2Taix_AIX
+p*2Tdarwin_Darwin/Mac OS X
+p*2Tlinux_Linux
S*2Tsolaris_Solaris
S*2Tlinux_Linux
+V*2Tembedded_Embedded
**1u<x>_Entferne die Definition fr das Symbol <x>
**1U<x>_Unit-Optionen:
**2Un_Prfe den Unitnamen nicht
@@ -3690,7 +3746,7 @@ S*2Tlinux_Linux
**2*_i : Allgemeine Informationen d : Debug Informationen
**2*_l : Zeilennummern r : Rhide/GCC kompatibler Modus
**2*_s : Zeitstempel q : Nummer der Meldung
-**2*_a : Alles x : Exe-Datei Informationen (nur Win32)
+**2*_a : Alles x : Zeige Infos ber aufgerufene Tools
**2*_b : Schreibe bei Meldungen mit p : Schreibe tree.log mit Analysenbaum (parse tree)
**2*_ Dateinamen den vollst„ndigen v : Schreibe fpcdebug.txt mit
**2*_ Pfad ganz viel Information
@@ -3712,7 +3768,7 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
A*2WBxxxx_Setze die Imagebasis auf xxxx (Windows)
3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
-4*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
+4*2WC_Spezifiziere "console type application" (Windows)
A*2WC_Spezifiziere "console type application" (Windows)
P*2WC_Spezifiziere "console type application" (Classic Mac OS)
3*2WD_Benutze DEFFILE um Funktionen der DLL oder EXE zu exportieren (Windows)
@@ -3725,7 +3781,7 @@ P*2We_Benutze externe Resourcen (Darwin)
p*2We_Benutze externe Resourcen (Darwin)
3*2WF_Spezifiziere "full-screen type application" (EMX, OS/2)
3*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
-4*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
+4*2WG_Spezifiziere "graphic type application" (Windows)
A*2WG_Spezifiziere "graphic type application" (Windows)
P*2WG_Spezifiziere "graphic type application" (Classic Mac OS)
3*2Wi_Benutze interne Resourcen (Darwin)
@@ -3749,8 +3805,9 @@ P*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
3*2WN_Erzeuge keinen "relocation code" (notwendig fr debugging) (Windows)
4*2WN_Erzeuge keinen "relocation code" (notwendig fr debugging) (Windows)
A*2WN_Erzeuge keinen "relocation code" (notwendig fr debugging) (Windows)
-A*2Wpxxxx_Spezifiziere den Kontrollertyp, m”gliche Werte liefert fpc -i
-V*2Wpxxxx_Spezifiziere den Kontrollertyp, m”gliche Werte liefert fpc -i
+A*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben m”gliche Werte aus
+m*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben m”gliche Werte aus
+V*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben m”gliche Werte aus
3*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (iphonesim)
A*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (Darwin)
3*2WR_Erzeuge "relocation code" (Windows)
@@ -3765,11 +3822,16 @@ P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
**2Xc_šbergebe --shared an den Linker (nur Unix)
**2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (ben”tigt fr cross compile, wenn nicht -XR verwendet wird)
**2Xe_Verwende den externen Linker
+**2Xf_Ersetze zum Linken den Namen der pthread-Bibliothek (BSD)
**2Xg_Erstelle die Debug-Informationen in einer separaten Datei und einen "Debug-Link"-Abschnitt im ausfhrbaren Programm
**2XD_Versuche Units dynamisch zu linken (definiert FPC_LINK_DYNAMIC)
**2Xi_Verwende den internen Linker
+**2XLA_Definiere Bibliotheksersetzungen fr das Linken
+**2XLO_Definiere die Reihenfolge der Bibliotheken fr das Linken
+**2XLD_Schlieáe die voreingestellte Reihenfolge der Standard-Bibliotheken aus
**2Xm_Erzeuge die "link map"
**2XM<x>_Setze den Namen der 'main' program Routine (default ist 'main')
+**2Xn_Nutze den platformeigenen linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
**2XP<x>_Stelle dem Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
**2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (ben”tigt fr cross compile, siehe ld-Manual fr mehr Informationen) (BeOS, Linux)
@@ -3777,6 +3839,7 @@ F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
**2Xs_Entferne alle Symbole aus der ausfhrbaren Datei
**2XS_Versuche Units statisch zu linken (default) (definiert FPC_LINK_STATIC)
**2Xt_Linke mit statischen Bibliotheken (-static wird an den Linker bergeben)
+**2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
**2XX_Versuche Units smart zu linken (definiert FPC_LINK_SMART)
**1*_
**1?_Zeigt diese Hilfe an
diff --git a/compiler/msg/errorda.msg b/compiler/msg/errorda.msg
index 3e3ced41f8..cef8bcb45a 100644
--- a/compiler/msg/errorda.msg
+++ b/compiler/msg/errorda.msg
@@ -271,7 +271,7 @@ scan_e_illegal_asmmode_specifier=02050_E_Ugyldig assemblerstil angivet "$1"
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_Kan ikke skifte assemblerlæser midt i en assemblerblok. Skifter til "$1" i næste blok
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statements only.
scan_e_wrong_switch_toggle=02052_E_Forkert indstillingsparameter. Brug ON/OFF eller +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2207,7 +2207,7 @@ option_config_is_dir=11040_F_Konfigurationsfilen $1 er et directory
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] til $FPCTARGET
-Copyright (c) 1993-2014 Florian Klaempfl
+Copyright (c) 1993-2015 Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errordu.msg b/compiler/msg/errordu.msg
index 90c7034a11..07bf532ead 100644
--- a/compiler/msg/errordu.msg
+++ b/compiler/msg/errordu.msg
@@ -3,7 +3,7 @@
# Latest updates contributed by Karl-Michael Schindler aka mischi
# <karl-michael.schindler at web.de>
#
-# Based on errore.msg of SVN revision 28127
+# Based on errore.msg of SVN revision 29129
#
# This file is part of the Free Pascal Compiler
# Copyright (c) 1998-2014 by the Free Pascal Development team
@@ -181,9 +181,9 @@ scan_n_ignored_switch=02008_N_Compilerschalter $1 wurde ignoriert
scan_w_illegal_switch=02009_W_Compilerschalter $1 ist ungültig
% You included a compiler switch (i.e. \var{\{\$... \}}) which the compiler
% does not recognise.
-scan_w_switch_is_global=02010_W_Dieser Compilerschalter hat globale Auswirkung
-% The compiler switch is misplaced, and should be located at
-% the start of the unit or program.
+scan_w_switch_is_global=02010_W_Dieser globale Compilerschalter ist an der falschen Stelle und wird deshalb ignoriert
+% The compiler switch is misplaced. It must be located at
+% the start of the compilation unit, before the uses clause or any declaration.
scan_e_illegal_char_const=02011_E_Ungültige Char-Konstante
% This happens when you specify a character with its ASCII code, as in
% \var{\#96}, but the number is either illegal, or out of range.
@@ -411,8 +411,9 @@ scan_w_invalid_stacksize=02096_W_Die spezifizierte Größe des Stack ist außerh
scan_w_heapmax_lessthan_heapmin=02097_W_Die spezifizierte Größe des HeapMax ist kleiner als der des HeapMin. Setzen der Größe des HeapMax ignoriert.
% The HeapMax value (if specified) must be greater than or equal to the HeapMin
% value. Otherwise, the HeapMax value is ignored.
-scan_w_hugepointernormalization_not_support=02098_W_HUGEPOINTERNORMALIZATION wird auf der Zielplatform nicht unterstützt
-% The \var{\{\$HUGEPOINTERNORMALIZATION\}} directive is not supported by the target platform.
+scan_e_illegal_hugepointernormalization=02098_E_Illegales Argument für HUGEPOINTERNORMALIZATION
+% The only allowed values for HUGEPOINTERNORMALIZATION are BORLANDC, MICROSOFTC
+% and WATCOMC.%
%
% \end{description}
# EndOfTeX
@@ -876,7 +877,7 @@ parser_e_self_in_non_message_handler=03146_E_SELF darf nur in Message-Handlern e
% The \var{Self} parameter can only be passed explicitly to a method which
% is declared as message method handler
parser_e_threadvars_only_sg=03147_E_Threadvariablen können nur statisch oder global sein
-% Threadvars must be static or global; you can't declare a thread
+% Threadvars must be static or global; you cannot declare a thread
% local to a procedure. Local variables are always local to a thread,
% because every thread has its own stack and local variables
% are stored on the stack.
@@ -893,7 +894,7 @@ parser_e_no_object_override=03150_E_OVERRIDE darf in Objekten nicht verwendet we
parser_e_cant_use_inittable_here=03151_E_Datentypen, die ein Initialiserung oder Finalisierung benötigen, können in varianten Records nicht verwendet werden
% Some data types (e.g. \var{ansistring}) need initialization/finalization
% code which is implicitly generated by the compiler. Such data types
-% can't be used in the variant part of a record.
+% cannot be used in the variant part of a record.
parser_e_resourcestring_only_sg=03152_E_Resourcestrings dürfen nur statisch oder global sein
% Resourcestring cannot be declared local, only global or using the static
% directive.
@@ -981,7 +982,7 @@ parser_w_skipped_fields_before=03175_W_Einige Felder vor dem Feld "$1" sind nich
% In Delphi mode, not all fields of a typed constant record have to be
% initialized, but the compiler warns you when it detects such situations.
parser_e_skipped_fields_before=03176_E_Einige Felder vor dem Feld "$1" sind nicht initialisiert
-% In all syntax modes but Delphi mode, you can't leave some fields uninitialized
+% In all syntax modes but Delphi mode, you cannot leave some fields uninitialized
% in the middle of a typed constant record.
parser_w_skipped_fields_after=03177_W_Einige Felder nach dem Feld "$1" sind nicht initialisiert
% You can leave some fields at the end of a type constant record uninitialized
@@ -1972,7 +1973,7 @@ type_e_type_not_allowed_for_type_helper=04120_E_Typ "$1" kann durch einen Typhel
type_e_procedure_must_be_far=04121_E_Prozedur oder Funktion muss weit ("far") sein, damit seine Adresse verwendet werden kann: "$1"
% In certain i8086 memory models (medium, large and huge), procedures and functions
% have to be declared 'far' in order to allow their address to be taken.
-type_w_instance_abstract_class=04122_-W_Erzeugung einer Instanz der abstrakten Klasse "$1"
+type_w_instance_abstract_class=04122_W_Erzeugung einer Instanz der abstrakten Klasse "$1"
% The specified class is declared as \var{abstract} and thus no instance of this class
% should be created. This is merely a warning for Delphi compatibility.
%
@@ -2317,7 +2318,7 @@ cg_e_cannot_call_cons_dest_inside_with=06037_E_Konstruktoren und Destruktoren kÃ
% Inside a \var{With} clause you cannot call a constructor or destructor for the
% object you have in the \var{with} clause.
cg_e_cannot_call_message_direct=06038_E_Kann Messagehandler-Methode nicht direkt aufrufen
-% A message method handler method can't be called directly if it contains an
+% A message method handler method cannot be called directly if it contains an
% explicit \var{Self} argument.
cg_e_goto_inout_of_exception_block=06039_E_Sprung in- oder aus dem Exceptionblock heraus
% It is not allowed to jump in or outside of an exception block like \var{try..finally..end;}.
@@ -2713,6 +2714,9 @@ asmr_e_invalid_ref_register=07125_E_Ungültiges Register in Speicherreferenzausd
% FPU, vector and sometimes integer registers cannot be used in memory reference
% expressions, due to limitations of the cpu architecture or simple because
% it is not meaningful.
+%
+% \end{description}
+# EndOfTeX
#
# Assembler/binary writers
@@ -2761,6 +2765,9 @@ asmw_e_handlerdata_no_handler=08025_E_".seh_handlerdata"-Direktive ohne vorangeh
asmw_f_too_many_relocations=08026_F_Relocationzähler für Sektion $1 übersteigt 65535
% Legacy COFF targets limit number of relocations per section to 65535 because they use a 2-byte field
% to store the relocation count. Targets using newer PECOFF format do not have this limitation.
+%
+% \end{description}
+# EndOfTeX
#
# Executing linker/assembler
@@ -3361,7 +3368,7 @@ wpo_cant_create_feedback_file=12019_E_Die angegebene Feedback-Eingabe-Datei "$1"
#
option_logo=11023_[
Free Pascal Compiler Version $FPCFULLVERSION [$FPCDATE] für $FPCTARGET
-Copyright (c) 1993-2014 Florian Klämpfl und andere
+Copyright (c) 1993-2015 Florian Klämpfl und andere
]
#
@@ -3370,10 +3377,10 @@ Copyright (c) 1993-2014 Florian Klämpfl und andere
option_info=11024_[
Free Pascal Compiler Version $FPCVERSION
-Compiler Datum: $FPCDATE
-Compiler Zielsystem: $FPCCPU
+Compiler-Datum: $FPCDATE
+Compiler-Zielsystem: $FPCCPU
-Unterstützte Zielbetriebssysteme:
+Unterstützte Zielbetriebssysteme (Mit '{*}' markierte Ziele sind in Entwicklung):
$OSTARGETS
Unterstützte CPU Instruktionen:
@@ -3385,6 +3392,9 @@ Unterstützte FPU Instruktionen:
Unterstützte Inline-Assembler Modi:
$ASMMODES
+Bekannte Compiler und RTL Feature:
+ $FEATURELIST
+
Unterstützte ABI Ziele:
$ABITARGETS
@@ -3395,7 +3405,7 @@ Unterstützte Gesamtprogramm-Optimierungen:
All
$WPOPTIMIZATIONS
-Unterstützte Microcontroller:
+Unterstützte Mikro-Kontroller:
$CONTROLLERTYPES
Dieses Programm unterliegt der GNU General Public Licence
@@ -3404,7 +3414,7 @@ Weitere Informationen sind in COPYING.v2 zu finden
Fehlerberichte bitte senden an:
http://bugs.freepascal.org
-Weiter Information stehen auf unseren WWW Seiten (einschließlich Links zu
+Weitere Informationen stehen auf unseren WWW Seiten (einschließlich Links zu
Mailing-Listen, auf denen Fragen gestellt und potentielle neue Features
diskutiert werden können, usw.):
http://www.freepascal.org
@@ -3423,9 +3433,14 @@ diskutiert werden können, usw.):
# A = ARM
# e = in extended debug mode only
# F = help for the 'fpc' binary (independent of the target compiler)
+# I = VIS
+# J = JVM
+# M = MIPS (MIPSEB) targets
+# m = MIPSEL targets
# P = PowerPC targets
+# p = PowerPC64 targets
# S = Sparc targets
-# V = Virtual machine targets
+# V = AVR
# The second character also indicates who will display this line,
# (if the above character was TRUE) the current possibilities are :
# * = everyone
@@ -3435,8 +3450,10 @@ diskutiert werden können, usw.):
# The third character represents the indentation level.
#
option_help_pages=11025_[
+F*0*_Es werden nur Optionen aufgelistet, die für die voreingestellte oder ausgewählte Platform gültig sind.
**0*_Nach booleschen Optionen geben Sie + zum Ein- bzw. - zum Ausschalten an
-**1a_Lösche die erzeugte Assembler-Datei nicht
+**1@<x>_Lese zusätzlich zu den voreingestellten Compiler-Optionen aus fpc.cfg auch die aus <x>
+**1a_Erzeugte Assembler-Datei nicht löschen
**2al_Liste Quellcode-Zeilen in der Assembler-Datei
**2an_Liste "node info" in der Assembler-Datei (-dEXTDEBUG Compiler)
**2ao_Füge eine zusätzliche Option zum Aufruf des externen Assemblers hinzu (ignoriert für den internen Assembler)
@@ -3486,12 +3503,12 @@ S*2Aas_Assembliere mit Hilfe von GNU AS
**1B_Erzeuge alle Module (Build)
**1C<x>_Optionen für Code-Erzeugung:
**2C3<x>_Schalte ieee-Prüfung von Konstanten ein
-**2Ca<x>_Wähle ABI aus; fpc -i gibt die möglichen Werte aus
+**2Ca<x>_Wähle ABI aus; fpc -i oder fpc -ia geben die möglichen Werte aus
**2Cb_Erzeuge Code für die "big-endian"-Variante der Zielarchitektur
**2Cc<x>_Setze "default calling convention" zu <x>
**2CD_Erzeuge auch eine dynamische Bibliothek (nicht unterstützt)
**2Ce_Übersetze mit emulierten Fliesskomma opcodes
-**2Cf<x>_Wähle den Fliesskomma-Instruction-Set aus; fpc -i gibt die möglichen Werte aus
+**2Cf<x>_Wähle den Fliesskomma-Instruction-Set aus; fpc -i oder fpc -if geben die möglichen Werte aus
**2CF<x>_Minimale Präzission von Fliesskommakonstanten (default, 32, 64)
**2Cg_Erzeuge PIC code
**2Ch<n>_<n> Bytes Heap (zwischen 1023 und 67107840)
@@ -3501,7 +3518,7 @@ A*2CI<x>_Wähle den Instruction-Set für ARM aus: ARM oder THUMB
P*2CN_Erzeuge Überprüfungen auf Nil-Zeiger (nur AIX)
**2Co_Prüfe auf Überlauf von Integer-Operationen
**2CO_Prüfe auf möglichen Überlauf von Integer-Operationen
-**2Cp<x>_Wähle Instruction-Set aus; fpc -i gibt die möglichen Werte aus
+**2Cp<x>_Wähle Instruction-Set aus; fpc -i oder fpc -ic geben die möglichen Werte aus
**2CP<x>=<y>_ Einstellungen für packing
**3CPPACKSET=<y>_ <y> Belegung von Sets: 0, 1 oder DEFAULT oder NORMAL, 2, 4 und 8
**2Cr_Führe Bereichsprüfung durch
@@ -3568,20 +3585,29 @@ J*2Cv_Var/out Parameter copy-out Überprüfung
*g3godwarfmethodclassprefix_ Stelle Methodennamen in DWARF den Namen der Klasse voran
*g2gp_Erhalte Gross/Kleinschreibung in Stabs-Symbolnamen
*g2gs_Erzeuge Stabs-Debug-Informationen
-*g2gt_Lösche lokale Variablen (um eine Verwendung ohne Initialisierung zu finden)
+*g2gt_Lösche lokale Variablen (um eine Verwendung ohne Initialisierung zu finden; mehrere 't' ändern den Wert, mit dem überschrieben wird)
*g2gv_Erzeuge ein mit Valgrind verfolgbares (traceable) Programm
*g2gw_Erzeuge DWARFv2-Debug-Informationen (wie -gw2)
*g2gw2_Erzeuge DWARFv2-Debug-Informationen
*g2gw3_Erzeuge DWARFv3-Debug-Informationen
-*g2gw4_Generate DWARFv4-Debug-Informationen (experimentell)
+*g2gw4_Erzeuge DWARFv4-Debug-Informationen (experimentell)
**1i_Zeige alle Informationen über den Compiler
**2iD_Zeige Compilerdatum
-**2iV_Zeige Compilerversion
-**2iW_Zeige vollständige Compilerversion
**2iSO_Zeige Compilerbetriebssystem
**2iSP_Zeige Compilerprozessor
**2iTO_Zeige Zielbetriebssystem
**2iTP_Zeige Zielprozessor
+**2iV_Zeige kurze Compilerversion
+**2iW_Zeige vollständige Compilerversion
+**2ia_Zeige Liste der unterstützten ABI-Ziele
+**2ic_Zeige Liste der unterstützten CPU-Instruction-Sets
+**2if_Zeige Liste der unterstützten Fliesskomma-Instruction-Sets
+**2ii_Zeige Liste der unterstützten Inline-Assembler-Modi
+**2io_Zeige Liste der unterstützten Optimierungen
+**2ir_Zeige Liste der erkannten Compiler- und RTL-Feature
+**2it_Zeige Liste der unterstützten Ziele
+**2iu_Zeige Liste der unterstützten Mikro-Kontrollertypen
+**2iw_Zeige Liste der unterstützten Gesamtprogramm-Optimierungen
**1I<x>_Ergänze <x> zum Include-Pfad
**1k<x>_Übergebe <x> an den Linker
**1l_Zeige Logo
@@ -3600,16 +3626,16 @@ J*2Cv_Var/out Parameter copy-out Überprüfung
**2O3_Level 3 Optimierung (-O2 + langsame Optimierungen)
**2O4_Level 4 Optimierung (-O3 + Optimierungen, die unerwartete Nebeneffekte haben können)
**2Oa<x>=<y>_Ausrichtung (alignment) von Mengen
-**2Oo[NO]<x>_Optimierungen ein- oder ausschalten; fpc -i gibt die möglichen Werte aus
-**2Op<x>_Setze Zielprozessor für die Optimierung; fpc -i gibt die möglichen Werte aus
-**2OW<x>_Erzeuge Feedback für die Gesamtprogramm-Optimierung für Optimierung <x>, siehe fpc -i für mögliche Werte
-**2Ow<x>_Führe die Gesamtprogramm-Optimierung durch <x>, siehe fpc -i für mögliche Werte
+**2Oo[NO]<x>_Optimierungen ein- oder ausschalten; fpc -i oder fpc -io geben die möglichen Werte aus
+**2Op<x>_Setze Zielprozessor für die Optimierung; fpc -i oder fpc -ic geben die möglichen Werte aus
+**2OW<x>_Erzeuge Feedback für die Gesamtprogramm-Optimierung für Optimierung <x>; fpc -i oder fpc -iw geben die möglichen Werte aus
+**2Ow<x>_Führe die Gesamtprogramm-Optimierung durch <x>; fpc -i oder fpc -iw geben die möglichen Werte aus
**2Os_Erzeuge kürzeren Code
**1pg_Erzeuge Profiler-Code für gprof
F*1P<x>_Ziel CPU / Compiler bezogene Optionen:
F*2PB_Zeige die voreingestellte Compilerbinärdatei
F*2PP_Zeige die voreingestellte Ziel-CPU
-F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, sparc, x86_64)
+F*2P<x>_Setze die Ziel-CPU (arm, avr, i386, jvm, m68k, mips, mipsel, powerpc, powerpc64, sparc, x86_64)
**1R<x>_Assembler Code-Format:
**2Rdefault_Benutze den voreingestellten Assembler
3*2Ratt_Lese Assembler Code im AT&T-Format
@@ -3625,6 +3651,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**3*_w : Compiler hält auch nach Warnungen
**3*_n : Compiler hält auch nach Anmerkungen
**3*_h : Compiler hält auch nach Hinweisen
+**2Sf_Schalte bestimmte Feature in Compiler und RTL ein; fpc -i oder fpc -ir geben die möglichen Werte aus
**2Sg_Erlaube LABEL und GOTO
**2Sh_Benutze ANSI-Strings
**2Si_Benutze C++ artige INLINE
@@ -3635,6 +3662,7 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**2Sm_Unterstütze Makros wie in C (global)
**2So_Sei TP/BP 7.0 kompatibel (wie -Mtp)
**2Ss_Konstruktor- und Destruktorname müssen "Init" und "Done" sein
+**2Sv_Unterstütze Vektor-Verarbeitung (soweit vorhanden benutze CPU-Vektorerweiterungen)
**2Sx_Exception Schlüsselwörter einschalten (Voreinstellung in Delphi/ObjFPC Moden)
**2Sy_@<pointer> gibt einen typisierten Zeiger zurück, genau wie $T+
**1s_Rufe weder Assembler noch Linker auf (nur mit -a)
@@ -3642,10 +3670,15 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
**2st_Erzeuge Script um auf dem Zielsystem zu linken
**2sr_Überspringe die Phase der "register allocation" (mit -alr benutzen)
**1T<x>_Zielbetriebssystem::
+3*2Tandroid_Android
+3*2Taros_AROS
+3*2Tbeos_BeOS
3*2Tdarwin_Darwin/Mac OS X
+3*2Tembedded_Embedded
3*2Temx_OS/2 via EMX (einschliesslich EMX/RSX extender)
3*2Tfreebsd_FreeBSD
3*2Tgo32v2_Version 2 des DJ Delorie DOS extender
+3*2Thaiku_Haiku
3*2Tlinux_Linux
3*2Tnativent_Native NT API (experimentell)
3*2Tnetbsd_NetBSD
@@ -3661,22 +3694,45 @@ F*2P<x>_Setze die Ziel-CPU (arm, i386, m68k, mips, mipsel, powerpc, powerpc64, s
3*2Twin32_Windows 32 Bit
3*2Twince_Windows CE
4*2Tdarwin_Darwin/Mac OS X
+4*2Tfreebsd_FreeBSD
4*2Tlinux_Linux
-4*2Twin64_Win64 (64 bit Windows systems)
+4*2Tnetbsd_NetBSD
+4*2Topenbsd_OpenBSD
+4*2Tsolaris_Solaris
+4*2Twin64_Win64 (64 bit Windows Systeme)
6*2Tamiga_Commodore Amiga
6*2Tatari_Atari ST/STe/TT
6*2Tlinux_Linux
6*2Tpalmos_PalmOS
+8*2Tmsdos_MS-DOS (und kompatible)
+A*2Tandroid_Android
A*2Tdarwin_Darwin/iPhoneOS/iOS
+A*2Tembedded_Embedded
+A*2Tgba_Game Boy Advance
A*2Tlinux_Linux
+A*2Tnds_Nintendo DS
+A*2Tsymbian_Symbian
A*2Twince_Windows CE
+J*2Tandroid_Android
+J*2Tjava_Java
+m*2Tembedded_Embedded
+M*2Tandroid_Android
+M*2Tembedded_Embedded
+M*2Tlinux_Linux
+P*2Taix_AIX
P*2Tamiga_AmigaOS
P*2Tdarwin_Darwin und Mac OS X
P*2Tlinux_Linux
P*2Tmacos_Mac OS (classic)
P*2Tmorphos_MorphOS
+P*2Tnetbsd_NetBSD
+P*2Twii_Wii
+p*2Taix_AIX
+p*2Tdarwin_Darwin/Mac OS X
+p*2Tlinux_Linux
S*2Tsolaris_Solaris
S*2Tlinux_Linux
+V*2Tembedded_Embedded
**1u<x>_Entferne die Definition für das Symbol <x>
**1U<x>_Unit-Optionen:
**2Un_Prüfe den Unitnamen nicht
@@ -3690,7 +3746,7 @@ S*2Tlinux_Linux
**2*_i : Allgemeine Informationen d : Debug Informationen
**2*_l : Zeilennummern r : Rhide/GCC kompatibler Modus
**2*_s : Zeitstempel q : Nummer der Meldung
-**2*_a : Alles x : Exe-Datei Informationen (nur Win32)
+**2*_a : Alles x : Zeige Infos über aufgerufene Tools
**2*_b : Schreibe bei Meldungen mit p : Schreibe tree.log mit Analysenbaum (parse tree)
**2*_ Dateinamen den vollständigen v : Schreibe fpcdebug.txt mit
**2*_ Pfad ganz viel Information
@@ -3712,7 +3768,7 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
A*2WBxxxx_Setze die Imagebasis auf xxxx (Windows)
3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
-4*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
+4*2WC_Spezifiziere "console type application" (Windows)
A*2WC_Spezifiziere "console type application" (Windows)
P*2WC_Spezifiziere "console type application" (Classic Mac OS)
3*2WD_Benutze DEFFILE um Funktionen der DLL oder EXE zu exportieren (Windows)
@@ -3725,7 +3781,7 @@ P*2We_Benutze externe Resourcen (Darwin)
p*2We_Benutze externe Resourcen (Darwin)
3*2WF_Spezifiziere "full-screen type application" (EMX, OS/2)
3*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
-4*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
+4*2WG_Spezifiziere "graphic type application" (Windows)
A*2WG_Spezifiziere "graphic type application" (Windows)
P*2WG_Spezifiziere "graphic type application" (Classic Mac OS)
3*2Wi_Benutze interne Resourcen (Darwin)
@@ -3749,8 +3805,9 @@ P*2WM<x>_Minimale Mac OS X Deployment Version: 10.4, 10.5.1, ... (Darwin)
3*2WN_Erzeuge keinen "relocation code" (notwendig für debugging) (Windows)
4*2WN_Erzeuge keinen "relocation code" (notwendig für debugging) (Windows)
A*2WN_Erzeuge keinen "relocation code" (notwendig für debugging) (Windows)
-A*2Wpxxxx_Spezifiziere den Kontrollertyp, mögliche Werte liefert fpc -i
-V*2Wpxxxx_Spezifiziere den Kontrollertyp, mögliche Werte liefert fpc -i
+A*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben mögliche Werte aus
+m*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben mögliche Werte aus
+V*2Wpxxxx_Spezifiziere den Kontrollertyp; fpc -i oder fpc -iu geben mögliche Werte aus
3*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (iphonesim)
A*2WP<x>_Minimale iOS Deployment Version: 3.0, 5.0.1, ... (Darwin)
3*2WR_Erzeuge "relocation code" (Windows)
@@ -3765,11 +3822,16 @@ P*2WF_Spezifiziere "MPW tool type application" (Classic Mac OS)
**2Xc_Übergebe --shared an den Linker (nur Unix)
**2Xd_Den Standard Bibliotheks-Suchpfad NICHT nutzen (benötigt für cross compile, wenn nicht -XR verwendet wird)
**2Xe_Verwende den externen Linker
+**2Xf_Ersetze beim linken den Namen der pthread-Bibliothek (BSD)
**2Xg_Erstelle die Debug-Informationen in einer separaten Datei und einen "Debug-Link"-Abschnitt im ausführbaren Programm
**2XD_Versuche Units dynamisch zu linken (definiert FPC_LINK_DYNAMIC)
**2Xi_Verwende den internen Linker
+**2XLA_Definiere Bibliotheksersetzungen für das Linken
+**2XLO_Definiere die Reihenfolge der Bibliotheken für das Linken
+**2XLD_Schließe die voreingestellte Reihenfolge der Standard-Bibliotheken aus
**2Xm_Erzeuge die "link map"
**2XM<x>_Setze den Namen der 'main' program Routine (default ist 'main')
+**2Xn_Nutze den platformeigenen linker des Zielsystem anstelle des GNU ld (Solaris, AIX)
F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
**2XP<x>_Stelle dem Namen der Compiler-Hilfsprogramme (binutils) den Prefix <x> voran
**2Xr<x>_Setze den rlink-Pfad des Linker zu <x> (benötigt für cross compile, siehe ld-Manual für mehr Informationen) (BeOS, Linux)
@@ -3777,6 +3839,7 @@ F*2Xp<x>_Suche nach der Compilerbinary zuerst im Verzeichnis <x>
**2Xs_Entferne alle Symbole aus der ausführbaren Datei
**2XS_Versuche Units statisch zu linken (default) (definiert FPC_LINK_STATIC)
**2Xt_Linke mit statischen Bibliotheken (-static wird an den Linker übergeben)
+**2Xv_Erzeuge eine Tabelle mit den virtuellen Entry-Aufrufen
**2XX_Versuche Units smart zu linken (definiert FPC_LINK_SMART)
**1*_
**1?_Zeigt diese Hilfe an
diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg
index 979885fb76..da8080febd 100644
--- a/compiler/msg/errore.msg
+++ b/compiler/msg/errore.msg
@@ -174,16 +174,16 @@ scan_n_ignored_switch=02008_N_Ignored compiler switch "$1"
scan_w_illegal_switch=02009_W_Illegal compiler switch "$1"
% You included a compiler switch (i.e. \var{\{\$... \}}) which the compiler
% does not recognise.
-scan_w_switch_is_global=02010_W_Misplaced global compiler switch
-% The compiler switch is misplaced, and should be located at
-% the start of the unit or program.
+scan_w_switch_is_global=02010_W_Misplaced global compiler switch, ignored
+% The compiler switch is misplaced. It must be located at
+% the start of the compilation unit, before the uses clause or any declaration.
scan_e_illegal_char_const=02011_E_Illegal char constant
% This happens when you specify a character with its ASCII code, as in
% \var{\#96}, but the number is either illegal, or out of range.
-scan_f_cannot_open_input=02012_F_Can not open file "$1"
+scan_f_cannot_open_input=02012_F_Cannot open file "$1"
% \fpc cannot find the program or unit source file you specified on the
% command line.
-scan_f_cannot_open_includefile=02013_F_Can not open include file "$1"
+scan_f_cannot_open_includefile=02013_F_Cannot open include file "$1"
% \fpc cannot find the source file you specified in a \var{\{\$include ..\}}
% statement.
scan_e_illegal_pack_records=02015_E_Illegal record alignment specifier "$1"
@@ -411,7 +411,7 @@ scan_e_illegal_hugepointernormalization=02098_E_Illegal argument for HUGEPOINTER
#
# Parser
#
-# 03338 is the last used one
+# 03339 is the last used one
#
% \section{Parser messages}
% This section lists all parser messages. The parser takes care of the
@@ -704,7 +704,7 @@ parser_e_comparative_operator_return_boolean=03090_E_Comparative operator must r
parser_e_only_virtual_methods_abstract=03091_E_Only virtual methods can be abstract
% You are declaring a method as abstract, when it is not declared to be
% virtual.
-parser_f_unsupported_feature=03092_F_Use of unsupported feature!
+parser_f_unsupported_feature=03092_F_Use of unsupported feature: "$1".
% You're trying to force the compiler into doing something it cannot do yet.
parser_e_mix_of_classes_and_objects=03093_E_The mix of different kind of objects (class, object, interface, etc) isn't allowed
% You cannot derive \var{objects}, \var{classes}, \var{cppclasses} and \var{interfaces} intertwined. E.g.
@@ -802,7 +802,7 @@ parser_e_function_already_declared_public_forward=03120_E_Function is already de
% You will get this error if a function is defined as \var{forward} twice.
% Or if it occurs in the \var{interface} section, and again as a \var{forward}
% declaration in the \var{implementation} section.
-parser_e_not_external_and_export=03121_E_Can not use both EXPORT and EXTERNAL
+parser_e_not_external_and_export=03121_E_Cannot use both EXPORT and EXTERNAL
% These two procedure directives are mutually exclusive.
parser_h_not_supported_for_inline=03123_H_"$1" not yet supported inside inline procedure/function
% Inline procedures don't support this declaration.
@@ -873,7 +873,7 @@ parser_e_threadvars_only_sg=03147_E_Threadvars can be only static or global
parser_f_direct_assembler_not_allowed=03148_F_Direct assembler not supported for binary output format
% You cannot use direct assembler when using a binary writer. Choose an
% other output format or use another assembler reader.
-parser_w_no_objpas_use_mode=03149_W_Don't load OBJPAS unit manually, use \{\$mode objfpc\} or \{\$mode delphi\} instead
+parser_w_no_objpas_use_mode=03149_W_Don't load OBJPAS unit manually, use {$mode objfpc} or {$mode delphi} instead
% You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
% This is not a good idea. Use the \var{\{\$MODE OBJFPC\}} or
% \var{\{\$mode delphi\}} directives which load the unit automatically.
@@ -927,7 +927,7 @@ parser_e_dlltool_unit_var_problem2=03161_E_Compile without -WD option
parser_f_need_objfpc_or_delphi_mode=03162_F_You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this module
% You need to use \var{\{\$MODE OBJFPC\}} or \var{\{\$MODE DELPHI\}} to compile this file.
% Or use the corresponding command line switch, either \var{-Mobjfpc} or \var{-MDelphi.}
-parser_e_no_export_with_index_for_target=03163_E_Can not export with index under $1
+parser_e_no_export_with_index_for_target=03163_E_Cannot export with index under $1
% Exporting of functions or procedures with a specified index is not
% supported on this target.
parser_e_no_export_of_variables_for_target=03164_E_Exporting of variables is not supported under $1
@@ -964,7 +964,7 @@ parser_e_no_access_specifier_in_interfaces=03172_E_Access specifiers cannot be u
parser_e_no_vars_in_interfaces=03173_E_An interface, helper or Objective-C protocol or category cannot contain fields
% Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories.
% An interface/helper/protocol/category can contain only methods and properties with method read/write specifiers.
-parser_e_no_local_proc_external=03174_E_Can not declare local procedure as EXTERNAL
+parser_e_no_local_proc_external=03174_E_Cannot declare local procedure as EXTERNAL
% Declaring local procedures as external is not possible. Local procedures
% get hidden parameters that will make the chance of errors very high.
parser_w_skipped_fields_before=03175_W_Some fields coming before "$1" were not initialized
@@ -977,10 +977,10 @@ parser_w_skipped_fields_after=03177_W_Some fields coming after "$1" were not ini
% You can leave some fields at the end of a type constant record uninitialized
% (The compiler will initialize them to zero automatically). This may be the cause
% of subtle problems.
-parser_e_varargs_need_cdecl_and_external=03178_E_VarArgs directive (or '...' in MacPas) without CDecl/CPPDecl/MWPascal and External
+parser_e_varargs_need_cdecl_and_external=03178_E_VarArgs directive (or '...' in MacPas) without CDecl/CPPDecl/MWPascal/StdCall and External
% The varargs directive (or the ``...'' varargs parameter in MacPas mode) can only be
% used with procedures or functions that are declared with \var{external} and one of
-% \var{cdecl}, \var{cppdecl} and \var{mwpascal}. This functionality
+% \var{cdecl}, \var{cppdecl}, \var{stdcall} and \var{mwpascal}. This functionality
% is only supported to provide a compatible interface to C functions like printf.
parser_e_self_call_by_value=03179_E_Self must be a normal (call-by-value) parameter
% You cannot declare \var{Self} as a const or var parameter, it must always be
@@ -1102,7 +1102,7 @@ parser_e_illegal_assignment_to_count_var=03208_E_Illegal assignment to for-loop
% loop variables inside the loop (Except in Delphi and TP modes). Use a while or
% repeat loop instead if you need to do something like that, since those
% constructs were built for that.
-parser_e_no_local_var_external=03209_E_Can not declare local variable as EXTERNAL
+parser_e_no_local_var_external=03209_E_Cannot declare local variable as EXTERNAL
% Declaring local variables as external is not allowed. Only global variables can reference
% external variables.
parser_e_proc_already_external=03210_E_Procedure is already declared EXTERNAL
@@ -1528,6 +1528,9 @@ parser_w_ptr_type_ignored=03338_W_Pointer type "$1" ignored
% The specified pointer type modifier is ignored, because it is not supported on
% the current platform. This happens, for example, when a far pointer is
% declared on a non-x86 platform.
+parser_e_global_generic_references_static=03339_E_Global Generic template references static symtable
+% A generic declared in the interface section of a unit must not reference symbols that belong
+% solely to the implementation section of that unit.
%
%
%
@@ -1976,7 +1979,7 @@ type_e_anonymous_function_unsupported=04999_E_Function references are not yet su
#
# Symtable
#
-# 05087 is the last used one
+# 05095 is the last used one
#
% \section{Symbol handling}
% This section lists all the messages that concern the handling of symbols.
@@ -2244,6 +2247,47 @@ sym_d_adding_helper_for=05087_D_Adding helper for $1
% A helper for the mentioned type is added to the current scope
sym_e_param_list=05088_E_Found declaration: $1
% This message shows all overloaded declarations in case of an error.
+sym_w_uninitialized_managed_local_variable=05089_W_Local variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_w_uninitialized_managed_variable=05090_W_Variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_uninitialized_managed_local_variable=05091_H_Local variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. it did not appear in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_uninitialized_managed_variable=05092_H_Variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. t did not appear in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_w_managed_function_result_uninitialized=05093_W_function result variable of a managed type does not seem to initialized
+% This message is displayed if the compiler thinks that the function result
+% variable will be used (i.e. it appears in the right-hand side of an expression)
+% before it is initialized (i.e. before it appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_managed_function_result_uninitialized=05094_H_Function result variable of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that the function result
+% variable will be used (i.e. it appears in the right-hand side of an expression)
+% before it is initialized (i.e. it appears in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_w_duplicate_id=05095_W_Duplicate identifier "$1"
+% The identifier was already declared in an Objective-C category that's in the
+% same scope as the current identifier. This is a warning instead of an error,
+% because while this hides the identifier from the category, there are often
+% many unused categories in scope.
% \end{description}
#
# Codegenerator
@@ -2682,7 +2726,7 @@ asmr_e_wrong_gotpcrel_intel_syntax=07117_E_GOTPCREL references in Intel assemble
asmr_e_no_gotpcrel_support=07118_E_The current target does not support GOTPCREL relocations
% Not all targets support position-independent code using a global offset table.
% Use a different way to access symbols in a position-indepent way in these cases.
-asmr_w_global_access_without_got=07119_W_Exported/global symbols should accessed via the GOT
+asmr_w_global_access_without_got=07119_W_Exported/global symbols should be accessed via the GOT
% Global symbols (symbols from the unit interface, or defined in a program
% or library) should be accessed via the GOT when generating position-indepent code.
asmr_w_check_mem_operand_size=07120_W_Check size of memory operand "$1"
@@ -2707,7 +2751,7 @@ asmr_e_invalid_ref_register=07125_E_Invalid register used in memory reference ex
#
# Assembler/binary writers
#
-# 08026 is the last used one
+# 08028 is the last used one
#
asmw_f_too_many_asm_files=08000_F_Too many assembler files
% With smartlinking enabled, there are too many assembler
@@ -2751,7 +2795,12 @@ asmw_e_handlerdata_no_handler=08025_E_.seh_handlerdata directive without precedi
asmw_f_too_many_relocations=08026_F_Relocation count for section $1 exceeds 65535
% Legacy COFF targets limit number of relocations per section to 65535 because they use a 2-byte field
% to store the relocation count. Targets using newer PECOFF format do not have this limitation.
-
+asmw_w_changing_bind_type=08027_N_Change of bind type of symbol $1 from $2 to $3 after use
+asmw_h_changing_bind_type=08028_H_Change of bind type of symbol $1 from $2 to $3 after use
+% An assembler symbol bind type has been altered after use, which can lead to wrong code.
+% First version is reserved for changig to local label, which is the most probable cause
+% of wrong code generation, but currently set to Note level as it appears inside
+% the compiler compilation.
#
# Executing linker/assembler
#
@@ -3107,10 +3156,10 @@ unit_u_indirect_crc_changed=10062_U_Indirect interface (objects/classes) CRC cha
% indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
% in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
% implementation has been parsed.
-% \end{description}
unit_u_ppu_invalid_memory_model=10063_U_PPU is compiled for another i8086 memory model
% This unit file was compiled for a different i8086 memory model and
% cannot be read.
+% \end{description}
# EndOfTeX
#
@@ -3153,10 +3202,10 @@ option_target_is_already_set=11011_W_Target is already set to: $1
option_no_shared_lib_under_dos=11012_W_Shared libs not supported on DOS platform, reverting to static
% If you specify \var{-CD} for the \dos platform, this message is displayed.
% The compiler supports only static libraries under \dos.
-option_too_many_ifdef=11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encountered
+option_too_many_ifdef=11013_F_In options file $1 at line $2 too many #IF(N)DEFs encountered
% The \var{\#IF(N)DEF} statements in the options file are not balanced with
% the \var{\#ENDIF} statements.
-option_too_many_endif=11014_F_In options file $1 at line $2 unexpected \var{\#ENDIFs} encountered
+option_too_many_endif=11014_F_In options file $1 at line $2 unexpected #ENDIFs encountered
% The \var{\#IF(N)DEF} statements in the options file are not balanced with
% the \var{\#ENDIF} statements.
option_too_less_endif=11015_F_Open conditional at the end of the options file
@@ -3225,7 +3274,7 @@ option_confict_asm_debug=11041_W_Assembler output selected "$1" cannot generate
option_ppc386_deprecated=11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead
% Using ppc386.cfg is still supported for historical reasons, however, for a multiplatform
% system the naming makes no sense anymore. Please continue to use fpc.cfg instead.
-option_else_without_if=11043_F_In options file $1 at line $2 \var{\#ELSE} directive without \var{\#IF(N)DEF} found
+option_else_without_if=11043_F_In options file $1 at line $2 #ELSE directive without #IF(N)DEF found
% An \var{\#ELSE} statement was found in the options file without a matching \var{\#IF(N)DEF} statement.
option_unsupported_target=11044_F_Option "$1" is not, or not yet, supported on the current target platform
% Not all options are supported or implemented for all target platforms. This message informs you that a chosen
@@ -3349,7 +3398,7 @@ wpo_cant_create_feedback_file=12019_E_Cannot create specified whole program opti
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl and others
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
@@ -3358,10 +3407,10 @@ Copyright (c) 1993-2014 by Florian Klaempfl and others
option_info=11024_[
Free Pascal Compiler version $FPCVERSION
-Compiler Date : $FPCDATE
-Compiler CPU Target: $FPCCPU
+Compiler date : $FPCDATE
+Compiler CPU target: $FPCCPU
-Supported targets:
+Supported targets (targets marked with '{*}' are under development):
$OSTARGETS
Supported CPU instruction sets:
@@ -3373,6 +3422,9 @@ Supported FPU instruction sets:
Supported inline assembler modes:
$ASMMODES
+Recognized compiler and RTL features:
+ $FEATURELIST
+
Supported ABI targets:
$ABITARGETS
@@ -3383,9 +3435,7 @@ Supported Whole Program Optimizations:
All
$WPOPTIMIZATIONS
-Supported Microcontroller types:
- $CONTROLLERTYPES
-
+Supported Microcontroller types:$\n $CONTROLLERTYPES$\n
This program comes under the GNU General Public Licence
For more information read COPYING.v2
@@ -3411,10 +3461,14 @@ new features, etc.):
# A = ARM
# e = in extended debug mode only
# F = help for the 'fpc' binary (independent of the target compiler)
+# I = VIS
+# J = JVM
+# M = MIPS (MIPSEB) targets
+# m = MIPSEL targets
# P = PowerPC targets
+# p = PowerPC64 targets
# S = Sparc targets
-# V = Virtual machine targets
-# J = JVM
+# V = AVR
# The second character also indicates who will display this line,
# (if the above character was TRUE) the current possibilities are :
# * = everyone
@@ -3424,7 +3478,8 @@ new features, etc.):
# The third character represents the indentation level.
#
option_help_pages=11025_[
-**0*_Put + after a boolean switch option to enable it, - to disable it
+F*0*_Only options valid for the default or selected platform are listed.
+**0*_Put + after a boolean switch option to enable it, - to disable it.
**1@<x>_Read compiler options from <x> in addition to the default fpc.cfg
**1a_The compiler does not delete the generated assembler file
**2al_List sourcecode lines in assembler file
@@ -3452,7 +3507,7 @@ option_help_pages=11025_[
3*2Aelf_ELF (Linux) using internal writer
3*2Acoff_COFF (Go32v2) using internal writer
3*2Apecoff_PE-COFF (Win32) using internal writer
-3*2Ayasm_Assmeble using Yasm (experimental)
+3*2Ayasm_Assemble using Yasm (experimental)
4*2Aas_Assemble using GNU AS
4*2Agas_Assemble using GNU GAS
4*2Agas-darwin_Assemble darwin Mach-O64 using GNU GAS
@@ -3476,12 +3531,12 @@ S*2Aas_Assemble using GNU AS
**1B_Build all modules
**1C<x>_Code generation options:
**2C3_Turn on ieee error checking for constants
-**2Ca<x>_Select ABI, see fpc -i for possible values
+**2Ca<x>_Select ABI; see fpc -i or fpc -ia for possible values
**2Cb_Generate code for a big-endian variant of the target architecture
**2Cc<x>_Set default calling convention to <x>
**2CD_Create also dynamic library (not supported)
**2Ce_Compilation with emulated floating point opcodes
-**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible values
+**2Cf<x>_Select fpu instruction set to use; see fpc -i or fpc -if for possible values
**2CF<x>_Minimal floating point constant precision (default, 32, 64)
**2Cg_Generate PIC code
**2Ch<n>_<n> bytes heap (between 1023 and 67107840)
@@ -3491,9 +3546,11 @@ A*2CI<x>_Select instruction set on ARM: ARM or THUMB
P*2CN_Generate nil-pointer checks (AIX-only)
**2Co_Check overflow of integer operations
**2CO_Check for possible overflow of integer operations
-**2Cp<x>_Select instruction set, see fpc -i for possible values
+**2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
**2CP<x>=<y>_ packing settings
**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
+**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMAL
+**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2, 4, 8, 16 and 32
**2Cr_Range checking
**2CR_Verify object method call validity
**2Cs<n>_Set stack checking size to <n>
@@ -3558,7 +3615,7 @@ J*2Cv_Var/out parameter copy-out checking
*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class name
*g2gp_Preserve case in stabs symbol names
*g2gs_Generate Stabs debug information
-*g2gt_Trash local variables (to detect uninitialized uses)
+*g2gt_Trash local variables (to detect uninitialized uses; multiple 't' changes the trashing value)
*g2gv_Generates programs traceable with Valgrind
*g2gw_Generate DWARFv2 debug information (same as -gw2)
*g2gw2_Generate DWARFv2 debug information
@@ -3566,12 +3623,21 @@ J*2Cv_Var/out parameter copy-out checking
*g2gw4_Generate DWARFv4 debug information (experimental)
**1i_Information
**2iD_Return compiler date
-**2iV_Return short compiler version
-**2iW_Return full compiler version
**2iSO_Return compiler OS
**2iSP_Return compiler host processor
**2iTO_Return target OS
**2iTP_Return target processor
+**2iV_Return short compiler version
+**2iW_Return full compiler version
+**2ia_Return list of supported ABI targets
+**2ic_Return list of supported CPU instruction sets
+**2if_Return list of supported FPU instruction sets
+**2ii_Return list of supported inline assembler modes
+**2io_Return list of supported optimizations
+**2ir_Return list of recognized compiler and RTL features
+**2it_Return list of supported targets
+**2iu_Return list of supported microcontroller types
+**2iw_Return list of supported whole program optimizations
**1I<x>_Add <x> to include path
**1k<x>_Pass <x> to the linker
**1l_Write logo
@@ -3590,16 +3656,16 @@ J*2Cv_Var/out parameter copy-out checking
**2O3_Level 3 optimizations (-O2 + slow optimizations)
**2O4_Level 4 optimizations (-O3 + optimizations which might have unexpected side effects)
**2Oa<x>=<y>_Set alignment
-**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible values
-**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values
-**2OW<x>_Generate whole-program optimization feedback for optimization <x>, see fpc -i for possible values
-**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possible values
+**2Oo[NO]<x>_Enable or disable optimizations; see fpc -i or fpc -io for possible values
+**2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for possible values
+**2OW<x>_Generate whole-program optimization feedback for optimization <x>; see fpc -i or fpc -iw for possible values
+**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw for possible values
**2Os_Optimize for size rather than speed
**1pg_Generate profile code for gprof (defines FPC_PROFILE)
F*1P<x>_Target CPU / compiler related options:
F*2PB_Show default compiler binary
F*2PP_Show default target cpu
-F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64)
+F*2P<x>_Set target CPU (arm,avr,i386,jvm,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64)
**1R<x>_Assembler reading style:
**2Rdefault_Use default assembler for target
3*2Ratt_Read AT&T style assembler
@@ -3615,6 +3681,7 @@ F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64
**3*_w : Compiler also halts after warnings
**3*_n : Compiler also halts after notes
**3*_h : Compiler also halts after hints
+**2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -ir for possible values)
**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)
**2Sh_Use reference counted strings (ansistring by default) instead of shortstrings
**2Si_Turn on inlining of procedures/functions declared as "inline"
@@ -3625,6 +3692,7 @@ F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64
**2Sm_Support macros like C (global)
**2So_Same as -Mtp
**2Ss_Constructor name must be init (destructor must be done)
+**2Sv_Support vector processing (use CPU vector extensions if available)
**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)
**2Sy_@<pointer> returns a typed pointer, same as $T+
**1s_Do not call assembler and linker
@@ -3632,10 +3700,15 @@ F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64
**2st_Generate script to link on target
**2sr_Skip register allocation phase (use with -alr)
**1T<x>_Target operating system:
+3*2Tandroid_Android
+3*2Taros_AROS
+3*2Tbeos_BeOS
3*2Tdarwin_Darwin/Mac OS X
+3*2Tembedded_Embedded
3*2Temx_OS/2 via EMX (including EMX/RSX extender)
3*2Tfreebsd_FreeBSD
3*2Tgo32v2_Version 2 of DJ Delorie DOS extender
+3*2Thaiku_Haiku
3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdarwin)
3*2Tlinux_Linux
3*2Tnativent_Native NT API (experimental)
@@ -3652,22 +3725,45 @@ F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64
3*2Twin32_Windows 32 Bit
3*2Twince_Windows CE
4*2Tdarwin_Darwin/Mac OS X
+4*2Tfreebsd_FreeBSD
4*2Tlinux_Linux
+4*2Tnetbsd_NetBSD
+4*2Topenbsd_OpenBSD
+4*2Tsolaris_Solaris
4*2Twin64_Win64 (64 bit Windows systems)
6*2Tamiga_Commodore Amiga
6*2Tatari_Atari ST/STe/TT
6*2Tlinux_Linux
6*2Tpalmos_PalmOS
+8*2Tmsdos_MS-DOS (and compatible)
+A*2Tandroid_Android
A*2Tdarwin_Darwin/iPhoneOS/iOS
+A*2Tembedded_Embedded
+A*2Tgba_Game Boy Advance
A*2Tlinux_Linux
+A*2Tnds_Nintendo DS
+A*2Tsymbian_Symbian
A*2Twince_Windows CE
+J*2Tandroid_Android
+J*2Tjava_Java
+m*2Tembedded_Embedded
+M*2Tandroid_Android
+M*2Tembedded_Embedded
+M*2Tlinux_Linux
+P*2Taix_AIX
P*2Tamiga_AmigaOS
P*2Tdarwin_Darwin/Mac OS X
P*2Tlinux_Linux
P*2Tmacos_Mac OS (classic)
P*2Tmorphos_MorphOS
+P*2Tnetbsd_NetBSD
+P*2Twii_Wii
+p*2Taix_AIX
+p*2Tdarwin_Darwin/Mac OS X
+p*2Tlinux_Linux
S*2Tsolaris_Solaris
S*2Tlinux_Linux
+V*2Tembedded_Embedded
**1u<x>_Undefines the symbol <x>
**1U_Unit options:
**2Un_Do not check where the unit name matches the file name
@@ -3681,10 +3777,10 @@ S*2Tlinux_Linux
**2*_i : Show general info d : Show debug info
**2*_l : Show linenumbers r : Rhide/GCC compatibility mode
**2*_s : Show time stamps q : Show message numbers
-**2*_a : Show everything x : Executable info (Win32 only)
+**2*_a : Show everything x : Show info about invoked tools
**2*_b : Write file names messages p : Write tree.log with parse tree
**2*_ with full path v : Write fpcdebug.txt with
-**2*_ lots of debugging info
+**2*_z : Write output to stderr lots of debugging info
**2*_m<x>,<y> : Do not show messages numbered <x> and <y>
F*1V<x>_Append '-<x>' to the used compiler binary name (e.g. for version)
**1W<x>_Target-specific options (targets)
@@ -3703,7 +3799,7 @@ A*2Wb_Create a bundle instead of a library (Darwin)
A*2WB_Create a relocatable image (Windows, Symbian)
A*2WBxxxx_Set image base to xxxx (Windows, Symbian)
3*2WC_Specify console type application (EMX, OS/2, Windows)
-4*2WC_Specify console type application (EMX, OS/2, Windows)
+4*2WC_Specify console type application (Windows)
A*2WC_Specify console type application (Windows)
P*2WC_Specify console type application (Classic Mac OS)
3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)
@@ -3716,7 +3812,7 @@ P*2We_Use external resources (Darwin)
p*2We_Use external resources (Darwin)
3*2WF_Specify full-screen type application (EMX, OS/2)
3*2WG_Specify graphic type application (EMX, OS/2, Windows)
-4*2WG_Specify graphic type application (EMX, OS/2, Windows)
+4*2WG_Specify graphic type application (Windows)
A*2WG_Specify graphic type application (Windows)
P*2WG_Specify graphic type application (Classic Mac OS)
3*2Wi_Use internal resources (Darwin)
@@ -3740,8 +3836,9 @@ P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwin)
3*2WN_Do not generate relocation code, needed for debugging (Windows)
4*2WN_Do not generate relocation code, needed for debugging (Windows)
A*2WN_Do not generate relocation code, needed for debugging (Windows)
-A*2Wpxxxx_Specify the controller type, see fpc -i for possible values
-V*2Wpxxxx_Specify the controller type, see fpc -i for possible values
+A*2Wpxxxx_Specify the controller type; see fpc -i or fpc -iu for possible values
+m*2Wpxxxx_Specify the controller type; see fpc -i or fpc -iu for possible values
+V*2Wpxxxx_Specify the controller type; see fpc -i or fpc -iu for possible values
3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)
A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)
3*2WR_Generate relocation code (Windows)
@@ -3756,11 +3853,16 @@ P*2WT_Specify MPW tool type application (Classic Mac OS)
**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
**2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
**2Xe_Use external linker
+**2Xf_Substitute pthread library name for linking (BSD)
**2Xg_Create debuginfo in a separate file and add a debuglink section to executable
**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)
**2Xi_Use internal linker
+**2XLA_Define library substitutions for linking
+**2XLO_Define order of library linking
+**2XLD_Exclude default order of standard libraries
**2Xm_Generate link map
**2XM<x>_Set the name of the 'main' program routine (default is 'main')
+**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)
F*2Xp<x>_First search for the compiler binary in the directory <x>
**2XP<x>_Prepend the binutils names with the prefix <x>
**2Xr<x>_Set the linker's rlink-path to <x> (needed for cross compile, see the ld manual for more information) (BeOS, Linux)
@@ -3768,6 +3870,7 @@ F*2Xp<x>_First search for the compiler binary in the directory <x>
**2Xs_Strip all symbols from executable
**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)
**2Xt_Link with static libraries (-static is passed to linker)
+**2Xv_Generate table for Virtual Entry calls
**2XX_Try to smartlink units (defines FPC_LINK_SMART)
**1*_
**1?_Show this help
diff --git a/compiler/msg/errores.msg b/compiler/msg/errores.msg
index fa8c3e77bf..a525562547 100644
--- a/compiler/msg/errores.msg
+++ b/compiler/msg/errores.msg
@@ -270,7 +270,7 @@ scan_e_illegal_asmmode_specifier=02050_E_Estilo de ensamblador inváalido especif
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_No es posible cambiar el lector dentro de una sentencia asm. "$1" solo sera efectivo en los siguientes
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statements only.
scan_e_wrong_switch_toggle=02052_E_Modificador de conmutador erróneo, use ON/OFF o +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2111,7 +2111,7 @@ option_code_page_not_available=11039_E_Código de página desconocido
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorf.msg b/compiler/msg/errorf.msg
index 94f4d2fdb2..58e271b99a 100644
--- a/compiler/msg/errorf.msg
+++ b/compiler/msg/errorf.msg
@@ -269,7 +269,7 @@ scan_w_unsupported_asmmode_specifier=02050_W_Style assembleur non support‚ $1
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_Changement de type d'interpr‚teur ASM … l'int‚rieur de code assembleur, $1 sera effectif seulement pour le prochain
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statement only.
scan_e_wrong_switch_toggle=02052_E_Mauvais argument de switch, utilisez ON/OFF ou +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -1712,7 +1712,7 @@ option_asm_forced=11022_W_"$1" assembler use forced
#
option_logo=11023_[
Compilateur Free Pascal version $FPCFULLVERSION [$FPCDATE] pour $FPCTARGET
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorfi.msg b/compiler/msg/errorfi.msg
index b927d04241..c58dec2a1b 100644
--- a/compiler/msg/errorfi.msg
+++ b/compiler/msg/errorfi.msg
@@ -2258,7 +2258,7 @@ option_config_is_dir=11040_F_Le fichier de configuration $1 est un répertoire
# Logo (option -l)
#
option_logo=11023_[ Compilateur Free Pascal version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014, Florian Klaempfl ]
+Copyright (c) 1993-2015, Florian Klaempfl and others]
#
# Info (option -i)
#
diff --git a/compiler/msg/errorhe.msg b/compiler/msg/errorhe.msg
index 0627414580..99b682acf7 100644
--- a/compiler/msg/errorhe.msg
+++ b/compiler/msg/errorhe.msg
@@ -2404,7 +2404,7 @@ option_confict_asm_debug=11041_W_ñåâ äôìè ùì äîàñó ùðáçø "$1" àéðå éëåì ìéöåø îé
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorheu.msg b/compiler/msg/errorheu.msg
index 6ac6ee5a7b..63f5bd7146 100644
--- a/compiler/msg/errorheu.msg
+++ b/compiler/msg/errorheu.msg
@@ -2404,7 +2404,7 @@ option_confict_asm_debug=11041_W_סוג הפלט של המ×סף שנבחר "$1"
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorid.msg b/compiler/msg/errorid.msg
index aad846822a..b09623bc32 100644
--- a/compiler/msg/errorid.msg
+++ b/compiler/msg/errorid.msg
@@ -2421,7 +2421,7 @@ option_confict_asm_debug=11041_W_Output assembler yang dipilih "$1" tidak bisa m
#
option_logo=11023_[
Free Pascal Compiler versi $FPCFULLVERSION [$FPCDATE] untuk $FPCCPU
-Hak Cipta (c) 1993-2014 oleh Florian Klaempfl
+Hak Cipta (c) 1993-2015 oleh Florian Klaempfl and others
]
#
diff --git a/compiler/msg/erroriu.msg b/compiler/msg/erroriu.msg
index 85637d7629..ccd8d0b975 100644
--- a/compiler/msg/erroriu.msg
+++ b/compiler/msg/erroriu.msg
@@ -2690,7 +2690,7 @@ wpo_cant_create_feedback_file=12019_E_Impossibile creare il file di feedback "$1
#
option_logo=11023_[
Compilatore Free Pascal, versione $FPCFULLVERSION [$FPCDATE] per $FPCCPU
-Copyright (c) 1993-2014 di Florian Klaempfl
+Copyright (c) 1993-2015 di Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorn.msg b/compiler/msg/errorn.msg
index 6b6f618313..8242e260cb 100644
--- a/compiler/msg/errorn.msg
+++ b/compiler/msg/errorn.msg
@@ -2183,7 +2183,7 @@ option_config_is_dir=11040_F_Config bestand $1 is een directorie
%\end{description}
option_logo=11023_[
Free Pascal Compiler versie $FPCFULLVERSION [$FPCDATE] voor $FPCTARGET
-Copyright (c) 1993-2014 door Florian Klaempfl en anderen
+Copyright (c) 1993-2015 door Florian Klaempfl en anderen
]
#
# Info (option -i)
diff --git a/compiler/msg/errorpl.msg b/compiler/msg/errorpl.msg
index 5090a1dce2..9bf7c154f8 100644
--- a/compiler/msg/errorpl.msg
+++ b/compiler/msg/errorpl.msg
@@ -266,7 +266,7 @@ scan_w_unsupported_asmmode_specifier=02050_W_Nieprawidˆowy styl asemblera $1
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_Przeˆ¥cznik stylu asemblera niedozwolony w bloku asemblera, $1 b©dzie dziaˆa† dopiero w nast©pnym bloku
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statement only.
scan_e_wrong_switch_toggle=02052_E_Zˆa warto˜† przeˆ¥cznika, u¾yj ON/OFF lub +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2116,7 +2116,7 @@ option_code_page_not_available=11039_E_Nieznana strona kodowa
#
option_logo=11023_[
Free Pascal Compiler wersja $FPCFULLVERSION [$FPCDATE] dla $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorpli.msg b/compiler/msg/errorpli.msg
index 89ba461520..527f51b92a 100644
--- a/compiler/msg/errorpli.msg
+++ b/compiler/msg/errorpli.msg
@@ -266,7 +266,7 @@ scan_w_unsupported_asmmode_specifier=02050_W_Nieprawid³owy styl asemblera $1
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_Prze³±cznik stylu asemblera niedozwolony w bloku asemblera, $1 bêdzie dzia³aæ dopiero w nastêpnym bloku
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statement only.
scan_e_wrong_switch_toggle=02052_E_Z³a warto¶æ prze³±cznika, u¿yj ON/OFF lub +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2116,7 +2116,7 @@ option_code_page_not_available=11039_E_Nieznana strona kodowa
#
option_logo=11023_[
Free Pascal Compiler wersja $FPCFULLVERSION [$FPCDATE] dla $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorpt.msg b/compiler/msg/errorpt.msg
index 6c5b74f43c..67aa93d227 100644
--- a/compiler/msg/errorpt.msg
+++ b/compiler/msg/errorpt.msg
@@ -3083,7 +3083,7 @@ wpo_cant_create_feedback_file=12019_E_Imposs¡vel criar arquivo retorno otimiza‡ä
#
option_logo=11023_[
Compilador Free Pascal versÆo $FPCFULLVERSION [$FPCDATE] para $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
@@ -3384,7 +3384,7 @@ A*2Wb_Cria um encarte ao inv‚s de uma biblioteca (Darwin)
A*2WB_Cria uma imagem reloc vel (Windows, Symbian)
A*2WBxxxx_Define base da imagem para xxxx (Windows, Symbian)
3*2WC_Especifica aplica‡Æo do tipo console (EMX, OS/2, Windows)
-4*2WC_Especifica aplica‡Æo do tipo console (EMX, OS/2, Windows)
+4*2WC_Especifica aplica‡Æo do tipo console (Windows)
A*2WC_Especifica aplica‡Æo do tipo console (Windows)
P*2WC_Especifica aplica‡Æo do tipo console (Classic Mac OS)
3*2WD_Usa DEFFILE para exportar fun‡äes de DLL ou EXE (Windows)
@@ -3397,7 +3397,7 @@ P*2We_Usa recursos externos (Darwin)
p*2We_Usa recursos externos (Darwin)
3*2WF_Especifica aplica‡Æo do tipo tela-cheia (EMX, OS/2)
3*2WG_Especifica aplica‡Æo do tipo gr fica (EMX, OS/2, Windows)
-4*2WG_Especifica aplica‡Æo do tipo gr fica (EMX, OS/2, Windows)
+4*2WG_Especifica aplica‡Æo do tipo gr fica (Windows)
A*2WG_Especifica aplica‡Æo do tipo gr fica (Windows)
P*2WG_Especifica aplica‡Æo do tipo gr fica (Classic Mac OS)
3*2Wi_Usa recursos internos (Darwin)
diff --git a/compiler/msg/errorptu.msg b/compiler/msg/errorptu.msg
index fbb5cba4cc..8a0663c0ed 100644
--- a/compiler/msg/errorptu.msg
+++ b/compiler/msg/errorptu.msg
@@ -3083,7 +3083,7 @@ wpo_cant_create_feedback_file=12019_E_Impossível criar arquivo retorno otimizaÃ
#
option_logo=11023_[
Compilador Free Pascal versão $FPCFULLVERSION [$FPCDATE] para $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
@@ -3384,7 +3384,7 @@ A*2Wb_Cria um encarte ao invés de uma biblioteca (Darwin)
A*2WB_Cria uma imagem relocável (Windows, Symbian)
A*2WBxxxx_Define base da imagem para xxxx (Windows, Symbian)
3*2WC_Especifica aplicação do tipo console (EMX, OS/2, Windows)
-4*2WC_Especifica aplicação do tipo console (EMX, OS/2, Windows)
+4*2WC_Especifica aplicação do tipo console (Windows)
A*2WC_Especifica aplicação do tipo console (Windows)
P*2WC_Especifica aplicação do tipo console (Classic Mac OS)
3*2WD_Usa DEFFILE para exportar funções de DLL ou EXE (Windows)
@@ -3397,7 +3397,7 @@ P*2We_Usa recursos externos (Darwin)
p*2We_Usa recursos externos (Darwin)
3*2WF_Especifica aplicação do tipo tela-cheia (EMX, OS/2)
3*2WG_Especifica aplicação do tipo gráfica (EMX, OS/2, Windows)
-4*2WG_Especifica aplicação do tipo gráfica (EMX, OS/2, Windows)
+4*2WG_Especifica aplicação do tipo gráfica (Windows)
A*2WG_Especifica aplicação do tipo gráfica (Windows)
P*2WG_Especifica aplicação do tipo gráfica (Classic Mac OS)
3*2Wi_Usa recursos internos (Darwin)
diff --git a/compiler/msg/errorr.msg b/compiler/msg/errorr.msg
index 2c3f95f55a..3683793cf2 100644
--- a/compiler/msg/errorr.msg
+++ b/compiler/msg/errorr.msg
@@ -2503,7 +2503,7 @@ wpo_cant_create_feedback_file=12019_E_¥¢®§¬®¦­® á®§¤ âì ä ©« ®¡à â­®© á¢ï§¨ "$1"
#
option_logo=11023_[
Š®¬¯¨«ïâ®à Free Pascal ¢¥àᨨ $FPCFULLVERSION [$FPCDATE] ¤«ï $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorru.msg b/compiler/msg/errorru.msg
index 8868bad05d..524a1064b5 100644
--- a/compiler/msg/errorru.msg
+++ b/compiler/msg/errorru.msg
@@ -2503,7 +2503,7 @@ wpo_cant_create_feedback_file=12019_E_Ðевозможно Ñоздать фай
#
option_logo=11023_[
КомпилÑтор Free Pascal верÑии $FPCFULLVERSION [$FPCDATE] Ð´Ð»Ñ $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msg/errorues.msg b/compiler/msg/errorues.msg
index 4bebec7fd4..433181e165 100644
--- a/compiler/msg/errorues.msg
+++ b/compiler/msg/errorues.msg
@@ -264,7 +264,7 @@ scan_e_illegal_asmmode_specifier=02050_E_Estilo de ensamblador inváalido especi
% the compiler didn't recognize the mode you specified.
scan_w_no_asm_reader_switch_inside_asm=02051_W_No es posible cambiar el lector dentro de una sentencia asm. "$1" solo sera efectivo en los siguientes
% It is not possible to switch from one assembler reader to another
-% inside an assmebler block. The new reader will be used for next
+% inside an assembler block. The new reader will be used for next
% assembler statements only.
scan_e_wrong_switch_toggle=02052_E_Modificador de conmutador erróneo, use ON/OFF o +/-
% You need to use ON or OFF or a + or - to toggle the switch
@@ -2105,7 +2105,7 @@ option_code_page_not_available=11039_E_Código de página desconocido
#
option_logo=11023_[
Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPCCPU
-Copyright (c) 1993-2014 by Florian Klaempfl
+Copyright (c) 1993-2015 by Florian Klaempfl and others
]
#
diff --git a/compiler/msgidx.inc b/compiler/msgidx.inc
index f011abd443..b751dfd233 100644
--- a/compiler/msgidx.inc
+++ b/compiler/msgidx.inc
@@ -440,6 +440,7 @@ const
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;
type_e_mismatch=04000;
type_e_incompatible_types=04001;
type_e_not_equal_types=04002;
@@ -630,6 +631,13 @@ const
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;
cg_e_parasize_too_big=06009;
cg_e_file_must_call_by_reference=06012;
cg_e_cant_use_far_pointer_there=06013;
@@ -812,6 +820,8 @@ const
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;
exec_w_source_os_redefined=09000;
exec_i_assembling_pipe=09001;
exec_d_cant_create_asmfile=09002;
@@ -996,9 +1006,9 @@ const
option_info=11024;
option_help_pages=11025;
- MsgTxtSize = 72262;
+ MsgTxtSize = 74953;
MsgIdxMax : array[1..20] of longint=(
- 26,99,339,1000,89,57,126,27,202,64,
+ 26,99,340,1000,96,57,126,29,202,64,
58,20,1,1,1,1,1,1,1,1
);
diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc
index 9d6b67a49d..be14fc1a7f 100644
--- a/compiler/msgtxt.inc
+++ b/compiler/msgtxt.inc
@@ -1,7 +1,7 @@
{$ifdef Delphi}
-const msgtxt : array[0..000301] of string[240]=(
+const msgtxt : array[0..000312] of string[240]=(
{$else Delphi}
-const msgtxt : array[0..000301,1..240] of char=(
+const msgtxt : array[0..000312,1..240] of char=(
{$endif Delphi}
'01000_T_Compiler: $1'#000+
'01001_D_Compiler OS: $1'#000+
@@ -37,16 +37,16 @@ const msgtxt : array[0..000301,1..240] of char=(
'02005_W_Comment level $1 found'#000+
'02008_N_Ignored compiler switch "$1"'#000+
'02009_W_Illegal compiler s','witch "$1"'#000+
- '02010_W_Misplaced global compiler switch'#000+
+ '02010_W_Misplaced global compiler switch, ignored'#000+
'02011_E_Illegal char constant'#000+
- '02012_F_Can not open file "$1"'#000+
- '02013_F_Can not open include file "$1"'#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 specif','ier "$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_Syntax error while parsing a conditional compiling expression'#000+
'02019_E_Evaluating a conditional compiling expression'#000+
- '02020_W_Macro contents are limited to 255 character','s in length'#000+
+ '02020_W_Macro contents are limited to 255 ch','aracters in length'#000+
'02021_E_ENDIF without IF(N)DEF'#000+
'02022_F_User defined: $1'#000+
'02023_E_User defined: $1'#000+
@@ -54,13 +54,13 @@ const msgtxt : array[0..000301,1..240] of char=(
'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 effec','t'#000+
+ '02028_E_Keyword redefined as macro has n','o 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+
- '02','034_CL_IFDEF $1 found, $2'#000+
+ '02033_CL_ENDIF $1 f','ound'#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+
@@ -68,990 +68,1006 @@ const msgtxt : array[0..000301,1..240] of char=(
'02039_CL_Skipping until...'#000+
'02040_I_Press <return> to continue'#000+
'02041_W_Unsupported switch "$1"'#000+
- '02042_W_Ill','egal compiler directive "$1"'#000+
+ '0204','2_W_Illegal compiler directive "$1"'#000+
'02043_TL_Back in $1'#000+
'02044_W_Unsupported application 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 O','S'#000+
+ '02047_N_VERSION is not supported by t','arget OS'#000+
'02048_N_VERSION only for exes or DLLs'#000+
'02049_W_Wrong format for VERSION directive "$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+
- '0205','2_E_Wrong switch toggle, use ON/OFF or +/-'#000+
+ 'ill be effective only for ne','xt'#000+
+ '02052_E_Wrong switch toggle, use ON/OFF or +/-'#000+
'02053_E_Resource files are not supported 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 sup','ported for this target'#000+
+ '02056_W_Only one resource file',' is supported for this target'#000+
'02057_W_Macro support has been turned off'#000+
'02058_E_Illegal interface type specified. Valids are COM, CORBA or DEF'+
'AULT.'#000+
'02059_W_APPID is only supported for PalmOS'#000+
'02060_W_APPNAME is only supported for PalmOS'#000+
- '02061_E_Con','stant strings cannot be longer than 255 chars'#000+
+ '0206','1_E_Constant strings cannot be longer than 255 chars'#000+
'02062_F_Including include files 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,
+ '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 switch "$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+
+ '02070_E_Malformed UTF-8 string',#000+
+ '02071_C_UTF-8 signature found, using UTF-8 encoding'#000+
'02072_E_Compile time expression: 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 t','he target OS'#000+
+ '02075_W_SETPEFLAGS is not support','ed by the target OS'#000+
'02076_W_IMAGEBASE is not supported by the target OS'#000+
'02077_W_MINSTACKSIZE 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 se','t packing value'#000+
+ '02080_E_Ill','egal set packing value'#000+
'02081_W_PIC directive or switch ignored'#000+
'02082_W_The switch "$1" is not supported by the currently selected tar'+
'get'#000+
'02084_W_Framework-related options are only supported for Darwin/Mac OS'+
' X'#000+
- '02085_E_Illegal minimal floating poin','t constant precision "$1"'#000+
+ '02085_E_Illegal minimal floati','ng point constant precision "$1"'#000+
'02086_W_Overriding name of "main" procedure multiple times, was previo'+
'usly 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'+
+ '02089_F_It is not possible to in','clude 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 the current target platform'#000+
'02091_W_Current system codepage "$1" is not available for the compiler'+
- '. Switching default ','codepage back to "$2".'#000+
+ '. Switching d','efault 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 sta','ck size is not within the valid range for t'+
+ '02096_W_The specif','ied stack size is not within the valid range for t'+
'he 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+
- '03','000_E_Parser - Syntax Error'#000+
+ '02098_E_Illegal argument for HUGEPOINTERNORMALIZA','TION'#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 all declarations of "$1" are declared with OVERLOAD'#000+
'03008_E_Duplicate exported function name "$1"'#000+
- '03009_E_Duplicate exp','orted function index $1'#000+
+ '03009_E_Duplic','ate exported function index $1'#000+
'03010_E_Invalid index for exported function'#000+
'03011_W_Relocatable DLL or executable $1 debug info does not work, dis'+
'abled.'#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+
+ '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_Constructor 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+
+ '0','3021_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 i','dentifier "$1" isn'#039't a function'#000+
+ '03027_E_overl','oaded 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+
- '030','31_N_Values in enumeration types have to be ascending'#000+
+ '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+
'03034_E_function nesting > 31'#000+
'03035_E_range check error while evaluating constants'#000+
- '03036_W_range check error while evalua','ting 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 constants of classes or interfaces are not allowed'#000+
- '03040_E_functions variables of overloaded functions are not allowed'#000+
- '0304','1_E_string length must be a value from 1 to 255'#000+
+ '03040_E_functions variables of overloaded functions are not allow','ed'#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+
'03043_W_use of NEW or DISPOSE for untyped pointers is meaningless'#000+
- '03044_E_use of NEW or DISPOSE is not possible for unty','ped pointers'#000+
+ '03044_E_use of NEW or DISPOSE is not possible f','or 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 fl','oating point constant'#000+
+ '03050_E_Ill','egal 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 b'+
'e referred with class references'#000+
- '03054_E_Only class methods',', class properties and class variables can'+
+ '03054_E_Only class ','methods, class properties and class variables can'+
' be 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 meth','od in an ancestor class to be overridden: "$'+
+ '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 directive is not yet implemented'#000+
'03061_E_Illegal symbol for property access'#000+
- '03062_E_Cannot access a protected field of a','n object here'#000+
+ '03062_E_Cannot access a protected fie','ld 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 ove'+
'rridden by "$1" which has another return type'#000+
- '03067_E_EXPORT declared functions cannot be nested'#000+
- '030','68_E_Methods cannot be EXPORTed'#000+
+ '03067_E_EXPORT declared functions cannot be nes','ted'#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_Class 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 o','ther methods called direct with type'+
+ '03072_E_Methods can be on','ly in other methods called direct with type'+
' identifier of the class'#000+
'03073_E_Illegal use of '#039':'#039#000+
'03074_E_range check error in set constructor or duplicate set element'#000+
'03075_E_Pointer to object expected'#000+
- '03076_E_Expression must be constructor call'#000+
- '030','77_E_Expression must be destructor call'#000+
+ '03076_E_Expression must be constructor c','all'#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 record type, got $1'#000+
'03080_E_Procedures cannot return a value'#000+
- '03081_E_constructors, destructors and class operators mus','t be method'+
+ '03081_E_constructors, destructors and class operat','ors must be method'+
's'#000+
'03082_E_Operator is not overloaded'#000+
'03083_E_Impossible to overload assignment for equal types'#000+
'03084_E_Impossible 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 '+
+ '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 overload'+
'able operators (if any) are: $1'#000+
'03090_E_Comparative operator must return a boolean value'#000+
- '03091_E_Only virtual m','ethods can be abstract'#000+
- '03092_F_Use of unsupported feature!'#000+
+ '03091_E_Only vi','rtual methods can be abstract'#000+
+ '03092_F_Use of unsupported feature: "$1".'#000+
'03093_E_The mix of different kind of objects (class, object, interface'+
', etc) isn'#039't allowed'#000+
'03094_W_Unknown procedure directive had to be ignored: "$1"'#000+
- '03095_E_$1 can be associated w','ith only one variable'#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 initialized'#000+
'03098_E_Abstract methods shouldn'#039't have any definition (with funct'+
'ion body)'#000+
- '03099_E_This overloaded function cann','ot be local (must be exported)'#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+
- '031','06_UL_Parsing implementation of $1'#000+
+ '03105_UL_Parsing interface o','f 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+
'03110_E_Only one default property is allowed'#000+
'03111_E_The default property must be an array property'#000+
- '03112_E_Virtual construct','ors are only supported in class object mode'+
+ '03112_E_Virt','ual constructors are only supported in class object mode'+
'l'#000+
'03113_E_No default property available'#000+
'03114_E_The class cannot have a published section, use the {$M+} switc'+
'h'#000+
'03115_E_Forward declaration of class "$1" must be resolved here to use'+
- ' the class as a','ncestor'#000+
+ ' t','he 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 section'+
#000+
- '03119_E_Procedure directive "$1" not allowed in procvar d','eclaration'#000+
+ '03119_E_Procedure directive "$1" not allowed',' in procvar declaration'#000+
'03120_E_Function is already declared Public/Forward "$1"'#000+
- '03121_E_Can not use both EXPORT and EXTERNAL'#000+
+ '03121_E_Cannot use both EXPORT and EXTERNAL'#000+
'03123_H_"$1" not yet supported inside inline procedure/function'#000+
'03124_H_Inlining disabled'#000+
- '03125_I_Writing Browser log $1'#000+
- '03126_','H_may be pointer dereference is missing'#000+
+ '03125_I_Writing Browser l','og $1'#000+
+ '03126_H_may be pointer dereference is missing'#000+
'03127_F_Selected assembler reader not supported'#000+
'03128_E_Procedure directive "$1" has conflicts with other directives'#000+
'03129_E_Calling convention doesn'#039't match forward'#000+
- '03131_E_Property cannot have a def','ault value'#000+
+ '03131_E_Property canno','t 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+
+ '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+
'03142_E_string length is larger than array of char length'#000+
- '03143_E_Illegal expression after message directive'#000+
- '03','144_E_Message handlers can take only one call by ref. parameter'#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 explicit parameter in methods which are me'+
'ssage 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 '+
- '\{\$mode delphi\} instead'#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 delphi} instead'#000+
'03150_E_OVERRIDE cannot be used in objects'#000+
- '03151_E_Data types which require initializatio','n/finalization cannot '+
+ '03151_E_Data types which require initial','ization/finalization cannot '+
'be used in variant records'#000+
'03152_E_Resourcestrings can be only static or global'#000+
'03153_E_Exit with argument cannot be 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+
+ '03155_E_This symbol isn'#039't allo','wed 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 value for a property index must be of an ordinal type'#000+
- '03159_E_Procedure name too short to be exported'#000+
- '0316','0_E_No DEFFILE entry can be generated for unit global vars'#000+
+ '03159_E_Procedure name too short to be exporte','d'#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 (-Sd) mode to compile this mod'+
'ule'#000+
- '03163_E_Can not export with index under $1'#000+
- '03164_E_Exporting of variable','s is not supported under $1'#000+
+ '03163_E_Cannot export with index under $1'#000+
+ '03164_E_Exporting of var','iables 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_C','on- and destructors are not allowed in interfaces'#000+
+ '0317','1_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 interface, helper or Objective-C protocol or category canno'+
't contain fields'#000+
- '03174_E_Can not declare local ','procedure as EXTERNAL'#000+
+ '03174_E_Cannot declare lo','cal procedure as EXTERNAL'#000+
'03175_W_Some fields coming before "$1" were not initialized'#000+
'03176_E_Some fields coming before "$1" were not initialized'#000+
'03177_W_Some fields coming after "$1" were not initialized'#000+
- '03178_E_VarArgs directive (or '#039'...'#039' in ','MacPas) without CDecl'+
- '/CPPDecl/MWPascal and External'#000+
+ '03178_E_VarArgs directive (or '#039'...'#039,' in MacPas) without CDecl/'+
+ 'CPPDecl/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 call','ing convention "$1" with "$2"'#000+
+ '03182_W_Ove','rriding calling convention "$1" with "$2"'#000+
'03183_E_Typed constants of the type "procedure of object" can only be '+
'initialized with NIL'#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+
+ '031','86_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+
'03189_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+
+ '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+
+ '03196_E_REINTR','ODUCE cannot be used in objects'#000+
'03197_E_Each argument must have its own location'#000+
'03198_E_Each argument must have an explicit location'#000+
'03199_E_Unknown argument location'#000+
'03200_E_32 Bit-Integer or pointer variable expected'#000+
- '03201_E_Goto statements are not ','allowed between different procedures'+
+ '03201_E_Goto stateme','nts are not allowed between different procedures'+
#000+
'03202_F_Procedure too complex, it requires too many registers'#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_Ex','it'#039's parameter must be the name of the procedure it is'+
- ' used in or of a surrounding procedure'#000+
+ '03206_E_High range limit < low range limi','t'#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+
'03208_E_Illegal assignment to for-loop variable "$1"'#000+
- '03209_E_Can not declare local variable as EXTERNAL'#000+
- '03210_E_Procedure is already declared EXTER','NAL'#000+
+ '03209_E_Cannot declare local variable as EXTERNAL'#000+
+ '03210_E_Procedure is already dec','lared EXTERNAL'#000+
'03211_W_Implicit uses of Variants unit'#000+
'03212_E_Class and static methods cannot be used in INTERFACES'#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+
- '0','3216_E_A DISPINTERFACE cannot have a parent class'#000+
+ '03215_E_SLICE cannot be used outside of param','eter list'#000+
+ '03216_E_A DISPINTERFACE cannot have a parent class'#000+
'03217_E_A DISPINTERFACE needs a guid'#000+
'03218_W_Overridden methods must have a related return type. This code '+
'may crash, it depends on a Delphi parser bug ("$2" is overridden by "$'+
- '1" which has ','another return type)'#000+
+ '1"',' which has another return type)'#000+
'03219_E_Dispatch IDs must be ordinal constants'#000+
'03220_E_The range of the array 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 a'+
- 's loop variables'#000+
+ '03222_E_Dynamic arrays cannot be p','acked'#000+
+ '03223_E_Bit packed array elements and record fields cannot be used as '+
+ 'loop variables'#000+
'03224_E_VAR, TYPE and CONST are allowed only in records, objects and c'+
'lasses'#000+
'03225_E_This type cannot be a generic'#000+
- '03226_W_Don'#039't load LINEINFO unit manually, Us','e the -gl compiler '+
+ '03226_W_Don'#039't load LINEINFO unit m','anually, Use the -gl compiler '+
'switch instead'#000+
'03227_E_No function result type specified for function "$1"'#000+
'03228_E_Specialization is only supported for generic types'#000+
'03229_E_Generics cannot be used as parameters when specializing generi'+
'cs'#000+
- '03230_E_Consta','nts of objects containing a VMT are not allowed'#000+
+ '032','30_E_Constants of objects containing a VMT are not allowed'#000+
'03231_E_Taking the address of labels defined outside the current scope'+
' isn'#039't allowed'#000+
'03233_E_Cannot initialize variables declared as external'#000+
'03234_E_Illegal function result type'#000+
- '03235_E_No co','mmon type possible between "$1" and "$2"'#000+
+ '03','235_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 t','ype'#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 mu','st not have stored-specifier'#000+
+ '03242_E_Implements-','property must not have stored-specifier'#000+
'03243_E_Implements-property used on unimplemented interface: "$1"'#000+
'03244_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+
+ '03246_E_Type used by impleme','nts 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 (var'+
'iable name: $1, declared export name: $2)'#000+
- '03248_E_Weak external symbols are not suppor','ted for the current targ'+
+ '03248_E_Weak external symbols are',' not supported for the current targ'+
'et'#000+
'03249_E_Forward type definition does not match'#000+
'03250_N_Virtual method "$1" has a lower visibility ($2) than parent cl'+
'ass $3 ($4)'#000+
'03251_E_Fields cannot appear after a method or property definition, st'+
- 'art a new visi','bility section first'#000+
+ 'art',' a new visibility section first'#000+
'03252_E_Parameters or result types cannot contain local type definitio'+
'ns. Use 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,
+ '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+
'03257_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+
+ '03259_E_Invalid enumerator identifier:',' "$1"'#000+
+ '03260_E_Enumerator identifier required'#000+
'03261_E_Enumerator MoveNext pattern method is not valid. Method must b'+
'e a function with the Boolean return type and no required arguments.'#000+
- '03262_E_Enumerator Current pattern property is not valid. Property ','m'+
+ '03262_E_Enumerator Current pattern property is not valid','. Property m'+
'ust have a getter.'#000+
'03263_E_Only one enumerator MoveNext method is allowed per class/objec'+
't'#000+
'03264_E_Only one enumerator Current property is allowed per class/obje'+
'ct'#000+
'03265_E_For in loop cannot be used for the type "$1"'#000+
- '03266_E_Objective-C me','ssages require their Objective-C selector name'+
+ '03266_E_Obj','ective-C messages require their Objective-C selector name'+
' to be specified using the "message" directive.'#000+
'03267_E_Objective-C does not have formal constructors nor destructors.'+
' Use the alloc, initXXX and dealloc messages.'#000+
- '03268_E_Message name is too lo','ng (max. 255 characters)'#000+
+ '03268_E_Message nam','e is too long (max. 255 characters)'#000+
'03269_E_Objective-C message symbol name for "$1" is too long'#000+
'03270_H_Defining a new Objective-C root class. To derive from another '+
'root class (e.g., NSObject), specify it as the parent class.'#000+
- '03271_E_Objective-C cla','sses cannot have published sections.'#000+
+ '03271_E_Obje','ctive-C classes cannot have published sections.'#000+
'03272_F_This module requires an Objective-C mode switch to be compiled'+
#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_In','herited methods can only be overridden in Objective-C and '+
- 'Java, add "override" (inherited method defined in $1).'#000+
+ '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 possib','le to make unique copies of Objective-C '+
+ '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 cannot '+
'be used as types'#000+
'03278_E_Categories do not override, but replace methods. Use "reintrod'+
'uce" instead.'#000+
- '03279_E_Replace','d methods can only be reintroduced in Objective-C, ad'+
+ '0327','9_E_Replaced methods can only be reintroduced in Objective-C, ad'+
'd "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 im','plements interface must use the target'#039's de'+
+ '03281_E_Ge','tter for implements interface must use the target'#039's de'+
'fault 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 a','nother $1 array elements'#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 unkn'+
'own at compile time: "$1"'#000+
- '03288_E_Only one class constructor can be declared in c','lass: "$1"'#000+
+ '03288_E_Only one class constructor can be de','clared in class: "$1"'#000+
'03289_E_Only one class destructor can be declared in class: "$1"'#000+
'03290_E_Class constructors cannot have parameters'#000+
'03291_E_Class destructors cannot have parameters'#000+
- '03292_F_This construct requires the \{\$modeswitch objectivec1\} ','mod'+
+ '03292_F_This construct requires the \{\$modeswitch obj','ectivec1\} mod'+
'e switch to be active'#000+
'03293_E_Unicodechar/string constants cannot be converted to ansi/short'+
'string 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 t','he NSFastEnumerationProtocol or NS'+
+ '03295_E_The compiler ca','nnot find the NSFastEnumerationProtocol or NS'+
'FastEnumerationState type in the CocoaAll unit'#000+
'03296_E_Typed constants of the type '#039'procedure is nested'#039' can '+
'only be initialized with NIL and global procedures/functions'#000+
- '03297_F_Declaration of generic class',' inside another generic class is'+
+ '03297_F_Declaration of ge','neric class inside another generic class is'+
' not allowed'#000+
'03298_E_Forward declaration "$1" must be resolved before a class can c'+
'onform 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+
+ '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 allowed in records or recor'+
'd/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 - ca'+
+ '03304_E_Type',' parameters may require initialization/finalization - ca'+
'nnot be used in variant records'#000+
'03305_E_Variables being declared as external cannot be in a custom sec'+
'tion'#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+
+ '0','3307_E_"$1" is not allowed in helper types'#000+
'03308_E_Class constructors are not allowed in helpers'#000+
'03309_E_The use of "inherited" is not allowed in a record'#000+
'03310_E_Type declarations are not allowed in local or anonymous record'+
's'#000+
- '03311_E_Duplicate implem','ents clause for interface "$1"'#000+
+ '03311_E_Dupli','cate implements clause for interface "$1"'#000+
'03312_E_Interface "$1" cannot be delegated by "$2", it already has met'+
'hod resolutions'#000+
'03313_E_Interface "$1" cannot have method resolutions, "$2" already de'+
'legates it'#000+
'03314_E_Invalid codepage'#000+
- '03315_E_Only fiel','ds (var-sections) and constants can be final in obj'+
+ '03315_','E_Only fields (var-sections) and constants can be final in obj'+
'ect types'#000+
'03316_E_Final fields are currently only supported for external classes'+
#000+
'03317_E_Typed constants are not allowed here, only formal constants ar'+
'e'#000+
- '03318_E_Constructors are not automat','ically inherited in the JVM; exp'+
+ '03318_E_Constructors are ','not automatically inherited in the JVM; exp'+
'licitly 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 virtu','al constructor for the current instance insid'+
+ '03321_E_Call','ing a virtual constructor for the current instance insid'+
'e another constructor is not possible on the JVM target'#000+
'03322_E_Overriding method "$1" cannot have a lower visibility ($2) tha'+
'n in parent class $3 ($4)'#000+
- '03323_E_Procedure/Function declared with ca','ll option NOSTACKFRAME bu'+
+ '03323_E_Procedure/Function decla','red with call option NOSTACKFRAME bu'+
't without ASSEMBLER'#000+
'03324_E_Procedure/Function declared with call option NOSTACKFRAME but '+
'local stack size is $1'#000+
'03325_E_Cannot generate property getter/setter $1 because its name cla'+
- 'shes with existing identifier $2',#000+
+ 'shes with existing id','entifier $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+
+ 'utomatically constructed name $2, not changing de','clared name'#000+
'03328_E_Constants declarations are not allowed in local or anonymous r'+
'ecords'#000+
'03329_E_Method declarations are not allowed in local or anonymous reco'+
'rds'#000+
'03330_E_Property declarations are not allowed in local or anonymous re'+
'cords'#000+
- '03331_E_Clas','s memeber declarations are not allowed in local or anony'+
+ '0','3331_E_Class memeber declarations are not allowed in local or anony'+
'mous records'#000+
'03332_E_Visibility section "$1" not allowed 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 t'+
+ '03335_E_Prop','erties can be only static, global or inside structured t'+
'ypes'#000+
'03336_E_Overloaded routines have the same mangled name'#000+
'03337_E_Default values can only be specified for value, const and cons'+
'tref parameters'#000+
'03338_W_Pointer type "$1" ignored'#000+
- '04000_E_Type mi','smatch'#000+
+ '0333','9_E_Global Generic template references static symtable'#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 expected'#000+
+ '04004_E_Variable identifier expecte','d'#000+
'04005_E_Integer expression expected, but got "$1"'#000+
- '04006_E_Boolean ex','pression 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+
+ '04011_E_Can'#039't ev','aluate constant expression'#000+
'04012_E_Set elements are not compatible'#000+
- '040','13_E_Operation not implemented for sets'#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+
+ '04015_H_use DIV instead to get an integer re','sult'#000+
'04016_E_String types have to match exactly in $V+ mode'#000+
- '04017_E_su','cc or pred on enums with assignments not possible'#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 elemen','ts'#000+
+ '04020_E_Can'#039't use r','ead 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_Incompatible type for arg no. $1: Got "$2", expected "$3"'#000+
- '04026_E_Method (vari','able) and Procedure (variable) are not compatibl'+
- 'e'#000+
+ '04025_E_Incompat','ible 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/f','unction to procedure varia'+
- 'ble'#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 64bit result'+
- #000+
+ '04034_E_interface type e','xpected, but got "$1"'#000+
+ '04035_H_Mixing signed expressions and longwords gives a 64bit 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+
- '04038_E_enums with assignments cannot be used as array index'#000+
- '04039_E_Class ','or Object types "$1" and "$2" are not related'#000+
+ '04038','_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 th','an short string length'#000+
+ '04042_E_Type "$1" i','s 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 constant and e'+
- 'xpression'#000+
- '04046_W_Constructing a class "$1" with abstract method "','$2"'#000+
+ '04045_W_Comparison might be always true due to range of constant a','nd'+
+ ' 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 error'#000+
- '04050_E_The address of an abstr','act method cannot be taken'#000+
+ '04049_H_Type size mismatch, pos','sible 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 supported for types "$2" and "$3"'#000+
- '04054_E_Illegal type conversion: "$1" to ','"$2"'#000+
+ '04053_E_Operation "$1" not suppo','rted 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 overloaded function to call'#000+
+ '04057_E_Can'#039't determine which overl','oaded function to call'#000+
'04058_E_Illegal counter variable'#000+
- '04059_W_Conver','ting constant real value to double for C variable argu'+
- 'ment, add explicit typecast to prevent this.'#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_Constant packed arrays are not yet supported'#000+
- '04062_E_Incompatible type for',' arg no. $1: Got "$2" expected "(Bit)Pa'+
- 'cked Array"'#000+
+ '04061_E_Cons','tant 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 cannot be of a type which need to be'+
- ' initialised'#000+
- '04065_E_Constant packed r','ecords and objects are not yet supported'#000+
+ '04064_E_Elements of packed arrays cann','ot 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 u','nit'#000+
+ '04076_E_Can'#039't take address of a subroutine ma','rked 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 to "$1" before doing the subtract coul'+
- 'd prevent overflow errors.'#000+
- '04081_H_C','onverting the operands to "$1" before doing the multiply co'+
+ '04080_H_Converting the operands to "','$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 results and range errors, use an unsigned type instead.'#000+
- '04083_E_Interface ','type $1 has no valid GUID'#000+
+ 'parison resu','lts 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 name'#000+
- '04087_E_No type info available for this type'#000+
- '04088_E_Ordinal or string ','expression expected'#000+
+ '0','4087_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 not supported for interaction with the Object'+
- 'ive-C and the blocks runtime.'#000,
+ '04092_E_The type "$1" is not s','upported 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 memory corruption: $1 to $2'#000+
- '04096_E_Type parameters of specializations of g','enerics cannot refere'+
- 'nce the currently specialized type'#000+
+ 'rash or memor','y 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_Generic declaration of "$1" differs from previous declaration'#000+
- '04099_E_Helper ty','pe expected'#000+
+ '04098_E_Generic d','eclaration 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 extend "$1"'#000+
+ '04102_E_Derived record or type helper must extend',' "$1"'#000+
'04103_E_Invalid assignment, procedures return no value'#000+
- '04104_W_I','mplicit string type conversion from "$1" to "$2"'#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 from "$1" to "$2"'#000+
- '04107_-W_Explicit string typecast with potential data lo','ss from "$1"'+
- ' to "$2"'#000+
+ '04106_-W_Explicit string typecast from',' "$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 betwe'+
- 'en $2 and ','$3)'#000+
+ '04110_W_ra','nge 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 typeca','st untyped parameters on managed'+
- ' platforms, simply assign a value to them instead.'#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 visibilit','y of "$2" to '+
- 'public when accessed via an interface instance'#000+
+ ' supertype on man','aged 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 used on object types with VMT'#000+
- '04119_E_It is not possible to define a default',' value for a parameter'+
- ' of type "$1"'#000+
+ '04118_E_TYPEOF can only be used o','n 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'+
- ' address: "$1"'#000+
+ ' address: ','"$1"'#000+
'04122_W_Creating an instance of abstract class "$1"'#000+
- '04123_E_Subro','utine references cannot be declared as "of object" or "'+
- 'is nested", they can always refer to any kind of subroutine'#000+
- '04999_E_Function references are not yet supported, only blocks (add "c'+
- 'decl;" at the end)'#000+
+ '04123_E_Subroutine references cannot be declared as "of object" or "is'+
+ ' nested", they can always refer to any kind of subroutine'#000+
+ '04999_E_Function references are not yet supported, only',' blocks (add '+
+ '"cdecl;" at the end)'#000+
'05000_E_Identifier not found "$1"'#000+
- '05','001_F_Internal Error in SymTableStack()'#000+
+ '05001_F_Internal Error in SymTableStack()'#000+
'05002_E_Duplicate identifier "$1"'#000+
'05003_H_Identifier already defined in $1 at line $2'#000+
'05004_E_Unknown identifier "$1"'#000+
- '05005_E_Forward declaration not solved "$1"'#000+
+ '05005_E_Forw','ard declaration not solved "$1"'#000+
'05007_E_Error in type definition'#000+
- '05009','_E_Forward type not resolved "$1"'#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+
+ '05013_E_I','nstances of classes or objects with an abstract method are '+
+ 'not allowed'#000+
'05014_W_Label not defined "$1"'#000+
'05015_E_Label used but not defined "$1"'#000+
'05016_E_Illegal label declaration'#000+
'05017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+
- '05018_E_Label not found'#000+
+ '05018_','E_Label not found'#000+
'05019_E_identifier isn'#039't a label'#000+
- '05020_E_label alrea','dy defined'#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+
+ '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+
+ '05026_H_Value parameter "$1" is assigned but never used'#000+
'05027_N_Local variable "$1" is assigned but never used'#000+
'05028_H_Local $1 "$2" is not used'#000+
'05029_N_Private field "$1.$2" is never used'#000+
- '05030_N_Private field "$1.$2" is assigned but never used'#000+
- '05031_N_Private metho','d "$1.$2" 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+
+ '05035_E_','Unknown record field identifier "$1"'#000+
+ '05036_W_Local variable "$1" does not seem to be initialized'#000+
'05037_W_Variable "$1" does not seem to be initialized'#000+
'05038_E_identifier idents no member "$1"'#000+
'05039_H_Found declaration: $1'#000+
- '05040_E_Data element too large'#000+
- '05042_E_No matching implementation for interface method "','$1" found'#000+
+ '05040_E_Data eleme','nt too large'#000+
+ '05042_E_No matching implementation for interface method "$1" found'#000+
'05043_W_Symbol "$1" is deprecated'#000+
'05044_W_Symbol "$1" is not portable'#000+
'05055_W_Symbol "$1" is not implemented'#000+
'05056_E_Can'#039't create unique type from this type'#000+
- '05057_H_Local variable "$1" does not seem to be initialized'#000+
- '05058_H_Varia','ble "$1" does not seem to be initialized'#000+
+ '050','57_H_Local variable "$1" does not seem to be initialized'#000+
+ '05058_H_Variable "$1" does not seem to be initialized'#000+
'05059_W_Function result variable does not seem to initialized'#000+
'05060_H_Function result variable does not seem to be initialized'#000+
- '05061_W_Variable "$1" read but nowhere assigned'#000+
- '05062_H_Found abstract m','ethod: $1'#000+
+ '05','061_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 belongs to a library'#000+
- '05066_W_Symbol "$1" is deprecated: "$2"'#000+
- '05067_E_Cannot find an enumerator for the type',' "$1"'#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_Mismatch between number of declared parameters and number of c'+
- 'olons in message string.'#000+
- '05071_N_Private type',' "$1.$2" never used'#000+
+ '05070_E_Mismatch between number of declared p','arameters 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 deprecated'#000+
- '05075_W_Unit "$1" is deprecated: "$2"'#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+
+ '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 complete definition of the formally declared class "$1" is '+
'in scope'#000+
- '05081_E_Gotos into initialization or finalization blocks of units are '+
- 'not allow','ed'#000+
+ '05081_E_G','otos into initialization or finalization blocks of units ar'+
+ 'e not allowed'#000+
'05082_E_Invalid external name "$1" for formal class "$2"'#000+
'05083_E_Complete 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 implic','it constructor '#039'Create'#039' because ide'+
- 'ntifier already used by "$1"'#000+
+ '05084_W_Possible library conflict: symbol "$1" ','from library "$2" als'+
+ 'o found in library "$3"'#000+
+ '05085_E_Cannot add implicit constructor '#039'Create'#039' because ident'+
+ 'ifier already used by "$1"'#000+
'05086_E_Cannot generate default constructor for class, because parent '+
'has no parameterless constructor'#000+
- '05087_D_Adding helper for $1'#000+
+ '050','87_D_Adding helper for $1'#000+
'05088_E_Found declaration: $1'#000+
- '06009_E_Parame','ter list size exceeds 65535 bytes'#000+
+ '05089_W_Local variable "$1" of a managed type does not seem to be init'+
+ 'ialized'#000+
+ '05090_W_Variable "$1" of a managed type does not seem to be initialize'+
+ 'd'#000+
+ '05091_H_Local variable "$1" of a m','anaged type does not seem to be in'+
+ 'itialized'#000+
+ '05092_H_Variable "$1" of a managed type does not seem to be initialize'+
+ 'd'#000+
+ '05093_W_function result variable of a managed type does not seem to in'+
+ 'itialized'#000+
+ '05094_H_Function result variable of a manage','d type does not seem to '+
+ 'be initialized'#000+
+ '05095_W_Duplicate identifier "$1"'#000+
+ '06009_E_Parameter list size exceeds 65535 bytes'#000+
'06012_E_File types must be var parameters'#000+
'06013_E_The use of a far pointer isn'#039't allowed there'#000+
- '06015_E_EXPORT declared functions cannot be called'#000+
+ '06015_E_EXPORT declared ','functions cannot be called'#000+
'06016_W_Possible illegal call of constructor or destructor'#000+
- '0','6017_N_Inefficient code'#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+
+ '06029_DL_Stack fram','e is omitted'#000+
'06031_E_Object or class methods cannot be inline.'#000+
- '06032_E_Procvar calls ca','nnot be inline.'#000+
+ '06032_E_Procvar calls cannot be inline.'#000+
'06033_E_No code for inline procedure stored'#000+
'06035_E_Element zero of an ansi/wide- or longstring cannot be accessed'+
- ', use (set)length instead'#000+
+ ', use (set)length inste','ad'#000+
'06037_E_Constructors or destructors cannot be called inside a '#039'wit'+
'h'#039' clause'#000+
- '06038_E_','Cannot call message handler methods directly'#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+
+ '06040_E_Control flow statements are not allowed in a finall','y block'#000+
'06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+
- '06042_W_Local variable ','size exceed limit for certain cpu'#039's'#000+
+ '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 correct run ti'+
- 'me library.'#000+
- '06047_F_Cannot',' find system type "$1". Check if you use the correct r'+
- 'un time library.'#000+
+ '06046_F_U','nknown compilerproc "$1". Check if you use the correct 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" in unit "$2". Check if you use the ','cor'+
- 'rect run time library.'#000+
+ '06049_E_Goto label "$1" not defi','ned or optimized away'#000+
+ '06050_F_Cannot find type "$1" in unit "$2". Check if you use the corre'+
+ 'ct 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+
+ '06052_E_Label must be defined in the same scope as it is de','clared'#000+
'06053_E_Leaving procedures containing explicit or implicit exceptions '+
- 'frames usi','ng goto is not allowed'#000+
+ '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+
- '07000_DL_Starting $1 styled assemb','ler parsing'#000+
+ '06056_E_The function used, ','is not supported by the selected instruct'+
+ 'ion set: $1'#000+
+ '07000_DL_Starting $1 styled assembler parsing'#000+
'07001_DL_Finished $1 styled assembler parsing'#000+
'07002_E_Non-label pattern contains @'#000+
'07004_E_Error building record offset'#000+
- '07005_E_OFFSET used without identifier'#000+
+ '07005_E_OFFSET used w','ithout identifier'#000+
'07006_E_TYPE used without identifier'#000+
- '07007_E_Cannot use local variabl','e or parameters here'#000+
+ '07007_E_Cannot use local variable or parameters here'#000+
'07008_E_need to use OFFSET here'#000+
'07009_E_need to use $ here'#000+
'07010_E_Cannot use multiple relocatable symbols'#000+
- '07011_E_Relocatable symbol can only be added'#000+
+ '07011_E_Relocatable symbo','l can only be added'#000+
'07012_E_Invalid constant expression'#000+
- '07013_E_Relocatable symbol is n','ot allowed'#000+
+ '07013_E_Relocatable 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 object field handling'#000,
+ '07017_E','_Invalid base and index register usage'#000+
+ '07018_W_Possible error in object field handling'#000+
'07019_E_Wrong scale factor specified'#000+
'07020_E_Multiple index register usage'#000+
'07021_E_Invalid operand type'#000+
'07022_E_Invalid string as opcode operand: $1'#000+
- '07023_W_@CODE and @DATA not supported'#000+
+ '0702','3_W_@CODE and @DATA not supported'#000+
'07024_E_Null label references are not allowed'#000+
- '07025_E','_Divide by zero in asm evaluator'#000+
+ '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+
+ '07029_W_Fwait can cause ','emulation problems with emu387'#000+
'07030_W_$1 without operand translated into $1P'#000+
- '07031_W_E','NTER instruction is not supported by Linux kernel'#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+
+ '07034_E_C','onstant value out of bounds'#000+
'07035_E_Error converting decimal $1'#000+
- '07036_E_Error convertin','g octal $1'#000+
+ '07036_E_Error converting octal $1'#000+
'07037_E_Error converting binary $1'#000+
'07038_E_Error converting hexadecimal $1'#000+
'07039_H_$1 translated to $2'#000+
- '07040_W_$1 is associated to an overloaded function'#000+
+ '07040_W_$1 is associated to an overload','ed function'#000+
'07041_E_Cannot use SELF outside a method'#000+
- '07042_E_Cannot use OLDEBP outside ','a nested procedure'#000+
+ '07042_E_Cannot 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+
+ '07045_E_Size suffix and destination or source size do',' not match'#000+
'07046_W_Size suffix and destination or source size do not match'#000+
- '07047_E_Asse','mbler syntax error'#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+
+ '07050_E_Assembler syntax error in constan','t'#000+
'07051_E_Invalid String expression'#000+
- '07052_W_constant with symbol $1 for address which i','s not on a pointe'+
- 'r'#000+
+ '07052_W_constant with symbol $1 for address which is not on a pointer'#000+
'07053_E_Unrecognized opcode $1'#000+
'07054_E_Invalid or missing opcode'#000+
'07055_E_Invalid combination of prefix and opcode: $1'#000+
- '07056_E_Invalid combination of override and opcode: $1'#000+
+ '07056_E_Invalid ','combination of override and opcode: $1'#000+
'07057_E_Too many operands on line'#000+
- '07058_W_NEAR i','gnored'#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+
+ '07063_E_Invalid regist','er name'#000+
'07064_E_Invalid floating point register name'#000+
'07066_W_Modulo not supported'#000+
- '07067','_E_Invalid floating point constant $1'#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+
+ '07070_E_Cannot index a local var or parameter w','ith a register'#000+
'07071_E_Invalid segment override expression'#000+
- '07072_W_Identifier $1 suppos','ed external'#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+
+ '07076_E_No','t 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+
+ '07078_E_Dollar token is used without an identifier'#000+
'07079_W_32bit constant created for address'#000+
'07080_N_.align is target specific, use .balign or .p2align'#000+
- '07081_E_Can'#039't access fields directly for parameters'#000+
- '07082_E_Can'#039't access fields of objects/clas','ses directly'#000+
+ '07081_E_','Can'#039't access fields directly for parameters'#000+
+ '07082_E_Can'#039't access fields of objects/classes directly'#000+
'07083_E_No size specified and unable to determine the size of the oper'+
'ands'#000+
'07084_E_Cannot use RESULT in this function'#000+
- '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+
- '07087_W_"$1 %st(n)" translated into "$1 %st,%st(','n)"'#000+
+ '07086_W_"$1" without o','perand 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+
+ '07094','_E_Inc and Dec cannot be together'#000+
'07095_E_Invalid reglist for movem'#000+
- '07096_E_Reglist inv','alid for opcode'#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+
+ 'ands, using DWORD as default'#000,
'07099_E_Syntax error while trying to parse a shifter operand'#000+
- '07100_E_Address of packed ','component is not at a byte boundary'#000+
+ '07100_E_Address of packed component is not at a byte boundary'#000+
'07101_W_No size specified and unable to determine the size of the oper'+
'ands, using BYTE as default'#000+
- '07102_W_Use of +offset(%ebp) for parameters invalid here'#000+
- '07103_W_Use of +offset(%ebp) is not compatible wi','th regcall conventi'+
- 'on'#000+
+ '07102_W_Use of +off','set(%ebp) for parameters invalid here'#000+
+ '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+
+ #000+
'07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+
'ess'#000+
- '07105_W_Use of -offset(%esp), access may cause a crash or value may be'+
- ' lost'#000+
- '07106_E_VMTOffset must be used in combination with a virtual method,',' '+
- 'and "$1" is not virtual'#000+
+ '07105_W_Use of -offset(%esp), access may cause a crash or',' value may '+
+ 'be lost'#000+
+ '07106_E_VMTOffset must be used in combination with a virtual method, a'+
+ 'nd "$1" is not virtual'#000+
'07107_E_Generating PIC, but reference is not PIC-safe'#000+
'07108_E_All registers in a register set must be of the same kind and w'+
- 'idth'#000+
+ 'idth',#000+
'07109_E_A register set cannot be empty'#000+
- '07110_W_@GOTPCREL is useless and potentially da','ngereous for local sy'+
- 'mbols'#000+
+ '07110_W_@GOTPCREL is useless and potentially dangereous for local symb'+
+ 'ols'#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_Directive "$1','" is not supported for the current target'#000+
+ '071','14_E_SEH directives are allowed only in pure assembler procedures'+
+ #000+
+ '07115_E_Directive "$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+
+ ' in a single operand when "nostackframe" is u','sed'#000+
'07117_E_GOTPCREL references in Intel assembler syntax cannot contain a'+
- ' base or inde','x register, and their offset must 0.'#000+
+ ' 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 accessed via the GOT'#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 memory operand',' "$1: memory-operand-size is $2 '+
- 'bits, but expected [$3 bits]"'#000+
+ '07121_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+
+ 'ts, 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 negative "$2 byt','e"'#000+
+ 'ts, but expected [','$3 bits + $4 byte offset]"'#000+
+ '07123_W_Check "$1: offset of memory operand is negative "$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+
- '08000_F_Too many assembler fil','es'#000+
+ '07125_E','_Invalid register used in memory reference expression: "$1"'#000+
+ '08000_F_Too many assembler files'#000+
'08001_F_Selected assembler output not supported'#000+
'08002_F_Comp not supported'#000+
'08003_F_Direct not support for binary writers'#000+
- '08004_E_Allocating of data is only allowed in bss section'#000+
+ '08004_E_Allocating of data',' is only allowed in bss section'#000+
'08005_F_No binary writer selected'#000+
- '08006_E_Asm: Opcode $1 n','ot in table'#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+
+ '08009_E_Asm: Invalid effective add','ress'#000+
'08010_E_Asm: Immediate or reference expected'#000+
- '08011_E_Asm: $1 value exceeds bounds $2'#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+
'08014_E_Asm: Comp type not supported for this target'#000+
- '08015_E_Asm: Extended 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+
+ '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+
+ '08021_E_Asm: 64 Bit opera','nds not supported'#000+
'08022_E_Asm: AH,BH,CH or DH cannot be used in an instruction requiring'+
- ' R','EX prefix'#000+
+ ' 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+
+ '08025_E_.seh_handlerdata directive without preceding ','.seh_handler'#000+
'08026_F_Relocation count for section $1 exceeds 65535'#000+
- '09000_W_Source operatin','g system redefined'#000+
- '09001_I_Assembling (pipe) $1'#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+
+ '09000_W_Source operating system redefined'#000+
+ '0','9001_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_Assembler $1 not found, switching to external assemb','ling'#000+
- '09006_T_Using assembler: $1'#000+
+ '09005_E_Assembler $1 not found, switching to external assembling'#000+
+ '09006_T_Using a','ssembler: $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 with smartlinking $1'#000+
- '09011_W_Object $1 not foun','d, Linking may fail !'#000+
+ '09011_W_Object $1 not found, Linking may fail ','!'#000+
'09012_W_Library $1 not found, Linking may fail !'#000+
'09013_E_Error while linking'#000+
'09014_E_Can'#039't call the linker, switching to external linking'#000+
'09015_I_Linking $1'#000+
'09016_E_Util $1 not found, switching to external linking'#000+
- '0901','7_T_Using util $1'#000+
- '09018_E_Creation of Executables not supported'#000+
+ '09017_T_Using util $1'#000+
+ '09','018_E_Creation of Executables not supported'#000+
'09019_E_Creation of Dynamic/Shared Libraries not supported'#000+
'09035_E_Creation of Static Libraries not supported'#000+
'09020_I_Closing script $1'#000+
- '09021_E_resource compiler "$1" not found',', switching to external mode'+
+ '09021_E_resource compiler "$1" not found, switching to exter','nal 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 shared linked, ','switching to static linking'+
+ '09025_T_unit $1 cannot be shared 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 resources'#000+
- '09030_E_','Can'#039't call the resource compiler "$1", switching to exte'+
+ '09030_E_Can'#039't call the resou','rce compiler "$1", switching to exte'+
'rnal 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 will probably',' cause a linking failure'#000+
+ '09034_W_"$1" not found, this will probably cause a linking fai','lure'#000+
'09128_F_Can'#039't post process executable $1'#000+
'09129_F_Can'#039't open executable $1'#000+
'09130_X_Size of Code: $1 bytes'#000+
'09131_X_Size of initialized data: $1 bytes'#000+
'09132_X_Size of uninitialized data: $1 bytes'#000+
- '09133_X_Stack space re','served: $1 bytes'#000+
- '09134_X_Stack space committed: $1 bytes'#000+
+ '09133_X_Stack space reserved: $1 bytes'#000+
+ '091','34_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+
'10000_T_Unitsearch: $1'#000+
'10001_T_PPU Loading $1'#000+
- '1000','2_U_PPU Name: $1'#000+
- '10003_U_PPU Flags: $1'#000+
+ '10002_U_PPU Name: $1'#000+
+ '100','03_U_PPU Flags: $1'#000+
'10004_U_PPU Crc: $1'#000+
'10005_U_PPU Time: $1'#000+
'10006_U_PPU File too short'#000+
'10007_U_PPU Invalid Header (no PPU at the begin)'#000+
'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+
+ '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+
@@ -1059,603 +1075,660 @@ const msgtxt : array[0..000301,1..240] of char=(
'10015_F_unexpected end of PPU-File'#000+
'10016_F_Invalid PPU-File entry: $1'#000+
'10017_F_PPU Dbx count problem'#000+
- '10','018_E_Illegal unit name: $1'#000+
+ '10018_E_Illegal unit n','ame: $1'#000+
'10019_F_Too much units'#000+
'10020_F_Circular unit reference between $1 and $2'#000+
'10021_F_Can'#039't compile unit $1, no sources 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+
+ '10024_F_Unit $1 searched ','but $2 found'#000+
'10025_W_Compiling the system unit requires the -Us switch'#000+
'10026_F_There were $1 errors compiling module, stopping'#000+
'10027_U_Load from $1 ($2) unit $3'#000+
'10028_U_Recompiling $1, checksum changed for $2'#000+
- '10029_U_Rec','ompiling $1, source found only'#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+
+ '10033_U_Recompiling unit, obj is older than asm'#000+
+ '10','034_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 modifed include files'#000+
- '10041_U_File $1 is new','er than the one used for creating PPU file $2'#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 m'+
'ode'#000+
'10043_U_Loading interface units from $1'#000+
'10044_U_Loading implementation units from $1'#000+
- '10045_U_Interface CRC changed for u','nit $1'#000+
- '10046_U_Implementation CRC changed for unit $1'#000+
+ '10045_U_Interface CRC changed for unit $1'#000+
+ '10046_U_Imple','mentation 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+
+ '10051_U_Flag for reload: $1'#000+
+ '10052_U_Forced re','loading'#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+
+ '10059_U_Skipping re-resolvin','g unit $1, still loading used units'#000+
'10060_U_Unloading resource unit $1 (not needed)'#000+
'10061_E_Unit $1 was compiled using a different whole program optimizat'+
- 'ion feedback input ($2, $3); recompile it without wpo or use the s','am'+
- 'e wpo feedback input file for this compilation invocation'#000+
+ 'ion feedback input ($2, $3); recompile it without wpo or use the same '+
+ 'wpo feedback inp','ut file for this compilation invocation'#000+
'10062_U_Indirect interface (objects/classes) CRC changed for unit $1'#000+
'10063_U_PPU is compiled for another i8086 memory model'#000+
'11000_O_$1 [options] <inputfile> [options]'#000+
- '11001_W_Only ','one source file supported, changing source file to comp'+
+ '11001_W_Only one source file supp','orted, 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 insid','e $1 config file'#000+
- '11006_E_Illegal parameter: $1'#000+
+ '11005_N_No option inside $1 config file'#000+
+ '110','06_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 supported on DOS platform, reverting to stat'+
+ '11012_W_Shared libs not supported on DO','S platform, reverting to stat'+
'ic'#000+
- '11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encou'+
- 'ntered'#000+
- '11014_F_In options file $1 at line $2 unexpected \var{\#ENDIFs} encoun'+
- 'tered'#000+
- '11015_F_Open conditional at the end',' of the options file'#000+
- '11016_W_Debug information generation is not supported by this executab'+
- 'le'#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+
+ '11016_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 to default source writing assembler'#000+
+ '11020_N_Switching assembler to default s','ource writing assembler'#000+
'11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
'11022_W_"$1" assembler use forced'#000+
'11026_T_Reading options from file $1'#000+
- '11027_T_Reading options from environment $1'#000,
+ '11027_T_Reading options from environment $1'#000+
'11028_D_Handling option "$1"'#000+
- '11029_O_*** press enter ***'#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+
'11036_D_interpreting firstpass option "$1"'#000+
- '11033_D_interpreting file opt','ion "$1"'#000+
- '11034_D_Reading config file "$1"'#000+
+ '11033_D_interpreting file option "$1"'#000+
+ '11034_D_Reading config fi','le "$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 output selected "$1" cannot generate debug info, deb'+
'ugging 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 \var{\#ELSE} directive without \'+
- 'var{\#IF(N)DEF} found'#000+
+ '11042_W_Use of ppc386.cfg is deprecated, p','lease 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 targe'+
't platform'#000+
- '11045_F','_The feature "$1" is not, or not yet, supported on the select'+
+ '11045_F_The feature "$1" is not, or not yet, supported ','on the select'+
'ed target platform'#000+
'11046_N_DWARF debug information cannot be used with smart linking on t'+
'his target, switching to static linking'#000+
- '11047_W_Option "$1" is ignored for the current tar','get platform.'#000+
- '11048_W_Disabling external debug information because it is unsupported'+
- ' for the selected target/debug format combination.'#000+
+ '11047_W_Option "$1" is ignored for the current target platform.'#000+
+ '11048_W_Disabling external debug i','nformation because it is unsupport'+
+ 'ed for the selected target/debug format combination.'#000+
'11049_N_DWARF debug information cannot be used with smart linking with'+
- ' external assembler, disabling stat','ic library creation.'#000+
- '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET environment variabl'+
- 'e: $1'#000+
+ ' external assembler, disabling static library creation.'#000+
+ '11050_E_Invalid value for M','ACOSX_DEPLOYMENT_TARGET environment varia'+
+ 'ble: $1'#000+
'11051_E_Invalid value for IPHONEOS_DEPLOYMENT_TARGET environment varia'+
'ble: $1'#000+
- '11052_E_You must use a FPU type of VFPV2, VFPV3 or VFPV3_D16 when',' us'+
- 'ing 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+
+ '11052_E_You must use a FPU type of VFPV2, VFPV3 or VFPV3_D16 when usin'+
+ 'g the EABIHF ABI target'#000+
+ '11053_W_The selecte','d debug format is not supported on the current ta'+
+ 'rget, not changing the current setting'#000+
'11054_E_argument to "$1" is missing'#000+
'11055_E_malformed parameter: $1'#000+
- '11056_W_Smart linking requires exter','nal 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+
+ '11056_W_Smart linking requires external linker'#000+
+ '11057_E_Creating .COM files is not su','pported in the current memory m'+
+ 'odel. Only the tiny memory model supports making .COM files.'#000+
'12000_F_Cannot open whole program optimization feedback file "$1"'#000+
- '12001_D_Processing whole program o','ptimization information in wpo fee'+
- 'dback 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 section header, but got "$2" at line $1 of wpo feedba'+
'ck file'#000+
- '12004_W_No hand','ler registered for whole program optimization section'+
+ '12004_W_No handler registered for whole program optimization se','ction'+
' "$2" at line $1 of wpo feedback file, ignoring'#000+
'12005_D_Found whole program optimization section "$1" with information'+
' about "$2"'#000+
- '12006_F_The selected whole program optimizations require ','a previousl'+
- 'y generated feedback file (use -Fw to specify)'#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 th'+
- 'e generated info in ','(using -FW)'#000+
- '12009_E_Not generating any whole program optimization information, yet'+
- ' a feedback file was specified (using -FW)'#000+
+ 'e generated info in (using -FW)'#000+
+ '12009_E_Not generating any whole pro','gram optimization information, y'+
+ 'et a feedback file was specified (using -FW)'#000+
'12010_E_Not performing any whole program optimizations, yet an input f'+
'eedback file was specified (using -Fw)'#000+
- '12011_','D_Skipping whole program optimization section "$1", because no'+
+ '12011_D_Skipping whole program optimization section "$','1", because no'+
't needed by the requested optimizations'#000+
'12012_W_Overriding previously read information for "$1" from feedback '+
'input file using information in section "$2"'#000+
- '12013_E_Cannot extract ','symbol liveness information from program when'+
- ' stripping symbols, use -Xs-'#000+
+ '12013_E_Cannot extract symbol liveness information from program when s'+
+ 't','ripping 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 informatio'+
- 'n from lin','ked program'#000+
- '12016_E_Error during reading symbol liveness information produced by "'+
- '$1"'#000+
+ 'n 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 linked program'#000+
- '12018_E_Collection of symbol liveness information can only h','elp when'+
- ' using smart linking, use -CX -XX'#000+
- '12019_E_Cannot create specified whole program optimisation feedback fi'+
- 'le "$1"'#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 '+
+ 'file "$1"'#000+
'11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
'CPU'#010+
- 'Copyright (c) 1993-2014 by Florian Klaempfl an','d others'#000+
- '11024_Free Pascal Compiler version $FPCVERSION'#010+
+ 'Copyright (c) 1993-2015 by Florian Klaempfl and others'#000+
+ '11024_Free Pascal Compiler version $FPC','VERSION'#010+
#010+
- 'Compiler Date : $FPCDATE'#010+
- 'Compiler CPU Target: $FPCCPU'#010+
+ 'Compiler date : $FPCDATE'#010+
+ 'Compiler CPU target: $FPCCPU'#010+
#010+
- 'Supported targets:'#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+
- ' $FPU','INSTRUCTIONSETS'#010+
+ ' $F','PUINSTRUCTIONSETS'#010+
#010+
'Supported inline assembler modes:'#010+
' $ASMMODES'#010+
#010+
+ 'Recognized compiler and RTL features:'#010+
+ ' $FEATURELIST'#010+
+ #010+
'Supported ABI targets:'#010+
' $ABITARGETS'#010+
#010+
'Supported Optimizations:'#010+
' $OPTIMIZATIONS'#010+
#010+
- 'Supported Whole Program Optimizations:'#010+
+ 'Supported Whole Program Optimizations:'#010,
' All'#010+
' $WPOPTIMIZATIONS'#010+
#010+
- 'Supported Microcontroller type','s:'#010+
- ' $CONTROLLERTYPES'#010+
- #010+
+ 'Supported Microcontroller types:$\n $CONTROLLERTYPES$\n'#010+
'This program 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+
- ' http://bugs.freepascal.org'#010+
- #010+
- 'More information may be found on our',' WWW pages (including directions'+
+ ' http','://bugs.freepascal.org'#010+
#010+
+ 'More information may be found on our WWW pages (including directions'#010+
'for mailing lists useful for asking questions or discussing potential'#010+
'new features, etc.):'#010+
' http://www.freepascal.org'#000+
- '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
- 'ble',' it'#010+
+ '11025_F*0*_On','ly options valid for the default or selected platform a'+
+ 're listed.'#010+
+ '**0*_Put + after a boolean 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'#010+
+ '**1a_The compiler does not d','elete the generated assembler file'#010+
'**2al_List sourcecode lines in assembler file'#010+
- '**2an_List node info in assembler file (-dEXTDEBUG co','mpiler)'#010+
+ '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+
'**2ao_Add an extra option to external assembler call (ignored for inte'+
'rnal)'#010+
- '*L2ap_Use pipes instead of creating temporary assembler files'#010+
+ '*L2ap_Use pipes instea','d of creating temporary assembler files'#010+
'**2ar_List register allocation/release info in assembler file'#010+
- '**2at_List temp allocation/relea','se 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_Assemble using G','NU AS'#010+
'3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer'#010+
'8*2Anasm_Assemble using Nasm'#010+
'8*2Anasmobj_Assemble using Nasm'#010+
- '3*2An','asm_Assemble using Nasm'#010+
+ '3*2Anasm_Assemble using Nasm'#010+
'3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
- '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
+ '3*2Anasmelf_ELF32 (Linux) file using Na','sm'#010+
'3*2Anasmwin32_Win32 object file using Nasm'#010+
'3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
- '3*2Anasmdarwin_macho32 object file usin','g Nasm (experimental)'#010+
+ '3*2Anasmdarwin_macho32 object file using Nasm (experimental)'#010+
'3*2Awasm_Obj file using Wasm (Watcom)'#010+
'3*2Anasmobj_Obj file using Nasm'#010+
- '3*2Amasm_Obj file using Masm (Microsoft)'#010+
+ '3*2Amasm_Obj f','ile using Masm (Microsoft)'#010+
'3*2Atasm_Obj file using Tasm (Borland)'#010+
'3*2Aelf_ELF (Linux) using internal writer'#010+
- '3*2Acoff_COFF (Go32v2) usi','ng internal writer'#010+
+ '3*2Acoff_COFF (Go32v2) using internal writer'#010+
'3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
- '3*2Ayasm_Assmeble using Yasm (experimental)'#010+
+ '3*2Ayasm_Assemble using Yasm (experime','ntal)'#010+
'4*2Aas_Assemble using GNU AS'#010+
'4*2Agas_Assemble using GNU GAS'#010+
'4*2Agas-darwin_Assemble darwin Mach-O64 using GNU GAS'#010+
- '4*2Amasm_Win64',' object file using ml64 (Microsoft)'#010+
+ '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+
'4*2Apecoff_PE-COFF (Win64) using internal writer'#010+
- '4*2Aelf_ELF (Linux-64bit) using internal writer'#010+
+ '4*2Aelf_ELF (Linux-64','bit) using internal writer'#010+
'4*2Ayasm_Assemble using Yasm (experimental)'#010+
'4*2Anasm_Assemble using Nasm (experimental)'#010+
- '4*2Anasmwin64_Asse','mble Win64 object file using Nasm (experimental)'#010+
- '4*2Anasmelf_Assemble Linux-64bit object file using Nasm (experimental)'+
- #010+
+ '4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)'#010+
+ '4*2Anasmelf_Assemble Linux-64bit object file using Nasm (','experimenta'+
+ 'l)'#010+
'4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experim'+
'ental)'#010+
'6*2Aas_Unix o-file using GNU AS'#010+
- '6*2Agas_GNU',' Motorola assembler'#010+
+ '6*2Agas_GNU Motorola assembler'#010+
'6*2Amit_MIT Syntax (old GAS)'#010+
'6*2Amot_Standard Motorola assembler'#010+
- 'A*2Aas_Assemble using GNU AS'#010+
+ 'A*2Aas_Assemble using',' GNU AS'#010+
'P*2Aas_Assemble using GNU AS'#010+
'S*2Aas_Assemble using GNU AS'#010+
'**1b_Generate browser info'#010+
'**2bl_Generate local symbol info'#010+
- '**1B_Bui','ld all modules'#010+
+ '**1B_Build all modules'#010+
'**1C<x>_Code generation options:'#010+
'**2C3_Turn on ieee error checking for constants'#010+
- '**2Ca<x>_Select ABI, see fpc -i for possible values'#010+
+ '**2Ca<x>_S','elect 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',' calling convention to <x>'#010+
+ '**2Cc<x>_Set default calling convention to <x>'#010+
'**2CD_Create also dynamic library (not supported)'#010+
- '**2Ce_Compilation with emulated floating point opcodes'#010+
- '**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible va'+
- 'lues'#010+
- '**2CF<x>_Minimal floating point c','onstant precision (default, 32, 64)'+
- #010+
+ '**2Ce_Compilation ','with emulated floating point opcodes'#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>_<n> bytes heap (between 1023 and 67107840)'#010+
+ '**2Ch<n>_<n> bytes heap ','(between 1023 and 67107840)'#010+
'**2Ci_IO-checking'#010+
'A*2CI<x>_Select instruction set on ARM: ARM or THUMB'#010+
'**2Cn_Omit linking stage'#010+
- 'P*2CN_Generate nil-pointer check','s (AIX-only)'#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 instruction set, see fpc -i for possible values'#010+
+ '**2CO_Check for possible ove','rflow of integer operations'#010+
+ '**2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible va'+
+ 'lues'#010+
'**2CP<x>=<y>_ packing settings'#010+
- '**3CPPACKSET=<y>_ <y> set allocat','ion: 0, 1 or DEFAULT or NORMAL, 2, '+
- '4 and 8'#010+
+ '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
+ 'and 8'#010+
+ '**3CPPACKENUM=<y>_ <y> enum pa','cking: 0, 1, 2 and 4 or DEFAULT or NOR'+
+ 'MAL'#010+
+ '**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2,'+
+ ' 4, 8, 16 and 32'#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 op','tions'#010+
+ '**2Ct_Sta','ck 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 generati','on 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+
'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
' (AIX)'#010+
- 'P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
- ' (AIX)'#010+
- 'J*3CTautogetterprefix=X_ ','Automatically create getters for propertie'+
- 's with prefix X (empty string disables)'#010+
- 'J*3CTautosetterprefix=X_ Automatically create setters for properties '+
+ 'P*3CTsmalltoc_ Ge','nerate 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+
- '8*3CTcld_ Emit a CLD instruction b','efore using the x8'+
- '6 string instructions'#010+
- '3*3CTcld_ Emit a CLD instruction before using the x86 '+
+ 'J*3CTautosetterprefix=X_ Automatically create setters for properties '+
+ 'wi','th prefix X (empty string disables)'#010+
+ '8*3CTcld_ Emit a CLD instruction before using the x86 '+
'string instructions'#010+
- '4*3CTcld_ Emit a CLD instruction before using the x86 '+
+ '3*3CTcld_ Emit a CLD instruction before using the x86 '+
'string instructions'#010+
- 'J*3CTcompactintarray','init_ Generate smaller (but potentially slower) '+
- 'code for initializing 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 '+
- 'JVM bytecode verification error if used uninitialized (slows down code'+
- ')'#010+
- 'J*3CTlowercaseprocstart_ Lowercase the first character of procedure/f'+
- 'unction/method names'#010+
- 'A*3CTthumbinterworking_ Genera','te Thumb interworking-safe code if pos'+
- 'sible'#010+
+ '4*3CTcld_ ',' Emit a CLD instruction before using the x8'+
+ '6 string instructions'#010+
+ 'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
+ 'de for initializing integer array constants'#010+
+ 'J*3CTenumfieldinit_ Initialize enumeration fields in c','onstruct'+
+ 'ors to enumtype(0), after calling inherited constructors'#010+
+ 'J*3CTinitlocals_ Initialize local variables that trigger a JV'+
+ 'M bytecode verification error if used uninitialized (slows down code)'#010+
+ 'J*3CTlowercaseprocstart_ Lowercase',' the first character of procedure'+
+ '/function/method names'#010+
+ 'A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possi'+
+ 'ble'#010+
'J*2Cv_Var/out parameter copy-out checking'#010+
'**2CX_Create also smartlinked library'#010+
- '**1d<x>_Defines the symbol <x>'#010+
+ '**1d<x>_Defines the symbol <x>',#010+
'**1D_Generate a DEF file'#010+
'**2Dd<x>_Set description to <x>'#010+
- '**2Dv<x>_Set DLL version to ','<x>'#010+
+ '**2Dv<x>_Set DLL version to <x>'#010+
'*O2Dw_PM application'#010+
'**1e<x>_Set path to executable'#010+
'**1E_Same as -Cn'#010+
'**1fPIC_Same as -Cg'#010+
'**1F<x>_Set file names and paths:'#010+
- '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
- 'sed'#010+
+ '**2Fa<x>[,y]_(for a program',') load units <x> and [y] before uses is p'+
+ 'arsed'#010+
'**2Fc<x>_Set input codepage to <x>'#010+
- '**2F','C<x>_Set RC compiler binary name 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+
+ '**2FD<x>_Set the directory where to search for compiler util','ities'#010+
'**2Fe<x>_Redirect error output to <x>'#010+
- '**2Ff<x>_Add <x> to framework path (Darwin',' only)'#010+
+ '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
'**2FE<x>_Set exe/unit output path to <x>'#010+
'**2Fi<x>_Add <x> to include path'#010+
'**2Fl<x>_Add <x> to library path'#010+
'**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 di','rectory where to search for unicode binary files'#010+
+ '**2Fm','<x>_Load unicode conversion table from <x>.txt in the compiler '+
+ 'dir'#010+
+ '**2FM<x>_Set the directory where to search for unicode binary files'#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+
+ '**2FR<x>_Set resource (.res) linker ','to <x>'#010+
'**2Fu<x>_Add <x> to unit path'#010+
- '**2FU<x>_Set unit output path to <x>, overrides -','FE'#010+
+ '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
'**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
'**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
'om <x>'#010+
- '*g1g_Generate debug information (default format for target)'#010+
- '*g2gc_Generate checks for pointe','rs'#010+
+ '*g1g_G','enerate debug information (default format for target)'#010+
+ '*g2gc_Generate checks for pointers'#010+
'*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
'*g2gl_Use line info unit (show more info with backtraces)'#010+
- '*g2go<x>_Set debug information options'#010+
+ '*g2go<x>_Set debug informatio','n options'#010+
'*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug information (bre'+
- 'aks gdb < 6.5)',#010+
+ 'aks gdb < 6.5)'#010+
'*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
#010+
'*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
'ame'#010+
- '*g2gp_Preserve case in stabs symbol names'#010+
+ '*g2gp_Pr','eserve case in stabs symbol names'#010+
'*g2gs_Generate Stabs debug information'#010+
- '*g2gt_Trash l','ocal variables (to detect uninitialized uses)'#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+
+ '*g2gw_Generate DWA','RFv2 debug information (same as -gw2)'#010+
'*g2gw2_Generate DWARFv2 debug information'#010+
'*g2gw3_Generate DWARFv3 debug information'#010+
- '*g2gw','4_Generate DWARFv4 debug information (experimental)'#010+
+ '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
'**1i_Information'#010+
'**2iD_Return compiler date'#010+
- '**2iV_Return short compiler version'#010+
- '**2iW_Return full compiler version'#010+
- '**2iSO_Return compiler OS'#010+
+ '**2iSO_Return com','piler OS'#010+
'**2iSP_Return compiler host processor'#010+
- '**2iTO_Re','turn target OS'#010+
+ '**2iTO_Return target OS'#010+
'**2iTP_Return target processor'#010+
+ '**2iV_Return short compiler version'#010+
+ '**2iW_Return full compiler version'#010+
+ '**2ia_Return list of supported ABI targets'#010+
+ '**2ic_Return list of sup','ported CPU instruction sets'#010+
+ '**2if_Return list of supported FPU instruction sets'#010+
+ '**2ii_Return list of supported inline assembler modes'#010+
+ '**2io_Return list of supported optimizations'#010+
+ '**2ir_Return list of recognized compiler and RTL features'#010+
+ '**2','it_Return list of supported targets'#010+
+ '**2iu_Return list of supported microcontroller types'#010+
+ '**2iw_Return list of supported whole program optimizations'#010+
'**1I<x>_Add <x> to include path'#010+
'**1k<x>_Pass <x> to the linker'#010+
'**1l_Write logo'#010+
- '**1M<x>_Set language mode to <x>'#010+
+ '**1M<x>_Set l','anguage mode to <x>'#010+
'**2Mfpc_Free Pascal dialect (default)'#010+
- '**2Mobjfpc_FPC mode with Object Pascal suppo','rt'#010+
+ '**2Mobjfpc_FPC mode with Object Pascal support'#010+
'**2Mdelphi_Delphi 7 compatibility mode'#010+
'**2Mtp_TP/BP 7.0 compatibility mode'#010+
'**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
- '**1n_Do not read the default config files'#010+
+ '**1n','_Do not read the default config files'#010+
'**1o<x>_Change the name of the executable produced to <x>'#010+
- '**1O<x','>_Optimizations:'#010+
+ '**1O<x>_Optimizations:'#010+
'**2O-_Disable optimizations'#010+
'**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
- '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
+ '**2O2_Level 2 optimizations (-O1 + ','quick optimizations)'#010+
'**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
- '**2O4_Level 4 optimization','s (-O3 + optimizations which might have un'+
- 'expected side effects)'#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 optimizations, see fpc -i for possible '+
- 'values'#010+
- '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
- #010,
+ '**2Oo[NO]<x>_Enable or disable optimizations; ','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+
'**2OW<x>_Generate whole-program optimization feedback for optimization'+
- ' <x>, see fpc -i for possible values'#010+
- '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possib'+
- 'le values'#010+
+ ' <x>; see fpc -i or fpc -iw for possible value','s'#010+
+ '**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw'+
+ ' for possible values'#010+
'**2Os_Optimize for size rather than speed'#010+
- '**1pg_Gener','ate profile code for gprof (defines FPC_PROFILE)'#010+
- 'F*1P<x>_Target CPU / compiler related options:'#010+
+ '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
+ 'F*1P<x>_Target CPU / compiler related options',':'#010+
'F*2PB_Show default compiler binary'#010+
'F*2PP_Show default target cpu'#010+
- 'F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sp'+
- 'arc,x86_6','4)'#010+
+ 'F*2P<x>_Set target CPU (arm,avr,i386,jvm,m68k,mips,mipsel,powerpc,powe'+
+ 'rpc64,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*2Ra','tt_Read AT&T style assembler'#010+
'3*2Rintel_Read Intel style assembler'#010+
'6*2RMOT_Read motorola style assembler'#010+
'**1S<x>_Syntax options:'#010+
'**2S2_Same as -Mobjfpc'#010+
- '**2','Sc_Support operators like C (*=,+=,/= and -=)'#010+
+ '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
'**2Sa_Turn on assertions'#010+
- '**2Sd_Same as -Mdelphi'#010+
+ '**2Sd_Same as -','Mdelphi'#010+
'**2Se<x>_Error options. <x> is a combination of the following:'#010+
'**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
- '**3*_w : Compiler als','o halts after warnings'#010+
+ '**3*_w : Compiler also halts after warnings'#010+
'**3*_n : Compiler also halts after notes'#010+
- '**3*_h : Compiler also halts after hints'#010+
+ '**3*_h : Compiler also',' halts after hints'#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 -Mdelphi)'#010+
- '**2Sh_Use reference counted strings (ansistring by default) instead of'+
- ' short','strings'#010+
+ '**2Sh_Use reference counted strings (ansistring by default) instead ','o'+
+ 'f shortstrings'#010+
'**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
'**2Sk_Load fpcylix unit'#010+
'**2SI<x>_Set interface style to <x>'#010+
'**3SIcom_COM compatible interface (default)'#010+
'**3SIcorba_CORBA compatible interface'#010+
- '**2Sm_Support macros l','ike C (global)'#010+
+ '**2Sm_Support ','macros like C (global)'#010+
'**2So_Same as -Mtp'#010+
'**2Ss_Constructor name must be init (destructor must be done)'#010+
- '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#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, same as $T+'#010+
- '**1s_Do not call assemble','r and linker'#010+
+ '**1s_Do not call assembler and linker'#010+
'**2sh_Generate script to link on host'#010+
'**2st_Generate script to link on target'#010+
'**2sr_Skip register allocation phase (use with -alr)'#010+
- '**1T<x>_Target operating system:'#010+
+ '**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*2Temx_OS/2 via EMX (including EMX/','RSX extender)'#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 Delorie DOS extender'#010+
+ '3*2Thai','ku_Haiku'#010+
'3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tda'+
'rwin)'#010+
'3*2Tlinux_Linux'#010+
'3*2Tnativent_Native NT API (experimental)'#010+
'3*2Tnetbsd_NetBSD'#010+
- '3*2Tne','tware_Novell Netware Module (clib)'#010+
- '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
+ '3*2Tnetware_Novell Netware Module (clib)'#010+
+ '3*2Tnetwlibc_Novell Netware Module (li','bc)'#010+
'3*2Topenbsd_OpenBSD'#010+
'3*2Tos2_OS/2 / eComStation'#010+
'3*2Tsunos_SunOS/Solaris'#010+
'3*2Tsymbian_Symbian OS'#010+
'3*2Tsolaris_Solaris'#010+
'3*2Twatcom_Watcom compatible DOS extender'#010+
- '3*2Twdo','sx_WDOSX DOS extender'#010+
+ '3*2Twdosx_WDOSX DOS extender'#010+
'3*2Twin32_Windows 32 Bit'#010+
'3*2Twince_Windows CE'#010+
- '4*2Tdarwin_Darwin/Mac OS X'#010+
+ '4*2Td','arwin_Darwin/Mac OS X'#010+
+ '4*2Tfreebsd_FreeBSD'#010+
'4*2Tlinux_Linux'#010+
+ '4*2Tnetbsd_NetBSD'#010+
+ '4*2Topenbsd_OpenBSD'#010+
+ '4*2Tsolaris_Solaris'#010+
'4*2Twin64_Win64 (64 bit Windows systems)'#010+
'6*2Tamiga_Commodore Amiga'#010+
'6*2Tatari_Atari ST/STe/TT'#010+
'6*2Tlinux_Linux'#010+
- '6*2Tpalmos_PalmOS'#010+
- 'A*','2Tdarwin_Darwin/iPhoneOS/iOS'#010+
+ '6*2Tpalmos_Palm','OS'#010+
+ '8*2Tmsdos_MS-DOS (and compatible)'#010+
+ 'A*2Tandroid_Android'#010+
+ 'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+
+ 'A*2Tembedded_Embedded'#010+
+ 'A*2Tgba_Game Boy Advance'#010+
'A*2Tlinux_Linux'#010+
+ 'A*2Tnds_Nintendo DS'#010+
+ 'A*2Tsymbian_Symbian'#010+
'A*2Twince_Windows CE'#010+
+ 'J*2Tandroid_Android'#010+
+ 'J*2Tjava','_Java'#010+
+ 'm*2Tembedded_Embedded'#010+
+ 'M*2Tandroid_Android'#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*2Tlinux_Linux'#010+
'P*2Tmacos_Mac OS (classic)'#010+
'P*2Tmorphos_MorphOS'#010+
+ 'P*2Tnetbsd_NetBSD'#010+
+ 'P*2Twii_Wii'#010+
+ 'p*2T','aix_AIX'#010+
+ 'p*2Tdarwin_Darwin/Mac OS X'#010+
+ 'p*2Tlinux_Linux'#010+
'S*2Tsolaris_Solaris'#010+
'S*2Tlinux_Linux'#010+
- '**1u<x>_Undefines the symbol <','x>'#010+
+ 'V*2Tembedded_Embedded'#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+
+ '**2Ur_Generate rel','ease unit files (never automatically recompiled)'#010+
'**2Us_Compile a system unit'#010+
- '**1v<x>_Be verbose. <x> is a combination of the following lett','ers:'#010+
+ '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
'**2*_e : Show errors (default) 0 : Show nothing (except errors)'#010+
- '**2*_w : Show warnings u : Show unit info'#010+
+ '**2*_w : Show warnings ',' u : Show unit info'#010+
'**2*_n : Show notes t : Show tried/used files'#010+
- '**2*_h : Show hints c : Show ','conditionals'#010+
+ '**2*_h : Show hints c : Show conditionals'#010+
'**2*_i : Show general info d : Show debug info'#010+
- '**2*_l : Show linenumbers r : Rhide/GCC compatibility mode'#010+
- '**2*_s : Show time stamps q : Show message numbers'#010+
- '**2*_a : Show everything x',' : Executable info (Win32 only'+
- ')'#010+
- '**2*_b : Write file names messages p : Write tree.log with parse tre'+
+ '**2*_l : Show linenumbers ',' r : Rhide/GCC compatibility mod'+
'e'#010+
+ '**2*_s : Show time stamps q : Show message numbers'#010+
+ '**2*_a : Show everything x : Show info about invoked tools'+
+ #010+
+ '**2*_b : Write file names messages p : Write tree.log with parse t','r'+
+ 'ee'#010+
'**2*_ with full path v : Write fpcdebug.txt with'#010+
- '**2*_ lots of debugging info'#010+
- '**2*_m<','x>,<y> : Do not show messages numbered <x> and <y>'#010+
- 'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
- 'or version)'#010+
+ '**2*_z : Write output to stderr lots of debugging info'#010+
+ '**2*_m<x>,<y> : Do not show messages numbered <x> and <y>'#010+
+ 'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary',' name (e.g.'+
+ ' for 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+
+ '4*2WA_Specify native type application (Windows)'#010+
'A*2WA_Specify native type application (Windows)'#010+
- '3*2Wb_Create a bundle instead of a library (Darwin)'#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_Create 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_Cre','ate a relocatable image (Windows, Symbian)'#010+
'3*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
'4*2WB_Create a relocatable image (Windows)'#010+
- '4*','2WBxxxx_Set image base to xxxx (Windows)'#010+
+ '4*2WBxxxx_Set image base to xxxx (Windows)'#010+
'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
- 'A*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
+ 'A*2WBxx','xx_Set image base to xxxx (Windows, Symbian)'#010+
'3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
- '4*2WC_Specify console type applicat','ion (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+
+ 'P*2WC_Specify console type applicatio','n (Classic Mac OS)'#010+
'3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
- '4*2WD_Use DEFFILE to export functions of DLL or ','EXE (Windows)'#010+
+ '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
- '3*2We_Use external resources (Darwin)'#010+
+ '3*2We_Use external resources (Darwi','n)'#010+
'4*2We_Use external resources (Darwin)'#010+
'A*2We_Use external resources (Darwin)'#010+
'P*2We_Use external resources (Darwin)'#010+
- 'p*2We_Use ex','ternal resources (Darwin)'#010+
+ 'p*2We_Use external resources (Darwin)'#010+
'3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
- '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
- '4*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
- 'A*2WG_Specify graphic type application ','(Windows)'#010+
+ '3*2WG_Specify graphic type app','lication (EMX, 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+
+ '4*2Wi_Use internal',' resources (Darwin)'#010+
'A*2Wi_Use internal resources (Darwin)'#010+
'P*2Wi_Use internal resources (Darwin)'#010+
- 'p*2Wi_Use internal res','ources (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 usage of import sections (Windows)'#010+
+ '4*2WI_Turn on/off the usage of import sections (W','indows)'#010+
'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
'8*2Wm<x>_Set memory model'#010+
- '8*3WmTiny_Tiny memory model',#010+
+ '8*3WmTiny_Tiny memory model'#010+
'8*3WmSmall_Small memory model (default)'#010+
'8*3WmMedium_Medium memory model'#010+
'8*3WmCompact_Compact memory model'#010+
- '8*3WmLarge_Large memory model'#010+
+ '8*3WmLarge_Larg','e 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 depl','oyment version: 10.4, 10.5.1, ... (Dar'+
- 'win)'#010+
- 'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
+ '4*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'+
+ '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 d','ebugging (Windows'+
- ')'#010+
+ 'P*2WM<','x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Dar'+
+ 'win)'#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*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
- 'V*2Wpxxxx_S','pecify the controller type, see fpc -i for possible value'+
- 's'#010+
+ 'A*2WN_Do not generate relocation ','code, needed for debugging (Windows'+
+ ')'#010+
+ 'A*2Wpxxxx_Specify the controller type; see fpc -i or fpc -iu for possi'+
+ 'ble values'#010+
+ 'm*2Wpxxxx_Specify the controller type; see fpc -i or fpc -iu for possi'+
+ 'ble values'#010+
+ 'V*2Wpxxxx_Specify the controller type; se','e fpc -i or fpc -iu for pos'+
+ 'sible values'#010+
'3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
'3*2WR_Generate relocation code (Windows)'#010+
- '4*2WR','_Generate relocation code (Windows)'#010+
+ '4*2WR_Generate relocatio','n code (Windows)'#010+
'A*2WR_Generate relocation code (Windows)'#010+
'8*2Wt<x>_Set the target executable format'#010+
'8*3Wtexe_Create a DOS .EXE file (default)'#010+
'8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+
- 'P*2WT_Specify MPW ','tool type application (Classic Mac OS)'#010+
+ 'P*2WT_Specify MPW tool type applicati','on (Classic Mac OS)'#010+
'**2WX_Enable executable stack (Linux)'#010+
'**1X_Executable options:'#010+
'**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
'ux)'#010+
- '**2Xd_Do not search default library path (sometimes required for',' cro'+
- 'ss-compiling when not using -XR)'#010+
+ '**2Xd_Do not search default library path (sometimes required for cross'+
+ '-compiling wh','en not using -XR)'#010+
'**2Xe_Use external linker'#010+
+ '**2Xf_Substitute pthread library name for linking (BSD)'#010+
'**2Xg_Create debuginfo in a separate file and add a debuglink section '+
'to executable'#010+
- '**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)'#010+
- '**2Xi_Use internal linker',#010+
+ '**2XD_Try to link units dynamically (defines FPC_LI','NK_DYNAMIC)'#010+
+ '**2Xi_Use internal linker'#010+
+ '**2XLA_Define library substitutions for linking'#010+
+ '**2XLO_Define order of library linking'#010+
+ '**2XLD_Exclude default order of standard libraries'#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+
+ '**2XM<x>_Set the name of the '#039'main'#039' prog','ram routine (default'+
+ ' is '#039'main'#039')'#010+
+ '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+
+ #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 lin','ker'#039's rlink-path to <x> (needed for cross co'+
+ '**2Xr<x>_Set t','he linker'#039's rlink-path to <x> (needed for cross co'+
'mpile, see the ld manual for more 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_Strip all symbols from exec','utable'#010+
'**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
'**2Xt_Link with static libraries (-static is passed to linker)'#010+
- '**2XX_Try to smartlink units (defines FPC_LINK_SMART)'#010+
+ '**2Xv_Generate table for Virtual Entry calls'#010+
+ '**2XX_Try to smartlink units (defines FPC_L','INK_SMART)'#010+
'**1*_'#010+
'**1?_Show this help'#010+
- '**1h_Shows thi','s help without waiting'
+ '**1h_Shows this help without waiting'
);
diff --git a/compiler/nadd.pas b/compiler/nadd.pas
index bf7b7f2a4e..ab89377400 100644
--- a/compiler/nadd.pas
+++ b/compiler/nadd.pas
@@ -73,6 +73,10 @@ interface
{ full 64 bit multiplies. }
function use_generic_mul64bit: boolean; virtual;
+ { shall be overriden if the target cpu supports
+ an fma instruction
+ }
+ function use_fma : boolean; virtual;
{ This routine calls internal runtime library helpers
for all floating point arithmetic in the case
where the emulation switches is on. Otherwise
@@ -80,18 +84,22 @@ interface
the code generation phase.
}
function first_addfloat : tnode; virtual;
- private
- { checks whether a muln can be calculated as a 32bit }
- { * 32bit -> 64 bit }
- function try_make_mul32to64: boolean;
- { Match against the ranges, i.e.:
- var a:1..10;
- begin
- if a>0 then
- ...
- always evaluates to true. (DM)
- }
- function cmp_of_disjunct_ranges(var res : boolean) : boolean;
+ private
+ { checks whether a muln can be calculated as a 32bit }
+ { * 32bit -> 64 bit }
+ function try_make_mul32to64: boolean;
+
+ { Match against the ranges, i.e.:
+ var a:1..10;
+ begin
+ if a>0 then
+ ...
+ always evaluates to true. (DM)
+ }
+ function cmp_of_disjunct_ranges(var res : boolean) : boolean;
+
+ { tries to replace the current node by a fma node }
+ function try_fma(ld,rd : tdef) : tnode;
end;
taddnodeclass = class of taddnode;
@@ -401,8 +409,7 @@ implementation
end;
{ both are int constants }
- if (
- (
+ if (
is_constintnode(left) and
is_constintnode(right)
) or
@@ -414,7 +421,7 @@ implementation
(
is_constenumnode(left) and
is_constenumnode(right) and
- allowenumop(nodetype))
+ (allowenumop(nodetype) or (nf_internal in flags))
) or
(
(lt = pointerconstn) and
@@ -676,6 +683,50 @@ implementation
result:=t;
exit;
end;
+{$if FPC_FULLVERSION>20700}
+ { bestrealrec is 2.7.1+ only }
+
+ { replace .../const by a multiplication, but only if fastmath is enabled or
+ the division is done by a power of 2, do not mess with special floating point values like Inf etc.
+
+ do this after constant folding to avoid unnecessary precision loss if
+ an slash expresion would be first converted into a multiplication and later
+ folded }
+ if (nodetype=slashn) and
+ { do not mess with currency types }
+ (not(is_currency(right.resultdef))) and
+ (((cs_opt_fastmath in current_settings.optimizerswitches) and (rt=ordconstn)) or
+ ((cs_opt_fastmath in current_settings.optimizerswitches) and (rt=realconstn) and
+ (bestrealrec(trealconstnode(right).value_real).SpecialType in [fsPositive,fsNegative])
+ ) or
+ ((rt=realconstn) and
+ (bestrealrec(trealconstnode(right).value_real).SpecialType in [fsPositive,fsNegative]) and
+ { mantissa returns the mantissa/fraction without the hidden 1, so power of two means only the hidden
+ bit is set => mantissa must be 0 }
+ (bestrealrec(trealconstnode(right).value_real).Mantissa=0)
+ )
+ ) then
+ case rt of
+ ordconstn:
+ begin
+ { the normal code handles div/0 }
+ if (tordconstnode(right).value<>0) then
+ begin
+ nodetype:=muln;
+ t:=crealconstnode.create(1/tordconstnode(right).value,resultdef);
+ right.free;
+ right:=t;
+ exit;
+ end;
+ end;
+ realconstn:
+ begin
+ nodetype:=muln;
+ trealconstnode(right).value_real:=1.0/trealconstnode(right).value_real;
+ exit;
+ end;
+ end;
+{$endif FPC_FULLVERSION>20700}
{ first, we handle widestrings, so we can check later for }
{ stringconstn only }
@@ -1013,6 +1064,14 @@ implementation
change : boolean;
{$endif}
+ function maybe_cast_ordconst(var n: tnode; adef: tdef): boolean;
+ begin
+ result:=(tordconstnode(n).value>=torddef(adef).low) and
+ (tordconstnode(n).value<=torddef(adef).high);
+ if result then
+ inserttypeconv(n,adef);
+ end;
+
begin
result:=nil;
rlow:=0;
@@ -1420,6 +1479,18 @@ implementation
inserttypeconv(right,nd);
end;
end
+ { don't extend (sign-mismatched) comparisons if either side is a constant
+ whose value is within range of opposite side }
+ else if is_integer(ld) and is_integer(rd) and
+ (nodetype in [equaln,unequaln,gtn,gten,ltn,lten]) and
+ (is_signed(ld)<>is_signed(rd)) and
+ (
+ ((lt=ordconstn) and maybe_cast_ordconst(left,rd)) or
+ ((rt=ordconstn) and maybe_cast_ordconst(right,ld))
+ ) then
+ begin
+ { done here }
+ end
{ is there a signed 64 bit type ? }
else if ((torddef(rd).ordtype=s64bit) or (torddef(ld).ordtype=s64bit)) then
begin
@@ -1967,7 +2038,7 @@ implementation
end
else
resultdef:=right.resultdef;
- inserttypeconv(left,get_int_type_for_pointer_arithmetic(rd));
+ inserttypeconv(left,tpointerdef(right.resultdef).pointer_arithmetic_int_type);
if nodetype=addn then
begin
if (rt=niln) then
@@ -1981,7 +2052,7 @@ implementation
(tpointerdef(rd).pointeddef.size>1) then
begin
left:=caddnode.create(muln,left,
- cordconstnode.create(tpointerdef(rd).pointeddef.size,get_int_type_for_pointer_arithmetic(rd),true));
+ cordconstnode.create(tpointerdef(rd).pointeddef.size,tpointerdef(right.resultdef).pointer_arithmetic_int_type,true));
typecheckpass(left);
end;
end
@@ -2000,7 +2071,7 @@ implementation
else
resultdef:=left.resultdef;
- inserttypeconv(right,get_int_type_for_pointer_arithmetic(ld));
+ inserttypeconv(right,tpointerdef(left.resultdef).pointer_arithmetic_int_type);
if nodetype in [addn,subn] then
begin
if (lt=niln) then
@@ -2017,7 +2088,7 @@ implementation
if (tpointerdef(ld).pointeddef.size>1) then
begin
right:=caddnode.create(muln,right,
- cordconstnode.create(tpointerdef(ld).pointeddef.size,get_int_type_for_pointer_arithmetic(ld),true));
+ cordconstnode.create(tpointerdef(ld).pointeddef.size,tpointerdef(left.resultdef).pointer_arithmetic_int_type,true));
typecheckpass(right);
end
end else
@@ -2025,7 +2096,7 @@ implementation
(tarraydef(ld).elementdef.size>1) then
begin
right:=caddnode.create(muln,right,
- cordconstnode.create(tarraydef(ld).elementdef.size,get_int_type_for_pointer_arithmetic(ld),true));
+ cordconstnode.create(tarraydef(ld).elementdef.size,tpointerdef(left.resultdef).pointer_arithmetic_int_type,true));
typecheckpass(right);
end;
end
@@ -2068,7 +2139,7 @@ implementation
{ enums }
else if (ld.typ=enumdef) and (rd.typ=enumdef) then
begin
- if allowenumop(nodetype) then
+ if allowenumop(nodetype) or (nf_internal in flags) then
inserttypeconv(right,left.resultdef)
else
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
@@ -2592,6 +2663,127 @@ implementation
end;
+ function taddnode.use_fma : boolean;
+ begin
+ result:=false;
+ end;
+
+
+ function taddnode.try_fma(ld,rd : tdef) : tnode;
+ var
+ inlinennr : Integer;
+ begin
+ result:=nil;
+ if (cs_opt_fastmath in current_settings.optimizerswitches) and
+ use_fma and
+ (nodetype in [addn,subn]) and
+ (rd.typ=floatdef) and (ld.typ=floatdef) and
+ (is_single(rd) or is_double(rd)) and
+ equal_defs(rd,ld) and
+ { transforming a*b+c into fma(a,b,c) makes only sense if c can be
+ calculated easily. Consider a*b+c*d which results in
+
+ fmul
+ fmul
+ fadd
+
+ and in
+
+ fmul
+ fma
+
+ when using the fma optimization. On a super scalar architecture, the first instruction
+ sequence requires clock_cycles(fmul)+clock_cycles(fadd) clock cycles because the fmuls can be executed in parallel.
+ The second sequence requires clock_cycles(fmul)+clock_cycles(fma) because the fma has to wait for the
+ result of the fmul. Since typically clock_cycles(fma)>clock_cycles(fadd) applies, the first sequence is better.
+ }
+ (((left.nodetype=muln) and (node_complexity(right)<3)) or
+ ((right.nodetype=muln) and (node_complexity(left)<3)) or
+ ((left.nodetype=inlinen) and
+ (tinlinenode(left).inlinenumber=in_sqr_real) and
+ (node_complexity(right)<3)) or
+ ((right.nodetype=inlinen) and
+ (tinlinenode(right).inlinenumber=in_sqr_real) and
+ (node_complexity(left)<3))
+ ) then
+ begin
+ case tfloatdef(ld).floattype of
+ s32real:
+ inlinennr:=in_fma_single;
+ s64real:
+ inlinennr:=in_fma_double;
+ s80real:
+ inlinennr:=in_fma_extended;
+ s128real:
+ inlinennr:=in_fma_float128;
+ else
+ internalerror(2014042601);
+ end;
+ if left.nodetype=muln then
+ begin
+ if nodetype=subn then
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(cunaryminusnode.create(right),
+ ccallparanode.create(taddnode(left).right,
+ ccallparanode.create(taddnode(left).left,nil
+ ))))
+ else
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(right,
+ ccallparanode.create(taddnode(left).right,
+ ccallparanode.create(taddnode(left).left,nil
+ ))));
+ right:=nil;
+ taddnode(left).right:=nil;
+ taddnode(left).left:=nil;
+ end
+ else if right.nodetype=muln then
+ begin
+ if nodetype=subn then
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(left,
+ ccallparanode.create(cunaryminusnode.create(taddnode(right).right),
+ ccallparanode.create(taddnode(right).left,nil
+ ))))
+ else
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(left,
+ ccallparanode.create(taddnode(right).right,
+ ccallparanode.create(taddnode(right).left,nil
+ ))));
+ left:=nil;
+ taddnode(right).right:=nil;
+ taddnode(right).left:=nil;
+ end
+ else if (left.nodetype=inlinen) and (tinlinenode(left).inlinenumber=in_sqr_real) then
+ begin
+ if nodetype=subn then
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(cunaryminusnode.create(right),
+ ccallparanode.create(tinlinenode(left).left.getcopy,
+ ccallparanode.create(tinlinenode(left).left.getcopy,nil
+ ))))
+ else
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(right,
+ ccallparanode.create(tinlinenode(left).left.getcopy,
+ ccallparanode.create(tinlinenode(left).left.getcopy,nil
+ ))));
+ right:=nil;
+ end
+ { we get here only if right is a sqr node }
+ else if (right.nodetype=inlinen) and (tinlinenode(right).inlinenumber=in_sqr_real) then
+ begin
+ if nodetype=subn then
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(left,
+ ccallparanode.create(cunaryminusnode.create(tinlinenode(right).left.getcopy),
+ ccallparanode.create(tinlinenode(right).left.getcopy,nil
+ ))))
+ else
+ result:=cinlinenode.create(inlinennr,false,ccallparanode.create(left,
+ ccallparanode.create(tinlinenode(right).left.getcopy,
+ ccallparanode.create(tinlinenode(right).left.getcopy,nil
+ ))));
+ left:=nil;
+ end;
+ end;
+ end;
+
+
function taddnode.first_add64bitint: tnode;
var
procname: string[31];
@@ -3089,6 +3281,10 @@ implementation
expectloc:=LOC_FPUREGISTER
else
expectloc:=LOC_FLAGS;
+
+ result:=try_fma(ld,rd);
+ if assigned(result) then
+ exit;
end
{ pointer comperation and subtraction }
diff --git a/compiler/ncal.pas b/compiler/ncal.pas
index ed62fa2256..dc0902e92a 100644
--- a/compiler/ncal.pas
+++ b/compiler/ncal.pas
@@ -269,6 +269,9 @@ interface
between the callparanodes and the callnode they belong to }
aktcallnode : tcallnode;
+ const
+ { track current inlining depth }
+ inlinelevel : longint = 0;
implementation
@@ -337,6 +340,8 @@ implementation
pvardatadef : tdef;
useresult: boolean;
restype: byte;
+ selftemp: ttempcreatenode;
+ selfpara: tnode;
names : ansistring;
variantdispatch : boolean;
@@ -370,7 +375,7 @@ implementation
if is_interfacecom_or_dispinterface(sourcedef) then
begin
{ distinct IDispatch and IUnknown interfaces }
- if def_is_related(tobjectdef(sourcedef),tobjectdef(search_system_type('IDISPATCH').typedef)) then
+ if def_is_related(tobjectdef(sourcedef),interface_idispatch) then
result:=vardispatch
else
result:=varunknown;
@@ -383,6 +388,8 @@ implementation
variantdispatch:=selfnode.resultdef.typ=variantdef;
result:=internalstatements(statements);
result_data:=nil;
+ selftemp:=nil;
+ selfpara:=nil;
useresult := assigned(resultdef) and not is_void(resultdef);
if useresult then
@@ -528,13 +535,27 @@ implementation
{ actual call }
vardatadef:=trecorddef(search_system_type('TVARDATA').typedef);
+ { the Variant should behave similar to hidden 'self' parameter of objects/records,
+ see issues #26773 and #27044 }
+ if not valid_for_var(selfnode,false) then
+ begin
+ selftemp:=ctempcreatenode.create(selfnode.resultdef,selfnode.resultdef.size,tt_persistent,false);
+ addstatement(statements,selftemp);
+ addstatement(statements,cassignmentnode.create(ctemprefnode.create(selftemp),selfnode));
+ selfpara:=ctemprefnode.create(selftemp);
+ end
+ else
+ selfpara:=selfnode;
+
addstatement(statements,ccallnode.createintern('fpc_dispinvoke_variant',
{ parameters are passed always reverted, i.e. the last comes first }
ccallparanode.create(caddrnode.create(ctemprefnode.create(params)),
ccallparanode.create(caddrnode.create(calldescnode),
- ccallparanode.create(ctypeconvnode.create_internal(selfnode,vardatadef),
+ ccallparanode.create(ctypeconvnode.create_internal(selfpara,vardatadef),
ccallparanode.create(ctypeconvnode.create_internal(resultvalue,pvardatadef),nil)))))
);
+ if assigned(selftemp) then
+ addstatement(statements,ctempdeletenode.create(selftemp));
end
else
begin
@@ -1685,7 +1706,10 @@ implementation
typecheckpass(temp);
if (temp.nodetype <> ordconstn) or
(tordconstnode(temp).value <> 0) then
- hightree := caddnode.create(subn,hightree,temp)
+ begin
+ hightree:=caddnode.create(subn,hightree,temp);
+ include(hightree.flags,nf_internal);
+ end
else
temp.free;
end;
@@ -2898,7 +2922,7 @@ implementation
for i:=1 to procdefinition.maxparacount-paralength do
begin
if paraidx<0 then
- internalerror(200402261);
+ internalerror(200402265);
if not assigned(tparavarsym(procdefinition.paras[paraidx]).defaultconstsym) then
begin
CGMessage1(parser_e_wrong_parameter_size,'<Procedure Variable>');
@@ -3481,9 +3505,25 @@ implementation
{ Can we inline the procedure? }
if (po_inline in procdefinition.procoptions) and
(procdefinition.typ=procdef) and
- tprocdef(procdefinition).has_inlininginfo then
+ tprocdef(procdefinition).has_inlininginfo and
+ { Prevent too deep inlining recursion and code bloat by inlining
+
+ The actual formuala is
+ inlinelevel+1 /-------
+ node count < -------------\/ 10000
+
+ This allows exponential grow of the code only to a certain limit.
+
+ Remarks
+ - The current approach calculates the inlining level top down, so outer call nodes (nodes closer to the leaf) might not be inlined
+ if the max. complexity is reached. This is done because it makes the implementation easier and because
+ there might be situations were it is more beneficial to inline inner nodes and do the calls to the outer nodes
+ if the outer nodes are in a seldomly used code path
+ - The code avoids to use functions from the math unit
+ }
+ (node_count(tprocdef(procdefinition).inlininginfo^.code)<round(exp((1.0/(inlinelevel+1))*ln(10000)))) then
begin
- include(callnodeflags,cnf_do_inline);
+ include(callnodeflags,cnf_do_inline);
{ Check if we can inline the procedure when it references proc/var that
are not in the globally available }
st:=procdefinition.owner;
@@ -3987,7 +4027,7 @@ implementation
(assigned(aktassignmentnode) and
(aktassignmentnode.right=self) and
(nf_assign_done_in_right in aktassignmentnode.flags) and
- aktassignmentnode.left.isequal(para.left)))) or
+ actualtargetnode(@aktassignmentnode.left)^.isequal(actualtargetnode(@para.left)^)))) or
{ the compiler expects that it can take the address of parameters passed by reference in
the case of const so we can't replace the node simply by a constant node
When playing with this code, ensure that
@@ -4151,6 +4191,7 @@ implementation
inlineblock,
inlinecleanupblock : tblocknode;
begin
+ inc(inlinelevel);
result:=nil;
if not(assigned(tprocdef(procdefinition).inlininginfo) and
assigned(tprocdef(procdefinition).inlininginfo^.code)) then
@@ -4248,6 +4289,7 @@ implementation
writeln('**************************',tprocdef(procdefinition).mangledname);
printnode(output,result);
{$endif DEBUGINLINE}
+ dec(inlinelevel);
end;
end.
diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas
index e0ca908b47..e9045f33ca 100644
--- a/compiler/ncgcal.pas
+++ b/compiler/ncgcal.pas
@@ -249,6 +249,7 @@ implementation
href : treference;
otlabel,
oflabel : tasmlabel;
+ pushaddr: boolean;
begin
if not(assigned(parasym)) then
internalerror(200304242);
@@ -306,7 +307,7 @@ implementation
begin
{ don't push a node that already generated a pointer type
by address for implicit hidden parameters }
- if (vo_is_funcret in parasym.varoptions) or
+ pushaddr:=(vo_is_funcret in parasym.varoptions) or
{ pass "this" in C++ classes explicitly as pointer
because push_addr_param might not be true for them }
(is_cppclass(parasym.vardef) and (vo_is_self in parasym.varoptions)) or
@@ -324,8 +325,15 @@ implementation
)
) and
paramanager.push_addr_param(parasym.varspez,parasym.vardef,
- aktcallnode.procdefinition.proccalloption)) then
- push_addr_para
+ aktcallnode.procdefinition.proccalloption));
+
+ if pushaddr then
+ begin
+ { objects or advanced records could be located in registers if they are the result of a type case, see e.g. webtbs\tw26075.pp }
+ if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
+ hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
+ push_addr_para
+ end
else
push_value_para;
end
@@ -918,8 +926,7 @@ implementation
else
begin
{ Load VMT value in register }
- { todo: fix vmt type for high level cg }
- hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,proc_addr_voidptrdef,proc_addr_voidptrdef,false);
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,methodpointer.resultdef,methodpointer.resultdef,false);
vmtreg:=methodpointer.location.register;
{ test validity of VMT }
if not(is_interface(tprocdef(procdefinition).struct)) and
@@ -1048,6 +1055,7 @@ implementation
correct parameter register }
if assigned(left) then
begin
+ reorder_parameters;
pushparas;
{ free the resources allocated for the parameters }
freeparas;
diff --git a/compiler/ncgcnv.pas b/compiler/ncgcnv.pas
index d179cb5f17..da7dcc6293 100644
--- a/compiler/ncgcnv.pas
+++ b/compiler/ncgcnv.pas
@@ -120,12 +120,12 @@ interface
{ On targets without 8/16 bit register components, 8/16-bit operations
always adjust high bits of result, see 'maybeadjustresult' method in
respective cgcpu.pas. Therefore 8/16-bit locations are valid as larger
- ones (except OS_S8->OS_16 which still needs high 16 bits cleared). }
+ ones (except signed->unsigned, which still needs high bits cleared). }
else if (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) and
- (tcgsize2size[(reg_cgsize(left.location.register))]=sizeof(aint)) and
- (ressize>leftsize) and
- (newsize in [OS_32,OS_S32,OS_16,OS_S16]) and
- not ((newsize=OS_16) and (def_cgsize(left.resultdef)=OS_S8)) then
+ (tcgsize2size[(reg_cgsize(left.location.register))]=sizeof(aint)) and
+ (ressize>leftsize) and
+ (newsize in [OS_32,OS_S32,OS_16,OS_S16]) and
+ (not is_signed(left.resultdef) or is_signed(resultdef)) then
location.size:=newsize
{$endif}
else
diff --git a/compiler/ncgcon.pas b/compiler/ncgcon.pas
index 0cd1da2ffc..1ac8f76bbb 100644
--- a/compiler/ncgcon.pas
+++ b/compiler/ncgcon.pas
@@ -471,7 +471,7 @@ implementation
end
else
begin
- location.value:=swapendian(Pcardinal(value_set)^);
+ location.value:=aint(swapendian(Pcardinal(value_set)^));
location.value:=aint(
reverse_byte (location.value and $ff) or
(reverse_byte((location.value shr 8) and $ff) shl 8) or
diff --git a/compiler/ncgmat.pas b/compiler/ncgmat.pas
index 88baa9a2dd..82f75f4e66 100644
--- a/compiler/ncgmat.pas
+++ b/compiler/ncgmat.pas
@@ -50,6 +50,7 @@ interface
{$endif not cpu64bitalu}
procedure second_integer;virtual;
procedure second_float;virtual;
+ procedure second_float_emulated;virtual;
public
procedure pass_generate_code;override;
end;
@@ -206,6 +207,23 @@ implementation
end;
{$endif not cpu64bitalu}
+
+ procedure tcgunaryminusnode.second_float_emulated;
+ begin
+ secondpass(left);
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
+ location:=left.location;
+ case location.size of
+ OS_32:
+ cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,tcgint($80000000),location.register);
+ OS_64:
+ cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_XOR,OS_32,tcgint($80000000),location.registerhi);
+ else
+ internalerror(2014033101);
+ end;
+ end;
+
+
procedure tcgunaryminusnode.second_float;
begin
secondpass(left);
@@ -282,7 +300,12 @@ implementation
else
{$endif SUPPORT_MMX}
if (left.resultdef.typ=floatdef) then
- second_float
+ begin
+ if (cs_fp_emulation in current_settings.moduleswitches) then
+ second_float_emulated
+ else
+ second_float;
+ end
else
second_integer;
end;
diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas
index 5ae2e79fba..b80ae15208 100644
--- a/compiler/ncgmem.pas
+++ b/compiler/ncgmem.pas
@@ -300,7 +300,7 @@ implementation
pd:=tprocdef(tprocsym(sym).ProcdefList[0]);
paraloc1.init;
paramanager.getintparaloc(pd,1,paraloc1);
- hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,resultdef,location.reference.base,paraloc1);
+ hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,left.resultdef,location.reference.base,paraloc1);
paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
paraloc1.done;
hlcg.allocallcpuregisters(current_asmdata.CurrAsmList);
@@ -383,7 +383,7 @@ implementation
internalerror(2012010602);
pd:=tprocdef(tprocsym(sym).ProcdefList[0]);
paramanager.getintparaloc(pd,1,paraloc1);
- hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,resultdef,location.reference.base,paraloc1);
+ hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,left.resultdef,location.reference.base,paraloc1);
paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
hlcg.allocallcpuregisters(current_asmdata.CurrAsmList);
hlcg.a_call_name(current_asmdata.CurrAsmList,pd,'FPC_CHECKPOINTER',nil,false);
@@ -446,14 +446,14 @@ implementation
offsetcorrection:=0;
if (left.location.size in [OS_PAIR,OS_SPAIR]) then
begin
- if (vs.fieldoffset>=sizeof(aword)) then
- begin
- location.sreg.subsetreg := left.location.registerhi;
- offsetcorrection:=sizeof(aword)*8;
- end
+ if (vs.fieldoffset>=sizeof(aword)) xor (target_info.endian=endian_big) then
+ location.sreg.subsetreg := left.location.registerhi
else
location.sreg.subsetreg := left.location.register;
+ if (vs.fieldoffset>=sizeof(aword)) then
+ offsetcorrection:=sizeof(aword)*8;
+
location.sreg.subsetregsize := OS_INT;
end
else
diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas
index b891a0916c..9d8e618898 100644
--- a/compiler/ncgrtti.pas
+++ b/compiler/ncgrtti.pas
@@ -307,7 +307,7 @@ implementation
until not assigned(hpropsym);
if not(assigned(propaccesslist) and assigned(propaccesslist.firstsym)) then
begin
- current_asmdata.asmlists[al_rtti].concat(Tai_const.create(aitconst_ptr,unsetvalue));
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_int_codeptr(unsetvalue));
typvalue:=3;
end
else if propaccesslist.firstsym^.sym.typ=fieldvarsym then
@@ -347,7 +347,7 @@ implementation
end;
hp:=hp^.next;
end;
- current_asmdata.asmlists[al_rtti].concat(Tai_const.create(aitconst_ptr,address));
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_int_codeptr(address));
typvalue:=0;
end
else
@@ -364,7 +364,7 @@ implementation
else
begin
{ virtual method, write vmt offset }
- current_asmdata.asmlists[al_rtti].concat(Tai_const.create(aitconst_ptr,
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_int_codeptr(
tobjectdef(tprocdef(propaccesslist.procdef).struct).vmtmethodoffset(tprocdef(propaccesslist.procdef).extnumber)));
{ register for wpo }
tobjectdef(tprocdef(propaccesslist.procdef).struct).register_vmt_call(tprocdef(propaccesslist.procdef).extnumber);
@@ -396,7 +396,7 @@ implementation
if not(ppo_stored in tpropertysym(sym).propoptions) then
begin
{ no, so put a constant zero }
- current_asmdata.asmlists[al_rtti].concat(Tai_const.create(aitconst_ptr,0));
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_nil_codeptr);
proctypesinfo:=proctypesinfo or (3 shl 4);
end
else
@@ -656,7 +656,7 @@ implementation
if def.elementdef.needs_inittable then
write_rtti_reference(def.elementdef,rt)
else
- current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_pint(0));
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_nil_dataptr);
{ write unit name }
write_string(current_module.realmodulename^);
end;
diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas
index 54323eb07f..d81afe5667 100644
--- a/compiler/ncgutil.pas
+++ b/compiler/ncgutil.pas
@@ -1075,13 +1075,13 @@ implementation
begin
unget_para(paraloc^);
gen_alloc_regloc(list,destloc);
- cg.a_load_cgparaloc_anyreg(list,OS_INT,paraloc^,destloc.register,sizeof(aint));
+ cg.a_load_cgparaloc_anyreg(list,OS_8,paraloc^,destloc.register,sizeof(aint));
unget_para(paraloc^.Next^);
- cg.a_load_cgparaloc_anyreg(list,OS_INT,paraloc^.Next^,GetNextReg(destloc.register),sizeof(aint));
+ cg.a_load_cgparaloc_anyreg(list,OS_8,paraloc^.Next^,GetNextReg(destloc.register),sizeof(aint));
unget_para(paraloc^.Next^.Next^);
- cg.a_load_cgparaloc_anyreg(list,OS_INT,paraloc^.Next^.Next^,GetNextReg(GetNextReg(destloc.register)),sizeof(aint));
+ cg.a_load_cgparaloc_anyreg(list,OS_8,paraloc^.Next^.Next^,GetNextReg(GetNextReg(destloc.register)),sizeof(aint));
unget_para(paraloc^.Next^.Next^.Next^);
- cg.a_load_cgparaloc_anyreg(list,OS_INT,paraloc^.Next^.Next^.Next^,GetNextReg(GetNextReg(GetNextReg(destloc.register))),sizeof(aint));
+ cg.a_load_cgparaloc_anyreg(list,OS_8,paraloc^.Next^.Next^.Next^,GetNextReg(GetNextReg(GetNextReg(destloc.register))),sizeof(aint));
end
{$endif defined(cpu8bitalu)}
else
@@ -1348,10 +1348,18 @@ implementation
item := TCmdStrListItem(pd.aliasnames.first);
while assigned(item) do
begin
- current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION);
- item := TCmdStrListItem(item.next);
- end;
- end;
+ { The condition to use global or local symbol must match
+ the code written in hlcg.gen_proc_symbol to
+ avoid change from AB_LOCAL to AB_GLOBAL, which generates
+ erroneous code (at least for targets using GOT) }
+ if (cs_profile in current_settings.moduleswitches) or
+ (po_global in current_procinfo.procdef.procoptions) then
+ current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION)
+ else
+ current_asmdata.DefineAsmSymbol(item.str,AB_LOCAL,AT_FUNCTION);
+ item := TCmdStrListItem(item.next);
+ end;
+ end;
procedure gen_proc_entry_code(list:TAsmList);
diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas
index 50c9d7786a..7a99797870 100644
--- a/compiler/ncnv.pas
+++ b/compiler/ncnv.pas
@@ -2592,6 +2592,27 @@ implementation
end;
{$endif not CPUNO32BITOPS}
+ procedure swap_const_value (var val : TConstExprInt; size : longint);
+ begin
+ case size of
+ 1 : {do nothing };
+ 2 : if val.signed then
+ val.svalue:=swapendian(smallint(val.svalue))
+ else
+ val.uvalue:=swapendian(word(val.uvalue));
+ 4 : if val.signed then
+ val.svalue:=swapendian(longint(val.svalue))
+ else
+ val.uvalue:=swapendian(qword(val.uvalue));
+ 8 : if val.signed then
+ val.svalue:=swapendian(int64(val.svalue))
+ else
+ val.uvalue:=swapendian(qword(val.uvalue));
+ else
+ internalerror(2014111201);
+ end;
+ end;
+
function ttypeconvnode.simplify(forinline : boolean): tnode;
var
hp: tnode;
@@ -2707,7 +2728,7 @@ implementation
not(convtype=tc_char_2_char) then
begin
{ replace the resultdef and recheck the range }
- if ([nf_explicit,nf_internal] * flags <> []) then
+ if ([nf_explicit,nf_absolute, nf_internal] * flags <> []) then
include(left.flags, nf_explicit)
else
{ no longer an ordconst with an explicit typecast }
@@ -2726,7 +2747,16 @@ implementation
tordconstnode(left).value:=-ord(tordconstnode(left).value<>0);
end
else
- testrange(resultdef,tordconstnode(left).value,(nf_explicit in flags),false);
+ begin
+ { for constant values on absolute variables, swaping is required }
+ if (target_info.endian = endian_big) and (nf_absolute in flags) then
+ swap_const_value(tordconstnode(left).value,tordconstnode(left).resultdef.size);
+ testrange(resultdef,tordconstnode(left).value,(nf_explicit in flags)
+ or (nf_absolute in flags),false);
+ { swap value back, but according to new type }
+ if (target_info.endian = endian_big) and (nf_absolute in flags) then
+ swap_const_value(tordconstnode(left).value,resultdef.size);
+ end;
left.resultdef:=resultdef;
tordconstnode(left).typedef:=resultdef;
if is_signed(resultdef) then
diff --git a/compiler/nflw.pas b/compiler/nflw.pas
index c76b171fc2..bc6edd8c18 100644
--- a/compiler/nflw.pas
+++ b/compiler/nflw.pas
@@ -457,7 +457,7 @@ implementation
if hp.resultdef.typ<>pointerdef then
internalerror(2010061904);
inserttypeconv(hp,
- carraydef.create_from_pointer(tpointerdef(hp.resultdef).pointeddef));
+ carraydef.create_from_pointer(tpointerdef(hp.resultdef)));
hp:=cvecnode.create(hp,ctemprefnode.create(innerloopcounter));
addstatement(innerloopbodystatement,
cassignmentnode.create(hloopvar,hp));
@@ -1394,7 +1394,7 @@ implementation
not(is_typeparam(left.resultdef)) then
inserttypeconv(left,pasbool8type);
- result:=internalsimplify(true);
+ result:=internalsimplify(not(nf_internal in flags));
end;
@@ -1524,8 +1524,11 @@ implementation
set_varstate(left,vs_written,[]);
{ loop unrolling }
- if cs_opt_loopunroll in current_settings.optimizerswitches then
+ if (cs_opt_loopunroll in current_settings.optimizerswitches) and
+ { statements must be error free }
+ not(nf_error in t2.flags) then
begin
+ typecheckpass(t2);
res:=t2.simplify(false);
if assigned(res) then
t2:=res;
diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas
index 1811029fb1..6b5a4169fd 100644
--- a/compiler/ngenutil.pas
+++ b/compiler/ngenutil.pas
@@ -605,9 +605,14 @@ implementation
StructList: TFPList absolute arg;
begin
if (tdef(p).typ in [objectdef,recorddef]) and
- not (df_generic in tdef(p).defoptions) and
- ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then
- StructList.Add(p);
+ not (df_generic in tdef(p).defoptions) then
+ begin
+ { first add the class... }
+ if ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then
+ StructList.Add(p);
+ { ... and then also add all subclasses }
+ tabstractrecorddef(p).symtable.deflist.foreachcall(@AddToStructInits,arg);
+ end;
end;
@@ -908,7 +913,7 @@ implementation
begin
if (target_res.id in [res_elf,res_macho,res_xcoff]) then
begin
- ResourceInfo:=TAsmList.Create;
+ ResourceInfo:=current_asmdata.asmlists[al_globals];
maybe_new_object_file(ResourceInfo);
new_section(ResourceInfo,sec_data,'FPC_RESLOCATION',sizeof(aint));
@@ -923,9 +928,6 @@ implementation
{$ELSE}
ResourceInfo.Concat(Tai_const.Create_64bit(0));
{$ENDIF}
- maybe_new_object_file(current_asmdata.asmlists[al_globals]);
- current_asmdata.asmlists[al_globals].concatlist(ResourceInfo);
- ResourceInfo.free;
end;
end;
diff --git a/compiler/ngtcon.pas b/compiler/ngtcon.pas
index 2592482d09..a2aabb8619 100644
--- a/compiler/ngtcon.pas
+++ b/compiler/ngtcon.pas
@@ -81,6 +81,7 @@ interface
function parse_single_packed_const(def: tdef; var bp: tbitpackedval): boolean;
protected
list: tasmlist;
+ datalist: tasmlist;
procedure parse_packed_array_def(def: tarraydef);
procedure parse_arraydef(def:tarraydef);override;
@@ -97,7 +98,7 @@ interface
procedure tc_emit_stringdef(def: tstringdef; var node: tnode);override;
public
constructor create(sym: tstaticvarsym);virtual;
- function parse_into_asmlist: tasmlist;
+ procedure parse_into_asmlist(out res, data: tasmlist);
end;
tasmlisttypedconstbuilderclass = class of tasmlisttypedconstbuilder;
@@ -428,6 +429,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
begin
inherited;
list:=tasmlist.create;
+ datalist:=tasmlist.create;
curoffset:=0;
end;
@@ -545,7 +547,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
ll.ofs:=0;
end
else
- ll:=emit_ansistring_const(current_asmdata.asmlists[al_const],strval,strlength,def.encoding);
+ ll:=emit_ansistring_const(datalist,strval,strlength,def.encoding);
list.concat(Tai_const.Create_sym_offset(ll.lab,ll.ofs));
end;
st_unicodestring,
@@ -560,7 +562,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
else
begin
winlike:=(def.stringtype=st_widestring) and (tf_winlikewidestring in target_info.flags);
- ll:=emit_unicodestring_const(current_asmdata.asmlists[al_const],
+ ll:=emit_unicodestring_const(datalist,
strval,
def.encoding,
winlike);
@@ -833,8 +835,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
else
varalign:=0;
varalign:=const_align(varalign);
- new_section(current_asmdata.asmlists[al_const], sec_rodata, ll.name, varalign);
- current_asmdata.asmlists[al_const].concat(Tai_label.Create(ll));
+ new_section(datalist, sec_rodata, ll.name, varalign);
+ datalist.concat(Tai_label.Create(ll));
if node.nodetype=stringconstn then
begin
len:=tstringconstnode(node).len;
@@ -844,11 +846,11 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
len:=255;
getmem(ca,len+2);
move(tstringconstnode(node).value_str^,ca^,len+1);
- current_asmdata.asmlists[al_const].concat(Tai_string.Create_pchar(ca,len+1));
+ datalist.concat(Tai_string.Create_pchar(ca,len+1));
end
else
if is_constcharnode(node) then
- current_asmdata.asmlists[al_const].concat(Tai_string.Create(char(byte(tordconstnode(node).value.svalue))+#0))
+ datalist.concat(Tai_string.Create(char(byte(tordconstnode(node).value.svalue))+#0))
else
IncompatibleTypes(node.resultdef, def);
end
@@ -859,8 +861,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
begin
current_asmdata.getdatalabel(ll);
list.concat(Tai_const.Create_sym(ll));
- current_asmdata.asmlists[al_typedconsts].concat(tai_align.create(const_align(sizeof(pint))));
- current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(ll));
+ new_section(datalist,sec_rodata_norel,ll.name,const_align(sizeof(pint)));
+ datalist.concat(Tai_label.Create(ll));
if (node.nodetype in [stringconstn,ordconstn]) then
begin
{ convert to unicodestring stringconstn }
@@ -870,9 +872,9 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
begin
pw:=pcompilerwidestring(tstringconstnode(node).value_str);
for i:=0 to tstringconstnode(node).len-1 do
- current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_16bit(pw^.data[i]));
+ datalist.concat(Tai_const.Create_16bit(pw^.data[i]));
{ ending #0 }
- current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_16bit(0))
+ datalist.concat(Tai_const.Create_16bit(0))
end;
end
else
@@ -1060,8 +1062,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
(not equal_defs(node.resultdef,def) and
not is_subequal(node.resultdef,def)) then
begin
- node.free;
incompatibletypes(node.resultdef,def);
+ node.free;
consume_all_until(_SEMICOLON);
result:=false;
exit;
@@ -1689,10 +1691,11 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
end;
- function tasmlisttypedconstbuilder.parse_into_asmlist: tasmlist;
+ procedure tasmlisttypedconstbuilder.parse_into_asmlist(out res,data: tasmlist);
begin
read_typed_const_data(tcsym.vardef);
- result:=list;
+ res:=list;
+ data:=datalist;
end;
diff --git a/compiler/ninl.pas b/compiler/ninl.pas
index 1185675d9f..a81bdfe459 100644
--- a/compiler/ninl.pas
+++ b/compiler/ninl.pas
@@ -66,6 +66,7 @@ interface
function first_trunc_real: tnode; virtual;
function first_int_real: tnode; virtual;
function first_abs_long: tnode; virtual;
+ function first_IncDec: tnode; virtual;
function first_IncludeExclude: tnode; virtual;
function first_get_frame: tnode; virtual;
function first_setlength: tnode; virtual;
@@ -2075,7 +2076,7 @@ implementation
in_const_swap_long :
hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resultdef,true);
in_const_swap_qword :
- hp:=cordconstnode.create((vl and $ffff) shl 32+(vl shr 32),left.resultdef,true);
+ hp:=cordconstnode.create((vl and $ffffffff) shl 32+(vl shr 32),left.resultdef,true);
in_const_ptr:
begin
{Don't construct pointers from negative values.}
@@ -3280,11 +3281,8 @@ implementation
function tinlinenode.pass_1 : tnode;
var
- hp,hpp,resultnode : tnode;
+ hp: tnode;
shiftconst: longint;
- tempnode: ttempcreatenode;
- newstatement: tstatementnode;
- newblock: tblocknode;
begin
result:=nil;
@@ -3419,99 +3417,7 @@ implementation
in_inc_x,
in_dec_x:
begin
- expectloc:=LOC_VOID;
-
- { range/overflow checking doesn't work properly }
- { with the inc/dec code that's generated (JM) }
- if ((current_settings.localswitches * [cs_check_overflow,cs_check_range] <> []) and
- { No overflow check for pointer operations, because inc(pointer,-1) will always
- trigger an overflow. For uint32 it works because then the operation is done
- in 64bit. Range checking is not applicable to pointers either }
- (tcallparanode(left).left.resultdef.typ<>pointerdef))
-{$ifdef jvm}
- { enums are class instances on the JVM -> special treatment }
- or (tcallparanode(left).left.resultdef.typ=enumdef)
-{$endif}
- then
- { convert to simple add (JM) }
- begin
- newblock := internalstatements(newstatement);
- { extra parameter? }
- if assigned(tcallparanode(left).right) then
- begin
- { Yes, use for add node }
- hpp := tcallparanode(tcallparanode(left).right).left;
- tcallparanode(tcallparanode(left).right).left := nil;
- if assigned(tcallparanode(tcallparanode(left).right).right) then
- CGMessage(parser_e_illegal_expression);
- end
- else
- begin
- { no, create constant 1 }
- hpp := cordconstnode.create(1,tcallparanode(left).left.resultdef,false);
- end;
- typecheckpass(hpp);
-
- { make sure we don't call functions part of the left node twice (and generally }
- { optimize the code generation) }
- { Storing address is not always an optimization: alignment of left is not known
- at this point, so we must assume the worst and use an unaligned pointer.
- This results in larger and slower code on alignment-sensitive targets.
- Therefore the complexity condition below is questionable, maybe just filtering
- out calls with "= NODE_COMPLEXITY_INF" is sufficient.
- Value of 3 corresponds to subscript nodes, i.e. record field. }
- if node_complexity(tcallparanode(left).left) > 3 then
- begin
- tempnode := ctempcreatenode.create(voidpointertype,voidpointertype.size,tt_persistent,true);
- addstatement(newstatement,tempnode);
- addstatement(newstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
- caddrnode.create_internal(tcallparanode(left).left.getcopy)));
- hp := cderefnode.create(ctemprefnode.create(tempnode));
- inserttypeconv_internal(hp,tcallparanode(left).left.resultdef);
- end
- else
- begin
- hp := tcallparanode(left).left.getcopy;
- tempnode := nil;
- end;
-
- resultnode := hp.getcopy;
- { avoid type errors from the addn/subn }
- if not is_integer(resultnode.resultdef) then
- begin
- inserttypeconv_internal(hp,sinttype);
- inserttypeconv_internal(hpp,sinttype);
- end;
-
- { addition/substraction depending on inc/dec }
- if inlinenumber = in_inc_x then
- hpp := caddnode.create(addn,hp,hpp)
- else
- hpp := caddnode.create(subn,hp,hpp);
- { assign result of addition }
- if not(is_integer(resultnode.resultdef)) then
- inserttypeconv(hpp,corddef.create(
-{$ifdef cpu64bitaddr}
- s64bit,
-{$else cpu64bitaddr}
- s32bit,
-{$endif cpu64bitaddr}
- get_min_value(resultnode.resultdef),
- get_max_value(resultnode.resultdef)))
- else
- inserttypeconv(hpp,resultnode.resultdef);
- { avoid any possible warnings }
- inserttypeconv_internal(hpp,resultnode.resultdef);
-
- addstatement(newstatement,cassignmentnode.create(resultnode,hpp));
- { deallocate the temp }
- if assigned(tempnode) then
- addstatement(newstatement,ctempdeletenode.create(tempnode));
- { firstpass it }
- firstpass(tnode(newblock));
- { return new node }
- result := newblock;
- end;
+ result:=first_IncDec;
end;
in_include_x_y,
@@ -3853,6 +3759,110 @@ implementation
end;
+ function tinlinenode.first_IncDec: tnode;
+ var
+ hp,hpp,resultnode : tnode;
+ tempnode: ttempcreatenode;
+ newstatement: tstatementnode;
+ newblock: tblocknode;
+ begin
+ expectloc:=LOC_VOID;
+ result:=nil;
+
+ { range/overflow checking doesn't work properly }
+ { with the inc/dec code that's generated (JM) }
+ if ((current_settings.localswitches * [cs_check_overflow,cs_check_range] <> []) and
+ { No overflow check for pointer operations, because inc(pointer,-1) will always
+ trigger an overflow. For uint32 it works because then the operation is done
+ in 64bit. Range checking is not applicable to pointers either }
+ (tcallparanode(left).left.resultdef.typ<>pointerdef))
+{$ifdef jvm}
+ { enums are class instances on the JVM -> special treatment }
+ or (tcallparanode(left).left.resultdef.typ=enumdef)
+{$endif}
+ then
+ { convert to simple add (JM) }
+ begin
+ newblock := internalstatements(newstatement);
+ { extra parameter? }
+ if assigned(tcallparanode(left).right) then
+ begin
+ { Yes, use for add node }
+ hpp := tcallparanode(tcallparanode(left).right).left;
+ tcallparanode(tcallparanode(left).right).left := nil;
+ if assigned(tcallparanode(tcallparanode(left).right).right) then
+ CGMessage(parser_e_illegal_expression);
+ end
+ else
+ begin
+ { no, create constant 1 }
+ hpp := cordconstnode.create(1,tcallparanode(left).left.resultdef,false);
+ end;
+ typecheckpass(hpp);
+
+ { make sure we don't call functions part of the left node twice (and generally }
+ { optimize the code generation) }
+ { Storing address is not always an optimization: alignment of left is not known
+ at this point, so we must assume the worst and use an unaligned pointer.
+ This results in larger and slower code on alignment-sensitive targets.
+ Therefore the complexity condition below is questionable, maybe just filtering
+ out calls with "= NODE_COMPLEXITY_INF" is sufficient.
+ Value of 3 corresponds to subscript nodes, i.e. record field. }
+ if node_complexity(tcallparanode(left).left) > 3 then
+ begin
+ tempnode := ctempcreatenode.create(voidpointertype,voidpointertype.size,tt_persistent,true);
+ addstatement(newstatement,tempnode);
+ addstatement(newstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
+ caddrnode.create_internal(tcallparanode(left).left.getcopy)));
+ hp := cderefnode.create(ctemprefnode.create(tempnode));
+ inserttypeconv_internal(hp,tcallparanode(left).left.resultdef);
+ end
+ else
+ begin
+ hp := tcallparanode(left).left.getcopy;
+ tempnode := nil;
+ end;
+
+ resultnode := hp.getcopy;
+ { avoid type errors from the addn/subn }
+ if not is_integer(resultnode.resultdef) then
+ begin
+ inserttypeconv_internal(hp,sinttype);
+ inserttypeconv_internal(hpp,sinttype);
+ end;
+
+ { addition/substraction depending on inc/dec }
+ if inlinenumber = in_inc_x then
+ hpp := caddnode.create(addn,hp,hpp)
+ else
+ hpp := caddnode.create(subn,hp,hpp);
+ { assign result of addition }
+ if not(is_integer(resultnode.resultdef)) then
+ inserttypeconv(hpp,corddef.create(
+{$ifdef cpu64bitaddr}
+ s64bit,
+{$else cpu64bitaddr}
+ s32bit,
+{$endif cpu64bitaddr}
+ get_min_value(resultnode.resultdef),
+ get_max_value(resultnode.resultdef)))
+ else
+ inserttypeconv(hpp,resultnode.resultdef);
+ { avoid any possible warnings }
+ inserttypeconv_internal(hpp,resultnode.resultdef);
+
+ addstatement(newstatement,cassignmentnode.create(resultnode,hpp));
+ { deallocate the temp }
+ if assigned(tempnode) then
+ addstatement(newstatement,ctempdeletenode.create(tempnode));
+ { firstpass it }
+ firstpass(tnode(newblock));
+ { return new node }
+ result := newblock;
+ end;
+ end;
+
+
function tinlinenode.first_IncludeExclude: tnode;
begin
result:=nil;
@@ -4107,6 +4117,7 @@ implementation
{$endif}
result:=cifnode.create(cnotnode.create(tcallparanode(left).left),
ccallnode.createintern('fpc_assert',paras),nil);
+ include(result.flags,nf_internal);
tcallparanode(left).left:=nil;
tcallparanode(left).right:=nil;
end;
diff --git a/compiler/nmat.pas b/compiler/nmat.pas
index 47ab9aaa21..183cbd098d 100644
--- a/compiler/nmat.pas
+++ b/compiler/nmat.pas
@@ -931,26 +931,8 @@ implementation
begin
if not(target_info.system in systems_wince) then
begin
- case tfloatdef(resultdef).floattype of
- s32real:
- begin
- procname:='float32_sub';
- fdef:=search_system_type('FLOAT32REC').typedef;
- end;
- s64real:
- begin
- procname:='float64_sub';
- fdef:=search_system_type('FLOAT64').typedef;
- end;
- {!!! not yet implemented
- s128real:
- }
- else
- internalerror(2005082801);
- end;
- result:=ctypeconvnode.create_internal(ccallnode.createintern(procname,ccallparanode.create(
- ctypeconvnode.create_internal(left,fDef),
- ccallparanode.create(ctypeconvnode.create_internal(crealconstnode.create(0,resultdef),fdef),nil))),resultdef);
+ expectloc:=LOC_REGISTER;
+ exit;
end
else
begin
diff --git a/compiler/nmem.pas b/compiler/nmem.pas
index c2bd94fce0..9e87041519 100644
--- a/compiler/nmem.pas
+++ b/compiler/nmem.pas
@@ -106,6 +106,9 @@ interface
tsubscriptnodeclass = class of tsubscriptnode;
tvecnode = class(tbinarynode)
+ protected
+ function first_arraydef: tnode; virtual;
+ public
constructor create(l,r : tnode);virtual;
function pass_1 : tnode;override;
function pass_typecheck:tnode;override;
@@ -570,7 +573,7 @@ implementation
else
begin
hp:=left;
- while assigned(hp) and (hp.nodetype in [typeconvn,vecn,derefn,subscriptn]) do
+ while assigned(hp) and (hp.nodetype in [typeconvn,derefn,subscriptn]) do
hp:=tunarynode(hp).left;
if not assigned(hp) then
internalerror(200412042);
@@ -833,7 +836,7 @@ implementation
function tvecnode.pass_typecheck:tnode;
var
hightree: tnode;
- htype,elementdef : tdef;
+ htype,elementdef,elementptrdef : tdef;
newordtyp: tordtype;
valid : boolean;
begin
@@ -946,8 +949,10 @@ implementation
else
{Convert indexes into dynamically allocated strings to aword.}
inserttypeconv(right,uinttype);
+ pointerdef:
+ inserttypeconv(right,tpointerdef(left.resultdef).pointer_arithmetic_int_type);
else
- {Others, i.e. pointer indexes to aint.}
+ {Others, (are there any?) indexes to aint.}
inserttypeconv(right,sinttype);
end;
@@ -1014,7 +1019,7 @@ implementation
) then
begin
{ convert pointer to array }
- htype:=carraydef.create_from_pointer(tpointerdef(left.resultdef).pointeddef);
+ htype:=carraydef.create_from_pointer(tpointerdef(left.resultdef));
inserttypeconv(left,htype);
if right.nodetype=rangen then
resultdef:=htype
@@ -1029,19 +1034,23 @@ implementation
case tstringdef(left.resultdef).stringtype of
st_unicodestring,
st_widestring :
- elementdef:=cwidechartype;
- st_ansistring :
- elementdef:=cansichartype;
- st_longstring :
- elementdef:=cansichartype;
+ begin
+ elementdef:=cwidechartype;
+ elementptrdef:=widecharpointertype;
+ end;
+ st_ansistring,
+ st_longstring,
st_shortstring :
- elementdef:=cansichartype;
+ begin
+ elementdef:=cansichartype;
+ elementptrdef:=charpointertype;
+ end;
else
internalerror(2013112902);
end;
if right.nodetype=rangen then
begin
- htype:=carraydef.create_from_pointer(elementdef);
+ htype:=carraydef.create_from_pointer(tpointerdef(elementptrdef));
resultdef:=htype;
end
else
@@ -1100,17 +1109,32 @@ implementation
tcallnode.gen_high_tree }
if (right.nodetype=rangen) then
CGMessagePos(right.fileinfo,parser_e_illegal_expression)
- else if (not is_packed_array(left.resultdef)) or
- ((tarraydef(left.resultdef).elepackedbitsize mod 8) = 0) then
- if left.expectloc=LOC_CREFERENCE then
- expectloc:=LOC_CREFERENCE
- else
- expectloc:=LOC_REFERENCE
+ else if left.resultdef.typ=arraydef then
+ result:=first_arraydef
else
- if left.expectloc=LOC_CREFERENCE then
- expectloc:=LOC_CSUBSETREF
- else
- expectloc:=LOC_SUBSETREF;
+ begin
+ if left.expectloc=LOC_CREFERENCE then
+ expectloc:=LOC_CREFERENCE
+ else
+ expectloc:=LOC_REFERENCE
+ end;
+ end;
+
+
+ function tvecnode.first_arraydef: tnode;
+ begin
+ result:=nil;
+ if (not is_packed_array(left.resultdef)) or
+ ((tarraydef(left.resultdef).elepackedbitsize mod 8) = 0) then
+ if left.expectloc=LOC_CREFERENCE then
+ expectloc:=LOC_CREFERENCE
+ else
+ expectloc:=LOC_REFERENCE
+ else
+ if left.expectloc=LOC_CREFERENCE then
+ expectloc:=LOC_CSUBSETREF
+ else
+ expectloc:=LOC_SUBSETREF;
end;
diff --git a/compiler/nutils.pas b/compiler/nutils.pas
index a802fffdf7..7cfa826a0d 100644
--- a/compiler/nutils.pas
+++ b/compiler/nutils.pas
@@ -1043,6 +1043,41 @@ implementation
function handle_staticfield_access(sym: tsym; nested: boolean; var p1: tnode): boolean;
+
+ function handle_generic_staticfield_access:boolean;
+ var
+ tmp : tstoreddef;
+ pd : tprocdef;
+ begin
+ { in case we have a specialization inside a generic (thus the static var sym does not
+ exist) we simply simulate a non static access to avoid unnecessary errors }
+ if assigned(sym.owner.defowner) and (df_specialization in tstoreddef(sym.owner.defowner).defoptions) then
+ begin
+ tmp:=tstoreddef(sym.owner.defowner);
+ while assigned(tmp) do
+ begin
+ if df_generic in tmp.defoptions then
+ begin
+ p1.free;
+ if assigned(current_procinfo) then
+ begin
+ pd:=current_procinfo.get_normal_proc.procdef;
+ if assigned(pd) and pd.no_self_node then
+ p1:=cloadvmtaddrnode.create(ctypenode.create(pd.struct))
+ else
+ p1:=load_self_node;
+ end
+ else
+ p1:=load_self_node;
+ p1:=csubscriptnode.create(sym,p1);
+ exit(true);
+ end;
+ tmp:=tstoreddef(tmp.owner.defowner);
+ end;
+ end;
+ result:=false;
+ end;
+
var
static_name: shortstring;
srsymtable: tsymtable;
@@ -1052,6 +1087,8 @@ implementation
if (sp_static in sym.symoptions) then
begin
result:=true;
+ if handle_generic_staticfield_access then
+ exit;
if not nested then
static_name:=lower(sym.owner.name^)+'_'+sym.name
else
diff --git a/compiler/ogbase.pas b/compiler/ogbase.pas
index 700b550592..4b1c54da77 100644
--- a/compiler/ogbase.pas
+++ b/compiler/ogbase.pas
@@ -145,7 +145,9 @@ interface
{ Contains only strings }
oso_strings,
{ Must be cloned when writing separate debug file }
- oso_debug_copy
+ oso_debug_copy,
+ { Has relocations with explicit addends (ELF-specific) }
+ oso_rela_relocs
);
TObjSectionOptions = set of TObjSectionOption;
diff --git a/compiler/ogcoff.pas b/compiler/ogcoff.pas
index c4bc96cfc5..e17d776394 100644
--- a/compiler/ogcoff.pas
+++ b/compiler/ogcoff.pas
@@ -1665,6 +1665,13 @@ const pemagic : array[0..3] of byte = (
strname : string;
auxrec : array[0..17] of byte;
objsec : TObjSection;
+
+ { keeps string manipulations out of main routine }
+ procedure UnsupportedSymbolType;
+ begin
+ Comment(V_Fatal,'Unsupported COFF symbol type '+tostr(sym.typ)+' at index '+tostr(symidx)+' while reading '+InputFileName);
+ end;
+
begin
with TCoffObjData(objdata) do
begin
@@ -1738,8 +1745,7 @@ const pemagic : array[0..3] of byte = (
end;
COFF_SYM_SECTION :
begin
- if sym.section=0 then
- InputError('Failed reading coff file, illegal section');
+ { GetSection checks that index is in range }
objsec:=GetSection(sym.section);
if assigned(objsec) then
begin
@@ -1757,7 +1763,7 @@ const pemagic : array[0..3] of byte = (
COFF_SYM_FILE :
;
else
- internalerror(200602232);
+ UnsupportedSymbolType;
end;
FSymTbl^[symidx]:=objsym;
{ read aux records }
diff --git a/compiler/ogelf.pas b/compiler/ogelf.pas
index 8aa5526c39..8a8ee3388a 100644
--- a/compiler/ogelf.pas
+++ b/compiler/ogelf.pas
@@ -1216,7 +1216,7 @@ implementation
shstrtabsect:=TElfObjSection.create_ext(data,'.shstrtab',SHT_STRTAB,0,1,0);
{ "no executable stack" marker }
{ TODO: used by OpenBSD/NetBSD as well? }
- if (target_info.system in (systems_linux + systems_android + systems_freebsd)) and
+ if (target_info.system in (systems_linux + systems_android + systems_freebsd + systems_dragonfly)) and
not(cs_executable_stack in current_settings.moduleswitches) then
TElfObjSection.create_ext(data,'.note.GNU-stack',SHT_PROGBITS,0,1,0);
{ symbol for filename }
@@ -1260,7 +1260,9 @@ implementation
if target_info.system in systems_openbsd then
header.e_ident[EI_OSABI]:=ELFOSABI_OPENBSD
else if target_info.system in systems_freebsd then
- header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD;
+ header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD
+ else if target_info.system in systems_dragonfly then
+ header.e_ident[EI_OSABI]:=ELFOSABI_NONE;
header.e_type:=ET_REL;
header.e_machine:=ElfTarget.machine_code;
header.e_version:=1;
@@ -1334,6 +1336,8 @@ implementation
FReader.Seek(secrec.relocpos);
if secrec.sec=nil then
InternalError(2012060203);
+ if (secrec.relentsize=3*sizeof(pint)) then
+ with secrec.sec do SecOptions:=SecOptions+[oso_rela_relocs];
for i:=0 to secrec.relocs-1 do
begin
FReader.Read(rel,secrec.relentsize);
@@ -2023,7 +2027,9 @@ implementation
if target_info.system in systems_openbsd then
header.e_ident[EI_OSABI]:=ELFOSABI_OPENBSD
else if target_info.system in systems_freebsd then
- header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD;
+ header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD
+ else if target_info.system in systems_dragonfly then
+ header.e_ident[EI_OSABI]:=ELFOSABI_NONE;
if IsSharedLibrary then
header.e_type:=ET_DYN
else
diff --git a/compiler/optdfa.pas b/compiler/optdfa.pas
index 5f65379fb9..1ae6fcb2bc 100644
--- a/compiler/optdfa.pas
+++ b/compiler/optdfa.pas
@@ -59,7 +59,7 @@ unit optdfa;
symconst,symdef,symsym,
defutil,
procinfo,
- nutils,
+ nutils,htypechk,
nbas,nflw,ncon,ninl,ncal,nset,nld,nadd,
optbase;
@@ -700,7 +700,10 @@ unit optdfa;
begin
{ issue only a hint for var, when encountering the node passed as out, we need only to stop searching }
if tcallparanode(n).parasym.varspez=vs_var then
- MessagePos1(hpt.fileinfo,sym_h_uninitialized_local_variable,tloadnode(hpt).symtableentry.RealName);
+ UninitializedVariableMessage(hpt.fileinfo,false,
+ tloadnode(hpt).symtable.symtabletype=localsymtable,
+ is_managed_type(tloadnode(hpt).resultdef),
+ tloadnode(hpt).symtableentry.RealName);
AddFilepos(hpt.fileinfo);
result:=fen_norecurse_true;
end
@@ -778,7 +781,10 @@ unit optdfa;
begin
if (vo_is_funcret in varsym.varoptions) and not(WarnedForLocation(n.fileinfo)) then
begin
- MessagePos(n.fileinfo,sym_w_function_result_uninitialized);
+ if is_managed_type(varsym.vardef) then
+ MessagePos(n.fileinfo,sym_w_managed_function_result_uninitialized)
+ else
+ MessagePos(n.fileinfo,sym_w_function_result_uninitialized);
AddFilepos(n.fileinfo);
result:=fen_norecurse_true;
end
@@ -787,10 +793,7 @@ unit optdfa;
{ typed consts are initialized, further, warn only once per location }
if not (vo_is_typed_const in varsym.varoptions) and not(WarnedForLocation(n.fileinfo)) then
begin
- if varsym.typ=paravarsym then
- MessagePos1(n.fileinfo,sym_w_uninitialized_variable,varsym.realname)
- else
- MessagePos1(n.fileinfo,sym_w_uninitialized_local_variable,varsym.realname);
+ UninitializedVariableMessage(n.fileinfo,true,varsym.typ=localvarsym,is_managed_type(varsym.vardef),varsym.realname);
AddFilepos(n.fileinfo);
result:=fen_norecurse_true;
end;
@@ -905,7 +908,10 @@ unit optdfa;
{ don't warn about constructors }
not(current_procinfo.procdef.proctypeoption in [potype_class_constructor,potype_constructor]) then
begin
- MessagePos(node.fileinfo,sym_w_function_result_uninitialized);
+ if is_managed_type(current_procinfo.procdef.returndef) then
+ MessagePos(node.fileinfo,sym_w_managed_function_result_uninitialized)
+ else
+ MessagePos(node.fileinfo,sym_w_function_result_uninitialized);
Setlength(SearchNodeInfo.warnedfilelocs,length(SearchNodeInfo.warnedfilelocs)+1);
SearchNodeInfo.warnedfilelocs[high(SearchNodeInfo.warnedfilelocs)]:=node.fileinfo;
diff --git a/compiler/options.pas b/compiler/options.pas
index 6d687fdd55..0078199e7c 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -42,7 +42,7 @@ Type
FileLevel : longint;
QuickInfo : string;
FPCBinaryPath: string;
- ParaIncludeCfgPath,
+ ParaIncludeCfgPath,
ParaIncludePath,
ParaUnitPath,
ParaObjectPath,
@@ -52,7 +52,7 @@ Type
Constructor Create;
Destructor Destroy;override;
procedure WriteLogo;
- procedure WriteInfo;
+ procedure WriteInfo (More: string);
procedure WriteHelpPages;
procedure WriteQuickInfo;
procedure IllegalPara(const opt:TCmdStr);
@@ -112,7 +112,7 @@ var
const
{ gprof (requires implementation of g_profilecode in the code generator) }
- supported_targets_pg = [system_i386_linux,system_x86_64_linux,system_mipseb_linux,system_mipsel_linux]
+ supported_targets_pg = [system_i386_linux,system_x86_64_linux,system_mipseb_linux,system_mipsel_linux,system_arm_linux]
+ [system_i386_win32]
+ [system_powerpc_darwin,system_x86_64_darwin]
+ [system_i386_GO32V2]
@@ -136,6 +136,9 @@ begin
undef_system_macro('FPC_LINK_DYNAMIC');
init_settings.globalswitches:=init_settings.globalswitches+[cs_link_static];
init_settings.globalswitches:=init_settings.globalswitches-[cs_link_shared,cs_link_smart];
+{$ifdef AIX}
+ init_settings.globalswitches:=init_settings.globalswitches+[cs_link_native];
+{$endif}
end;
@@ -182,185 +185,403 @@ begin
end;
-procedure Toption.WriteInfo;
+procedure Toption.WriteInfo (More: string);
var
p : pchar;
- hs,hs1,s : TCmdStr;
- target : tsystem;
- cpu : tcputype;
- fpu : tfputype;
- opt : toptimizerswitch;
- wpopt: twpoptimizerswitch;
- abi : tabi;
- asmmode : tasmmode;
-{$if defined(arm) or defined(avr) or defined(mipsel)}
- controllertype : tcontrollertype;
-{$endif defined(arm) or defined(avr) or defined(mipsel)}
-begin
- p:=MessagePchar(option_info);
- while assigned(p) do
- begin
- s:=GetMsgLine(p);
- { list OS Targets }
- if pos('$OSTARGETS',s)>0 then
- begin
- for target:=low(tsystem) to high(tsystem) do
- if assigned(targetinfos[target]) then
- begin
- hs:=s;
- hs1:=targetinfos[target]^.name;
- if tf_under_development in targetinfos[target]^.flags then
- hs1:=hs1+' (under development)';
- Replace(hs,'$OSTARGETS',hs1);
- Comment(V_Normal,hs);
- end;
- end
- else if pos('$INSTRUCTIONSETS',s)>0 then
- begin
- hs1:='';
- for cpu:=low(tcputype) to high(tcputype) do
- begin
- if length(hs1+cputypestr[cpu])>70 then
- begin
- hs:=s;
- Replace(hs,'$INSTRUCTIONSETS',hs1);
- Comment(V_Normal,hs);
- hs1:=''
- end
- else
- if hs1<>'' then
- hs1:=hs1+',';
- if cputypestr[cpu]<>'' then
- hs1:=hs1+cputypestr[cpu];
- end;
- if hs1<>'' then
- begin
- hs:=s;
- Replace(hs,'$INSTRUCTIONSETS',hs1);
- Comment(V_Normal,hs);
- hs1:=''
- end;
- end
- else if pos('$FPUINSTRUCTIONSETS',s)>0 then
+ hs,hs1,hs3,s : TCmdStr;
+ J: longint;
+const
+ NewLineStr = '$\n';
+ OSTargetsPlaceholder = '$OSTARGETS';
+ CPUListPlaceholder = '$INSTRUCTIONSETS';
+ FPUListPlaceholder = '$FPUINSTRUCTIONSETS';
+ ABIListPlaceholder = '$ABITARGETS';
+ OptListPlaceholder = '$OPTIMIZATIONS';
+ WPOListPlaceholder = '$WPOPTIMIZATIONS';
+ AsmModeListPlaceholder = '$ASMMODES';
+ ControllerListPlaceholder = '$CONTROLLERTYPES';
+ FeatureListPlaceholder = '$FEATURELIST';
+
+ procedure SplitLine (var OrigString: TCmdStr; const Placeholder: TCmdStr;
+ var RemainderString: TCmdStr);
+ var
+ I, L: longint;
+ HS2: TCmdStr;
+ begin
+ RemainderString := '';
+ if OrigString = '' then
+ Exit;
+ repeat
+ I := Pos (NewLineStr, OrigString);
+ if I > 0 then
begin
- hs1:='';
- for fpu:=low(tfputype) to high(tfputype) do
- begin
- if length(hs1+fputypestr[fpu])>70 then
- begin
- hs:=s;
- Replace(hs,'$FPUINSTRUCTIONSETS',hs1);
- Comment(V_Normal,hs);
- hs1:=''
- end
- else
- if hs1<>'' then
- hs1:=hs1+',';
- if fputypestr[fpu]<>'' then
- hs1:=hs1+fputypestr[fpu];
- end;
+ HS2 := Copy (OrigString, 1, Pred (I));
+{ Stop if this line contains the placeholder for list replacement }
+ if Pos (Placeholder, HS2) > 0 then
+ begin
+ RemainderString := Copy (OrigString, I + Length (NewLineStr),
+ Length (OrigString) - I - Length (NewLineStr));
+{ Special case - NewLineStr at the end of the line }
+ if RemainderString = '' then
+ RemainderString := NewLineStr;
+ OrigString := HS2;
+ Exit;
+ end;
+ Comment (V_Normal, HS2);
+ Delete (OrigString, 1, Pred (I) + Length (NewLineStr));
+ end;
+ until I = 0;
+ if (OrigString <> '') and (Pos (Placeholder, OrigString) = 0) then
+ Comment (V_Normal, OrigString);
+ end;
+
+ procedure ListOSTargets (OrigString: TCmdStr);
+ var
+ target : tsystem;
+ begin
+ SplitLine (OrigString, OSTargetsPlaceholder, HS3);
+ for target:=low(tsystem) to high(tsystem) do
+ if assigned(targetinfos[target]) then
+ begin
+ hs1:=targetinfos[target]^.shortname;
+ if OrigString = '' then
+ WriteLn (hs1)
+ else
+ begin
+ hs := OrigString;
+ hs1:=hs1 + ': ' + targetinfos[target]^.name;
+ if tf_under_development in targetinfos[target]^.flags then
+ hs1:=hs1+' {*}';
+ Replace(hs,OSTargetsPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ end;
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, OSTargetsPlaceholder, HS3);
+ end;
+
+ procedure ListCPUInstructionSets (OrigString: TCmdStr);
+ var
+ cpu : tcputype;
+ begin
+ SplitLine (OrigString, CPUListPlaceholder, HS3);
+ hs1:='';
+ for cpu:=low(tcputype) to high(tcputype) do
+ begin
+ if (OrigString = '') then
+ begin
+ if CPUTypeStr [CPU] <> '' then
+ WriteLn (CPUTypeStr [CPU]);
+ end
+ else
+ begin
+ if length(hs1+cputypestr[cpu])>70 then
+ begin
+ hs:=OrigString;
+ Replace(hs,CPUListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ hs1:=''
+ end
+ else if hs1<>'' then
+ hs1:=hs1+',';
+ if cputypestr[cpu]<>'' then
+ hs1:=hs1+cputypestr[cpu];
+ end;
+ end;
+ if (OrigString <> '') and (hs1 <> '') then
+ begin
+ hs:=OrigString;
+ Replace(hs,CPUListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ hs1:=''
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, CPUListPlaceholder, HS3);
+ end;
+
+ procedure ListFPUInstructionSets (OrigString: TCmdStr);
+ var
+ fpu : tfputype;
+ begin
+ SplitLine (OrigString, FPUListPlaceholder, HS3);
+ hs1:='';
+ for fpu:=low(tfputype) to high(tfputype) do
+ begin
+ if (OrigString = '') then
+ begin
+ if FPUTypeStr [FPU] <> '' then
+ WriteLn (FPUTypeStr [FPU]);
+ end
+ else
+ begin
+ if length(hs1+fputypestr[fpu])>70 then
+ begin
+ hs:=OrigString;
+ Replace(hs,FPUListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ hs1:=''
+ end
+ else if hs1<>'' then
+ hs1:=hs1+',';
+ if fputypestr[fpu]<>'' then
+ hs1:=hs1+fputypestr[fpu];
+ end;
+ end;
+ if (OrigString <> '') and (hs1 <> '') then
+ begin
+ hs:=OrigString;
+ Replace(hs,FPUListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ hs1:=''
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, FPUListPlaceholder, HS3);
+ end;
+
+ procedure ListABITargets (OrigString: TCmdStr);
+ var
+ abi : tabi;
+ begin
+ SplitLine (OrigString, ABIListPlaceholder, HS3);
+ for abi:=low(abi) to high(abi) do
+ begin
+ if not abiinfo[abi].supported then
+ continue;
+ hs1:=abiinfo[abi].name;
+ if hs1<>'' then
+ begin
+ if OrigString = '' then
+ WriteLn (HS1)
+ else
+ begin
+ hs:=OrigString;
+ Replace(hs,ABIListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ end;
+ end;
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, ABIListPlaceholder, HS3);
+ end;
+
+ procedure ListOptimizations (OrigString: TCmdStr);
+ var
+ opt : toptimizerswitch;
+ begin
+ SplitLine (OrigString, OptListPlaceholder, HS3);
+ for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
+ begin
+ if opt in supported_optimizerswitches then
+ begin
+ hs1:=OptimizerSwitchStr[opt];
if hs1<>'' then
- begin
- hs:=s;
- Replace(hs,'$FPUINSTRUCTIONSETS',hs1);
+ begin
+ if OrigString = '' then
+ WriteLn (hs1)
+ else
+ begin
+ hs:=OrigString;
+ Replace(hs,OptListPlaceholder,hs1);
Comment(V_Normal,hs);
- hs1:=''
- end;
- end
- else if pos('$ABITARGETS',s)>0 then
- begin
- for abi:=low(abi) to high(abi) do
- begin
- if not abiinfo[abi].supported then
- continue;
- hs:=s;
- hs1:=abiinfo[abi].name;
- if hs1<>'' then
- begin
- Replace(hs,'$ABITARGETS',hs1);
- Comment(V_Normal,hs);
- end;
- end;
- end
- else if pos('$OPTIMIZATIONS',s)>0 then
- begin
- for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
- begin
- if opt in supported_optimizerswitches then
- begin
- hs:=s;
- hs1:=OptimizerSwitchStr[opt];
- if hs1<>'' then
- begin
- Replace(hs,'$OPTIMIZATIONS',hs1);
- Comment(V_Normal,hs);
- end;
- end;
- end;
- end
- else if pos('$WPOPTIMIZATIONS',s)>0 then
- begin
- for wpopt:=low(twpoptimizerswitch) to high(twpoptimizerswitch) do
- begin
-{ currently all whole program optimizations are platform-independent
- if opt in supported_wpoptimizerswitches then
+ end;
+ end;
+ end;
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, OptListPlaceholder, HS3);
+ end;
+
+ procedure ListWPOptimizations (OrigString: TCmdStr);
+ var
+ wpopt: twpoptimizerswitch;
+ begin
+ SplitLine (OrigString, WPOListPlaceholder, HS3);
+ for wpopt:=low(twpoptimizerswitch) to high(twpoptimizerswitch) do
+ begin
+{ currently all whole program optimizations are platform-independent
+ if opt in supported_wpoptimizerswitches then
}
- begin
- hs:=s;
- hs1:=WPOptimizerSwitchStr[wpopt];
- if hs1<>'' then
- begin
- Replace(hs,'$WPOPTIMIZATIONS',hs1);
- Comment(V_Normal,hs);
- end;
- end;
- end
- end
- else if pos('$ASMMODES',s)>0 then
- begin
- for asmmode:=low(tasmmode) to high(tasmmode) do
- if assigned(asmmodeinfos[asmmode]) then
+ begin
+ hs1:=WPOptimizerSwitchStr[wpopt];
+ if hs1<>'' then
+ begin
+ if OrigString = '' then
+ WriteLn (hs1)
+ else
begin
- hs:=s;
- hs1:=asmmodeinfos[asmmode]^.idtxt;
- if hs1<>'' then
- begin
- Replace(hs,'$ASMMODES',hs1);
- Comment(V_Normal,hs);
- end;
+ hs:=OrigString;
+ Replace(hs,WPOListPlaceholder,hs1);
+ Comment(V_Normal,hs);
end;
- end
- else if pos('$CONTROLLERTYPES',s)>0 then
- begin
- {$if defined(arm) or defined(avr) or defined(mipsel)}
- hs1:='';
- for controllertype:=low(tcontrollertype) to high(tcontrollertype) do
- begin
- if length(hs1+embedded_controllers[controllertype].ControllerTypeStr)>70 then
- begin
- hs:=s;
- Replace(hs,'$CONTROLLERTYPES',hs1);
- Comment(V_Normal,hs);
- hs1:=''
- end
- else
- if hs1<>'' then
- hs1:=hs1+',';
- if embedded_controllers[controllertype].ControllerTypeStr<>'' then
- hs1:=hs1+embedded_controllers[controllertype].ControllerTypeStr;
- end;
- if hs1<>'' then
- begin
- hs:=s;
- Replace(hs,'$CONTROLLERTYPES',hs1);
+ end;
+ end;
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, WPOListPlaceholder, HS3);
+ end;
+
+ procedure ListAsmModes (OrigString: TCmdStr);
+ var
+ asmmode : tasmmode;
+ begin
+ SplitLine (OrigString, AsmModeListPlaceholder, HS3);
+ for asmmode:=low(tasmmode) to high(tasmmode) do
+ if assigned(asmmodeinfos[asmmode]) then
+ begin
+ hs1:=asmmodeinfos[asmmode]^.idtxt;
+ if hs1<>'' then
+ begin
+ if OrigString = '' then
+ WriteLn (hs1)
+ else
+ begin
+ hs:=OrigString;
+ Replace(hs,AsmModeListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ end;
+ end;
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, AsmModeListPlaceholder, HS3);
+ end;
+
+ procedure ListControllerTypes (OrigString: TCmdStr);
+ var
+ controllertype : tcontrollertype;
+ begin
+{$PUSH}
+ {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
+ if (ControllerSupport) then
+ begin
+ SplitLine (OrigString, ControllerListPlaceholder, HS3);
+ hs1:='';
+ for controllertype:=low(tcontrollertype) to high(tcontrollertype) do
+ begin
+ if (OrigString = '') then
+ begin
+ if Embedded_Controllers [ControllerType].ControllerTypeStr <> '' then
+ WriteLn (Embedded_Controllers [ControllerType].ControllerTypeStr);
+ end
+ else
+ begin
+ if length(hs1+embedded_controllers[controllertype].ControllerTypeStr)
+ >70 then
+ begin
+ hs:=OrigString;
+ Replace(hs,ControllerListPlaceholder,hs1);
Comment(V_Normal,hs);
hs1:=''
- end;
- {$else defined(arm) or defined(avr) or defined(mipsel)}
- {$endif defined(arm) or defined(avr) or defined(mipsel)}
- end
- else
- Comment(V_Normal,s);
+ end
+ else if hs1<>'' then
+ hs1:=hs1+',';
+ if embedded_controllers[controllertype].ControllerTypeStr<>'' then
+ hs1:=hs1+embedded_controllers[controllertype].ControllerTypeStr;
+ end;
+ end;
+ if (OrigString <> '') and (hs1<>'') then
+ begin
+ hs:=OrigString;
+ Replace(hs,ControllerListPlaceholder,hs1);
+ Comment(V_Normal,hs);
+ hs1:=''
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, ControllerListPlaceholder, HS3);
+ end;
+{$POP}
+ end;
+
+ procedure ListFeatures (OrigString: TCmdStr);
+ var
+ Feature: TFeature;
+ begin
+ SplitLine (OrigString, FeatureListPlaceholder, HS3);
+ HS1 := '';
+ for Feature := Low (TFeature) to High (TFeature) do
+ begin
+ if (OrigString = '') then
+ begin
+ if FeatureStr [Feature] <> '' then
+ WriteLn (FeatureStr [Feature]);
+ end
+ else
+ begin
+ if Length (HS1 + FeatureStr [Feature]) > 70 then
+ begin
+ HS := OrigString;
+ Replace (HS, FeatureListPlaceholder, HS1);
+ Comment (V_Normal, HS);
+ HS1 := ''
+ end
+ else if HS1 <> '' then
+ HS1 := HS1 + ',';
+ if FeatureStr [Feature] <> '' then
+ HS1 := HS1 + FeatureStr [Feature];
+ end;
+ end;
+ if (OrigString <> '') and (HS1 <> '') then
+ begin
+ HS := OrigString;
+ Replace (HS, FeatureListPlaceholder, HS1);
+ Comment (V_Normal, HS);
+ HS1 := ''
+ end;
+ OrigString := HS3;
+ SplitLine (OrigString, FeatureListPlaceholder, HS3);
+ end;
+
+begin
+ if More = '' then
+ begin
+ p:=MessagePchar(option_info);
+ while assigned(p) do
+ begin
+ s:=GetMsgLine(p);
+ { list permitted values for certain options }
+ if pos(OSTargetsPlaceholder,s)>0 then
+ ListOSTargets (S)
+ else if pos(CPUListPlaceholder,s)>0 then
+ ListCPUInstructionSets (S)
+ else if pos(FPUListPlaceholder,s)>0 then
+ ListFPUInstructionSets (S)
+ else if pos(ABIListPlaceholder,s)>0 then
+ ListABITargets (S)
+ else if pos(OptListPlaceholder,s)>0 then
+ ListOptimizations (S)
+ else if pos(WPOListPlaceholder,s)>0 then
+ ListWPOptimizations (S)
+ else if pos(AsmModeListPlaceholder,s)>0 then
+ ListAsmModes (S)
+ else if pos(ControllerListPlaceholder,s)>0 then
+ ListControllerTypes (S)
+ else if pos(FeatureListPlaceholder,s)>0 then
+ ListFeatures (S)
+ else
+ Comment(V_Normal,s);
+ end;
+ end
+ else
+ begin
+ J := 1;
+ while J <= Length (More) do
+ begin
+ if J > 1 then
+ WriteLn; (* Put empty line between multiple sections *)
+ case More [J] of
+ 'a': ListABITargets ('');
+ 'c': ListCPUInstructionSets ('');
+ 'f': ListFPUInstructionSets ('');
+ 'i': ListAsmModes ('');
+ 'o': ListOptimizations ('');
+ 'r': ListFeatures ('');
+ 't': ListOSTargets ('');
+ 'u': ListControllerTypes ('');
+ 'w': ListWPOptimizations ('');
+ else
+ IllegalPara ('-i' + More);
+ end;
+ Inc (J);
+ end;
end;
StopOptions(0);
end;
@@ -428,6 +649,12 @@ begin
{$ifdef arm}
'A',
{$endif}
+{$ifdef mipsel}
+ 'm',
+{$endif}
+{$ifdef mipseb}
+ 'M',
+{$endif}
{$ifdef powerpc}
'P',
{$endif}
@@ -746,6 +973,7 @@ begin
(
((length(opt)>1) and (opt[2] in ['i','d','v','T','u','n','X','l'])) or
((length(opt)>3) and (opt[2]='F') and (opt[3]='e')) or
+ ((length(opt)>3) and (opt[2]='C') and (opt[3]='p')) or
((length(opt)>3) and (opt[2]='W') and (opt[3]='m'))
)
) then
@@ -970,24 +1198,46 @@ begin
'P':
begin
delete(more,1,1);
- if upper(copy(more,1,pos('=',more)-1))='PACKSET' then
- begin
- delete(more,1,pos('=',more));
- if (more='0') or (more='DEFAULT') or (more='NORMAL') then
- init_settings.setalloc:=0
- else if more='1' then
- init_settings.setalloc:=1
- else if more='2' then
- init_settings.setalloc:=2
- else if more='4' then
- init_settings.setalloc:=4
- else if more='8' then
- init_settings.setalloc:=8
- else
- IllegalPara(opt);
- end
- else
- IllegalPara(opt);
+ case upper(copy(more,1,pos('=',more)-1)) of
+ 'PACKSET':
+ begin
+ delete(more,1,pos('=',more));
+ case more of
+ '0','DEFAULT','NORMAL':
+ init_settings.setalloc:=0;
+ '1','2','4','8':
+ init_settings.setalloc:=StrToInt(more);
+ else
+ IllegalPara(opt);
+ end
+ end;
+ 'PACKENUM':
+ begin
+ delete(more,1,pos('=',more));
+ case more of
+ '0','DEFAULT','NORMAL':
+ init_settings.packenum:=4;
+ '1','2','4':
+ init_settings.packenum:=StrToInt(more);
+ else
+ IllegalPara(opt);
+ end;
+ end;
+ 'PACKRECORD':
+ begin
+ delete(more,1,pos('=',more));
+ case more of
+ '0','DEFAULT','NORMAL':
+ init_settings.packrecords:=default_settings.packrecords;
+ '1','2','4','8','16','32':
+ init_settings.packrecords:=StrToInt(more);
+ else
+ IllegalPara(opt);
+ end;
+ end
+ else
+ IllegalPara(opt);
+ end;
end;
'r' :
If UnsetBool(More, j, opt, false) then
@@ -1389,8 +1639,9 @@ begin
'i' :
begin
- if More='' then
- WriteInfo
+ if (More='') or
+ (More [1] in ['a', 'c', 'f', 'i', 'o', 'r', 't', 'u', 'w']) then
+ WriteInfo (More)
else
QuickInfo:=QuickInfo+More;
end;
@@ -1414,8 +1665,10 @@ begin
'l' :
ParaLogo:=not UnSetBool(more,0,opt,true);
+{$ifdef PREPROCWRITE}
'm' :
parapreprocess:=not UnSetBool(more,0,opt,true);
+{$endif PREPROCWRITE}
'M' :
begin
@@ -1963,8 +2216,8 @@ begin
end;
'p':
begin
-{$if defined(arm) or defined(avr) or defined(mipsel)}
- if (target_info.system in systems_embedded) then
+ if (target_info.system in systems_embedded) and
+ ControllerSupport then
begin
s:=upper(copy(more,j+1,length(more)-j));
if not(SetControllerType(s,init_settings.controllertype)) then
@@ -1972,7 +2225,6 @@ begin
break;
end
else
-{$endif defined(arm) or defined(avr) or defined(mipsel)}
IllegalPara(opt);
end;
'P':
@@ -2684,11 +2936,11 @@ begin
undef_system_macro('FPC_SECTION_THREADVARS');
{ Code generation flags }
- if def and
- (tf_pic_default in target_info.flags) then
- include(init_settings.moduleswitches,cs_create_pic)
- else
- exclude(init_settings.moduleswitches,cs_create_pic);
+ if (tf_pic_default in target_info.flags) then
+ if def then
+ include(init_settings.moduleswitches,cs_create_pic)
+ else
+ exclude(init_settings.moduleswitches,cs_create_pic);
{ Resources support }
if (tf_has_winlike_resources in target_info.flags) then
@@ -3493,6 +3745,16 @@ if (target_info.abi = abi_eabihf) then
if not option.FPUSetExplicitly then
init_settings.fputype:=fpu_mips2;
end;
+ system_mipsel_embedded:
+ begin
+ { set default cpu type to PIC32MX and softfloat for MIPSEL-EMBEDDED target unless specified otherwise }
+ if not option.CPUSetExplicitly then
+ init_settings.cputype:=cpu_pic32mx;
+ if not option.OptCPUSetExplicitly then
+ init_settings.optimizecputype:=cpu_pic32mx;
+ if not option.FPUSetExplicitly then
+ init_settings.fputype:=fpu_soft;
+ end;
end;
{$endif mipsel}
diff --git a/compiler/optloop.pas b/compiler/optloop.pas
index 9a8ea5acaf..2f312aed24 100644
--- a/compiler/optloop.pas
+++ b/compiler/optloop.pas
@@ -81,10 +81,7 @@ unit optloop;
function replaceloadnodes(var n: tnode; arg: pointer): foreachnoderesult;
begin
- if ((n.nodetype=loadn) and (preplaceinfo(arg)^.node.nodetype=loadn) and
- (tloadnode(n).symtableentry=tloadnode(preplaceinfo(arg)^.node).symtableentry)) or
- ((n.nodetype=temprefn) and (preplaceinfo(arg)^.node.nodetype=temprefn) and
- (ttemprefnode(n).tempinfo=ttemprefnode(preplaceinfo(arg)^.node).tempinfo)) then
+ if n.isequal(preplaceinfo(arg)^.node) then
begin
if n.flags*[nf_modify,nf_write,nf_address_taken]<>[] then
internalerror(2012090402);
@@ -135,12 +132,12 @@ unit optloop;
unrollblock:=internalstatements(unrollstatement);
{ can we get rid completly of the for ? }
- getridoffor:=(unrolls=counts) and not(usesbreakcontinue);
+ getridoffor:=(unrolls=counts) and not(usesbreakcontinue) and
+ { TP/Macpas allows assignments to the for-variables, so we cannot get rid of the for }
+ ([m_tp7,m_mac]*current_settings.modeswitches=[]);
if getridoffor then
begin
- if not(tfornode(node).left.nodetype in [temprefn,loadn]) then
- internalerror(2012090301);
replaceinfo.node:=tfornode(node).left;
replaceinfo.value:=tordconstnode(tfornode(node).right).value;
end;
diff --git a/compiler/paramgr.pas b/compiler/paramgr.pas
index 199231ce6b..bb634564a6 100644
--- a/compiler/paramgr.pas
+++ b/compiler/paramgr.pas
@@ -179,15 +179,14 @@ implementation
{ true if uses a parameter as return value }
function tparamanager.ret_in_param(def:tdef;pd:tabstractprocdef):boolean;
begin
+ { This handles all managed types, including COM interfaces and Variants }
if handle_common_ret_in_param(def,pd,result) then
exit;
ret_in_param:=(def.typ=arraydef) or
(def.typ=recorddef) or
(def.typ=stringdef) or
((def.typ=procvardef) and not tprocvardef(def).is_addressonly) or
- { interfaces are also passed by reference to be compatible with delphi and COM }
- ((def.typ=objectdef) and (is_object(def) or is_interface(def) or is_dispinterface(def))) or
- (def.typ=variantdef) or
+ ((def.typ=objectdef) and (is_object(def))) or
((def.typ=setdef) and not is_smallset(def));
end;
@@ -420,7 +419,12 @@ implementation
newparaloc^.loc:=paraloc^.loc;
case newparaloc^.loc of
LOC_REGISTER :
- newparaloc^.register:=cg.getintregister(list,paraloc^.size);
+ begin
+ if (vo_has_explicit_paraloc in parasym.varoptions) and (paraloc^.loc = LOC_REGISTER) then
+ newparaloc^.register:=paraloc^.register
+ else
+ newparaloc^.register:=cg.getintregister(list,paraloc^.size);
+ end;
LOC_FPUREGISTER :
newparaloc^.register:=cg.getfpuregister(list,paraloc^.size);
LOC_MMREGISTER :
diff --git a/compiler/parser.pas b/compiler/parser.pas
index 15f262e783..ffad2f1291 100644
--- a/compiler/parser.pas
+++ b/compiler/parser.pas
@@ -122,6 +122,8 @@ implementation
include(supported_calling_conventions,pocall_syscall);
system_m68k_amiga:
include(supported_calling_conventions,pocall_syscall);
+ system_i386_aros:
+ include(supported_calling_conventions,pocall_syscall);
{$ifdef i8086}
system_i8086_msdos:
begin
diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas
index 737336fecf..3153281815 100644
--- a/compiler/pdecl.pas
+++ b/compiler/pdecl.pas
@@ -937,7 +937,7 @@ implementation
read_var_decls([vd_threadvar])
else
begin
- Message(parser_f_unsupported_feature);
+ Message1(parser_f_unsupported_feature,featurestr[f_threading]);
read_var_decls([]);
end;
end;
diff --git a/compiler/pdecobj.pas b/compiler/pdecobj.pas
index 3e8c21cffb..0f7c7d4f71 100644
--- a/compiler/pdecobj.pas
+++ b/compiler/pdecobj.pas
@@ -1216,7 +1216,10 @@ implementation
begin
if is_interface(current_structdef) or
is_objc_protocol_or_category(current_structdef) or
- is_objectpascal_helper(current_structdef) or
+ (
+ is_objectpascal_helper(current_structdef) and
+ not class_fields
+ ) or
(is_javainterface(current_structdef) and
not(class_fields and final_fields)) then
Message(parser_e_no_vars_in_interfaces);
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas
index e57308c7d0..a03c3c15f1 100644
--- a/compiler/pdecsub.pas
+++ b/compiler/pdecsub.pas
@@ -548,6 +548,8 @@ implementation
orgsp,sp : TIDString;
srsym : tsym;
checkstack : psymtablestackitem;
+ oldfilepos,
+ classstartfilepos,
procstartfilepos : tfileposinfo;
i,
index : longint;
@@ -822,9 +824,16 @@ implementation
try_to_consume(_POINT) then
begin
repeat
+ classstartfilepos:=procstartfilepos;
searchagain:=false;
+
+ { throw the error at the right location }
+ oldfilepos:=current_filepos;
+ current_filepos:=procstartfilepos;
if not assigned(astruct) and not assigned(srsym) then
srsym:=search_object_name(sp,true);
+ current_filepos:=oldfilepos;
+
{ consume proc name }
procstartfilepos:=current_tokenpos;
consume_proc_name;
@@ -837,7 +846,7 @@ implementation
if (potype in [potype_class_constructor,potype_class_destructor]) then
sp:=lower(sp)
else
- if (potype=potype_operator)and(optoken=NOTOKEN) then
+ if (potype=potype_operator) and (optoken=NOTOKEN) then
parse_operator_name;
srsym:=tsym(astruct.symtable.Find(sp));
if assigned(srsym) then
@@ -865,13 +874,13 @@ implementation
end
else
begin
- Message(parser_e_methode_id_expected);
+ MessagePos(procstartfilepos,parser_e_methode_id_expected);
{ recover by making it a normal procedure instead of method }
astruct:=nil;
end;
end
else
- Message(parser_e_class_id_expected);
+ MessagePos(classstartfilepos,parser_e_class_id_expected);
until not searchagain;
end
else
@@ -1125,7 +1134,7 @@ implementation
end;
single_type(pd.returndef,[stoAllowSpecialization]);
-// Issue #24863, commented out for now because it breaks building of RTL and needs extensive
+ // Issue #24863, enabled only for the main progra commented out for now because it breaks building of RTL and needs extensive
// testing and/or RTL patching.
{
if ((pd.returndef=cvarianttype) or (pd.returndef=colevarianttype)) and
@@ -1792,13 +1801,13 @@ end;
procedure pd_syscall(pd:tabstractprocdef);
-{$if defined(powerpc) or defined(m68k)}
+{$if defined(powerpc) or defined(m68k) or defined(i386)}
var
vs : tparavarsym;
sym : tsym;
symtable : TSymtable;
v: Tconstexprint;
-{$endif defined(powerpc) or defined(m68k)}
+{$endif defined(powerpc) or defined(m68k) or defined(i386)}
begin
if (pd.typ<>procdef) and (target_info.system <> system_powerpc_amiga) then
internalerror(2003042614);
@@ -1816,6 +1825,7 @@ begin
is_32bitint(tabstractvarsym(sym).vardef)
) then
begin
+ include(pd.procoptions,po_syscall_has_libsym);
tcpuprocdef(pd).libsym:=sym;
if po_syscall_legacy in tprocdef(pd).procoptions then
begin
@@ -1827,8 +1837,8 @@ begin
else
Message(parser_e_32bitint_or_pointer_variable_expected);
end;
- (paramanager as tm68kparamanager).create_funcretloc_info(pd,calleeside);
- (paramanager as tm68kparamanager).create_funcretloc_info(pd,callerside);
+ paramanager.create_funcretloc_info(pd,calleeside);
+ paramanager.create_funcretloc_info(pd,callerside);
v:=get_intconst;
if (v<low(Tprocdef(pd).extnumber)) or (v>high(Tprocdef(pd).extnumber)) then
@@ -1850,6 +1860,7 @@ begin
is_32bitint(tabstractvarsym(sym).vardef)
) then
begin
+ include(pd.procoptions,po_syscall_has_libsym);
tcpuprocdef(pd).libsym:=sym;
vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
pd.parast.insert(vs);
@@ -1858,8 +1869,8 @@ begin
Message(parser_e_32bitint_or_pointer_variable_expected);
end;
- (paramanager as tppcparamanager).create_funcretloc_info(pd,calleeside);
- (paramanager as tppcparamanager).create_funcretloc_info(pd,callerside);
+ paramanager.create_funcretloc_info(pd,calleeside);
+ paramanager.create_funcretloc_info(pd,callerside);
v:=get_intconst;
if (v<low(Tprocdef(pd).extnumber)) or (v>high(Tprocdef(pd).extnumber)) then
@@ -1917,6 +1928,7 @@ begin
is_32bitint(tabstractvarsym(sym).vardef)
) then
begin
+ include(pd.procoptions,po_syscall_has_libsym);
tcpuprocdef(pd).libsym:=sym;
if po_syscall_legacy in tprocdef(pd).procoptions then
begin
@@ -1950,8 +1962,8 @@ begin
else
Message(parser_e_32bitint_or_pointer_variable_expected);
end;
- (paramanager as tppcparamanager).create_funcretloc_info(pd,calleeside);
- (paramanager as tppcparamanager).create_funcretloc_info(pd,callerside);
+ paramanager.create_funcretloc_info(pd,calleeside);
+ paramanager.create_funcretloc_info(pd,callerside);
v:=get_intconst;
if (v<low(Tprocdef(pd).extnumber)) or (v>high(Tprocdef(pd).extnumber)) then
@@ -1960,6 +1972,38 @@ begin
Tprocdef(pd).extnumber:=v.uvalue;
end;
{$endif powerpc}
+{$ifdef i386}
+ if target_info.system = system_i386_aros then
+ begin
+ include(pd.procoptions,po_syscall_sysvbase);
+
+ if consume_sym(sym,symtable) then
+ begin
+ if (sym.typ=staticvarsym) and
+ (
+ (tabstractvarsym(sym).vardef.typ=pointerdef) or
+ is_32bitint(tabstractvarsym(sym).vardef)
+ ) then
+ begin
+ include(pd.procoptions,po_syscall_has_libsym);
+ tcpuprocdef(pd).libsym:=sym;
+ vs:=cparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
+ pd.parast.insert(vs);
+ end
+ else
+ Message(parser_e_32bitint_or_pointer_variable_expected);
+ end;
+
+ paramanager.create_funcretloc_info(pd,calleeside);
+ paramanager.create_funcretloc_info(pd,callerside);
+
+ v:=get_intconst;
+ if (v<low(Tprocdef(pd).extnumber)) or (v>high(Tprocdef(pd).extnumber)) then
+ message(parser_e_range_check_error)
+ else
+ Tprocdef(pd).extnumber:=v.uvalue * 4; { sizeof Pointer for the target }
+ end;
+{$endif}
end;
@@ -2061,6 +2105,13 @@ begin
pd_external(pd);
end;
+procedure pd_winapi(pd:tabstractprocdef);
+begin
+ if not(target_info.system in systems_wince) then
+ pd.proccalloption:=pocall_cdecl
+ else
+ pd.proccalloption:=pocall_stdcall;
+end;
type
pd_handler=procedure(pd:tabstractprocdef);
@@ -2076,7 +2127,7 @@ type
end;
const
{Should contain the number of procedure directives we support.}
- num_proc_directives=44;
+ num_proc_directives=45;
proc_direcdata:array[1..num_proc_directives] of proc_dir_rec=
(
(
@@ -2443,7 +2494,7 @@ const
handler : nil;
pocall : pocall_none;
pooption : [po_varargs];
- mutexclpocall : [pocall_internproc,pocall_stdcall,pocall_register,
+ mutexclpocall : [pocall_internproc,pocall_register,
pocall_far16,pocall_oldfpccall,pocall_mwpascal];
mutexclpotype : [];
mutexclpo : [po_assembler,po_interrupt,po_inline]
@@ -2470,6 +2521,15 @@ const
mutexclpotype : [{potype_constructor,potype_destructor}potype_class_constructor,potype_class_destructor];
mutexclpo : [po_public,po_exports,po_interrupt,po_assembler,po_inline]
),(
+ idtok:_WINAPI;
+ pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
+ handler : @pd_winapi;
+ pocall : pocall_none;
+ pooption : [];
+ mutexclpocall : [pocall_stdcall,pocall_cdecl];
+ mutexclpotype : [potype_constructor,potype_destructor,potype_class_constructor,potype_class_destructor];
+ mutexclpo : [po_external]
+ ),(
idtok:_ENUMERATOR;
pd_flags : [pd_interface,pd_object,pd_record];
handler : @pd_enumerator;
@@ -2565,7 +2625,7 @@ const
next variable !! }
if ((pdflags * [pd_procvar,pd_object,pd_record,pd_objcclass,pd_objcprot])=[]) and
not(idtoken=_PROPERTY) then
- Message1(parser_w_unknown_proc_directive_ignored,name);
+ Message1(parser_w_unknown_proc_directive_ignored,pattern);
exit;
end;
@@ -2876,7 +2936,7 @@ const
{ for objcclasses this is checked later, because the entire
class may be external. }
is_objc_class_or_protocol(tprocdef(pd).struct)) and
- not(pd.proccalloption in (cdecl_pocalls + [pocall_mwpascal])) then
+ not(pd.proccalloption in (cdecl_pocalls + [pocall_mwpascal,pocall_stdcall])) then
Message(parser_e_varargs_need_cdecl_and_external);
end
else
@@ -2884,7 +2944,7 @@ const
{ both must be defined now }
if not((po_external in pd.procoptions) or
(pd.typ=procvardef)) or
- not(pd.proccalloption in (cdecl_pocalls + [pocall_mwpascal])) then
+ not(pd.proccalloption in (cdecl_pocalls + [pocall_mwpascal,pocall_stdcall])) then
Message(parser_e_varargs_need_cdecl_and_external);
end;
end;
diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas
index 86a7500b67..f8af2be543 100644
--- a/compiler/pexpr.pas
+++ b/compiler/pexpr.pas
@@ -889,6 +889,11 @@ implementation
{ consume the right bracket here for a nicer error position }
consume(_RKLAMMER);
end;
+
+ in_setstring_x_y_z:
+ begin
+ statement_syssym := inline_setstring;
+ end;
else
internalerror(15);
@@ -1711,7 +1716,7 @@ implementation
extdef : tdef;
begin
result:=false;
- if (token=_ID) and (block_type in [bt_body,bt_general,bt_except]) then
+ if (token=_ID) and (block_type in [bt_body,bt_general,bt_except,bt_const]) then
begin
if not assigned(def) then
if node.nodetype=addrn then
diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas
index 5b12b97ff7..94cfed0343 100644
--- a/compiler/pgenutil.pas
+++ b/compiler/pgenutil.pas
@@ -182,11 +182,26 @@ uses
odt_interfacecorba,
odt_interfacejava,
odt_dispinterface:
- if not def_is_related(paraobjdef,formalobjdef.childof) then
- begin
- MessagePos2(filepos,type_e_incompatible_types,paraobjdef.typename,formalobjdef.childof.typename);
- result:=false;
- end;
+ begin
+ if (oo_is_forward in paraobjdef.objectoptions) and
+ (paraobjdef.objecttype=formalobjdef.objecttype) and
+ (df_genconstraint in formalobjdef.defoptions) and
+ (
+ (formalobjdef.objecttype=odt_interfacecom) and
+ (formalobjdef.childof=interface_iunknown)
+ )
+ or
+ (
+ (formalobjdef.objecttype=odt_interfacecorba) and
+ (formalobjdef.childof=nil)
+ ) then
+ continue;
+ if not def_is_related(paraobjdef,formalobjdef.childof) then
+ begin
+ MessagePos2(filepos,type_e_incompatible_types,paraobjdef.typename,formalobjdef.childof.typename);
+ result:=false;
+ end;
+ end;
odt_class,
odt_javaclass:
begin
@@ -225,6 +240,14 @@ uses
result:=false;
continue;
end;
+ { for forward declared classes we allow pure TObject/class declarations }
+ if (oo_is_forward in paraobjdef.objectoptions) and
+ (df_genconstraint in formaldef.defoptions) then
+ begin
+ if (formalobjdef.childof=class_tobject) and
+ not formalobjdef.implements_any_interfaces then
+ continue;
+ end;
if assigned(formalobjdef.childof) and
not def_is_related(paradef,formalobjdef.childof) then
begin
@@ -590,6 +613,8 @@ uses
found:=searchsym_in_class(tobjectdef(genericdef.owner.defowner),tobjectdef(genericdef.owner.defowner),ugenname,srsym,st,[])
else
found:=searchsym_in_record(tabstractrecorddef(genericdef.owner.defowner),ugenname,srsym,st);
+ if not found then
+ found:=searchsym(ugenname,srsym,st);
end
else
found:=searchsym(ugenname,srsym,st);
@@ -664,39 +689,6 @@ uses
(current_structdef.objname^=ufinalspecializename) then
tt:=current_structdef;
- { decide in which symtable to put the specialization }
- if parse_generic then
- begin
- if not assigned(current_genericdef) then
- internalerror(2014050901);
- if assigned(current_procinfo) and (df_generic in current_procinfo.procdef.defoptions) then
- { if we are parsing the definition of a method we specialize into
- the local symtable of it }
- specializest:=current_procinfo.procdef.getsymtable(gs_local)
- else
- { we specialize the partial specialization into the symtable of the currently parsed
- generic }
- case current_genericdef.typ of
- procvardef,
- procdef:
- specializest:=current_genericdef.getsymtable(gs_local);
- objectdef,
- recorddef:
- specializest:=current_genericdef.getsymtable(gs_record);
- arraydef:
- specializest:=tarraydef(current_genericdef).symtable;
- else
- internalerror(2014050902);
- end;
- end
- else
- if current_module.is_unit and current_module.in_interface then
- specializest:=current_module.globalsymtable
- else
- specializest:=current_module.localsymtable;
- if not assigned(specializest) then
- internalerror(2014050910);
-
{ Can we reuse an already specialized type? }
{ for this first check whether we are currently specializing a nested
@@ -734,6 +726,39 @@ uses
end;
end;
+ { decide in which symtable to put the specialization }
+ if parse_generic and not assigned(tt) then
+ begin
+ if not assigned(current_genericdef) then
+ internalerror(2014050901);
+ if assigned(current_procinfo) and (df_generic in current_procinfo.procdef.defoptions) then
+ { if we are parsing the definition of a method we specialize into
+ the local symtable of it }
+ specializest:=current_procinfo.procdef.getsymtable(gs_local)
+ else
+ { we specialize the partial specialization into the symtable of the currently parsed
+ generic }
+ case current_genericdef.typ of
+ procvardef,
+ procdef:
+ specializest:=current_genericdef.getsymtable(gs_local);
+ objectdef,
+ recorddef:
+ specializest:=current_genericdef.getsymtable(gs_record);
+ arraydef:
+ specializest:=tarraydef(current_genericdef).symtable;
+ else
+ internalerror(2014050902);
+ end;
+ end
+ else
+ if current_module.is_unit and current_module.in_interface then
+ specializest:=current_module.globalsymtable
+ else
+ specializest:=current_module.localsymtable;
+ if not assigned(specializest) then
+ internalerror(2014050910);
+
{ now check whether there is a specialization somewhere else }
if not assigned(tt) then
begin
@@ -966,6 +991,8 @@ uses
if token=_ID then
begin
generictype:=ctypesym.create(orgpattern,cundefinedtype);
+ { type parameters need to be added as strict private }
+ generictype.visibility:=vis_strictprivate;
include(generictype.symoptions,sp_generic_para);
result.add(orgpattern,generictype);
end;
@@ -1141,6 +1168,8 @@ uses
if assigned(generictype.owner) then
begin
sym:=ctypesym.create(genericlist.nameofindex(i),generictype.typedef);
+ { type parameters need to be added as strict private }
+ sym.visibility:=vis_strictprivate;
st.insert(sym);
include(sym.symoptions,sp_generic_para);
end
@@ -1296,7 +1325,8 @@ uses
if assigned(hmodule.globalsymtable) then
symtablestack.push(hmodule.globalsymtable);
{ push the localsymtable if needed }
- if (hmodule<>current_module) or not current_module.in_interface then
+ if ((hmodule<>current_module) or not current_module.in_interface)
+ and assigned(hmodule.localsymtable) then
symtablestack.push(hmodule.localsymtable);
end;
diff --git a/compiler/pinline.pas b/compiler/pinline.pas
index 65a9640a8a..6c83df2784 100644
--- a/compiler/pinline.pas
+++ b/compiler/pinline.pas
@@ -35,6 +35,7 @@ interface
function new_function : tnode;
function inline_setlength : tnode;
+ function inline_setstring : tnode;
function inline_initialize : tnode;
function inline_finalize : tnode;
function inline_copy : tnode;
@@ -375,11 +376,13 @@ implementation
end;
if found then
begin
- { setup variant selector }
- addstatement(newstatement,cassignmentnode.create(
- csubscriptnode.create(variantselectsymbol,
- cderefnode.create(ctemprefnode.create(temp))),
- p2));
+ { if no tag-field is given, do not create an assignment statement for it }
+ if assigned(variantselectsymbol) then
+ { setup variant selector }
+ addstatement(newstatement,cassignmentnode.create(
+ csubscriptnode.create(variantselectsymbol,
+ cderefnode.create(ctemprefnode.create(temp))),
+ p2));
end
else
Message(parser_e_illegal_expression);
@@ -512,6 +515,55 @@ implementation
end;
+ function inline_setstring : tnode;
+ var
+ paras, strpara, pcharpara: tnode;
+ procname: string;
+ begin
+ consume(_LKLAMMER);
+ paras:=parse_paras(false,false,_RKLAMMER);
+ consume(_RKLAMMER);
+ procname:='';
+ if assigned(paras) and
+ assigned(tcallparanode(paras).right) and
+ assigned(tcallparanode(tcallparanode(paras).right).right) then
+ begin
+ do_typecheckpass(tcallparanode(tcallparanode(paras).right).left);
+ do_typecheckpass(tcallparanode(tcallparanode(tcallparanode(paras).right).right).left);
+ pcharpara:=tcallparanode(tcallparanode(paras).right).left;
+ strpara:=tcallparanode(tcallparanode(tcallparanode(paras).right).right).left;
+ if strpara.resultdef.typ=stringdef then
+ begin
+ { if there are three parameters and the first parameter
+ ( = paras.right.right) is an ansistring, add a codepage
+ parameter }
+ if is_ansistring(strpara.resultdef) then
+ paras:=ccallparanode.create(genintconstnode(tstringdef(strpara.resultdef).encoding),paras);
+ procname:='fpc_setstring_'+tstringdef(strpara.resultdef).stringtypname;
+ { decide which version to call based on the second parameter }
+ if not is_shortstring(strpara.resultdef) then
+ if is_pwidechar(pcharpara.resultdef) or
+ is_widechar(pcharpara.resultdef) or
+ ((pcharpara.resultdef.typ=arraydef) and
+ is_widechar(tarraydef(pcharpara.resultdef).elementdef)) then
+ procname:=procname+'_pwidechar'
+ else
+ procname:=procname+'_pansichar';
+ end;
+ end;
+ { default version (for error message) in case of missing or wrong
+ parameters }
+ if procname='' then
+ if m_default_unicodestring in current_settings.modeswitches then
+ procname:='fpc_setstring_unicodestr_pwidechar'
+ else if m_default_ansistring in current_settings.modeswitches then
+ procname:='fpc_setstring_ansistr_pansichar'
+ else
+ procname:='fpc_setstring_shortstr';
+ result:=ccallnode.createintern(procname,paras)
+ end;
+
+
function inline_initfinal(isinit: boolean): tnode;
var
newblock,
diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas
index 2556bc9d07..6faded7288 100644
--- a/compiler/pmodules.pas
+++ b/compiler/pmodules.pas
@@ -378,11 +378,10 @@ implementation
end;
{ CPU targets with microcontroller support can add a controller specific unit }
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
- if (target_info.system in systems_embedded) and (current_settings.controllertype<>ct_none) and
+ if ControllerSupport and (target_info.system in systems_embedded) and
+ (current_settings.controllertype<>ct_none) and
(embedded_controllers[current_settings.controllertype].controllerunitstr<>'') then
AddUnit(embedded_controllers[current_settings.controllertype].controllerunitstr);
-{$endif ARM AVR MIPSEL}
end;
diff --git a/compiler/powerpc/agppcvasm.pas b/compiler/powerpc/agppcvasm.pas
index 39e93ad29d..4b01f28885 100644
--- a/compiler/powerpc/agppcvasm.pas
+++ b/compiler/powerpc/agppcvasm.pas
@@ -165,7 +165,7 @@ unit agppcvasm;
top_ref :
begin
if o.ref^.refaddr<>addr_full then
- internalerror(200402262);
+ internalerror(200402264);
hs:=o.ref^.symbol.name;
if o.ref^.offset>0 then
hs:=hs+'+'+tostr(o.ref^.offset)
diff --git a/compiler/powerpc/cpuinfo.pas b/compiler/powerpc/cpuinfo.pas
index 340faf7fd4..ac7b4e3cd1 100644
--- a/compiler/powerpc/cpuinfo.pas
+++ b/compiler/powerpc/cpuinfo.pas
@@ -21,6 +21,9 @@ Interface
Type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -44,8 +47,25 @@ Type
fpu_standard
);
+ tcontrollertype =
+ (ct_none
+ );
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/powerpc/cpupara.pas b/compiler/powerpc/cpupara.pas
index 410a623642..c06ce6d45d 100644
--- a/compiler/powerpc/cpupara.pas
+++ b/compiler/powerpc/cpupara.pas
@@ -670,7 +670,11 @@ unit cpupara;
p.paraloc[callerside].intsize:=tcgsize2size[paracgsize];
paraloc:=p.paraloc[callerside].add_location;
paraloc^.loc:=LOC_REFERENCE;
- paraloc^.size:=paracgsize;
+ { The OS side should be zero extended and the entire "virtual"
+ 68k register should be overwritten. This is what the C ppcinline
+ macros do as well, by casting all arguments to ULONG. A call
+ which breaks w/o this is for example exec/RawPutChar (KB) }
+ paraloc^.size:=OS_ADDR;
paraloc^.def:=p.vardef;
paraloc^.reference.index:=newreg(R_INTREGISTER,RS_R2,R_SUBWHOLE);
{ pattern is always uppercase'd }
diff --git a/compiler/powerpc/nppcadd.pas b/compiler/powerpc/nppcadd.pas
index 7b38f363de..a1f33a7bcd 100644
--- a/compiler/powerpc/nppcadd.pas
+++ b/compiler/powerpc/nppcadd.pas
@@ -73,6 +73,7 @@ interface
tmpreg : tregister;
useconst : boolean;
begin
+ tmpreg:=NR_NO;
// get the constant on the right if there is one
if (left.location.loc = LOC_CONSTANT) then
swapleftright;
@@ -512,6 +513,8 @@ interface
op1 := A_MULLW;
op2 := A_MULHWU
end;
+ else
+ internalerror(2014082040);
end;
end;
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op1,location.register64.reglo,
@@ -663,6 +666,8 @@ interface
cgop := OP_OR;
andn:
cgop := OP_AND;
+ else
+ internalerror(2014082041);
end;
if (left.location.loc = LOC_CONSTANT) then
swapleftright;
diff --git a/compiler/powerpc/nppcmat.pas b/compiler/powerpc/nppcmat.pas
index 8359e65372..8f937a6302 100644
--- a/compiler/powerpc/nppcmat.pas
+++ b/compiler/powerpc/nppcmat.pas
@@ -419,6 +419,7 @@ implementation
op: tasmop;
begin
+ src1:=NR_NO;
secondpass(left);
if is_64bit(left.resultdef) then
begin
diff --git a/compiler/powerpc/symcpu.pas b/compiler/powerpc/symcpu.pas
index 0e76662a88..30bbefe212 100644
--- a/compiler/powerpc/symcpu.pas
+++ b/compiler/powerpc/symcpu.pas
@@ -186,14 +186,16 @@ implementation
procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
begin
inherited;
- ppufile.getderef(libsymderef);
+ if po_syscall_has_libsym in procoptions then
+ ppufile.getderef(libsymderef);
end;
procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
begin
inherited;
- ppufile.putderef(libsymderef);
+ if po_syscall_has_libsym in procoptions then
+ ppufile.putderef(libsymderef);
end;
@@ -208,14 +210,18 @@ implementation
procedure tcpuprocdef.buildderef;
begin
inherited;
- libsymderef.build(libsym);
+ if po_syscall_has_libsym in procoptions then
+ libsymderef.build(libsym);
end;
procedure tcpuprocdef.deref;
begin
inherited;
- libsym:=tsym(libsymderef.resolve);
+ if po_syscall_has_libsym in procoptions then
+ libsym:=tsym(libsymderef.resolve)
+ else
+ libsym:=nil;
end;
begin
diff --git a/compiler/powerpc64/cpuinfo.pas b/compiler/powerpc64/cpuinfo.pas
index 5a42db9b2d..8d4d636a4f 100644
--- a/compiler/powerpc64/cpuinfo.pas
+++ b/compiler/powerpc64/cpuinfo.pas
@@ -21,6 +21,9 @@ uses
type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -40,7 +43,25 @@ type
fpu_standard
);
-const
+ tcontrollertype =
+ (ct_none
+ );
+
+
+Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions: tproccalloptions = [
pocall_internproc,
diff --git a/compiler/ppcgen/agppcgas.pas b/compiler/ppcgen/agppcgas.pas
index 806493c463..17190b60d0 100644
--- a/compiler/ppcgen/agppcgas.pas
+++ b/compiler/ppcgen/agppcgas.pas
@@ -203,7 +203,7 @@ unit agppcgas;
top_ref :
begin
if o.ref^.refaddr<>addr_full then
- internalerror(200402262);
+ internalerror(200402267);
hs:=o.ref^.symbol.name;
if target_asm.dollarsign<>'$' then
hs:=ReplaceForbiddenAsmSymbolChars(hs);
diff --git a/compiler/ppcgen/cgppc.pas b/compiler/ppcgen/cgppc.pas
index 890cf5bc5f..5a5c11be3c 100644
--- a/compiler/ppcgen/cgppc.pas
+++ b/compiler/ppcgen/cgppc.pas
@@ -33,7 +33,6 @@ unit cgppc;
type
tcgppcgen = class(tcg)
- procedure a_load_const_cgpara(list: TAsmList; size: tcgsize; a: tcgint; const paraloc : tcgpara); override;
procedure a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const paraloc : tcgpara); override;
procedure a_call_reg(list : TAsmList;reg: tregister); override;
@@ -191,29 +190,6 @@ unit cgppc;
end;
- procedure tcgppcgen.a_load_const_cgpara(list: TAsmList; size: tcgsize; a: tcgint; const
- paraloc: tcgpara);
- var
- ref: treference;
- begin
- paraloc.check_simple_location;
- paramanager.allocparaloc(list,paraloc.location);
- case paraloc.location^.loc of
- LOC_REGISTER, LOC_CREGISTER:
- a_load_const_reg(list, size, a, paraloc.location^.register);
- LOC_REFERENCE:
- begin
- reference_reset(ref,paraloc.alignment);
- ref.base := paraloc.location^.reference.index;
- ref.offset := paraloc.location^.reference.offset;
- a_load_const_ref(list, size, a, ref);
- end;
- else
- internalerror(2002081101);
- end;
- end;
-
-
procedure tcgppcgen.a_loadaddr_ref_cgpara(list : TAsmList;const r : treference;const paraloc : tcgpara);
var
ref: treference;
diff --git a/compiler/ppu.pas b/compiler/ppu.pas
index 141227eeaa..634d7e545e 100644
--- a/compiler/ppu.pas
+++ b/compiler/ppu.pas
@@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
- CurrentPPUVersion = 170;
+ CurrentPPUVersion = 172;
{ buffer sizes }
maxentrysize = 1024;
diff --git a/compiler/psub.pas b/compiler/psub.pas
index 6d096af576..f4d035ed30 100644
--- a/compiler/psub.pas
+++ b/compiler/psub.pas
@@ -1191,6 +1191,23 @@ implementation
i : integer;
varsym : tabstractnormalvarsym;
{RedoDFA : boolean;}
+
+ procedure delete_marker(anode: tasmnode);
+ var
+ ai: tai;
+ begin
+ if assigned(anode) then
+ begin
+ ai:=anode.currenttai;
+ if assigned(ai) then
+ begin
+ aktproccode.remove(ai);
+ ai.free;
+ anode.currenttai:=nil;
+ end;
+ end;
+ end;
+
begin
{ the initialization procedure can be empty, then we
don't need to generate anything. When it was an empty
@@ -1317,7 +1334,12 @@ implementation
{ iterate through life info of the first node }
for i:=0 to dfabuilder.nodemap.count-1 do
begin
- if DFASetIn(GetUserCode.optinfo^.life,i) then
+ if DFASetIn(GetUserCode.optinfo^.life,i) and
+ { do not warn about parameters passed by var }
+ not((tnode(dfabuilder.nodemap[i]).nodetype=loadn) and (tloadnode(dfabuilder.nodemap[i]).symtableentry.typ=paravarsym) and
+ (tparavarsym(tloadnode(dfabuilder.nodemap[i]).symtableentry).varspez=vs_var) and
+ { function result is passed by var but it must be initialized }
+ not(vo_is_funcret in tparavarsym(tloadnode(dfabuilder.nodemap[i]).symtableentry).varoptions)) then
CheckAndWarn(GetUserCode,tnode(dfabuilder.nodemap[i]));
end;
end;
@@ -1581,6 +1603,16 @@ implementation
not(target_info.system in systems_garbage_collected_managed_types) then
internalerror(200405231);
+ { Position markers are only used to insert additional code after the secondpass
+ and before this point. They are of no use in optimizer. Instead of checking and
+ ignoring all over the optimizer, just remove them here. }
+ delete_marker(entry_asmnode);
+ delete_marker(loadpara_asmnode);
+ delete_marker(exitlabel_asmnode);
+ delete_marker(stackcheck_asmnode);
+ delete_marker(init_asmnode);
+ delete_marker(final_asmnode);
+
{$ifndef NoOpt}
if not(cs_no_regalloc in current_settings.globalswitches) then
begin
@@ -1763,11 +1795,11 @@ implementation
{ Give an error for accesses in the static symtable that aren't visible
outside the current unit }
st:=procdef.owner;
- while (st.symtabletype=ObjectSymtable) do
+ while (st.symtabletype in [ObjectSymtable,recordsymtable]) do
st:=st.defowner.owner;
if (pi_uses_static_symtable in flags) and
(st.symtabletype<>staticsymtable) then
- Comment(V_Error,'Global Generic template references static symtable');
+ Message(parser_e_global_generic_references_static);
end;
{ save exit info }
diff --git a/compiler/psystem.pas b/compiler/psystem.pas
index 5bd6ebcc7e..9e6a243de8 100644
--- a/compiler/psystem.pas
+++ b/compiler/psystem.pas
@@ -104,6 +104,7 @@ implementation
systemunit.insert(csyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
systemunit.insert(csyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
systemunit.insert(csyssym.create('Default',in_default_x));
+ systemunit.insert(csyssym.create('SetString',in_setstring_x_y_z));
systemunit.insert(cconstsym.create_ord('False',constord,0,pasbool8type));
systemunit.insert(cconstsym.create_ord('True',constord,1,pasbool8type));
end;
diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas
index b83bfad05d..cc2f0cc971 100644
--- a/compiler/ptconst.pas
+++ b/compiler/ptconst.pas
@@ -47,6 +47,7 @@ implementation
cursectype : TAsmSectionType;
section : ansistring;
tcbuilder : ttypedconstbuilder;
+ datalist,
reslist : tasmlist;
restree,
previnit : tnode;
@@ -64,13 +65,15 @@ implementation
if not(target_info.system in systems_typed_constants_node_init) then
begin
- if sym.varspez=vs_const then
+ maybe_new_object_file(list);
+ tcbuilder:=tasmlisttypedconstbuilderclass(ctypedconstbuilder).create(sym);
+ tasmlisttypedconstbuilder(tcbuilder).parse_into_asmlist(reslist,datalist);
+ { Certain types like windows WideString are initialized at runtime and cannot
+ be placed into readonly memory }
+ if (sym.varspez=vs_const) and not (vo_force_finalize in sym.varoptions) then
cursectype:=sec_rodata
else
cursectype:=sec_data;
- maybe_new_object_file(list);
- tcbuilder:=tasmlisttypedconstbuilderclass(ctypedconstbuilder).create(sym);
- reslist:=tasmlisttypedconstbuilder(tcbuilder).parse_into_asmlist;
tcbuilder.free;
end
else
@@ -87,6 +90,7 @@ implementation
current_module.tcinitcode:=restree;
tcbuilder.free;
reslist:=nil;
+ datalist:=nil;
cursectype:=sec_none;
end;
@@ -158,6 +162,9 @@ implementation
list.concatlist(reslist);
reslist.free;
list.concat(tai_symbol_end.Createname(sym.mangledname));
+ { and pointed data, if any }
+ current_asmdata.asmlists[al_const].concatlist(datalist);
+ datalist.free;
end
else
begin
diff --git a/compiler/ptype.pas b/compiler/ptype.pas
index 4b316a47a2..e099261edf 100644
--- a/compiler/ptype.pas
+++ b/compiler/ptype.pas
@@ -340,7 +340,11 @@ implementation
((ttypesym(srsym).typedef.typ=errordef) or
(not allowgenericsyms and
(ttypesym(srsym).typedef.typ=undefineddef) and
- not (sp_generic_para in srsym.symoptions))) then
+ not (sp_generic_para in srsym.symoptions) and
+ not (sp_explicitrename in srsym.symoptions) and
+ not assigned(srsym.owner.defowner) and
+ { use df_generic instead of is_generic to allow aliases in nested types as well }
+ not (df_generic in tstoreddef(srsym.owner.defowner).defoptions))) then
begin
Message1(type_e_type_is_not_completly_defined,ttypesym(srsym).realname);
def:=generrordef;
@@ -1040,39 +1044,39 @@ implementation
without "specialize" or "<T>" of the same type we're
currently parsing, so we need to handle that special }
newdef:=nil;
- if not dospecialize and
- assigned(ttypenode(pt1).typesym) and
- (ttypenode(pt1).typesym.typ=typesym) and
- (sp_generic_dummy in ttypenode(pt1).typesym.symoptions) and
- assigned(current_structdef) and
+ if not dospecialize and
+ assigned(ttypenode(pt1).typesym) and
+ (ttypenode(pt1).typesym.typ=typesym) and
+ (sp_generic_dummy in ttypenode(pt1).typesym.symoptions) and
+ assigned(current_structdef) and
+ (
(
- (
- not (m_delphi in current_settings.modeswitches) and
- (ttypesym(ttypenode(pt1).typesym).typedef.typ=undefineddef) and
- (df_generic in current_structdef.defoptions) and
- (ttypesym(ttypenode(pt1).typesym).typedef.owner=current_structdef.owner) and
- (upper(ttypenode(pt1).typesym.realname)=copy(current_structdef.objname^,1,pos('$',current_structdef.objname^)-1))
- ) or (
- { this could be a nested specialization which uses
- the type name of a surrounding generic to
- reference the specialization of said surrounding
- class }
- (df_specialization in current_structdef.defoptions) and
- return_specialization_of_generic(current_structdef,ttypesym(ttypenode(pt1).typesym).typedef,newdef)
- )
+ not (m_delphi in current_settings.modeswitches) and
+ (ttypesym(ttypenode(pt1).typesym).typedef.typ=undefineddef) and
+ (df_generic in current_structdef.defoptions) and
+ (ttypesym(ttypenode(pt1).typesym).typedef.owner=current_structdef.owner) and
+ (upper(ttypenode(pt1).typesym.realname)=copy(current_structdef.objname^,1,pos('$',current_structdef.objname^)-1))
+ ) or (
+ { this could be a nested specialization which uses
+ the type name of a surrounding generic to
+ reference the specialization of said surrounding
+ class }
+ (df_specialization in current_structdef.defoptions) and
+ return_specialization_of_generic(current_structdef,ttypesym(ttypenode(pt1).typesym).typedef,newdef)
)
- then
- begin
- if assigned(newdef) then
- def:=newdef
- else
- def:=current_structdef;
- if assigned(def) then
- { handle nested types }
- post_comp_expr_gendef(def)
- else
- def:=generrordef;
- end;
+ )
+ then
+ begin
+ if assigned(newdef) then
+ def:=newdef
+ else
+ def:=current_structdef;
+ if assigned(def) then
+ { handle nested types }
+ post_comp_expr_gendef(def)
+ else
+ def:=generrordef;
+ end;
if dospecialize then
begin
generate_specialization(def,false,name);
diff --git a/compiler/raatt.pas b/compiler/raatt.pas
index 6729d0c87c..734c7fe89d 100644
--- a/compiler/raatt.pas
+++ b/compiler/raatt.pas
@@ -112,10 +112,7 @@ unit raatt;
procedure handledollar;virtual;
procedure HandleTargetDirective;virtual;
end;
- tcattreader = class of tattreader;
- var
- cattreader : tcattreader;
implementation
diff --git a/compiler/rautils.pas b/compiler/rautils.pas
index 5d3c767fc5..8fd7981550 100644
--- a/compiler/rautils.pas
+++ b/compiler/rautils.pas
@@ -34,13 +34,6 @@ Const
RPNMax = 10; { I think you only need 4, but just to be safe }
OpMax = 25;
-{$if max_operands = 2}
- {$define MAX_OPER_2}
-{$endif}
-{$if max_operands = 3}
- {$define MAX_OPER_3}
-{$endif}
-
Function SearchLabel(const s: string; var hl: tasmlabel;emit:boolean): boolean;
@@ -110,7 +103,6 @@ type
and concats it to the passed list. The newly created item is returned if the
instruction was valid, otherwise nil is returned }
function ConcatInstruction(p:TAsmList) : tai;virtual;
- Procedure Swapoperands;
end;
{---------------------------------------------------------------------}
@@ -495,7 +487,7 @@ Function EscapeToPascal(const s:string): string;
{ converts a C styled string - which contains escape }
{ characters to a pascal style string. }
var
- i,len : aint;
+ i,len : asizeint;
hs : string;
temp : string;
c : char;
@@ -905,14 +897,20 @@ Begin
end;
procsym :
begin
- if opr.typ<>OPR_NONE then
- Message(asmr_e_invalid_operand_type);
if Tprocsym(sym).ProcdefList.Count>1 then
Message(asmr_w_calling_overload_func);
- l:=opr.ref.offset;
- opr.typ:=OPR_SYMBOL;
- opr.symbol:=current_asmdata.RefAsmSymbol(tprocdef(tprocsym(sym).ProcdefList[0]).mangledname);
- opr.symofs:=l;
+ case opr.typ of
+ OPR_REFERENCE:
+ opr.ref.symbol:=current_asmdata.RefAsmSymbol(tprocdef(tprocsym(sym).ProcdefList[0]).mangledname);
+ OPR_NONE:
+ begin
+ opr.typ:=OPR_SYMBOL;
+ opr.symbol:=current_asmdata.RefAsmSymbol(tprocdef(tprocsym(sym).ProcdefList[0]).mangledname);
+ opr.symofs:=0;
+ end;
+ else
+ Message(asmr_e_invalid_operand_type);
+ end;
hasvar:=true;
SetupVar:=TRUE;
Exit;
@@ -1030,44 +1028,6 @@ Begin
end;
- Procedure TInstruction.Swapoperands;
- Var
- p : toperand;
- Begin
- case ops of
- 0,1:
- ;
- 2 : begin
- { 0,1 -> 1,0 }
- p:=Operands[1];
- Operands[1]:=Operands[2];
- Operands[2]:=p;
- end;
-{$ifndef MAX_OPER_2}
- 3 : begin
- { 0,1,2 -> 2,1,0 }
- p:=Operands[1];
- Operands[1]:=Operands[3];
- Operands[3]:=p;
- end;
-{$ifndef MAX_OPER_3}
- 4 : begin
- { 0,1,2,3 -> 3,2,1,0 }
- p:=Operands[1];
- Operands[1]:=Operands[4];
- Operands[4]:=p;
- p:=Operands[2];
- Operands[2]:=Operands[3];
- Operands[3]:=p;
- end;
-{$endif}
-{$endif}
- else
- internalerror(201108142);
- end;
- end;
-
-
function TInstruction.ConcatInstruction(p:TAsmList) : tai;
var
ai : taicpu;
diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas
index 1ffed1a52e..57861897be 100644
--- a/compiler/rgobj.pas
+++ b/compiler/rgobj.pas
@@ -2152,7 +2152,7 @@ unit rgobj;
if not spilled then
exit;
-{$if defined(x86) or defined(mips) or defined(sparc) or defined(arm)}
+{$if defined(x86) or defined(mips) or defined(sparc) or defined(arm) or defined(m68k)}
{ Try replacing the register with the spilltemp. This is useful only
for the i386,x86_64 that support memory locations for several instructions
@@ -2167,7 +2167,7 @@ unit rgobj;
mustbespilled:=false;
end;
end;
-{$endif defined(x86) or defined(mips) or defined(sparc) or defined(arm)}
+{$endif defined(x86) or defined(mips) or defined(sparc) or defined(arm) or defined(m68k)}
{
There are registers that need are spilled. We generate the
diff --git a/compiler/scanner.pas b/compiler/scanner.pas
index 0aa02267ab..1461c4a188 100644
--- a/compiler/scanner.pas
+++ b/compiler/scanner.pas
@@ -1921,21 +1921,38 @@ type
{ first look for a macros/int/float }
result:=preproc_substitutedtoken(storedpattern,eval);
if eval and (result.consttyp=conststring) then
- if searchsym(storedpattern,srsym,srsymtable) then
+ begin
+ if searchsym(storedpattern,srsym,srsymtable) then
+ begin
+ try_consume_nestedsym(srsym,srsymtable);
+ if assigned(srsym) then
+ case srsym.typ of
+ constsym:
+ begin
+ result.free;
+ result:=texprvalue.create_const(tconstsym(srsym));
+ end;
+ enumsym:
+ begin
+ result.free;
+ result:=texprvalue.create_int(tenumsym(srsym).value);
+ end;
+ end;
+ end
+ end
+ { skip id(<expr>) if expression must not be evaluated }
+ else if not(eval) and (result.consttyp=conststring) then
begin
- try_consume_nestedsym(srsym,srsymtable);
- if assigned(srsym) then
- case srsym.typ of
- constsym:
- begin
- result.free;
- result:=texprvalue.create_const(tconstsym(srsym));
- end;
- enumsym:
- begin
- result.free;
- result:=texprvalue.create_int(tenumsym(srsym).value);
- end;
+ if current_scanner.preproc_token =_LKLAMMER then
+ begin
+ preproc_consume(_LKLAMMER);
+ current_scanner.skipspace;
+
+ result:=preproc_factor(false);
+ if current_scanner.preproc_token =_RKLAMMER then
+ preproc_consume(_RKLAMMER)
+ else
+ Message(scan_e_error_in_preproc_expr);
end;
end;
end
@@ -2952,9 +2969,18 @@ type
minfpconstprec:=tfloattype(tokenreadenum(sizeof(tfloattype)));
disabledircache:=boolean(tokenreadbyte);
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
- controllertype:=tcontrollertype(tokenreadenum(sizeof(tcontrollertype)));
-{$endif defined(ARM) or defined(AVR) or DEFINED(MIPSEL)}
+{ TH: Since the field was conditional originally, it was not stored in PPUs. }
+{ While adding ControllerSupport constant, I decided not to store ct_none }
+{ on targets not supporting controllers, but this might be changed here and }
+{ in tokenwritesettings in the future to unify the PPU structure and handling }
+{ of this field in the compiler. }
+{$PUSH}
+ {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
+ if ControllerSupport then
+ controllertype:=tcontrollertype(tokenreadenum(sizeof(tcontrollertype)))
+ else
+ ControllerType:=ct_none;
+{$POP}
endpos:=replaytokenbuf.pos;
if endpos-startpos<>expected_size then
Comment(V_Error,'Wrong size of Settings read-in');
@@ -3021,9 +3047,12 @@ type
tokenwriteenum(minfpconstprec,sizeof(tfloattype));
recordtokenbuf.write(byte(disabledircache),1);
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
- tokenwriteenum(controllertype,sizeof(tcontrollertype));
-{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)}
+{ TH: See note about controllertype field in tokenreadsettings. }
+{$PUSH}
+ {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
+ if ControllerSupport then
+ tokenwriteenum(controllertype,sizeof(tcontrollertype));
+{$POP}
endpos:=recordtokenbuf.pos;
size:=endpos-startpos;
recordtokenbuf.seek(sizepos);
@@ -3296,8 +3325,6 @@ type
begin
current_settings.pmessage:=nil;
mesgnb:=tokenreadsizeint;
- if mesgnb>0 then
- Comment(V_Error,'Message recordind not yet supported');
prevmsg:=nil;
for i:=1 to mesgnb do
begin
diff --git a/compiler/sparc/aoptcpu.pas b/compiler/sparc/aoptcpu.pas
index bc31c671eb..01ce2c0749 100644
--- a/compiler/sparc/aoptcpu.pas
+++ b/compiler/sparc/aoptcpu.pas
@@ -127,7 +127,7 @@ unit aoptcpu;
Result:=GetNextInstruction(Next,Next);
until {not(cs_opt_level3 in current_settings.optimizerswitches) or} not(Result) or (Next.typ<>ait_instruction) or (RegInInstruction(reg,Next)) or
(is_calljmp(taicpu(Next).opcode));
- if is_calljmp(taicpu(next).opcode) then
+ if result and (next.typ=ait_instruction) and is_calljmp(taicpu(next).opcode) then
begin
result:=false;
next:=nil;
diff --git a/compiler/sparc/cpuinfo.pas b/compiler/sparc/cpuinfo.pas
index e9d86e7d8b..55c26d3e6c 100644
--- a/compiler/sparc/cpuinfo.pas
+++ b/compiler/sparc/cpuinfo.pas
@@ -30,6 +30,9 @@ uses
type
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -49,8 +52,24 @@ type
fpu_hard
);
+ tcontrollertype =(ct_none
+ );
+
+
+Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = true;
+
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
-const
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/sparc/ncpuadd.pas b/compiler/sparc/ncpuadd.pas
index 12faca4876..3186e58bc9 100644
--- a/compiler/sparc/ncpuadd.pas
+++ b/compiler/sparc/ncpuadd.pas
@@ -82,6 +82,8 @@ interface
GetResFlags:=F_L;
gten:
GetResFlags:=F_LE;
+ else
+ internalerror(2014082010);
end
else
case NodeType of
@@ -93,6 +95,8 @@ interface
GetResFlags:=F_G;
gten:
GetResFlags:=F_GE;
+ else
+ internalerror(2014082011);
end;
end
else
@@ -107,6 +111,8 @@ interface
GetResFlags:=F_B;
gten:
GetResFlags:=F_BE;
+ else
+ internalerror(2014082012);
end
else
case NodeType of
@@ -118,6 +124,8 @@ interface
GetResFlags:=F_A;
gten:
GetResFlags:=F_AE;
+ else
+ internalerror(2014082013);
end;
end;
end;
@@ -143,6 +151,8 @@ interface
result:=F_FL;
gten:
result:=F_FLE;
+ else
+ internalerror(2014082014);
end
else
case NodeType of
@@ -154,6 +164,8 @@ interface
result:=F_FG;
gten:
result:=F_FGE;
+ else
+ internalerror(2014082015);
end;
end;
end;
diff --git a/compiler/symconst.pas b/compiler/symconst.pas
index 02712b4523..1c38f85446 100644
--- a/compiler/symconst.pas
+++ b/compiler/symconst.pas
@@ -310,6 +310,8 @@ type
po_syscall_basesysv,
po_syscall_sysvbase,
po_syscall_r12base,
+ { Used to record the fact that a symbol is asociated to this syscall }
+ po_syscall_has_libsym,
{ Procedure can be inlined }
po_inline,
{ Procedure is used for internal compiler calls }
@@ -467,7 +469,7 @@ type
);
tobjectoptions=set of tobjectoption;
- tarraydefoption=(
+ tarraydefoption=(
ado_IsConvertedPointer, // array created from pointer (e.g. PInteger(Ptr)[1])
ado_IsDynamicArray, // dynamic array
ado_IsVariant, //
diff --git a/compiler/symdef.pas b/compiler/symdef.pas
index 246ea66d1e..c092e6c20d 100644
--- a/compiler/symdef.pas
+++ b/compiler/symdef.pas
@@ -227,6 +227,12 @@ interface
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override;
+ {# returns the appropriate int type for pointer arithmetic with the given pointer type.
+ When adding or subtracting a number to/from a pointer, this function returns the
+ int type to which that number has to be converted, before the operation can be performed.
+ Normally, this is sinttype, except on i8086, where it takes into account the
+ special i8086 pointer types (near, far, huge). }
+ function pointer_arithmetic_int_type:tdef;virtual;
{# returns the int type produced when subtracting two pointers of the given type.
Normally, this is sinttype, except on i8086, where it takes into account the
special i8086 pointer types (near, far, huge). }
@@ -237,6 +243,9 @@ interface
tprocdef = class;
tabstractrecorddef= class(tstoreddef)
+ private
+ rttistring : string;
+ public
objname,
objrealname : PShortString;
{ for C++ classes: name of the library this class is imported from }
@@ -253,6 +262,8 @@ interface
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override;
destructor destroy; override;
+ procedure buildderefimpl;override;
+ procedure derefimpl;override;
procedure check_forwards; virtual;
function find_procdef_bytype(pt:tproctypeoption): tprocdef;
function GetSymtable(t:tGetSymtable):TSymtable;override;
@@ -297,7 +308,6 @@ interface
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override;
- procedure buildderefimpl;override;
procedure deref;override;
function size:asizeint;override;
function alignment : shortint;override;
@@ -404,7 +414,6 @@ interface
function GetTypeName:string;override;
procedure buildderef;override;
procedure deref;override;
- procedure buildderefimpl;override;
procedure derefimpl;override;
procedure resetvmtentries;
procedure copyvmtentries(objdef:tobjectdef);
@@ -473,7 +482,7 @@ interface
function elesize : asizeint;
function elepackedbitsize : asizeint;
function elecount : asizeuint;
- constructor create_from_pointer(def:tdef);virtual;
+ constructor create_from_pointer(def:tpointerdef);virtual;
constructor create(l,h:asizeint;def:tdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);
destructor destroy; override;
@@ -1771,7 +1780,7 @@ implementation
end;
if assigned(typesym) and
(owner.symtabletype in [staticsymtable,globalsymtable]) then
- result:=make_mangledname(prefix,owner,typesym.name)
+ result:=make_mangledname(prefix,typesym.owner,typesym.name)
else
result:=make_mangledname(prefix,findunitsymtable(owner),'DEF'+tostr(DefId))
end;
@@ -2023,8 +2032,7 @@ implementation
recsize:=size;
is_intregable:=
ispowerof2(recsize,temp) and
- { sizeof(asizeint)*2 records in int registers is currently broken for endian_big targets }
- (((recsize <= sizeof(asizeint)*2) and (target_info.endian=endian_little)
+ (((recsize <= sizeof(asizeint)*2)
{ records cannot go into registers on 16 bit targets for now }
and (sizeof(asizeint)>2)
and not trecorddef(self).contains_float_field) or
@@ -2107,7 +2115,7 @@ implementation
sym:=tsym(genericparas[i]);
if sym.typ<>symconst.typesym then
internalerror(2014050904);
- if sym.owner.defowner=self then
+ if sym.owner.defowner<>self then
exit(true);
end;
result:=false;
@@ -2425,10 +2433,12 @@ implementation
{$IFNDEF cpu64bitaddr} {$push}{$warnings off} {$ENDIF} //comparison always false warning
if (current_settings.packenum=8) or (min<low(longint)) or (int64(max)>high(cardinal)) then
savesize:=8
-{$IFDEF not cpu64bitaddr} {$pop} {$ENDIF}
+{$IFNDEF cpu64bitaddr} {$pop} {$ENDIF}
else
+{$IFDEF cpu16bitaddr} {$push}{$warnings off} {$ENDIF} //comparison always false warning
if (current_settings.packenum=4) or (min<low(smallint)) or (max>high(word)) then
savesize:=4
+{$IFDEF cpu16bitaddr} {$pop} {$ENDIF}
else
if (current_settings.packenum=2) or (min<low(shortint)) or (max>high(byte)) then
savesize:=2
@@ -2787,10 +2797,12 @@ implementation
s32real : savesize:=4;
s80real : savesize:=10;
sc80real:
- if target_info.system in [system_i386_darwin,system_i386_iphonesim,system_x86_64_darwin,
+ if target_info.system in [system_i386_darwin,
+ system_i386_iphonesim,system_x86_64_darwin,
system_x86_64_linux,system_x86_64_freebsd,
system_x86_64_openbsd,system_x86_64_netbsd,
- system_x86_64_solaris,system_x86_64_embedded] then
+ system_x86_64_solaris,system_x86_64_embedded,
+ system_x86_64_dragonfly] then
savesize:=16
else
savesize:=12;
@@ -3170,6 +3182,12 @@ implementation
end;
+ function tpointerdef.pointer_arithmetic_int_type:tdef;
+ begin
+ result:=ptrsinttype;
+ end;
+
+
function tpointerdef.pointer_subtraction_result_type:tdef;
begin
result:=ptrsinttype;
@@ -3396,12 +3414,12 @@ implementation
inherited;
end;
- constructor tarraydef.create_from_pointer(def:tdef);
+ constructor tarraydef.create_from_pointer(def:tpointerdef);
begin
{ use -1 so that the elecount will not overflow }
self.create(0,high(asizeint)-1,ptrsinttype);
arrayoptions:=[ado_IsConvertedPointer];
- setelementdef(def);
+ setelementdef(def.pointeddef);
end;
@@ -3693,6 +3711,23 @@ implementation
inherited destroy;
end;
+
+ procedure tabstractrecorddef.buildderefimpl;
+ begin
+ inherited buildderefimpl;
+ if not (df_copied_def in defoptions) then
+ tstoredsymtable(symtable).buildderefimpl;
+ end;
+
+
+ procedure tabstractrecorddef.derefimpl;
+ begin
+ inherited derefimpl;
+ if not (df_copied_def in defoptions) then
+ tstoredsymtable(symtable).derefimpl;
+ end;
+
+
procedure tabstractrecorddef.check_forwards;
begin
{ the defs of a copied def are defined for the original type only }
@@ -3733,8 +3768,104 @@ implementation
end;
function tabstractrecorddef.RttiName: string;
+
+ function generate_full_paramname(maxlength:longint):string;
+ const
+ commacount : array[boolean] of longint = (0,1);
+ var
+ fullparas,
+ paramname : ansistring;
+ module : tmodule;
+ sym : ttypesym;
+ i : longint;
+ begin
+ { we want at least enough space for an ellipsis }
+ if maxlength<3 then
+ internalerror(2014121203);
+ fullparas:='';
+ for i:=0 to genericparas.count-1 do
+ begin
+ sym:=ttypesym(genericparas[i]);
+ module:=find_module_from_symtable(sym.owner);
+ if not assigned(module) then
+ internalerror(2014121202);
+ paramname:=module.realmodulename^;
+ if sym.typedef.typ in [objectdef,recorddef] then
+ paramname:=paramname+'.'+tabstractrecorddef(sym.typedef).rttiname
+ else
+ paramname:=paramname+'.'+sym.typedef.typename;
+ if length(fullparas)+commacount[i>0]+length(paramname)>maxlength then
+ begin
+ if i>0 then
+ fullparas:=fullparas+',...'
+ else
+ fullparas:=fullparas+'...';
+ break;
+ end;
+ { could we fit an ellipsis after this parameter if it should be too long? }
+ if (maxlength-(length(fullparas)+commacount[i>0]+length(paramname))<4) and (i<genericparas.count-1) then
+ begin
+ { then omit already this parameter }
+ if i>0 then
+ fullparas:=fullparas+',...'
+ else
+ fullparas:=fullparas+'...';
+ break;
+ end;
+ if i>0 then
+ fullparas:=fullparas+',';
+ fullparas:=fullparas+paramname;
+ end;
+ result:=fullparas;
+ end;
+
+ var
+ nongeneric,
+ basename : string;
+ i,
+ remlength,
+ paramcount,
+ crcidx : longint;
begin
- Result:=OwnerHierarchyName+objrealname^;
+ if rttistring='' then
+ begin
+ if is_specialization then
+ begin
+ rttistring:=OwnerHierarchyName;
+ { there should be two $ characters, one before the CRC and one before the count }
+ crcidx:=-1;
+ for i:=length(objrealname^) downto 1 do
+ if objrealname^[i]='$' then
+ begin
+ crcidx:=i;
+ break;
+ end;
+ if crcidx<0 then
+ internalerror(2014121201);
+ basename:=copy(objrealname^,1,crcidx-1);
+ split_generic_name(basename,nongeneric,paramcount);
+ rttistring:=rttistring+nongeneric+'<';
+ remlength:=255-length(rttistring)-1;
+ if remlength<4 then
+ rttistring:=rttistring+'>'
+ else
+ rttistring:=rttistring+generate_full_paramname(remlength)+'>';
+ end
+ else
+ if is_generic then
+ begin
+ rttistring:=OwnerHierarchyName;
+ split_generic_name(objrealname^,nongeneric,paramcount);
+ rttistring:=rttistring+nongeneric+'<';
+ { we don't want any ',' if there is only one parameter }
+ for i:=0 to paramcount-0 do
+ rttistring:=rttistring+',';
+ rttistring:=rttistring+'>';
+ end
+ else
+ rttistring:=OwnerHierarchyName+objrealname^;
+ end;
+ result:=rttistring;
end;
function tabstractrecorddef.search_enumerator_get: tprocdef;
@@ -4004,14 +4135,6 @@ implementation
end;
- procedure trecorddef.buildderefimpl;
- begin
- inherited buildderefimpl;
- if not (df_copied_def in defoptions) then
- tstoredsymtable(symtable).buildderefimpl;
- end;
-
-
procedure trecorddef.deref;
begin
inherited deref;
@@ -6177,19 +6300,9 @@ implementation
end;
- procedure tobjectdef.buildderefimpl;
- begin
- inherited buildderefimpl;
- if not (df_copied_def in defoptions) then
- tstoredsymtable(symtable).buildderefimpl;
- end;
-
-
procedure tobjectdef.derefimpl;
begin
inherited derefimpl;
- if not (df_copied_def in defoptions) then
- tstoredsymtable(symtable).derefimpl;
{ the procdefs are not owned by the class helper procsyms, so they
are not stored/restored either -> re-add them here }
if (objecttype=odt_objcclass) or
diff --git a/compiler/symsym.pas b/compiler/symsym.pas
index 6f7b88432a..17164aa4f2 100644
--- a/compiler/symsym.pas
+++ b/compiler/symsym.pas
@@ -435,6 +435,14 @@ interface
function GetCopy:tmacro;
end;
+ { tPtrDefHashSet }
+
+ tPtrDefHashSet = class(THashSet)
+ public
+ constructor Create;virtual;
+ end;
+ tPtrDefHashSetClass = class of tPtrDefHashSet;
+
var
generrorsym : tsym;
@@ -452,6 +460,7 @@ interface
cconstsym: tconstsymclass;
cenumsym: tenumsymclass;
csyssym: tsyssymclass;
+ cPtrDefHashSet : tPtrDefHashSetClass = tPtrDefHashSet;
{ generate internal static field name based on regular field name }
function internal_static_field_name(const fieldname: TSymStr): TSymStr;
@@ -2130,15 +2139,8 @@ implementation
paraloc[calleeside].init;
paraloc[callerside].init;
if vo_has_explicit_paraloc in varoptions then
- begin
- paraloc[callerside].alignment:=ppufile.getbyte;
- b:=ppufile.getbyte;
- if b<>sizeof(paraloc[callerside].location^) then
- internalerror(200411154);
- ppufile.getdata(paraloc[callerside].add_location^,sizeof(paraloc[callerside].location^));
- paraloc[callerside].size:=paraloc[callerside].location^.size;
- paraloc[callerside].intsize:=tcgsize2size[paraloc[callerside].size];
- end;
+ paraloc[callerside].ppuload(ppufile);
+
ppuload_platform(ppufile);
end;
@@ -2166,9 +2168,7 @@ implementation
if vo_has_explicit_paraloc in varoptions then
begin
paraloc[callerside].check_simple_location;
- ppufile.putbyte(sizeof(paraloc[callerside].alignment));
- ppufile.putbyte(sizeof(paraloc[callerside].location^));
- ppufile.putdata(paraloc[callerside].location^,sizeof(paraloc[callerside].location^));
+ paraloc[callerside].ppuwrite(ppufile);
end;
writeentry(ppufile,ibparavarsym);
end;
@@ -2690,4 +2690,14 @@ implementation
Result:=p;
end;
+
+{****************************************************************************
+ tPtrDefHashSet
+ ****************************************************************************}
+
+ constructor tPtrDefHashSet.Create;
+ begin
+ inherited Create(64,true,false);
+ end;
+
end.
diff --git a/compiler/symtable.pas b/compiler/symtable.pas
index 4396969c73..dd91eeb60d 100644
--- a/compiler/symtable.pas
+++ b/compiler/symtable.pas
@@ -230,7 +230,7 @@ interface
function generate_objectpascal_helper_key(def:tdef):string;
procedure incompatibletypes(def1,def2:tdef);
procedure hidesym(sym:TSymEntry);
- procedure duplicatesym(var hashedid:THashedIDString;dupsym,origsym:TSymEntry);
+ procedure duplicatesym(var hashedid: THashedIDString; dupsym, origsym:TSymEntry; warn: boolean);
function handle_generic_dummysym(sym:TSymEntry;var symoptions:tsymoptions):boolean;
function get_jumpbuf_size : longint;
@@ -631,7 +631,7 @@ implementation
begin
hsym:=tsym(FindWithHash(hashedid));
if assigned(hsym) then
- DuplicateSym(hashedid,sym,hsym);
+ DuplicateSym(hashedid,sym,hsym,false);
result:=assigned(hsym);
end;
@@ -1393,9 +1393,9 @@ implementation
if tfieldvarsym(sym).fieldoffset=0 then
include(tfieldvarsym(sym).varoptions,vo_is_first_field);
- { add to this record symtable }
+ { add to this record symtable, checking for duplicate names }
// unionst.SymList.List.List^[i].Data:=nil;
- sym.ChangeOwner(self);
+ insert(sym);
varalign:=tfieldvarsym(sym).vardef.alignment;
if varalign=0 then
varalign:=size_2_align(tfieldvarsym(sym).getsize);
@@ -1480,7 +1480,8 @@ implementation
function tObjectSymtable.checkduplicate(var hashedid:THashedIDString;sym:TSymEntry):boolean;
var
- hsym : tsym;
+ hsym: tsym;
+ warn: boolean;
begin
result:=false;
if not assigned(defowner) then
@@ -1511,7 +1512,15 @@ implementation
)
) then
begin
- DuplicateSym(hashedid,sym,hsym);
+ { only watn when a parameter/local variable in a method
+ conflicts with a category method, because this can easily
+ happen due to all possible categories being imported via
+ CocoaAll }
+ warn:=
+ (is_objccategory(tdef(hsym.owner.defowner)) or
+ is_classhelper(tdef(hsym.owner.defowner))) and
+ (sym.typ in [paravarsym,localvarsym,fieldvarsym]);
+ DuplicateSym(hashedid,sym,hsym,warn);
result:=true;
end;
end
@@ -1590,7 +1599,7 @@ implementation
(vo_is_result in tabstractvarsym(hsym).varoptions)) then
HideSym(hsym)
else
- DuplicateSym(hashedid,sym,hsym);
+ DuplicateSym(hashedid,sym,hsym,false);
result:=true;
exit;
end;
@@ -1610,7 +1619,7 @@ implementation
(vo_is_result in tabstractvarsym(sym).varoptions)) then
Hidesym(sym)
else
- DuplicateSym(hashedid,sym,hsym);
+ DuplicateSym(hashedid,sym,hsym,false);
result:=true;
exit;
end;
@@ -1716,7 +1725,7 @@ implementation
tnamespacesym(sym).unitsym:=tsym(hsym);
end
else
- DuplicateSym(hashedid,sym,hsym);
+ DuplicateSym(hashedid,sym,hsym,false);
result:=true;
exit;
end;
@@ -2059,11 +2068,15 @@ implementation
end;
- procedure duplicatesym(var hashedid:THashedIDString;dupsym,origsym:TSymEntry);
+ procedure duplicatesym(var hashedid: THashedIDString; dupsym, origsym: TSymEntry; warn: boolean);
var
st : TSymtable;
+ filename : TIDString;
begin
- Message1(sym_e_duplicate_id,tsym(origsym).realname);
+ if not warn then
+ Message1(sym_e_duplicate_id,tsym(origsym).realname)
+ else
+ Message1(sym_w_duplicate_id,tsym(origsym).realname);
{ Write hint where the original symbol was found }
st:=finduniTSymtable(origsym.owner);
with tsym(origsym).fileinfo do
@@ -2073,7 +2086,13 @@ implementation
st.iscurrentunit then
Message2(sym_h_duplicate_id_where,current_module.sourcefiles.get_file_name(fileindex),tostr(line))
else if assigned(st.name) then
- Message2(sym_h_duplicate_id_where,'unit '+st.name^,tostr(line));
+ begin
+ filename:=find_module_from_symtable(st).sourcefiles.get_file_name(fileindex);
+ if filename<>'' then
+ Message2(sym_h_duplicate_id_where,'unit '+st.name^+': '+filename,tostr(line))
+ else
+ Message2(sym_h_duplicate_id_where,'unit '+st.name^,tostr(line))
+ end;
end;
{ Rename duplicate sym to an unreachable name, but it can be
inserted in the symtable without errors }
@@ -2223,6 +2242,7 @@ implementation
function is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
var
symownerdef : tabstractrecorddef;
+ nonlocalst : tsymtable;
begin
result:=false;
@@ -2231,17 +2251,22 @@ implementation
not (symst.symtabletype in [objectsymtable,recordsymtable]) then
internalerror(200810285);
symownerdef:=tabstractrecorddef(symst.defowner);
+ { specializations might belong to a localsymtable or parasymtable }
+ nonlocalst:=symownerdef.owner;
+ if tstoreddef(symst.defowner).is_specialization then
+ while nonlocalst.symtabletype in [localsymtable,parasymtable] do
+ nonlocalst:=nonlocalst.defowner.owner;
case symvisibility of
vis_private :
begin
{ private symbols are allowed when we are in the same
module as they are defined }
result:=(
- (symownerdef.owner.symtabletype in [globalsymtable,staticsymtable]) and
- (symownerdef.owner.iscurrentunit)
+ (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
+ (nonlocalst.iscurrentunit)
) or
( // the case of specialize inside the generic declaration and nested types
- (symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
+ (nonlocalst.symtabletype in [objectsymtable,recordsymtable]) and
(
assigned(current_structdef) and
(
@@ -2293,8 +2318,8 @@ implementation
in the current module }
result:=(
(
- (symownerdef.owner.symtabletype in [globalsymtable,staticsymtable]) and
- (symownerdef.owner.iscurrentunit)
+ (nonlocalst.symtabletype in [globalsymtable,staticsymtable]) and
+ (nonlocalst.iscurrentunit)
) or
(
assigned(contextobjdef) and
@@ -2303,7 +2328,7 @@ implementation
def_is_related(contextobjdef,symownerdef)
) or
( // the case of specialize inside the generic declaration and nested types
- (symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
+ (nonlocalst.symtabletype in [objectsymtable,recordsymtable]) and
(
assigned(current_structdef) and
(
@@ -2945,7 +2970,9 @@ implementation
end;
end;
{ now search in the extended type itself }
- if classh.extendeddef.typ in [recorddef,objectdef] then
+ { Note: the extendeddef might be Nil if we are currently parsing the
+ extended type itself and the identifier was not found }
+ if assigned(classh.extendeddef) and (classh.extendeddef.typ in [recorddef,objectdef]) then
begin
srsymtable:=tabstractrecorddef(classh.extendeddef).symtable;
srsym:=tsym(srsymtable.FindWithHash(hashedid));
diff --git a/compiler/systems.inc b/compiler/systems.inc
index 23c91706db..845d28124e 100644
--- a/compiler/systems.inc
+++ b/compiler/systems.inc
@@ -162,7 +162,10 @@
system_i8086_msdos, { 79 }
system_mipsel_android, { 80 }
system_mipseb_embedded, { 81 }
- system_mipsel_embedded { 82 }
+ system_mipsel_embedded, { 82 }
+ system_i386_aros, { 83 }
+ system_x86_64_aros, { 84 }
+ system_x86_64_dragonfly { 85 }
);
type
@@ -213,6 +216,7 @@
tlink = (ld_none,
ld_aix, { external linkers (one per OS, handles all CPUs) }
ld_amiga,
+ ld_aros,
ld_atari,
ld_android,
ld_beos,
@@ -270,7 +274,8 @@
tscripttype = (script_none
,script_dos,script_unix,script_amiga,
- script_mpw
+ script_mpw,
+ script_fpcres
);
tabi = (abi_default
diff --git a/compiler/systems.pas b/compiler/systems.pas
index a7cc436172..355f8b4b75 100644
--- a/compiler/systems.pas
+++ b/compiler/systems.pas
@@ -217,6 +217,7 @@ interface
systems_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,system_powerpc64_linux,
system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
system_x86_6432_linux,system_mipseb_linux,system_mipsel_linux];
+ systems_dragonfly = [system_x86_64_dragonfly];
systems_freebsd = [system_i386_freebsd,
system_x86_64_freebsd];
systems_netbsd = [system_i386_netbsd,
@@ -227,7 +228,7 @@ interface
system_m68k_openbsd,
system_x86_64_openbsd];
- systems_bsd = systems_freebsd + systems_netbsd + systems_openbsd;
+ systems_bsd = systems_freebsd + systems_netbsd + systems_openbsd + systems_dragonfly;
systems_aix = [system_powerpc_aix,system_powerpc64_aix];
@@ -773,6 +774,10 @@ begin
default_target(system_x86_64_linux);
{$define default_target_set}
{$endif}
+ {$ifdef dragonfly}
+ default_target(system_x86_64_dragonfly);
+ {$define default_target_set}
+ {$endif}
{$ifdef freebsd}
default_target(system_x86_64_freebsd);
{$define default_target_set}
diff --git a/compiler/systems/i_aros.pas b/compiler/systems/i_aros.pas
new file mode 100644
index 0000000000..1e6262481d
--- /dev/null
+++ b/compiler/systems/i_aros.pas
@@ -0,0 +1,169 @@
+{
+ Copyright (c) 1998-2002 by Peter Vreman
+
+ This unit implements support information structures for arosOS
+
+ 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.
+ ****************************************************************************
+}
+{ This unit implements support information structures for the arosOS. }
+unit i_aros;
+
+{$i fpcdefs.inc}
+
+ interface
+
+ uses
+ systems;
+
+ const
+ system_i386_aros_info : tsysteminfo =
+ (
+ system : system_i386_aros;
+ name : 'AROS for i386';
+ shortname : 'aros';
+ flags : [tf_files_case_aware, tf_smartlink_library, tf_has_winlike_resources];
+ cpu : cpu_i386;
+ unit_env : '';
+ extradefines : 'HASAMIGA';
+ exeext : '';
+ defext : '.def';
+ scriptext : '.sh';
+ smartext : '.sl';
+ unitext : '.ppu';
+ unitlibext : '.ppl';
+ asmext : '.s';
+ objext : '.o';
+ resext : '.res';
+ resobjext : '.or';
+ sharedlibext : '.library';
+ staticlibext : '.a';
+ staticlibprefix : 'libp';
+ sharedlibprefix : '';
+ sharedClibext : '.library';
+ staticClibext : '.a';
+ staticClibprefix : 'lib';
+ sharedClibprefix : '';
+ importlibprefix : 'libimp';
+ importlibext : '.a';
+ Cprefix : '';
+ newline : #10;
+ dirsep : '/';
+ assem : as_i386_elf32;
+ assemextern : as_gas;
+ link : ld_none;
+ linkextern : ld_aros;
+ ar : ar_gnu_ar;
+ res : res_elf;
+ dbg : dbg_stabs;
+ script : script_amiga;
+ endian : endian_little;
+ alignment :
+ (
+ procalign : 16;
+ loopalign : 4;
+ jumpalign : 0;
+ constalignmin : 0;
+ constalignmax : 8;
+ varalignmin : 0;
+ varalignmax : 16;
+ localalignmin : 0;
+ localalignmax : 4;
+ recordalignmin : 0;
+ recordalignmax : 16;
+ maxCrecordalign : 4
+ );
+ first_parm_offset : 8;
+ stacksize : 262144;
+ stackalign : 4;
+ abi : abi_default;
+ );
+
+ system_x86_64_aros_info : tsysteminfo =
+ (
+ system : system_x86_64_aros;
+ name : 'AROS for x86_64';
+ shortname : 'aros';
+ flags : [tf_files_case_aware];
+ cpu : cpu_x86_64;
+ unit_env : '';
+ extradefines : 'HASAMIGA';
+ exeext : '';
+ defext : '.def';
+ scriptext : '.sh';
+ smartext : '.sl';
+ unitext : '.ppu';
+ unitlibext : '.ppl';
+ asmext : '.s';
+ objext : '.o';
+ resext : '.res';
+ resobjext : '.or';
+ sharedlibext : '.library';
+ staticlibext : '.a';
+ staticlibprefix : 'libp';
+ sharedlibprefix : '';
+ sharedClibext : '.library';
+ staticClibext : '.a';
+ staticClibprefix : 'lib';
+ sharedClibprefix : '';
+ importlibprefix : 'libimp';
+ importlibext : '.a';
+ Cprefix : '';
+ newline : #10;
+ dirsep : '/';
+ assem : as_x86_64_elf64;
+ assemextern : as_gas;
+ link : ld_none;
+ linkextern : ld_aros;
+ ar : ar_gnu_ar;
+ res : res_none;
+ dbg : dbg_stabs;
+ script : script_amiga;
+ endian : endian_little;
+ alignment :
+ (
+ procalign : 8;
+ loopalign : 4;
+ jumpalign : 0;
+ constalignmin : 0;
+ constalignmax : 8;
+ varalignmin : 0;
+ varalignmax : 16;
+ localalignmin : 4;
+ localalignmax : 16;
+ recordalignmin : 0;
+ recordalignmax : 16;
+ maxCrecordalign : 16
+ );
+ first_parm_offset : 16;
+ stacksize : 8*1024*1024;
+ stackalign : 16; { fix me: this is a wild guess for now (KB) }
+ abi : abi_default;
+ );
+
+ implementation
+
+initialization
+{$ifdef CPU86}
+ {$ifdef aros}
+ set_source_info(system_i386_aros_info);
+ {$endif aros}
+{$endif CPU86}
+{$ifdef CPUX86_64}
+ {$ifdef AROS}
+ set_source_info(system_x86_64_aros_info);
+ {$endif AROS}
+{$endif CPUX86_64}
+end.
diff --git a/compiler/systems/i_bsd.pas b/compiler/systems/i_bsd.pas
index 90264afcf0..c9072cc4d8 100644
--- a/compiler/systems/i_bsd.pas
+++ b/compiler/systems/i_bsd.pas
@@ -188,6 +188,72 @@ unit i_bsd;
);
+ system_x86_64_dragonfly_info : tsysteminfo =
+ (
+ system : system_x86_64_dragonfly;
+ name : 'DragonFly for x86-64';
+ shortname : 'DragonFly';
+ flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_library_needs_pic,tf_needs_symbol_type,
+ tf_files_case_sensitive,tf_smartlink_library,
+ tf_dwarf_only_local_labels,
+ {tf_pic_uses_got,}tf_smartlink_sections,tf_has_winlike_resources];
+ cpu : cpu_x86_64;
+ unit_env : 'BSDUNITS';
+ extradefines : 'UNIX;HASUNIX;BSD';
+ exeext : '';
+ defext : '.def';
+ scriptext : '.sh';
+ smartext : '.sl';
+ unitext : '.ppu';
+ unitlibext : '.ppl';
+ asmext : '.s';
+ objext : '.o';
+ resext : '.res';
+ resobjext : '.or';
+ sharedlibext : '.so';
+ staticlibext : '.a';
+ staticlibprefix : 'libp';
+ sharedlibprefix : 'lib';
+ sharedClibext : '.so';
+ staticClibext : '.a';
+ staticClibprefix : 'lib';
+ sharedClibprefix : 'lib';
+ importlibprefix : 'libimp';
+ importlibext : '.a';
+ Cprefix : '';
+ newline : #10;
+ dirsep : '/';
+ assem : as_x86_64_elf64;
+ assemextern : as_gas;
+ link : ld_none;
+ linkextern : ld_bsd;
+ ar : ar_gnu_ar;
+ res : res_elf;
+ dbg : dbg_dwarf2; //dbg_stabs;
+ script : script_unix;
+ endian : endian_little;
+ alignment :
+ (
+ procalign : 8;
+ loopalign : 4;
+ jumpalign : 0;
+ constalignmin : 0;
+ constalignmax : 8;
+ varalignmin : 0;
+ varalignmax : 16;
+ localalignmin : 4;
+ localalignmax : 16;
+ recordalignmin : 0;
+ recordalignmax : 16;
+ maxCrecordalign : 16
+ );
+ first_parm_offset : 16;
+ stacksize : 256*1024;
+ stackalign : 16;
+ abi : abi_default;
+ );
+
+
system_i386_netbsd_info : tsysteminfo =
(
system : system_i386_NetBSD;
@@ -255,7 +321,7 @@ unit i_bsd;
system : system_i386_OpenBSD;
name : 'OpenBSD for i386';
shortname : 'OpenBSD';
- flags : [tf_pic_uses_got,tf_under_development,tf_files_case_sensitive,tf_smartlink_library,tf_has_winlike_resources];
+ flags : [tf_pic_uses_got,tf_under_development,tf_files_case_sensitive,tf_smartlink_library,tf_smartlink_sections,tf_has_winlike_resources];
cpu : cpu_i386;
unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX';
@@ -319,7 +385,7 @@ unit i_bsd;
shortname : 'OpenBSD';
flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_library_needs_pic,tf_needs_symbol_type,
tf_files_case_sensitive,tf_smartlink_library, tf_under_development,
- tf_dwarf_only_local_labels,
+ tf_dwarf_only_local_labels, tf_pic_default,
{ tf_pic_uses_got,}tf_smartlink_sections,tf_has_winlike_resources];
cpu : cpu_x86_64;
unit_env : 'BSDUNITS';
@@ -969,6 +1035,9 @@ initialization
{$ifdef FreeBSD}
set_source_info(system_x86_64_FreeBSD_info);
{$endif}
+ {$ifdef DragonFly}
+ set_source_info(system_x86_64_DragonFly_info);
+ {$endif}
{$ifdef OpenBSD}
set_source_info(system_x86_64_OpenBSD_info);
{$endif}
diff --git a/compiler/systems/i_linux.pas b/compiler/systems/i_linux.pas
index 5316dd9236..258bf2815e 100644
--- a/compiler/systems/i_linux.pas
+++ b/compiler/systems/i_linux.pas
@@ -167,6 +167,7 @@ unit i_linux;
name : 'Linux for m68k';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
+ tf_smartlink_sections,
tf_requires_proper_alignment, { Coldfire seems to need this at least (KB) }
tf_smartlink_library,tf_has_winlike_resources];
cpu : cpu_m68k;
@@ -816,7 +817,7 @@ unit i_linux;
name : 'Linux for MIPSEB';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
- tf_requires_proper_alignment,
+ tf_requires_proper_alignment,tf_pic_uses_got,tf_safecall_exceptions,
tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
cpu : cpu_mipseb;
unit_env : 'LINUXUNITS';
@@ -881,7 +882,7 @@ unit i_linux;
name : 'Linux for MIPSEL';
shortname : 'Linux';
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
- tf_requires_proper_alignment,
+ tf_requires_proper_alignment,tf_pic_uses_got,tf_safecall_exceptions,
tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
cpu : cpu_mipsel;
unit_env : 'LINUXUNITS';
diff --git a/compiler/systems/i_nativent.pas b/compiler/systems/i_nativent.pas
index 325257efb9..02a05775c0 100644
--- a/compiler/systems/i_nativent.pas
+++ b/compiler/systems/i_nativent.pas
@@ -42,7 +42,7 @@ unit i_nativent;
tf_dwarf_only_local_labels];
cpu : cpu_i386;
unit_env : 'NTUNITS';
- extradefines : 'NATIVENT,FPC_OS_UNICODE';
+ extradefines : 'NATIVENT;FPC_OS_UNICODE';
exeext : '.exe';
defext : '.def';
scriptext : '.bat';
diff --git a/compiler/systems/t_aix.pas b/compiler/systems/t_aix.pas
index beb6eec417..0d26dbca1d 100644
--- a/compiler/systems/t_aix.pas
+++ b/compiler/systems/t_aix.pas
@@ -43,6 +43,7 @@ interface
TLinkerAIX=class(texternallinker)
private
prtobj : string[80];
+ assumebinutils,use_gld : boolean;
Function WriteResponseFile(isdll:boolean) : Boolean;
public
constructor Create;override;
@@ -51,7 +52,6 @@ interface
function MakeSharedLibrary:boolean;override;
end;
-
implementation
uses
@@ -117,8 +117,8 @@ begin
sure that the binary does not contain any relocations in the text
section (otherwise you get an error at load time instead of at link time
in case something is wrong) }
- ExeCmd[1]:='ld -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $STRIP -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
- DllCmd[1]:='ld -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $INITFINI $STRIP -G -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
+ ExeCmd[1]:='$LDBIN -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $STRIP -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
+ DllCmd[1]:='$LDBIN -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $INITFINI $STRIP -G -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
if cs_debuginfo in current_settings.moduleswitches then
begin
{ debugging helpers }
@@ -139,6 +139,11 @@ begin
{$else}
{$error unsupported AIX architecture}
{$endif}
+ assumebinutils:=
+ not(cs_link_native in current_settings.globalswitches) or
+ (not(cs_link_on_target in current_settings.globalswitches) and
+ not(source_info.system in systems_aix)) ;
+ use_gld:=assumebinutils and (source_info.system in systems_aix)
end;
@@ -148,12 +153,8 @@ Var
i : longint;
HPath : TCmdStrListItem;
s,s1 : TCmdStr;
- assumebinutils : boolean;
begin
result:=False;
- assumebinutils:=
- not(cs_link_on_target in current_settings.globalswitches) and
- not(source_info.system in systems_aix) ;
{ Open link.res file }
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName,assumebinutils);
with linkres do
@@ -261,6 +262,10 @@ begin
{ Call linker }
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
+ if assumebinutils and (source_info.system in systems_aix) then
+ Replace(binstr,'$LDBIN','gld')
+ else
+ Replace(binstr,'$LDBIN','ld');
binstr:=FindUtil(utilsprefix+BinStr);
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
Replace(cmdstr,'$OPT',Info.ExtraOptions);
@@ -351,6 +356,10 @@ begin
{ Call linker }
SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
+ if assumebinutils and (source_info.system in systems_aix) then
+ Replace(binstr,'$LDBIN','gld')
+ else
+ Replace(binstr,'$LDBIN','ld');
binstr:=FindUtil(utilsprefix+BinStr);
{ on AIX, shared libraries are special object files that are stored inside
an archive. In that archive, the 32 bit version of the library is called
diff --git a/compiler/systems/t_amiga.pas b/compiler/systems/t_amiga.pas
index f7f0c53ea4..3976db7cb2 100644
--- a/compiler/systems/t_amiga.pas
+++ b/compiler/systems/t_amiga.pas
@@ -257,6 +257,7 @@ begin
{ Write used files and libraries }
WriteResponseFile(false);
+ success:=false;
case (target_info.system) of
system_m68k_amiga: success:=MakeAmiga68kExe;
system_powerpc_amiga: success:=MakeAmigaPPCExe;
diff --git a/compiler/systems/t_aros.pas b/compiler/systems/t_aros.pas
new file mode 100644
index 0000000000..06ebc47676
--- /dev/null
+++ b/compiler/systems/t_aros.pas
@@ -0,0 +1,304 @@
+{
+ Copyright (c) 2004-2006 by Free Pascal Development Team
+
+ This unit implements support import, export, link routines
+ for the aros targets (arosOS/i386, arosOS/x86_64)
+
+ 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 t_aros;
+
+{$i fpcdefs.inc}
+
+interface
+
+ uses
+ rescmn, comprsrc, import, export, link, ogbase;
+
+
+type
+
+ timportlibaros=class(timportlib)
+ procedure generatelib; override;
+ end;
+
+
+ PLinkeraros = ^TLinkeraros;
+ TLinkeraros = class(texternallinker)
+ private
+ function WriteResponseFile(isdll: boolean): boolean;
+ procedure Setaros386Info;
+ procedure Setarosx86_64Info;
+ function Makearos386Exe: boolean;
+ function Makearosx86_64Exe: boolean;
+ public
+ constructor Create; override;
+ procedure SetDefaultInfo; override;
+ function MakeExecutable: boolean; override;
+ end;
+
+
+implementation
+
+ uses
+ SysUtils,
+ cutils,cfileutl,cclasses,
+ globtype,globals,systems,verbose,script,fmodule,i_aros;
+
+
+procedure timportlibaros.generatelib;
+var
+ i: longint;
+ ImportLibrary: TImportLibrary;
+begin
+ for i:=0 to current_module.ImportLibraryList.count -1 do
+ begin
+ ImportLibrary := TImportlibrary(current_module.ImportLibraryList[i]);
+ current_module.linkothersharedlibs.add(ImportLibrary.Name, link_always);
+ end;
+end;
+
+{****************************************************************************
+ TLinkeraros
+****************************************************************************}
+
+
+
+constructor TLinkeraros.Create;
+begin
+ Inherited Create;
+ { allow duplicated libs (PM) }
+ SharedLibFiles.doubles:=true;
+ StaticLibFiles.doubles:=true;
+end;
+
+procedure TLinkeraros.Setaros386Info;
+begin
+ with Info do begin
+ { Note: collect-aros seems to be buggy, and doesn't forward options }
+ { properly when calling the underlying GNU LD. (FIXME?) }
+ { This means paths with spaces in them are not supported for now on AROS. }
+ { So for example no Ram Disk: usage for anything which must be linked. (KB) }
+ ExeCmd[1]:='collect-aros $OPT $STRIP -d -n -o $EXE $RES';
+ //ExeCmd[1]:='ld $OPT -d -n -o $EXE $RES';
+ end;
+end;
+
+procedure TLinkeraros.Setarosx86_64Info;
+begin
+ with Info do begin
+ ExeCmd[1]:='ld $OPT -defsym=__AROS__=1 -d -q -n -o $EXE $RES';
+ end;
+end;
+
+procedure TLinkeraros.SetDefaultInfo;
+begin
+ case (target_info.system) of
+ system_i386_aros: Setaros386Info;
+ system_x86_64_aros: Setarosx86_64Info;
+ end;
+end;
+
+
+function TLinkeraros.WriteResponseFile(isdll: boolean): boolean;
+var
+ linkres : TLinkRes;
+ i : longint;
+ HPath : TCmdStrListItem;
+ s,s1 : string;
+ linklibc : boolean;
+begin
+ WriteResponseFile:=False;
+
+ { Open link.res file }
+ LinkRes:=TLinkRes.Create(outputexedir+Info.ResName,true);
+
+ { Write path to search libraries }
+ HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
+ while assigned(HPath) do
+ begin
+ s:=HPath.Str;
+ if (cs_link_on_target in current_settings.globalswitches) then
+ s:=ScriptFixFileName(s);
+ LinkRes.Add('-L'+s);
+ HPath:=TCmdStrListItem(HPath.Next);
+ end;
+ HPath:=TCmdStrListItem(LibrarySearchPath.First);
+ while assigned(HPath) do
+ begin
+ s:=HPath.Str;
+ s1 := Unix2AmigaPath(maybequoted(s));
+ if trim(s1)<>'' then
+ LinkRes.Add('SEARCH_DIR('+s1+')');
+ HPath:=TCmdStrListItem(HPath.Next);
+ end;
+
+ LinkRes.Add('INPUT (');
+ { add objectfiles, start with prt0 always }
+ s:=FindObjectFile('prt0','',false);
+ LinkRes.AddFileName(s);
+ while not ObjectFiles.Empty do
+ begin
+ s:=ObjectFiles.GetFirst;
+ if s<>'' then
+ begin
+ LinkRes.AddFileName(Unix2AmigaPath(maybequoted(s)));
+ end;
+ end;
+
+ { Write staticlibraries }
+ if not StaticLibFiles.Empty then
+ begin
+ LinkRes.Add(')');
+ LinkRes.Add('GROUP(');
+ while not StaticLibFiles.Empty do
+ begin
+ S:=StaticLibFiles.GetFirst;
+ LinkRes.AddFileName(Unix2AmigaPath(maybequoted(s)));
+ end;
+ end;
+
+ if (cs_link_on_target in current_settings.globalswitches) then
+ begin
+ LinkRes.Add(')');
+
+ { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
+ here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
+ linklibc:=false;
+ while not SharedLibFiles.Empty do
+ begin
+ S:=SharedLibFiles.GetFirst;
+ if s<>'c' then
+ begin
+ i:=Pos(target_info.sharedlibext,S);
+ if i>0 then
+ Delete(S,i,255);
+ LinkRes.Add('-l'+s);
+ end
+ else
+ begin
+ LinkRes.Add('-l'+s);
+ linklibc:=true;
+ end;
+ end;
+ { be sure that libc&libgcc is the last lib }
+ if linklibc then
+ begin
+ LinkRes.Add('-lc');
+ LinkRes.Add('-lgcc');
+ end;
+ end
+ else
+ begin
+ while not SharedLibFiles.Empty do
+ begin
+ S:=SharedLibFiles.GetFirst;
+ LinkRes.Add('lib'+s+target_info.staticlibext);
+ end;
+ LinkRes.Add(')');
+ end;
+
+{ Write and Close response }
+ linkres.writetodisk;
+ linkres.free;
+
+ WriteResponseFile:=True;
+end;
+
+
+function TLinkeraros.Makearos386Exe: boolean;
+var
+ BinStr,
+ CmdStr : TCmdStr;
+ StripStr: string[40];
+begin
+ StripStr:='';
+ if (cs_link_strip in current_settings.globalswitches) then StripStr:='-s';
+
+ { Call linker }
+ SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
+ Replace(cmdstr,'$OPT',Info.ExtraOptions);
+ Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename)));
+ Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
+ Replace(cmdstr,'$STRIP',StripStr);
+
+ { Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename^))));
+ Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));}
+
+ Makearos386Exe:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
+end;
+
+
+function TLinkeraros.Makearosx86_64Exe: boolean;
+var
+ BinStr,
+ CmdStr : TCmdStr;
+ StripStr: string[40];
+begin
+ StripStr:='';
+ if (cs_link_strip in current_settings.globalswitches) then StripStr:='-s';
+
+ { Call linker }
+ SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
+ binstr:=FindUtil(utilsprefix+BinStr);
+ Replace(cmdstr,'$OPT',Info.ExtraOptions);
+ Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
+ Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
+ Replace(cmdstr,'$STRIP',StripStr);
+ Makearosx86_64Exe:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+end;
+
+
+function TLinkeraros.MakeExecutable:boolean;
+var
+ success : boolean;
+begin
+ success:=false;
+ if not(cs_link_nolink in current_settings.globalswitches) then
+ Message1(exec_i_linking,current_module.exefilename);
+
+ { Write used files and libraries }
+ WriteResponseFile(false);
+
+ case (target_info.system) of
+ system_i386_aros: success:=Makearos386Exe;
+ system_x86_64_aros: success:=Makearosx86_64Exe;
+ end;
+
+ { Remove ReponseFile }
+ if (success) and not(cs_link_nolink in current_settings.globalswitches) then
+ DeleteFile(outputexedir+Info.ResName);
+
+ MakeExecutable:=success; { otherwise a recursive call to link method }
+end;
+
+
+{*****************************************************************************
+ Initialize
+*****************************************************************************}
+
+initialization
+{$ifdef i386}
+ RegisterLinker(ld_aros,TLinkeraros);
+ RegisterTarget(system_i386_aros_info);
+{$endif i386}
+{$ifdef x86_64}
+ RegisterLinker(ld_aros,TLinkeraros);
+ RegisterTarget(system_x86_64_aros_info);
+{$endif x86_64}
+ RegisterRes(res_elf_info, TWinLikeResourceFile);
+end.
diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas
index 911fcd0e08..b35a78aecb 100644
--- a/compiler/systems/t_bsd.pas
+++ b/compiler/systems/t_bsd.pas
@@ -695,6 +695,12 @@ begin
else
DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
end;
+
+{ Use -nopie on OpenBSD }
+ if (target_info.system in systems_openbsd) and
+ (target_info.system <> system_x86_64_openbsd) then
+ Info.ExtraOptions:=Info.ExtraOptions+' -nopie';
+
{ Write used files and libraries }
WriteResponseFile(false);
@@ -912,6 +918,9 @@ end;
initialization
RegisterLinker(ld_bsd,TLinkerBSD);
{$ifdef x86_64}
+ RegisterImport(system_x86_64_dragonfly,timportlibbsd);
+ RegisterExport(system_x86_64_dragonfly,texportlibbsd);
+ RegisterTarget(system_x86_64_dragonfly_info);
RegisterImport(system_x86_64_freebsd,timportlibbsd);
RegisterExport(system_x86_64_freebsd,texportlibbsd);
RegisterTarget(system_x86_64_freebsd_info);
diff --git a/compiler/systems/t_gba.pas b/compiler/systems/t_gba.pas
index 2dee4d83ea..06d23d2a9b 100644
--- a/compiler/systems/t_gba.pas
+++ b/compiler/systems/t_gba.pas
@@ -571,6 +571,7 @@ begin
StripStr:='';
DynLinkStr:='';
MapStr:='';
+ GCSectionsStr:='';
if (cs_link_strip in current_settings.globalswitches) and
not(cs_link_separate_dbg_file in current_settings.globalswitches) then
diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas
index dd43499fd3..bebd8f7e04 100644
--- a/compiler/systems/t_linux.pas
+++ b/compiler/systems/t_linux.pas
@@ -146,6 +146,7 @@ begin
{$endif}
{$endif arm}
{$ifdef x86_64}
+ if not Dontlinkstdlibpath Then
LibrarySearchPath.AddPath(sysrootpath,'/usr/lib/x86_64-linux-gnu',true);
{$endif x86_64}
end;
diff --git a/compiler/systems/t_morph.pas b/compiler/systems/t_morph.pas
index fedd5c329c..c79d6583f8 100644
--- a/compiler/systems/t_morph.pas
+++ b/compiler/systems/t_morph.pas
@@ -205,13 +205,13 @@ var
success : boolean;
StripStr: string[40];
begin
+ StripStr:='';
if not(cs_link_nolink in current_settings.globalswitches) then
Message1(exec_i_linking,current_module.exefilename);
if UseVLink then
begin
- StripStr:='';
if (cs_link_strip in current_settings.globalswitches) then
StripStr:='-s -P __abox__';
end;
diff --git a/compiler/systems/t_nds.pas b/compiler/systems/t_nds.pas
index 16eab29b5e..93828c28aa 100644
--- a/compiler/systems/t_nds.pas
+++ b/compiler/systems/t_nds.pas
@@ -82,12 +82,14 @@ Var
linklibc,
linklibgcc : boolean;
found1,
- found2 : boolean;
+ found2 : boolean;
begin
WriteResponseFile:=False;
linklibc:=(SharedLibFiles.Find('c')<>nil);
linklibgcc:=(SharedLibFiles.Find('gcc')<>nil);
-
+
+ prtobj:='';
+ cprtobj:='';
case apptype of
app_arm9:
begin
@@ -243,20 +245,19 @@ begin
begin
if apptype=app_arm9 then //ARM9
begin
- add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")');
- add('OUTPUT_ARCH(arm)');
- add('ENTRY(_start)');
- add('');
add('MEMORY {');
- add('');
add(' rom : ORIGIN = 0x08000000, LENGTH = 32M');
add(' ewram : ORIGIN = 0x02000000, LENGTH = 4M - 4k');
add(' dtcm : ORIGIN = 0x0b000000, LENGTH = 16K');
- add(' vectors : ORIGIN = 0x01000000, LENGTH = 256');
- add(' itcm : ORIGIN = 0x01000100, LENGTH = 32K - 256');
+ add(' vectors : ORIGIN = 0x01000000, LENGTH = 256');
+ add(' itcm : ORIGIN = 0x01000100, LENGTH = 32K - 256');
add('}');
add('');
- add('__vectors_start = ORIGIN(vectors);');
+ add('OUTPUT_ARCH(arm)');
+ add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")');
+ add('ENTRY(_start)');
+ add('');
+ add('__vectors_start = ORIGIN(vectors);');
add('__itcm_start = ORIGIN(itcm);');
add('__ewram_end = ORIGIN(ewram) + LENGTH(ewram);');
add('__eheap_end = ORIGIN(ewram) + LENGTH(ewram);');
@@ -276,7 +277,7 @@ begin
add(' __text_start = . ;');
add(' KEEP (*(.init))');
add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
- add(' } >ewram = 0xff');
+ add(' } >ewram = 0xff');
add('');
add(' .plt : { *(.plt) } >ewram = 0xff');
add('');
@@ -312,36 +313,40 @@ begin
add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
add(' } >ewram = 0xff');
add('');
- add(' .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ewram');
- add(' __exidx_start = .;');
- add(' .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >ewram');
- add(' __exidx_end = .;');
- add(' /* Ensure the __preinit_array_start label is properly aligned. We');
- add(' could instead move the label definition inside the section, but');
- add(' the linker would then create the section even if it turns out to');
- add(' be empty, which isn''t pretty. */');
- add(' . = ALIGN(32 / 8);');
- add(' PROVIDE (__preinit_array_start = .);');
- add(' .preinit_array : { KEEP (*(.preinit_array)) } >ewram = 0xff');
- add(' PROVIDE (__preinit_array_end = .);');
- add(' PROVIDE (__init_array_start = .);');
- add(' .init_array :');
- add(' {');
- add(' KEEP (*(SORT(.init_array.*)))');
- add(' KEEP (*(.init_array))');
- add(' } >ewram = 0xff');
- add(' PROVIDE (__init_array_end = .);');
- add(' PROVIDE (__fini_array_start = .);');
- add(' .fini_array :');
- add(' {');
- add(' KEEP (*(.fini_array))');
- add(' KEEP (*(SORT(.fini_array.*)))');
- add(' } >ewram = 0xff');
- add(' PROVIDE (__fini_array_end = .);');
+ add(' .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ewram');
+ add(' __exidx_start = .;');
+ add(' ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >ewram');
+ add(' __exidx_end = .;');
+ add('');
+ add(' /* Ensure the __preinit_array_start label is properly aligned. We');
+ add(' could instead move the label definition inside the section, but');
+ add(' the linker would then create the section even if it turns out to');
+ add(' be empty, which isn''t pretty. */');
+ add('');
+ add(' . = ALIGN(32 / 8);');
+ add('');
+ add(' PROVIDE (__preinit_array_start = .);');
+ add(' .preinit_array : { KEEP (*(.preinit_array)) } >ewram = 0xff');
+ add(' PROVIDE (__preinit_array_end = .);');
+ add(' PROVIDE (__init_array_start = .);');
+ add(' .init_array :');
+ add(' {');
+ add(' KEEP (*(SORT(.init_array.*)))');
+ add(' KEEP (*(.init_array))');
+ add(' } >ewram = 0xff');
+ add(' PROVIDE (__init_array_end = .);');
+ add(' PROVIDE (__fini_array_start = .);');
+ add(' .fini_array :');
+ add(' {');
+ add(' KEEP (*(.fini_array))');
+ add(' KEEP (*(SORT(.fini_array.*)))');
+ add(' } >ewram = 0xff');
+ add('');
+ add(' PROVIDE (__fini_array_end = .);');
add('');
add(' .ctors :');
add(' {');
- add(' /* gcc uses crtbegin.o to find the start of the constructors, so');
+ add(' /* gcc uses crtbegin.o to find the start of the constructors, so');
add(' we make sure it is first. Because this is a wildcard, it');
add(' doesn''t matter if the user does not actually link against');
add(' crtbegin.o; the linker won''t look for a file to match a');
@@ -392,7 +397,6 @@ begin
add(' *(.data)');
add(' *(.data.*)');
add(' *(.gnu.linkonce.d*)');
- add(' *(.fpc*)');
add(' CONSTRUCTORS');
add(' . = ALIGN(4);');
add(' __data_end = ABSOLUTE(.) ;');
@@ -408,7 +412,7 @@ begin
add(' *(.dtcm.*)');
add(' . = ALIGN(4);');
add(' __dtcm_end = ABSOLUTE(.);');
- add(' } >dtcm = 0xff');
+ add(' } >dtcm = 0xff');
add('');
add('');
add(' __itcm_lma = __dtcm_lma + SIZEOF(.dtcm);');
@@ -420,29 +424,27 @@ begin
add(' . = ALIGN(4);');
add(' __itcm_end = ABSOLUTE(.);');
add(' } >itcm = 0xff');
+ add(' ');
+ add(' __vectors_lma = __itcm_lma + SIZEOF(.itcm);');
add('');
-
- add(' __vectors_lma = __itcm_lma + SIZEOF(.itcm);');
- add(' .vectors __vectors_start : AT (__vectors_lma)');
- add(' {');
- add(' *(.vectors)');
- add(' *vectors.*(.text)');
- add(' . = ALIGN(4);');
- add(' __vectors_end = ABSOLUTE(.);');
- add(' } >vectors = 0xff');
- add('');
- add(' .sbss __dtcm_end (NOLOAD):');
+ add(' .vectors __vectors_start : AT (__vectors_lma)');
+ add(' {');
+ add(' *(.vectors)');
+ add(' *vectors.*(.text)');
+ add(' . = ALIGN(4);');
+ add(' __vectors_end = ABSOLUTE(.);');
+ add(' } >vectors = 0xff');
+ add(' ');
+ add(' .sbss __dtcm_end (NOLOAD): ');
add(' {');
add(' __sbss_start = ABSOLUTE(.);');
add(' __sbss_start__ = ABSOLUTE(.);');
add(' *(.sbss)');
add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
add(' __sbss_end = ABSOLUTE(.);');
- add(' } >dtcm');
- add('');
+ add(' } >dtcm ');
add('');
- add('');
- add(' .bss __bss_vma (NOLOAD):');
+ add(' .bss __bss_vma (NOLOAD): ');
add(' {');
add(' __bss_start = ABSOLUTE(.);');
add(' __bss_start__ = ABSOLUTE(.);');
@@ -453,7 +455,8 @@ begin
add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
add(' __bss_end__ = ABSOLUTE(.) ;');
add(' __end__ = ABSOLUTE(.) ;');
- add(' } AT>ewram');
+ add(' } AT>ewram ');
+ add('');
add('');
add('');
add(' /* Stabs debugging sections. */');
@@ -492,6 +495,7 @@ begin
add(' .stack 0x80000 : { _stack = .; *(.stack) }');
add(' /* These must appear regardless of . */');
add('}');
+ add('');
end;
if apptype=app_arm7 then
begin
@@ -501,12 +505,13 @@ begin
add('');
add('MEMORY {');
add('');
- add(' rom : ORIGIN = 0x08000000, LENGTH = 32M');
- add(' iwram : ORIGIN = 0x037f8000, LENGTH = 96K');
+ add(' rom : ORIGIN = 0x08000000, LENGTH = 32M');
+ add(' iwram : ORIGIN = 0x037f8000, LENGTH = 96K ');
add('}');
add('');
add('__iwram_start = ORIGIN(iwram);');
add('__iwram_top = ORIGIN(iwram)+ LENGTH(iwram);');
+ add('');
add('__sp_irq = __iwram_top - 0x100;');
add('__sp_svc = __sp_irq - 0x100;');
add('__sp_usr = __sp_svc - 0x100;');
@@ -527,9 +532,8 @@ begin
add('');
add(' .text : /* ALIGN (4): */');
add(' {');
- add('');
- add(' *(.text .stub .text.* .gnu.linkonce.t.*)');
- add(' KEEP (*(.text.*personality*))');
+ add(' *(.text .stub .text.* .gnu.linkonce.t.*)');
+ add(' KEEP (*(.text.*personality*))');
add(' /* .gnu.warning sections are handled specially by elf32.em. */');
add(' *(.gnu.warning)');
add(' *(.glue_7t) *(.glue_7) *(.vfp11_veneer)');
@@ -612,30 +616,16 @@ begin
add(' .jcr : { KEEP (*(.jcr)) } >iwram = 0');
add(' .got : { *(.got.plt) *(.got) } >iwram = 0');
add('');
- add('');
- add(' .iwram ALIGN(4) :');
- add(' {');
- add(' __iwram_start = ABSOLUTE(.) ;');
- add(' *(.iwram)');
- add(' *iwram.*(.text)');
- add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
- add(' __iwram_end = ABSOLUTE(.) ;');
- add(' } >iwram = 0xff');
- add('');
- add('');
add(' .data ALIGN(4) : {');
add(' __data_start = ABSOLUTE(.);');
add(' *(.data)');
add(' *(.data.*)');
add(' *(.gnu.linkonce.d*)');
- add(' *(.fpc*)');
add(' CONSTRUCTORS');
add(' . = ALIGN(4);');
add(' __data_end = ABSOLUTE(.) ;');
add(' } >iwram = 0xff');
add('');
- add('');
- add('');
add(' .bss ALIGN(4) :');
add(' {');
add(' __bss_start = ABSOLUTE(.);');
@@ -714,6 +704,8 @@ begin
StripStr:='';
MapStr:='';
DynLinkStr:='';
+ GCSectionsStr:='';
+ preName:='';
case apptype of
app_arm9: preName:='.nef';
app_arm7: preName:='.nlf';
diff --git a/compiler/systems/t_os2.pas b/compiler/systems/t_os2.pas
index 064169836c..f6d9f4d65b 100644
--- a/compiler/systems/t_os2.pas
+++ b/compiler/systems/t_os2.pas
@@ -396,7 +396,7 @@ begin
with Info do
begin
ExeCmd[1]:='ld $OPT -o $OUT @$RES';
- ExeCmd[2]:='emxbind -b $STRIP $MAP $APPTYPE $RSRC -k$STACKKB -h1 -o $EXE $OUT -ai -s8';
+ ExeCmd[2]:='emxbind -b $STRIP $MAP $APPTYPE $RSRC -k$STACKKB -h1 -q -o $EXE $OUT -ai -s8';
if Source_Info.Script = script_dos then
ExeCmd[3]:='del $OUT';
end;
@@ -533,7 +533,11 @@ begin
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
*)
Replace(cmdstr,'$RES',outputexedir+Info.ResName);
- Replace(cmdstr,'$OPT ',Info.ExtraOptions);
+ if (Info.ExtraOptions <> '') and
+ (Info.ExtraOptions [Length (Info.ExtraOptions)] <> ' ') then
+ Replace(cmdstr,'$OPT',Info.ExtraOptions)
+ else
+ Replace(cmdstr,'$OPT ',Info.ExtraOptions);
Replace(cmdstr,'$RSRC ',RsrcStr);
Replace(cmdstr,'$OUT',maybequoted(OutName));
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
diff --git a/compiler/systems/t_sunos.pas b/compiler/systems/t_sunos.pas
index 63788fd288..f369acaa77 100644
--- a/compiler/systems/t_sunos.pas
+++ b/compiler/systems/t_sunos.pas
@@ -143,12 +143,12 @@ procedure TLinkersolaris.SetDefaultInfo;
}
{$ifdef x86_64}
const
- gld = 'gld -m elf_x86_64 ';
+ gld = 'gld -m elf_x86_64_sol2 ';
solaris_ld = '/usr/bin/ld -64 ';
{$endif}
{$ifdef i386}
const
- gld = 'gld ';
+ gld = 'gld -m elf_i386_sol2 ';
solaris_ld = '/usr/bin/ld ';
{$endif }
{$ifdef sparc}
diff --git a/compiler/tgobj.pas b/compiler/tgobj.pas
index 30bcb55470..6c47ba2ad0 100644
--- a/compiler/tgobj.pas
+++ b/compiler/tgobj.pas
@@ -92,7 +92,7 @@ unit tgobj;
the forcesize parameter is so that it can be used for defs that
don't have an inherent size (e.g., array of const) }
- procedure gethltemp(list: TAsmList; def: tdef; forcesize: aint; temptype: ttemptype; out ref: treference); virtual;
+ procedure gethltemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference); virtual;
procedure gethltemptyped(list: TAsmList; def: tdef; temptype: ttemptype; out ref: treference); virtual;
procedure gettemp(list: TAsmList; size, alignment : longint;temptype:ttemptype;out ref : treference);
procedure gettemptyped(list: TAsmList; def:tdef;temptype:ttemptype;out ref : treference);
@@ -521,7 +521,7 @@ implementation
end;
- procedure ttgobj.gethltemp(list: TAsmList; def: tdef; forcesize: aint; temptype: ttemptype; out ref: treference);
+ procedure ttgobj.gethltemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference);
begin
gettemp(list,forcesize,def.alignment,temptype,ref);
end;
diff --git a/compiler/tokens.pas b/compiler/tokens.pas
index 09054ade2b..31a1b8500c 100644
--- a/compiler/tokens.pas
+++ b/compiler/tokens.pas
@@ -187,6 +187,7 @@ type
_STRICT,
_STRING,
_SYSTEM,
+ _WINAPI,
_ASMNAME,
_CPPDECL,
_DEFAULT,
@@ -506,6 +507,7 @@ const
(str:'STRICT' ;special:false;keyword:[m_none];op:NOTOKEN),
(str:'STRING' ;special:false;keyword:alllanguagemodes-[m_iso];op:NOTOKEN),
(str:'SYSTEM' ;special:false;keyword:[m_none];op:NOTOKEN),
+ (str:'WINAPI' ;special:false;keyword:[m_none];op:NOTOKEN),
(str:'ASMNAME' ;special:false;keyword:[m_none];op:NOTOKEN),
(str:'CPPDECL' ;special:false;keyword:[m_none];op:NOTOKEN),
(str:'DEFAULT' ;special:false;keyword:[m_none];op:NOTOKEN),
diff --git a/compiler/utils/Makefile b/compiler/utils/Makefile
index 72d50d224c..c4bc0d14b3 100644
--- a/compiler/utils/Makefile
+++ b/compiler/utils/Makefile
@@ -1,9 +1,9 @@
#
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-03-19 rev 27188]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
#
default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
UNIXs = linux $(BSDs) solaris qnx haiku aix
LIMIT83fs = go32v2 os2 emx watcom msdos
OSNeedsComspecToRunBatch = go32v2 watcom
@@ -394,6 +394,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
endif
@@ -481,6 +484,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
+endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove mkarmins mkx86ins
endif
@@ -619,6 +625,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override CLEAN_UNITS+=ppu crc
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override CLEAN_UNITS+=ppu crc
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override CLEAN_UNITS+=ppu crc
endif
@@ -706,6 +715,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override CLEAN_UNITS+=ppu crc
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override CLEAN_UNITS+=ppu crc
+endif
ifeq ($(FULL_TARGET),arm-linux)
override CLEAN_UNITS+=ppu crc
endif
@@ -845,6 +857,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_UNITDIR+=..
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_UNITDIR+=..
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_UNITDIR+=..
endif
@@ -932,6 +947,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_UNITDIR+=..
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_UNITDIR+=..
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_UNITDIR+=..
endif
@@ -1070,6 +1088,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
override COMPILER_SOURCEDIR+=..
endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=..
+endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_SOURCEDIR+=..
endif
@@ -1157,6 +1178,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_SOURCEDIR+=..
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=..
+endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_SOURCEDIR+=..
endif
@@ -1470,6 +1494,12 @@ EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=lnx
endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
ifeq ($(OS_TARGET),freebsd)
BATCHEXT=.sh
EXEEXT=
@@ -1515,6 +1545,11 @@ EXEEXT=
SHAREDLIBEXT=.library
SHORTSUFFIX=amg
endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
ifeq ($(OS_TARGET),morphos)
EXEEXT=
SHAREDLIBEXT=.library
@@ -1936,6 +1971,9 @@ endif
ifeq ($(FULL_TARGET),i386-android)
REQUIRE_PACKAGES_RTL=1
endif
+ifeq ($(FULL_TARGET),i386-aros)
+REQUIRE_PACKAGES_RTL=1
+endif
ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1
endif
@@ -2023,6 +2061,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-embedded)
REQUIRE_PACKAGES_RTL=1
endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+REQUIRE_PACKAGES_RTL=1
+endif
ifeq ($(FULL_TARGET),arm-linux)
REQUIRE_PACKAGES_RTL=1
endif
@@ -2243,7 +2284,7 @@ endif
ifdef CREATESHARED
override FPCOPT+=-Cg
endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
ifeq ($(CPU_TARGET),x86_64)
override FPCOPT+=-Cg
endif
@@ -2273,17 +2314,23 @@ ifdef ACROSSCOMPILE
override FPCOPT+=$(CROSSOPT)
endif
override COMPILER:=$(strip $(FPC) $(FPCOPT))
-ifeq (,$(findstring -s ,$(COMPILER)))
+ifneq (,$(findstring -sh ,$(COMPILER)))
+UseEXECPPAS=1
+endif
+ifneq (,$(findstring -s ,$(COMPILER)))
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+UseEXECPPAS=1
+endif
+endif
+ifneq ($(UseEXECPPAS),1)
EXECPPAS=
else
-ifeq ($(FULL_SOURCE),$(FULL_TARGET))
ifdef RUNBATCH
EXECPPAS:=@$(RUNBATCH) $(PPAS)
else
EXECPPAS:=@$(PPAS)
endif
endif
-endif
.PHONY: fpc_exes
ifndef CROSSINSTALL
ifneq ($(TARGET_PROGRAMS),)
diff --git a/compiler/utils/fpc.pp b/compiler/utils/fpc.pp
index 9d2de163ad..7da8dd2e1a 100644
--- a/compiler/utils/fpc.pp
+++ b/compiler/utils/fpc.pp
@@ -29,19 +29,15 @@ program fpc;
{$ifdef UNIX}
exeext='';
{$else UNIX}
- {$ifdef AMIGA}
+ {$ifdef HASAMIGA}
exeext='';
{$else}
- {$ifdef MORPHOS}
- exeext='';
- {$else}
- {$ifdef NETWARE}
+ {$ifdef NETWARE}
exeext='.nlm';
- {$else}
+ {$else}
exeext='.exe';
- {$endif NETWARE}
- {$endif MORPHOS}
- {$endif AMIGA}
+ {$endif NETWARE}
+ {$endif HASAMIGA}
{$endif UNIX}
diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp
index 9d8d4dd560..24c58cff0d 100644
--- a/compiler/utils/ppuutils/ppudump.pp
+++ b/compiler/utils/ppuutils/ppudump.pp
@@ -164,7 +164,10 @@ const
{ 79 } 'MSDOS-i8086',
{ 80 } 'Android-MIPSel',
{ 81 } 'Embedded-mipseb',
- { 82 } 'Embedded-mipsel'
+ { 82 } 'Embedded-mipsel',
+ { 83 } 'AROS-i386',
+ { 84 } 'AROS-x86-64',
+ { 85 } 'DragonFly-x86-64'
);
const
@@ -1100,9 +1103,7 @@ end;
disabledircache : boolean;
{ CPU targets with microcontroller support can add a controller specific unit }
-{$if defined(ARM) or defined(AVR) or defined(MIPSEL)}
controllertype : tcontrollertype;
-{$endif defined(ARM) or defined(AVR) or defined(MIPSEL)}
{ WARNING: this pointer cannot be written as such in record token }
pmessage : pmessagestaterecord;
end;
@@ -1526,6 +1527,19 @@ begin
end;
end;
+ if [df_generic,df_specialization]*defoptions<>[] then
+ begin
+ nb:=ppufile.getlongint;
+ writeln([space,'has ',nb,' parameters']);
+ if nb>0 then
+ begin
+ for i:=0 to nb-1 do
+ begin
+ writeln([space,'parameter ',i,': ',ppufile.getstring]);
+ readderef(space);
+ end;
+ end;
+ end;
if df_generic in defoptions then
begin
tokenbufsize:=ppufile.getlongint;
@@ -1724,6 +1738,7 @@ const
(mask:po_syscall_basesysv;str:'SyscallBaseSysV'),
(mask:po_syscall_sysvbase;str:'SyscallSysVBase'),
(mask:po_syscall_r12base; str:'SyscallR12Base'),
+ (mask:po_syscall_has_libsym; str:'Has LibSym'),
(mask:po_inline; str:'Inline'),
(mask:po_compilerproc; str:'CompilerProc'),
(mask:po_has_importdll; str:'HasImportDLL'),
@@ -1804,6 +1819,8 @@ begin
i:=ppufile.getbyte;
ppufile.getdata(tempbuf,i);
end;
+ if po_syscall_has_libsym in procoptions then
+ readderef(space);
end;
@@ -2867,6 +2884,8 @@ begin
writeln([space,' Range : ',arrdef.RangeLow,' to ',arrdef.RangeHigh]);
write ([space,' Options : ']);
readarraydefoptions(arrdef);
+ if tsystemcpu(ppufile.header.cpu)=cpu_i8086 then
+ writeln([space,' Huge : ',(getbyte<>0)]);
readsymtable('symbols', arrdef);
end;
diff --git a/compiler/utils/samplecfg b/compiler/utils/samplecfg
index c48c0b9e6a..0f08fefd10 100644
--- a/compiler/utils/samplecfg
+++ b/compiler/utils/samplecfg
@@ -99,4 +99,4 @@ ${FPCMKCFGBIN} -p -3 $compilerconfigdir -o $fppkgfile
# Write default
echo Writing sample configuration file to $defaultfile
-${FPCMKCFGBIN} -p -4 -d "GlobalPrefix=$FPCGLOBALPREFIX" -o $defaultfile
+${FPCMKCFGBIN} -p -4 -d "GlobalPrefix=$FPCGLOBALPREFIX" -d "FpcBin=$FPCBIN" -o $defaultfile
diff --git a/compiler/version.pas b/compiler/version.pas
index f51fcde36a..89aa439e61 100644
--- a/compiler/version.pas
+++ b/compiler/version.pas
@@ -27,8 +27,8 @@ interface
const
{ version string }
- version_nr = '2';
- release_nr = '7';
+ version_nr = '3';
+ release_nr = '1';
patch_nr = '1';
minorpatch = '';
diff --git a/compiler/vis/cpuinfo.pas b/compiler/vis/cpuinfo.pas
index ef0fa47113..ccc3d9bbaa 100644
--- a/compiler/vis/cpuinfo.pas
+++ b/compiler/vis/cpuinfo.pas
@@ -16,6 +16,9 @@ Unit CPUInfo;
Interface
+uses
+ globtype;
+
Type
{ Architecture word - Native unsigned type }
AWord = Longword;
@@ -31,6 +34,9 @@ Type
TConstPtrUInt = Longword;
bestreal = double;
+{$if FPC_FULLVERSION>20700}
+ bestrealrec = TDoubleRec;
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -41,7 +47,15 @@ Type
{ possible supported processors for this target }
tcputype = (cpu_none);
+ tcontrollertype =
+ (ct_none
+ );
+
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = false;
{# Size of native extended floating point type }
extended_size = 8;
{# Size of a pointer }
@@ -51,6 +65,15 @@ Const
{ target cpu string (used by compiler options) }
target_cpu_string = 'vis';
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
Implementation
end.
diff --git a/compiler/x86/aasmcpu.pas b/compiler/x86/aasmcpu.pas
index 89995f8df8..9462f72f01 100644
--- a/compiler/x86/aasmcpu.pas
+++ b/compiler/x86/aasmcpu.pas
@@ -1239,7 +1239,7 @@ implementation
assembler }
end;
else
- internalerror(200402261);
+ internalerror(200402266);
end;
end;
end;
@@ -1827,9 +1827,13 @@ implementation
{No register, so memory reference.}
if (input.typ<>top_ref) then
internalerror(200409262);
- if ((input.ref^.index<>NR_NO) and (getregtype(input.ref^.index)<>R_INTREGISTER)) or
+
+ if ((input.ref^.index<>NR_NO) and (getregtype(input.ref^.index)=R_MMREGISTER) and (input.ref^.base<>NR_NO) and (getregtype(input.ref^.base)<>R_INTREGISTER)) or // vector memory (AVX2)
+ ((input.ref^.index<>NR_NO) and (getregtype(input.ref^.index)<>R_INTREGISTER) and (getregtype(input.ref^.index)<>R_MMREGISTER)) or
((input.ref^.base<>NR_NO) and (getregtype(input.ref^.base)<>R_INTREGISTER)) then
- internalerror(200301081);
+ internalerror(200301081);
+
+
ir:=input.ref^.index;
br:=input.ref^.base;
isub:=getsubreg(ir);
@@ -1849,8 +1853,15 @@ implementation
{ it's an indirection }
begin
{ 16 bit address? }
- if ((ir<>NR_NO) and (isub<>R_SUBADDR)) or
- ((br<>NR_NO) and (bsub<>R_SUBADDR)) then
+
+ if ((ir<>NR_NO) and (isub in [R_SUBMMX,R_SUBMMY]) and
+ (br<>NR_NO) and (bsub=R_SUBADDR)
+ ) then
+ begin
+ // vector memory (AVX2) =>> ignore
+ end
+ else if ((ir<>NR_NO) and (isub<>R_SUBADDR)) or
+ ((br<>NR_NO) and (bsub<>R_SUBADDR)) then
message(asmw_e_16bit_not_supported);
{$ifdef OPTEA}
{ make single reg base }
@@ -1893,14 +1904,30 @@ implementation
end;
{ index }
case ir of
- NR_EAX : index:=0;
- NR_ECX : index:=1;
- NR_EDX : index:=2;
- NR_EBX : index:=3;
- NR_NO : index:=4;
- NR_EBP : index:=5;
- NR_ESI : index:=6;
- NR_EDI : index:=7;
+ NR_EAX,
+ NR_XMM0,
+ NR_YMM0: index:=0;
+ NR_ECX,
+ NR_XMM1,
+ NR_YMM1: index:=1;
+ NR_EDX,
+ NR_XMM2,
+ NR_YMM2: index:=2;
+ NR_EBX,
+ NR_XMM3,
+ NR_YMM3: index:=3;
+ NR_NO,
+ NR_XMM4,
+ NR_YMM4: index:=4;
+ NR_EBP,
+ NR_XMM5,
+ NR_YMM5: index:=5;
+ NR_ESI,
+ NR_XMM6,
+ NR_YMM6: index:=6;
+ NR_EDI,
+ NR_XMM7,
+ NR_YMM7: index:=7;
else
exit;
end;
@@ -3290,46 +3317,44 @@ implementation
RegXMMSizeMask := RegXMMSizeMask;
end;
-
-
for j := 0 to insentry^.ops -1 do
begin
if (insentry^.optypes[j] and OT_REGISTER) = OT_REGISTER then
- begin
- inc(actRegCount);
-
- NewRegSize := (insentry^.optypes[j] and OT_SIZE_MASK);
- if NewRegSize = 0 then
begin
- case insentry^.optypes[j] and (OT_MMXREG OR OT_XMMREG OR OT_YMMREG) of
- OT_MMXREG: begin
- NewRegSize := OT_BITS64;
- end;
- OT_XMMREG: begin
- NewRegSize := OT_BITS128;
- InsTabMemRefSizeInfoCache^[AsmOp].ExistsSSEAVX := true;
- end;
- OT_YMMREG: begin
- NewRegSize := OT_BITS256;
- InsTabMemRefSizeInfoCache^[AsmOp].ExistsSSEAVX := true;
- end;
- else NewRegSize := not(0);
+ inc(actRegCount);
+
+ NewRegSize := (insentry^.optypes[j] and OT_SIZE_MASK);
+ if NewRegSize = 0 then
+ begin
+ case insentry^.optypes[j] and (OT_MMXREG OR OT_XMMREG OR OT_YMMREG) of
+ OT_MMXREG: begin
+ NewRegSize := OT_BITS64;
+ end;
+ OT_XMMREG: begin
+ NewRegSize := OT_BITS128;
+ InsTabMemRefSizeInfoCache^[AsmOp].ExistsSSEAVX := true;
+ end;
+ OT_YMMREG: begin
+ NewRegSize := OT_BITS256;
+ InsTabMemRefSizeInfoCache^[AsmOp].ExistsSSEAVX := true;
+ end;
+ else NewRegSize := not(0);
+ end;
end;
- end;
actRegSize := actRegSize or NewRegSize;
actRegTypes := actRegTypes or (insentry^.optypes[j] and (OT_MMXREG OR OT_XMMREG OR OT_YMMREG));
- end
+ end
else if ((insentry^.optypes[j] and OT_MEMORY) <> 0) then
- begin
- inc(actMemCount);
-
- actMemSize := actMemSize or (insentry^.optypes[j] and OT_SIZE_MASK);
- if (insentry^.optypes[j] and OT_REGMEM) = OT_REGMEM then
begin
- actRegMemTypes := actRegMemTypes or insentry^.optypes[j];
- end;
- end
+ inc(actMemCount);
+
+ actMemSize:=actMemSize or (insentry^.optypes[j] and OT_SIZE_MASK);
+ if (insentry^.optypes[j] and OT_REGMEM) = OT_REGMEM then
+ begin
+ actRegMemTypes := actRegMemTypes or insentry^.optypes[j];
+ end;
+ end
else if ((insentry^.optypes[j] and OT_IMMEDIATE) = OT_IMMEDIATE) then
begin
inc(actConstCount);
@@ -3341,12 +3366,12 @@ implementation
if actConstCount > 0 then
begin
case actConstSize of
- 0: SConstInfo := csiNoSize;
- OT_BITS8: SConstInfo := csiMem8;
+ 0: SConstInfo := csiNoSize;
+ OT_BITS8: SConstInfo := csiMem8;
OT_BITS16: SConstInfo := csiMem16;
OT_BITS32: SConstInfo := csiMem32;
OT_BITS64: SConstInfo := csiMem64;
- else SConstInfo := csiMultiple;
+ else SConstInfo := csiMultiple;
end;
if InsTabMemRefSizeInfoCache^[AsmOp].ConstSize = csiUnkown then
@@ -3371,59 +3396,57 @@ implementation
end;
case actMemSize of
- 0: MRefInfo := msiNoSize;
- OT_BITS8: MRefInfo := msiMem8;
- OT_BITS16: MRefInfo := msiMem16;
- OT_BITS32: MRefInfo := msiMem32;
- OT_BITS64: MRefInfo := msiMem64;
+ 0: MRefInfo := msiNoSize;
+ OT_BITS8: MRefInfo := msiMem8;
+ OT_BITS16: MRefInfo := msiMem16;
+ OT_BITS32: MRefInfo := msiMem32;
+ OT_BITS64: MRefInfo := msiMem64;
OT_BITS128: MRefInfo := msiMem128;
OT_BITS256: MRefInfo := msiMem256;
OT_BITS80,
- OT_FAR,
- OT_NEAR,
- OT_SHORT: ; // ignore
- else begin
- bitcount := bitcnt(actMemSize);
-
- if bitcount > 1 then MRefInfo := msiMultiple
- else InternalError(777203);
- end;
+ OT_FAR,
+ OT_NEAR,
+ OT_SHORT: ; // ignore
+ else
+ begin
+ bitcount := bitcnt(actMemSize);
+
+ if bitcount > 1 then MRefInfo := msiMultiple
+ else InternalError(777203);
+ end;
end;
if InsTabMemRefSizeInfoCache^[AsmOp].MemRefSize = msiUnkown then
- begin
- InsTabMemRefSizeInfoCache^[AsmOp].MemRefSize := MRefInfo;
- end
+ begin
+ InsTabMemRefSizeInfoCache^[AsmOp].MemRefSize := MRefInfo;
+ end
else if InsTabMemRefSizeInfoCache^[AsmOp].MemRefSize <> MRefInfo then
- begin
- with InsTabMemRefSizeInfoCache^[AsmOp] do
begin
-
-
- if ((MemRefSize = msiMem8) OR (MRefInfo = msiMem8)) then MemRefSize := msiMultiple8
- else if ((MemRefSize = msiMem16) OR (MRefInfo = msiMem16)) then MemRefSize := msiMultiple16
- else if ((MemRefSize = msiMem32) OR (MRefInfo = msiMem32)) then MemRefSize := msiMultiple32
- else if ((MemRefSize = msiMem64) OR (MRefInfo = msiMem64)) then MemRefSize := msiMultiple64
- else if ((MemRefSize = msiMem128) OR (MRefInfo = msiMem128)) then MemRefSize := msiMultiple128
- else if ((MemRefSize = msiMem256) OR (MRefInfo = msiMem256)) then MemRefSize := msiMultiple256
-
- else MemRefSize := msiMultiple;
- end;
+ with InsTabMemRefSizeInfoCache^[AsmOp] do
+ begin
+ if ((MemRefSize = msiMem8) OR (MRefInfo = msiMem8)) then MemRefSize := msiMultiple8
+ else if ((MemRefSize = msiMem16) OR (MRefInfo = msiMem16)) then MemRefSize := msiMultiple16
+ else if ((MemRefSize = msiMem32) OR (MRefInfo = msiMem32)) then MemRefSize := msiMultiple32
+ else if ((MemRefSize = msiMem64) OR (MRefInfo = msiMem64)) then MemRefSize := msiMultiple64
+ else if ((MemRefSize = msiMem128) OR (MRefInfo = msiMem128)) then MemRefSize := msiMultiple128
+ else if ((MemRefSize = msiMem256) OR (MRefInfo = msiMem256)) then MemRefSize := msiMultiple256
+ else MemRefSize := msiMultiple;
+ end;
end;
if actRegCount > 0 then
- begin
- case actRegTypes and (OT_MMXREG or OT_XMMREG or OT_YMMREG) of
- OT_MMXREG: RegMMXSizeMask := RegMMXSizeMask or actMemSize;
- OT_XMMREG: RegXMMSizeMask := RegXMMSizeMask or actMemSize;
- OT_YMMREG: RegYMMSizeMask := RegYMMSizeMask or actMemSize;
- else begin
- RegMMXSizeMask := not(0);
- RegXMMSizeMask := not(0);
- RegYMMSizeMask := not(0);
- end;
+ begin
+ case actRegTypes and (OT_MMXREG or OT_XMMREG or OT_YMMREG) of
+ OT_MMXREG: RegMMXSizeMask := RegMMXSizeMask or actMemSize;
+ OT_XMMREG: RegXMMSizeMask := RegXMMSizeMask or actMemSize;
+ OT_YMMREG: RegYMMSizeMask := RegYMMSizeMask or actMemSize;
+ else begin
+ RegMMXSizeMask := not(0);
+ RegXMMSizeMask := not(0);
+ RegYMMSizeMask := not(0);
+ end;
+ end;
end;
- end;
end;
else InternalError(777202);
end;
diff --git a/compiler/x86/agx86att.pas b/compiler/x86/agx86att.pas
index 3c58323d9c..ab2970b762 100644
--- a/compiler/x86/agx86att.pas
+++ b/compiler/x86/agx86att.pas
@@ -163,18 +163,19 @@ interface
if assigned(relsymbol) then
owner.AsmWrite('-'+relsymbol.name);
if ref.refaddr=addr_pic then
-{$ifdef x86_64}
begin
- { local symbols don't have to (and in case of Mac OS X: cannot)
- be accessed via the GOT
- }
- if not assigned(ref.symbol) or
- (ref.symbol.bind<>AB_LOCAL) then
- owner.AsmWrite('@GOTPCREL');
- end;
+ { @GOT and @GOTPCREL references are only allowed for symbol alone,
+ indexing, relsymbol or offset cannot be present. }
+ if assigned(relsymbol) or (offset<>0) or (index<>NR_NO) then
+ InternalError(2015011801);
+{$ifdef x86_64}
+ if (base<>NR_RIP) then
+ InternalError(2015011802);
+ owner.AsmWrite('@GOTPCREL');
{$else x86_64}
- owner.AsmWrite('@GOT');
+ owner.AsmWrite('@GOT');
{$endif x86_64}
+ end;
if offset<0 then
owner.AsmWrite(tostr(offset))
else
@@ -469,7 +470,8 @@ interface
asmcmd : '--64 -o $OBJ $EXTRAOPT $ASM';
supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
system_x86_64_win64,system_x86_64_embedded,
- system_x86_64_openbsd,system_x86_64_netbsd];
+ system_x86_64_openbsd,system_x86_64_netbsd,
+ system_x86_64_dragonfly];
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
labelprefix : '.L';
comment : '# ';
@@ -527,7 +529,7 @@ interface
supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
system_i386_netbsd,system_i386_Netware,system_i386_qnx,system_i386_wdosx,system_i386_openbsd,
system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux,
- system_i386_nativent,system_i386_android];
+ system_i386_nativent,system_i386_android,system_i386_aros];
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
labelprefix : '.L';
comment : '# ';
diff --git a/compiler/x86/agx86nsm.pas b/compiler/x86/agx86nsm.pas
index ed02093c58..1deaba8e28 100644
--- a/compiler/x86/agx86nsm.pas
+++ b/compiler/x86/agx86nsm.pas
@@ -1302,6 +1302,8 @@ interface
case target_info.system of
system_i8086_msdos:
FormatName:='obj';
+ else
+ internalerror(2014082060);
end;
{$endif i8086}
{$ifdef i386}
diff --git a/compiler/x86/nx86add.pas b/compiler/x86/nx86add.pas
index 1f147bec76..1c57544131 100644
--- a/compiler/x86/nx86add.pas
+++ b/compiler/x86/nx86add.pas
@@ -47,6 +47,7 @@ unit nx86add;
procedure second_addfloatsse;
procedure second_addfloatavx;
public
+ function use_fma : boolean;override;
procedure second_addfloat;override;
{$ifndef i8086}
procedure second_addsmallset;override;
@@ -273,6 +274,15 @@ unit nx86add;
procedure tx86addnode.prepare_x87_locations(out refnode: tnode);
begin
refnode:=nil;
+
+ { later on, no mm registers are allowed, so transfer everything to memory here
+ below it is loaded into an fpu register if neede }
+ if left.location.loc in [LOC_CMMREGISTER,LOC_MMREGISTER] then
+ hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
+
+ if right.location.loc in [LOC_CMMREGISTER,LOC_MMREGISTER] then
+ hlcg.location_force_mem(current_asmdata.CurrAsmList,right.location,right.resultdef);
+
case ord(left.location.loc=LOC_FPUREGISTER)+ord(right.location.loc=LOC_FPUREGISTER) of
0:
begin
@@ -603,6 +613,8 @@ unit nx86add;
pass_left_right;
cmpop:=false;
+ op:=A_NOP;
+
mmxbase:=mmx_type(left.resultdef);
location_reset(location,LOC_MMXREGISTER,def_cgsize(resultdef));
case nodetype of
@@ -679,6 +691,9 @@ unit nx86add;
internalerror(2003042214);
end;
+ if op = A_NOP then
+ internalerror(201408201);
+
{ left and right no register? }
{ then one must be demanded }
if (left.location.loc<>LOC_MMXREGISTER) then
@@ -1072,6 +1087,18 @@ unit nx86add;
end;
+ function tx86addnode.use_fma : boolean;
+ begin
+{$ifndef i8086}
+ { test if the result stays in an xmm register, fiddeling with fpu registers and fma makes no sense }
+ Result:=use_vectorfpu(resultdef) and
+ ((cpu_capabilities[current_settings.cputype]*[CPUX86_HAS_FMA,CPUX86_HAS_FMA4])<>[]);
+{$else i8086}
+ Result:=inherited use_fma;
+{$endif i8086}
+ end;
+
+
procedure tx86addnode.second_cmpfloatvector;
var
op : tasmop;
diff --git a/compiler/x86/nx86mat.pas b/compiler/x86/nx86mat.pas
index d056f364bf..5d41b57650 100644
--- a/compiler/x86/nx86mat.pas
+++ b/compiler/x86/nx86mat.pas
@@ -99,6 +99,7 @@ interface
op : tasmop;
hreg : tregister;
begin
+ op:=A_NONE;
secondpass(left);
location_reset(location,LOC_MMXREGISTER,OS_NO);
hreg:=tcgx86(cg).getmmxregister(current_asmdata.CurrAsmList);
@@ -142,6 +143,9 @@ interface
mmxs32bit,mmxu32bit:
op:=A_PSUBD;
end;
+ if op = A_NONE then
+ internalerror(201408202);
+
emit_reg_reg(op,S_NO,location.register,hreg);
emit_reg_reg(A_MOVQ,S_NO,hreg,location.register);
end;
@@ -523,8 +527,8 @@ interface
else
emit_reg_reg(A_XOR,opsize,regd,regd);
- {Division depends on the right type.}
- if is_signed(right.resultdef) then
+ { Division depends on the result type }
+ if is_signed(resultdef) then
op:=A_IDIV
else
op:=A_DIV;
diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas
index 391ed7ad05..e3b91a0ac0 100644
--- a/compiler/x86/rax86.pas
+++ b/compiler/x86/rax86.pas
@@ -47,8 +47,9 @@ type
Function CheckOperand: boolean; override;
end;
+ { Operands are always in AT&T order.
+ Intel reader attaches them right-to-left, then shifts to start with 1 }
Tx86Instruction=class(TInstruction)
- OpOrder : TOperandOrder;
opsize : topsize;
constructor Create(optype : tcoperand);override;
{ Operand sizes }
@@ -56,7 +57,6 @@ type
procedure SetInstructionOpsize;
procedure CheckOperandSizes;
procedure CheckNonCommutativeOpcodes;
- procedure SwapOperands;
{ Additional actions required by specific reader }
procedure FixupOpcode;virtual;
{ opcode adding }
@@ -295,16 +295,6 @@ begin
end;
-procedure Tx86Instruction.SwapOperands;
-begin
- Inherited SwapOperands;
- { mark the correct order }
- if OpOrder=op_intel then
- OpOrder:=op_att
- else
- OpOrder:=op_intel;
-end;
-
const
{$ifdef x86_64}
topsize2memsize: array[topsize] of integer =
@@ -437,7 +427,11 @@ begin
memopsize := 0;
case operands[i].opr.typ of
OPR_LOCAL: memopsize := operands[i].opr.localvarsize * 8;
- OPR_REFERENCE: memopsize := operands[i].opr.varsize * 8;
+ OPR_REFERENCE:
+ if operands[i].opr.ref.refaddr = addr_pic then
+ memopsize := sizeof(pint) * 8
+ else
+ memopsize := operands[i].opr.varsize * 8;
end;
if memopsize = 0 then memopsize := topsize2memsize[tx86operand(operands[i]).opsize];
@@ -800,8 +794,6 @@ procedure Tx86Instruction.SetInstructionOpsize;
begin
if opsize<>S_NO then
exit;
- if (OpOrder=op_intel) then
- SwapOperands;
case ops of
0 : ;
1 :
@@ -937,8 +929,6 @@ end;
but before swapping in the NASM and TASM writers PM }
procedure Tx86Instruction.CheckNonCommutativeOpcodes;
begin
- if (OpOrder=op_intel) then
- SwapOperands;
if (
(ops=2) and
(operands[1].opr.typ=OPR_REGISTER) and
@@ -998,8 +988,6 @@ var
ai : taicpu;
begin
ConcatInstruction:=nil;
- if (OpOrder=op_intel) then
- SwapOperands;
ai:=nil;
for i:=1 to Ops do
@@ -1160,7 +1148,7 @@ begin
ai:=taicpu.op_none(opcode,siz);
ai.fileinfo:=filepos;
- ai.SetOperandOrder(OpOrder);
+ ai.SetOperandOrder(op_att);
ai.Ops:=Ops;
ai.Allocate_oper(Ops);
for i:=1 to Ops do
diff --git a/compiler/x86/rax86att.pas b/compiler/x86/rax86att.pas
index b13c587dde..85f60629e0 100644
--- a/compiler/x86/rax86att.pas
+++ b/compiler/x86/rax86att.pas
@@ -98,9 +98,6 @@ Implementation
procedure Tx86attInstruction.FixupOpcode;
begin
- if (OpOrder=op_intel) then
- SwapOperands;
-
case opcode of
A_MOVQ:
begin
@@ -973,7 +970,6 @@ Implementation
instr : Tx86Instruction;
begin
instr:=Tx86attInstruction.Create(Tx86Operand);
- instr.OpOrder:=op_att;
BuildOpcode(instr);
instr.AddReferenceSizes;
instr.SetInstructionOpsize;
diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas
index ab39284882..9e2080659e 100644
--- a/compiler/x86/rax86int.pas
+++ b/compiler/x86/rax86int.pas
@@ -65,7 +65,7 @@ Unit Rax86int;
procedure BuildRecordOffsetSize(const expr: string;var offset:aint;var size:aint; var mangledname: string; needvmtofs: boolean);
procedure BuildConstSymbolExpression(needofs,isref,startingminus:boolean;var value:aint;var asmsym:string;var asmsymtyp:TAsmsymtype);
function BuildConstExpression:aint;
- function BuildRefConstExpression:aint;
+ function BuildRefConstExpression(startingminus:boolean=false):aint;
procedure BuildReference(oper : tx86operand);
procedure BuildOperand(oper: tx86operand;istypecast:boolean);
procedure BuildConstantOperand(oper: tx86operand);
@@ -1141,13 +1141,13 @@ Unit Rax86int;
end;
- Function tx86intreader.BuildRefConstExpression:aint;
+ Function tx86intreader.BuildRefConstExpression(startingminus:boolean):aint;
var
l : aint;
hs : string;
hssymtyp : TAsmsymtype;
begin
- BuildConstSymbolExpression(false,true,false,l,hs,hssymtyp);
+ BuildConstSymbolExpression(false,true,startingminus,l,hs,hssymtyp);
if hs<>'' then
Message(asmr_e_relocatable_symbol_not_allowed);
BuildRefConstExpression:=l;
@@ -1190,7 +1190,8 @@ Unit Rax86int;
(SearchIConstant(actasmpattern,l) or
SearchRecordType(actasmpattern)) then
begin
- l:=BuildRefConstExpression;
+ l:=BuildRefConstExpression(negative);
+ negative:=false; { "l" was negated if necessary }
GotPlus:=(prevasmtoken=AS_PLUS);
GotStar:=(prevasmtoken=AS_STAR);
case oper.opr.typ of
@@ -1198,23 +1199,15 @@ Unit Rax86int;
begin
if GotStar then
Message(asmr_e_invalid_reference_syntax);
- if negative then
- Dec(oper.opr.localsymofs,l)
- else
- Inc(oper.opr.localsymofs,l);
+ Inc(oper.opr.localsymofs,l);
end;
OPR_REFERENCE :
begin
if GotStar then
oper.opr.ref.scalefactor:=l
else
- begin
- if negative then
- Dec(oper.opr.ref.offset,l)
- else
- Inc(oper.opr.ref.offset,l);
- end;
- end;
+ Inc(oper.opr.ref.offset,l);
+ end;
end;
end
else
@@ -1427,6 +1420,11 @@ Unit Rax86int;
begin
if (oper.opr.localindexreg<>NR_NO) then
Message(asmr_e_multiple_index);
+{$ifdef x86_64}
+ { Locals/parameters cannot be accessed RIP-relative. Need a dedicated error message here? }
+ if (hreg=NR_RIP) then
+ Message(asmr_e_no_local_or_para_allowed);
+{$endif x86_64}
oper.opr.localindexreg:=hreg;
if scale<>0 then
begin
@@ -1980,6 +1978,7 @@ Unit Rax86int;
operandnum : longint;
is_far_const:boolean;
i:byte;
+ tmp: toperand;
begin
PrefixOp:=A_None;
OverrideOp:=A_None;
@@ -1989,7 +1988,6 @@ Unit Rax86int;
if is_prefix(actopcode) then
with instr do
begin
- OpOrder:=op_intel;
PrefixOp:=ActOpcode;
opcode:=ActOpcode;
condition:=ActCondition;
@@ -2001,7 +1999,6 @@ Unit Rax86int;
if is_override(actopcode) then
with instr do
begin
- OpOrder:=op_intel;
OverrideOp:=ActOpcode;
opcode:=ActOpcode;
condition:=ActCondition;
@@ -2025,7 +2022,6 @@ Unit Rax86int;
{ Fill the instr object with the current state }
with instr do
begin
- OpOrder:=op_intel;
Opcode:=ActOpcode;
condition:=ActCondition;
opsize:=ActOpsize;
@@ -2052,15 +2048,13 @@ Unit Rax86int;
{$endif x86_64}
;
{ We are reading operands, so opcode will be an AS_ID }
- operandnum:=1;
+ { process operands backwards to get them in AT&T order }
+ operandnum:=max_operands;
is_far_const:=false;
Consume(AS_OPCODE);
{ Zero operand opcode ? }
if actasmtoken in [AS_SEPARATOR,AS_END] then
- begin
- operandnum:=0;
- exit;
- end;
+ exit;
{ Read Operands }
repeat
case actasmtoken of
@@ -2072,10 +2066,13 @@ Unit Rax86int;
{ Operand delimiter }
AS_COMMA :
begin
- if operandnum > Max_Operands then
+ { should have something before the comma }
+ if instr.operands[operandnum].opr.typ=OPR_NONE then
+ Message(asmr_e_syntax_error);
+ if operandnum <= 1 then
Message(asmr_e_too_many_operands)
else
- Inc(operandnum);
+ Dec(operandnum);
Consume(AS_COMMA);
end;
@@ -2083,10 +2080,10 @@ Unit Rax86int;
AS_COLON:
begin
is_far_const:=true;
- if operandnum>1 then
+ if operandnum<max_operands then
message(asmr_e_too_many_operands)
else
- inc(operandnum);
+ dec(operandnum);
consume(AS_COLON);
end;
@@ -2116,6 +2113,15 @@ Unit Rax86int;
BuildOperand(instr.Operands[operandnum] as tx86operand,false);
end; { end case }
until false;
+
+ { shift operands to start from 1, exchange to make sure they are destroyed correctly }
+ for i:=operandnum to max_operands do
+ begin
+ tmp:=instr.operands[i+1-operandnum];
+ instr.operands[i+1-operandnum]:=instr.operands[i];
+ instr.operands[i]:=tmp;
+ end;
+ operandnum:=(max_operands+1)-operandnum;
instr.ops:=operandnum;
{ Check operands }
for i:=1 to operandnum do
@@ -2303,9 +2309,6 @@ Unit Rax86int;
BuildOpcode(instr);
with instr do
begin
- { We need AT&T style operands }
- Swapoperands;
- { Must be done with args in ATT order }
CheckNonCommutativeOpcodes;
AddReferenceSizes;
SetInstructionOpsize;
diff --git a/compiler/x86/symx86.pas b/compiler/x86/symx86.pas
index 45c93a8cd3..500e4443c7 100644
--- a/compiler/x86/symx86.pas
+++ b/compiler/x86/symx86.pas
@@ -26,7 +26,7 @@ unit symx86;
interface
uses
- globtype,
+ globtype, cclasses,
symconst, symtype,symdef,symsym;
type
@@ -45,10 +45,62 @@ type
end;
tx86pointerdefclass = class of tx86pointerdef;
+ tx86PtrDefKey = packed record
+ def: tdef;
+ x86typ:tx86pointertyp;
+ end;
+
+ { tx86PtrDefHashSet }
+
+ tx86PtrDefHashSet = class(TPtrDefHashSet)
+ private
+ class procedure Key2FullKey(Key: Pointer; out FullKey: tx86PtrDefKey);
+ public
+ function Find(Key: Pointer; KeyLen: Integer): PHashSetItem;override;
+ function FindOrAdd(Key: Pointer; KeyLen: Integer;
+ var Found: Boolean): PHashSetItem;override;
+ function FindOrAdd(Key: Pointer; KeyLen: Integer): PHashSetItem;override;
+ function Get(Key: Pointer; KeyLen: Integer): TObject;override;
+ end;
+
+ { returns a pointerdef for def, reusing an existing one in case it exists
+ in the current module }
+ function getx86pointerdef(def: tdef;x86typ:tx86pointertyp): tpointerdef;
+
implementation
uses
- globals, verbose;
+ globals, verbose,
+ symbase, fmodule;
+
+ function getx86pointerdef(def: tdef;x86typ:tx86pointertyp): tpointerdef;
+ var
+ res: PHashSetItem;
+ oldsymtablestack: tsymtablestack;
+ key: tx86PtrDefKey;
+ begin
+ if not assigned(current_module) then
+ internalerror(2011071101);
+ key.def:=def;
+ key.x86typ:=x86typ;
+ res:=current_module.ptrdefs.FindOrAdd(@key,sizeof(key));
+ if not assigned(res^.Data) then
+ begin
+ { since these pointerdefs can be reused anywhere in the current
+ unit, add them to the global/staticsymtable }
+ oldsymtablestack:=symtablestack;
+ { do not simply push/pop current_module.localsymtable, because
+ that can have side-effects (e.g., it removes helpers) }
+ symtablestack:=nil;
+ res^.Data:=tx86pointerdefclass(cpointerdef).createx86(def,x86typ);
+ if assigned(current_module.localsymtable) then
+ current_module.localsymtable.insertdef(tdef(res^.Data))
+ else
+ current_module.globalsymtable.insertdef(tdef(res^.Data));
+ symtablestack:=oldsymtablestack;
+ end;
+ result:=tpointerdef(res^.Data);
+ end;
{****************************************************************************
tx86pointerdef
@@ -136,5 +188,69 @@ implementation
end;
+{****************************************************************************
+ tx86PtrDefHashSet
+****************************************************************************}
+
+ class procedure tx86PtrDefHashSet.Key2FullKey(Key: Pointer; out FullKey: tx86PtrDefKey);
+ type
+ pdef=^tdef;
+ begin
+ FullKey.def:=pdef(Key)^;
+ FullKey.x86typ:=tx86pointerdefclass(cpointerdef).default_x86_data_pointer_type;
+ end;
+
+ function tx86PtrDefHashSet.Find(Key: Pointer; KeyLen: Integer): PHashSetItem;
+ var
+ FullKey: tx86PtrDefKey;
+ begin
+ if KeyLen=SizeOf(tdef) then
+ begin
+ Key2FullKey(Key, FullKey);
+ Result:=inherited Find(@FullKey, SizeOf(FullKey));
+ end
+ else
+ Result:=inherited Find(Key, KeyLen);
+ end;
+
+ function tx86PtrDefHashSet.FindOrAdd(Key: Pointer; KeyLen: Integer; var Found: Boolean): PHashSetItem;
+ var
+ FullKey: tx86PtrDefKey;
+ begin
+ if KeyLen=SizeOf(tdef) then
+ begin
+ Key2FullKey(Key, FullKey);
+ Result:=inherited FindOrAdd(@FullKey, SizeOf(FullKey), Found);
+ end
+ else
+ Result:=inherited FindOrAdd(Key, KeyLen, Found);
+ end;
+
+ function tx86PtrDefHashSet.FindOrAdd(Key: Pointer; KeyLen: Integer): PHashSetItem;
+ var
+ FullKey: tx86PtrDefKey;
+ begin
+ if KeyLen=SizeOf(tdef) then
+ begin
+ Key2FullKey(Key, FullKey);
+ Result:=inherited FindOrAdd(@FullKey, SizeOf(FullKey));
+ end
+ else
+ Result:=inherited FindOrAdd(Key, KeyLen);
+ end;
+
+ function tx86PtrDefHashSet.Get(Key: Pointer; KeyLen: Integer): TObject;
+ var
+ FullKey: tx86PtrDefKey;
+ begin
+ if KeyLen=SizeOf(tdef) then
+ begin
+ Key2FullKey(Key, FullKey);
+ Result:=inherited Get(@FullKey, SizeOf(FullKey));
+ end
+ else
+ Result:=inherited Get(Key, KeyLen);
+ end;
+
end.
diff --git a/compiler/x86_64/cgcpu.pas b/compiler/x86_64/cgcpu.pas
index 3f1dce9a6b..d702844f4f 100644
--- a/compiler/x86_64/cgcpu.pas
+++ b/compiler/x86_64/cgcpu.pas
@@ -36,6 +36,9 @@ unit cgcpu;
tcgx86_64 = class(tcgx86)
procedure init_register_allocators;override;
+ procedure a_loadfpu_ref_cgpara(list: TAsmList; size: tcgsize; const ref: treference; const cgpara: TCGPara); override;
+ procedure a_loadfpu_reg_ref(list: TAsmList; fromsize, tosize: tcgsize; reg: tregister; const ref: treference); override;
+
procedure g_proc_entry(list : TAsmList;localsize:longint; nostackframe:boolean);override;
procedure g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean);override;
procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint);override;
@@ -116,6 +119,30 @@ unit cgcpu;
end;
+ procedure tcgx86_64.a_loadfpu_ref_cgpara(list: TAsmList; size: tcgsize; const ref: treference; const cgpara: TCGPara);
+ begin
+ { a record containing an extended value is returned on the x87 stack
+ -> size will be OS_F128 (if not packed), while cgpara.paraloc^.size
+ contains the proper size
+
+ In the future we should probably always use cgpara.location^.size, but
+ that should only be tested/done after 2.8 is branched }
+ if size in [OS_128,OS_F128] then
+ size:=cgpara.location^.size;
+ inherited;
+ end;
+
+
+ procedure tcgx86_64.a_loadfpu_reg_ref(list: TAsmList; fromsize, tosize: tcgsize; reg: tregister; const ref: treference);
+ begin
+ { same as with a_loadfpu_ref_cgpara() above, but on the callee side
+ when the value is moved from the fpu register into a memory location }
+ if tosize in [OS_128,OS_F128] then
+ tosize:=OS_F80;
+ inherited;
+ end;
+
+
function tcgx86_64.use_push: boolean;
begin
result:=(current_procinfo.framepointer=NR_STACK_POINTER_REG) or
@@ -330,10 +357,6 @@ unit cgcpu;
hreg : tregister;
r : longint;
begin
- { Release PIC register }
- if cs_create_pic in current_settings.moduleswitches then
- list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
-
{ Prevent return address from a possible call from ending up in the epilogue }
{ (restoring registers happens before epilogue, providing necessary padding) }
if (current_procinfo.flags*[pi_has_unwind_info,pi_do_call,pi_has_saved_regs])=[pi_has_unwind_info,pi_do_call] then
diff --git a/compiler/x86_64/cpuelf.pas b/compiler/x86_64/cpuelf.pas
index b73950277c..1d27bf8e8e 100644
--- a/compiler/x86_64/cpuelf.pas
+++ b/compiler/x86_64/cpuelf.pas
@@ -674,7 +674,8 @@ implementation
asmbin : '';
asmcmd : '';
supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
- system_x86_64_openbsd,system_x86_64_netbsd];
+ system_x86_64_openbsd,system_x86_64_netbsd,
+ system_x86_64_dragonfly];
flags : [af_outputbinary,af_smartlink_sections,af_supports_dwarf];
labelprefix : '.L';
comment : '';
diff --git a/compiler/x86_64/cpuinfo.pas b/compiler/x86_64/cpuinfo.pas
index cbf64867c9..8dfb941acf 100644
--- a/compiler/x86_64/cpuinfo.pas
+++ b/compiler/x86_64/cpuinfo.pas
@@ -30,6 +30,13 @@ Interface
Type
bestreal = extended;
+{$if FPC_FULLVERSION>20700}
+{$ifdef FPC_HAS_TYPE_EXTENDED}
+ bestrealrec = TExtended80Rec;
+{$else}
+ bestrealrec = TDoubleRec;
+{$endif}
+{$endif FPC_FULLVERSION>20700}
ts32real = single;
ts64real = double;
ts80real = extended;
@@ -58,7 +65,15 @@ Type
fpu_avx2
);
+ tcontrollertype =
+ (ct_none
+ );
+
+
Const
+ { Is there support for dealing with multiple microcontrollers available }
+ { for this platform? }
+ ControllerSupport = true;
{ Size of native extended type }
extended_size = 10;
{ Size of a multimedia register }
@@ -66,6 +81,15 @@ Const
{ target cpu string (used by compiler options) }
target_cpu_string = 'x86_64';
+ { We know that there are fields after sramsize
+ but we don't care about this warning }
+ {$PUSH}
+ {$WARN 3177 OFF}
+ embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
+ (
+ (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0));
+ {$POP}
+
{ calling conventions supported by the code generator }
supported_calling_conventions : tproccalloptions = [
pocall_internproc,
diff --git a/compiler/x86_64/cpupara.pas b/compiler/x86_64/cpupara.pas
index 7c1ea00457..c61712b10b 100644
--- a/compiler/x86_64/cpupara.pas
+++ b/compiler/x86_64/cpupara.pas
@@ -407,6 +407,20 @@ unit cpupara;
if (classes[i].typ=X86_64_X87UP_CLASS) and
(classes[i-1].typ<>X86_64_X87_CLASS) then
exit(0);
+
+ (* FPC addition: because we store an extended in 10 bytes, the
+ X86_64_X87UP_CLASS can be replaced with e.g. INTEGER if an
+ extended is followed by e.g. an array [0..5] of byte -> we also
+ have to check whether each X86_64_X87_CLASS is followed by
+ X86_64_X87UP_CLASS -- if not, pass in memory
+
+ This cannot happen in the original ABI, because there
+ sizeof(extended) = 16 and hence nothing can be merged with
+ X86_64_X87UP_CLASS and change it into something else *)
+ if (classes[i].typ=X86_64_X87_CLASS) and
+ ((i=(words-1)) or
+ (classes[i+1].typ<>X86_64_X87UP_CLASS)) then
+ exit(0);
end;
{ FIXME: in case a record contains empty padding space, e.g. a
@@ -1022,6 +1036,18 @@ unit cpupara;
end;
inc(mmretregidx);
end;
+ X86_64_X87_CLASS:
+ begin
+ { must be followed by X86_64_X87UP_CLASS and that must be
+ the last class }
+ if (i<>(numclasses-2)) or
+ (classes[i+1].typ<>X86_64_X87UP_CLASS) then
+ internalerror(2014110401);
+ paraloc^.loc:=LOC_FPUREGISTER;
+ paraloc^.register:=NR_FPU_RESULT_REG;
+ paraloc^.size:=OS_F80;
+ break;
+ end;
X86_64_NO_CLASS:
begin
{ empty record/array }
diff --git a/compiler/x86_64/nx64flw.pas b/compiler/x86_64/nx64flw.pas
index ff2665ddac..2f246563fd 100644
--- a/compiler/x86_64/nx64flw.pas
+++ b/compiler/x86_64/nx64flw.pas
@@ -448,7 +448,7 @@ procedure tx64tryexceptnode.pass_generate_code;
begin
{ emit filter table to a temporary asmlist }
hlist:=TAsmList.Create;
- current_asmdata.getdatalabel(filterlabel);
+ current_asmdata.getaddrlabel(filterlabel);
new_section(hlist,sec_rodata_norel,filterlabel.name,4);
cg.a_label(hlist,filterlabel);
onnodecount:=tai_const.create_32bit(0);
@@ -459,8 +459,7 @@ procedure tx64tryexceptnode.pass_generate_code;
begin
if hnode.nodetype<>onn then
InternalError(2011103101);
- { TODO: make it done without using global label }
- current_asmdata.getglobaljumplabel(onlabel);
+ current_asmdata.getjumplabel(onlabel);
hlist.concat(tai_const.create_rva_sym(current_asmdata.RefAsmSymbol(tonnode(hnode).excepttype.vmt_mangledname,AT_DATA)));
hlist.concat(tai_const.create_rva_sym(onlabel));
cg.a_label(current_asmdata.CurrAsmList,onlabel);
@@ -476,8 +475,7 @@ procedure tx64tryexceptnode.pass_generate_code;
inc(onnodecount.value);
end;
{ now move filter table to permanent list all at once }
- maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
- current_asmdata.asmlists[al_typedconsts].concatlist(hlist);
+ current_procinfo.aktlocaldata.concatlist(hlist);
hlist.free;
end;
diff --git a/compiler/x86_64/rax64att.pas b/compiler/x86_64/rax64att.pas
index 5f5ac9ccf9..e7d4cc8245 100644
--- a/compiler/x86_64/rax64att.pas
+++ b/compiler/x86_64/rax64att.pas
@@ -47,7 +47,6 @@ Unit rax64att;
instr : Tx86Instruction;
begin
instr:=Tx86attInstruction.Create(Tx86Operand);
- instr.OpOrder:=op_att;
BuildOpcode(instr);
instr.AddReferenceSizes;
instr.SetInstructionOpsize;
diff --git a/compiler/x86_64/symcpu.pas b/compiler/x86_64/symcpu.pas
index 4e33d0ceb9..195634520c 100644
--- a/compiler/x86_64/symcpu.pas
+++ b/compiler/x86_64/symcpu.pas
@@ -207,5 +207,7 @@ begin
cconstsym:=tcpuconstsym;
cenumsym:=tcpuenumsym;
csyssym:=tcpusyssym;
+
+ cPtrDefHashSet:=tx86PtrDefHashSet;
end.