Commit Graph

21721 Commits

Author SHA1 Message Date
florian
dfe37de0a1 * do not use push/pop based exception reason handling on i386 if dwarf based exceptions are used
git-svn-id: branches/debug_eh@41282 -
2019-02-10 17:49:40 +00:00
svenbarth
b1ee29c836 * fix for Mantis #30205: (adjusted) patch by Do-wan Kim to only use the default calling convention for exception handlers
+ added test

git-svn-id: trunk@41277 -
2019-02-10 11:26:46 +00:00
Jonas Maebe
a0831b058a * fixed LLVM para loading for byval paralocs that are preceded by other
paralocs

git-svn-id: branches/debug_eh@41217 -
2019-02-03 21:10:18 +00:00
Jonas Maebe
af098474f4 * keep track of the alignment requirements of parameters with LLVM, and emit
them when they are different from the default

git-svn-id: branches/debug_eh@41216 -
2019-02-03 21:10:14 +00:00
Jonas Maebe
016882ca82 * do not add references to external procedures and variables to the used
compiler symbols of the current module (useless, and moreover crashes
    clang)

git-svn-id: branches/debug_eh@41215 -
2019-02-03 21:10:11 +00:00
Jonas Maebe
8eb07ed7b1 * add support for custom calling conventions to LLVM function declarations
git-svn-id: branches/debug_eh@41211 -
2019-02-03 21:09:58 +00:00
Jonas Maebe
9d07e4948f * fix compilation of ARM compiler for LLVM
git-svn-id: branches/debug_eh@41210 -
2019-02-03 21:09:54 +00:00
Jonas Maebe
7aa6a2ec81 * only make a copy of the finally code in pass_1 instead of in pass_typecheck,
to avoid an internalerror in case the finally code contains a goto outside
    the finally code (tbf/tb0209.pp)

git-svn-id: branches/debug_eh@41209 -
2019-02-03 21:09:51 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
Jonas Maebe
13ce27cc1d * fixed the default external assembler for llvm when using -s
git-svn-id: trunk@41207 -
2019-02-03 21:01:13 +00:00
Jonas Maebe
1abea6451c * fixed thlcgobj.g_rangecheck() for cpuhighleveltarget when targetting a
cpu32bitalu

git-svn-id: trunk@41206 -
2019-02-03 21:01:08 +00:00
Jonas Maebe
7af95cbf06 * LLVM does not support 128 bits arithmetic on 32 bit platforms, which we
need for overflow checking -> use RTL built-ins

git-svn-id: trunk@41205 -
2019-02-03 21:01:02 +00:00
Jonas Maebe
353be907c7 * update the stack alignment field of parameters when doing so for paralocs
git-svn-id: trunk@41204 -
2019-02-03 21:00:57 +00:00
Jonas Maebe
7a65e1f393 * fixed ARM paraloc defs (for LLVM)
git-svn-id: trunk@41203 -
2019-02-03 21:00:51 +00:00
Jonas Maebe
da0deae9ae * removed unnecessary replacements of the paraloc def with arraydefs on ARM
git-svn-id: trunk@41202 -
2019-02-03 21:00:46 +00:00
Jonas Maebe
8c362eac67 * always emit UAL when using LLVM (clang does not and will not support
pre-UAL)

git-svn-id: trunk@41201 -
2019-02-03 21:00:41 +00:00
Jonas Maebe
ab51e8637c * set default Mac OS X target version to 10.6 for LLVM (earlier versions did
not include libunwind in libSystem, causing linking errors when compiling
    on later versions)

git-svn-id: trunk@41200 -
2019-02-03 21:00:36 +00:00
Jonas Maebe
f9668f8c03 * let de LLVM parameter manager merge multiple paralocs used to represent a
single ordinal, as such splitting is handled by LLVM itself (and handling
    such split locations is currently not supported by our LLVM code generator)

git-svn-id: trunk@41199 -
2019-02-03 21:00:28 +00:00
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
joost
6ffe906794 * Mover {CompilerVersion} from the fppkg.cfg template to samplecfg, because
on Windows it is possible to install fpc in a location without the 
   compilerversion in the path.

git-svn-id: trunk@41184 -
2019-02-03 13:32:43 +00:00
Jonas Maebe
0db9ff5c39 * fixed packed bitsize calculation for types with a negative lower bound and
and upper bound just below the next power of two (mantis #34971)

git-svn-id: trunk@41161 -
2019-02-01 17:31:53 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +00:00
Károly Balogh
6c87b89e45 atari: fpc now searches for the compiler with .ttp extension, as that's the default on Atari
git-svn-id: trunk@41141 -
2019-01-30 10:48:27 +00:00
florian
2b6076a719 * compilation fixed
git-svn-id: trunk@41139 -
2019-01-29 22:06:32 +00:00
Jonas Maebe
e52cf555ab * fix loading of constants in registers in the LLVM CG if the constant
does not fit in ptrsinttype

git-svn-id: trunk@41138 -
2019-01-29 21:39:26 +00:00
Jonas Maebe
2d01fe76f6 * initialse the cgpara for the C-style varargs on ARM (needed for LLVM)
git-svn-id: trunk@41137 -
2019-01-29 21:39:23 +00:00
Jonas Maebe
9c3e9e80a3 * fixed type correctness of and simplified the threadvar loading size
optimisation

git-svn-id: trunk@41135 -
2019-01-29 21:39:16 +00:00
Jonas Maebe
4869d0ace9 * perform extension of parameters to 32 bit for Darwin in the paraloc instead
of in the cgpara (cgpara should always correspond to the real parameter)

git-svn-id: trunk@41134 -
2019-01-29 21:39:12 +00:00
Jonas Maebe
04d295f186 * first step towards supporting 32 bit targets with the LLVM code generator:
use the generic code in more cases when cpuhighleveltarget is defined

git-svn-id: trunk@41133 -
2019-01-29 21:39:09 +00:00
florian
2f40f81890 + sanity check
git-svn-id: trunk@41131 -
2019-01-29 20:40:41 +00:00
florian
afd4599d26 * correctly handle LDRD in TAoptBaseCpu.RegModifiedByInstruction
git-svn-id: trunk@41130 -
2019-01-29 20:40:40 +00:00
florian
acbf7d15c4 * do not load always the references into a register in g_concatcopy
git-svn-id: trunk@41129 -
2019-01-29 20:40:39 +00:00
florian
4db5478acc + support msr regf,reg32 on arm in the internal assembler
git-svn-id: trunk@41128 -
2019-01-29 20:38:51 +00:00
florian
a186f48442 * cosmetics
git-svn-id: trunk@41127 -
2019-01-29 20:17:47 +00:00
florian
6c88894999 * do not call the internal assembler if -s is passed
git-svn-id: trunk@41126 -
2019-01-29 20:16:12 +00:00
Károly Balogh
d1878fe5b2 morphos: support section GC with GNU LD as well
git-svn-id: trunk@41105 -
2019-01-29 05:02:18 +00:00
pierre
7817e48e9a -Xr is also supported for systems_android
git-svn-id: trunk@41104 -
2019-01-28 17:43:15 +00:00
florian
597a23d278 + tls support for x86_64-linux (not yet enabled by default)
git-svn-id: trunk@41081 -
2019-01-27 09:37:25 +00:00
pierre
29bcef2825 Fix compilation (with -st option) of compiler for macos OS target
git-svn-id: trunk@41065 -
2019-01-25 08:00:58 +00:00
florian
c7bb028d35 * factored out OptPass1FLD, used bx x86-64 now as well
- removed unused function

git-svn-id: trunk@41061 -
2019-01-24 20:10:29 +00:00
florian
6cb6517411 * better recognization of procedure exit code
git-svn-id: trunk@41060 -
2019-01-24 19:53:51 +00:00
florian
24f6cc0da5 * factored out OptPass1FSTP, used by x86-64 now as well
git-svn-id: trunk@41059 -
2019-01-24 19:38:32 +00:00
florian
cfd0790f89 * avoid assembler errors for the MovOpMov2MovOp optimziation in case the size of the instruction
gets changed and the first one contains a constant, resolves #34933

git-svn-id: trunk@41021 -
2019-01-23 21:02:14 +00:00
florian
8d3d5276d7 * open arrays and arrays of consts might be only stack tainting if they are passed by value
git-svn-id: trunk@41008 -
2019-01-22 21:58:05 +00:00
florian
4fb7b5d3ff * fix MovOpMov2MovOp optimization if no -Cpcoreavx2 is used
git-svn-id: trunk@40979 -
2019-01-21 21:57:07 +00:00
florian
4f0da5fcc3 + patch by Marģers to support the x86 assembler instructions blsi, blsr, blsmsk, adcx, adox, movbe, pclmulqdq, resolves #34815 and #34799
+ avxopcodes tests also movbe and pclmulqdq

git-svn-id: trunk@40951 -
2019-01-20 18:50:12 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
florian
75a89d2115 * fix and enable MovOpMov2MovOp optimization on x86-64
git-svn-id: trunk@40941 -
2019-01-20 17:00:43 +00:00
florian
94d7a02fae * modified patch by Gareth Moreton to pool TmpUsedRegs in the assembler optimizers, resolves #34679
git-svn-id: trunk@40938 -
2019-01-20 14:16:38 +00:00
florian
e24449bcfd * if sub nodes of a commutative node contain conditionally executed nodes, these sub nodes might not be swapped
as this might result in some nodes not being executed, like temp. create nodes with init. code, see e.g. issue #34653, resolves #34653

git-svn-id: trunk@40934 -
2019-01-20 12:55:20 +00:00
florian
925531b99c * constrained generics are also compatible with formaldefs, resolves #34893
git-svn-id: trunk@40921 -
2019-01-19 21:23:36 +00:00
florian
6c82b2d1da * -tls-dialect is not a as option, removed it, resolves #34901
git-svn-id: trunk@40920 -
2019-01-19 19:37:48 +00:00
pierre
bbede67175 Also add /usr/lib/CPU-linux-gnu to link directory list for mips and mipsel
git-svn-id: trunk@40905 -
2019-01-19 16:06:04 +00:00
florian
644c47e121 * when deciding about the case code generation in case of size optimization, the number of labels is relevant, not the covered range, resolves #34818
git-svn-id: trunk@40851 -
2019-01-13 10:32:00 +00:00
florian
b223d1c304 * modified patch by Gareth Moreton to make ie unique, resolves #34849
git-svn-id: trunk@40849 -
2019-01-12 14:44:54 +00:00
florian
8fceba4493 * properly allocate parameter registers for constants on avr, resolves #33932
git-svn-id: trunk@40848 -
2019-01-12 13:28:09 +00:00
pierre
1b16ff3629 Change default debugging format for x86_64-haiku to dwarf-2, as stabs is normally disabled on 64-bit systems
git-svn-id: trunk@40835 -
2019-01-10 14:40:05 +00:00
pierre
3e2b102a44 Add missing support for -PriscvXX and -Psparc64
git-svn-id: trunk@40833 -
2019-01-10 12:18:22 +00:00
pierre
22ea2bd624 Avoid warnings with -O4 option
git-svn-id: trunk@40821 -
2019-01-09 22:48:08 +00:00
Jonas Maebe
2b3fb18327 * fixed thlcg2ll.location_force_mmregscalar() after r40633
git-svn-id: trunk@40810 -
2019-01-08 19:23:20 +00:00
Károly Balogh
9ce876e2ae haiku: move i386 also to internal sysinit
git-svn-id: trunk@40791 -
2019-01-07 12:58:02 +00:00
Jonas Maebe
51e68eb302 * fixed several places where the interface crc could change:
o unsetting po_inline while parsing the implementation for various reasons
     (interprocedural goto/label, accessing a local in a parent frame,
      having nested procedures)
   o instead handle this via the pio_inline_not_possible flag
   o noreturn can no longer be specified only in the implementation

git-svn-id: trunk@40789 -
2019-01-06 20:35:56 +00:00
Jonas Maebe
b2b34338e5 * give an error when trying to call an object instance method via a type node
(mantis #34821)

git-svn-id: trunk@40785 -
2019-01-06 15:21:36 +00:00
Jonas Maebe
170ec00348 - removed withnode (was no longer used since a very long time)
git-svn-id: trunk@40777 -
2019-01-05 22:28:37 +00:00
Jonas Maebe
51b58f342f * synchronised with trunk till r40775
git-svn-id: branches/debug_eh@40776 -
2019-01-05 22:12:28 +00:00
Jonas Maebe
91d5457b38 * moved around/replaced the following procedures to stop nflw from depending
on pdecsub (node units should not depend on parser units):
   o maybe_add_public_default_java_constructor()
   o handle_calling_convention()
   o create_finalizer_procdef() (replaced with create_outline_procdef())
   o insert_record_hidden_paras()
   o handle_calling_convention()
   o proc_add_definition()
   o build_parentfpstruct()
   o maybe_guarantee_record_typesym()
   o get_first_proc_str()
  * factored out the creation of a procinfo for a nested procdef based on a
    subnodetree of the current procdef into tprocinfo.create_for_outlining()

git-svn-id: trunk@40773 -
2019-01-05 16:26:33 +00:00
Jonas Maebe
28df55fe08 * moved handle_calling_convention() to pparautl
git-svn-id: trunk@40772 -
2019-01-05 16:26:29 +00:00
Károly Balogh
5182dc37af haiku-x86_64: regenerated all Makefiles, take 2
git-svn-id: trunk@40758 -
2019-01-04 03:18:42 +00:00
Károly Balogh
0d8ef46195 haiku: linker support code for internal sysinit and make the x86_64 port use it
git-svn-id: trunk@40756 -
2019-01-04 03:00:03 +00:00
Károly Balogh
2f7fe0e737 haiku-x86_64: add target to the compiler and ppudump, enable it in fpmake and fpcmake
git-svn-id: trunk@40753 -
2019-01-04 02:16:24 +00:00
Károly Balogh
1d7486748a tabs to spaces cleanup. no functional change
git-svn-id: trunk@40752 -
2019-01-04 01:35:36 +00:00
svenbarth
04bbfd1746 * fix for Mantis #27378: save and (more importantly) restore verbosity when switching a unit
+ added test

git-svn-id: trunk@40750 -
2019-01-03 20:31:34 +00:00
florian
10ab893de3 * improved explanation for warning 9034
git-svn-id: trunk@40749 -
2019-01-03 17:38:27 +00:00
florian
2ba239ea6d * more robust fix of #27543
git-svn-id: trunk@40746 -
2019-01-02 16:14:18 +00:00
florian
e7c4fccf41 * patch by Simon Ameis: adds mcu STM32F091* to compiler unit t_embed.pas; thus internal error 200902011 is not raised anymore, resolves #34570
git-svn-id: trunk@40742 -
2019-01-01 23:16:07 +00:00
Jonas Maebe
14cc517f40 * synchronised with trunk till r40724
git-svn-id: branches/debug_eh@40737 -
2019-01-01 17:15:29 +00:00
Jonas Maebe
a72a12eef6 * don't emit 0-sized parameters for LLVM: clang doesn't either, and some
LLVM backends (like the AArch64 one) trigger internal errors when
    encountering them

git-svn-id: trunk@40736 -
2019-01-01 16:55:41 +00:00
Jonas Maebe
9f928b2805 * fix exception handling code generator memory leaks
git-svn-id: branches/debug_eh@40734 -
2019-01-01 16:24:42 +00:00
Jonas Maebe
473fef315d * synchronised with trunk till r40732
git-svn-id: branches/debug_eh@40733 -
2019-01-01 16:24:18 +00:00
Jonas Maebe
4d03f3a65e * fixed LLVM memory leaks
git-svn-id: trunk@40732 -
2019-01-01 16:22:31 +00:00
Jonas Maebe
ff8ccb06e5 * changed reverseparameters() from function into procedure: it does not make
sense as a function (the original input needed to be replaced by its
    result to make any sense), and someone already mistakenly used it like that
    in htypechk causing a bug/memory leak

git-svn-id: trunk@40729 -
2019-01-01 15:08:40 +00:00
Jonas Maebe
11511e13d5 * synchronised with trunk till r40723
git-svn-id: branches/debug_eh@40724 -
2019-01-01 13:22:17 +00:00
florian
a2cee252e8 * when optimizing range checks in case nodes, unsigned comparisions must be used, resolves #34782
git-svn-id: trunk@40721 -
2019-01-01 01:11:13 +00:00
nickysn
635a6c7ef8 * fixed msdos .com file generation
git-svn-id: trunk@40720 -
2018-12-31 17:41:31 +00:00
florian
bd4b7a6bc4 * more case fixes
git-svn-id: trunk@40706 -
2018-12-29 21:53:52 +00:00
florian
f6e32ae90e * (modified) path by Gareth Moreton to fix case handling
git-svn-id: trunk@40686 -
2018-12-28 20:56:43 +00:00
Jonas Maebe
df598f1868 * update alignment values for Darwin
git-svn-id: trunk@40684 -
2018-12-28 19:01:11 +00:00
Jonas Maebe
7b313a2c15 * stop searching for methods to implement interfaces in parent classes after
encountering a method with the correct name that does not have the
    "overload" directive (same logic as when looking for a call candidate,
    to avoid errors when using a Pascal-level wrapper to call interface
    methods, and Delphi-compatible since it always required "overload" for
    overloaded methods)
   o also catches calling convention mismatches like in webtbs/tw27349

git-svn-id: trunk@40683 -
2018-12-28 18:25:58 +00:00
Jonas Maebe
dee1056546 * fixed wrong change of jumpalignmax from 10 to 16 in previous commit
o renamed jumpalignmax and coalescealignmax to jumpalignskipmax/
     coalescealignskipmax to better reflex the meaning of these setting
     (and the difference in meaning to e.g. constalignmax)

git-svn-id: trunk@40682 -
2018-12-28 13:22:50 +00:00
Jonas Maebe
9a797b9f49 * changed maxjumpalign:10 to 16
* changed (max)jumalign for Darwin/x86_64 from 0 to 16

git-svn-id: trunk@40681 -
2018-12-28 12:06:46 +00:00
florian
9c03c29856 * not all targets support the tls-model switch, use it only if section thread vars are used
git-svn-id: trunk@40680 -
2018-12-27 23:14:38 +00:00
florian
ce81e50907 * better code alignment for x86_64-win64 and x86_64-linux
git-svn-id: trunk@40679 -
2018-12-27 22:07:30 +00:00
florian
917de001d6 * patch (slighly modified) by Christo Crause to write 16 bit registers on avr in hi/lo order, resolves #34721
git-svn-id: trunk@40678 -
2018-12-27 21:41:36 +00:00
florian
a7c347fe56 * pass used tls model to the assembler
git-svn-id: trunk@40677 -
2018-12-27 20:54:14 +00:00
florian
7f5c2fa3aa * (modified) patch by Gareth Moreton: Speed improvement in case blocks, resolves #0034762
This patch improves the compiler where "case" statements are concerned, using jump tables more often and creating more efficient machine code in some situations:
  * If a case block only contains one branch (not including the else block), the initial range check is removed, since this becomes wasted effort.
  * If the else block is empty, the else label is set to the end label - though this doesn't decrease the code size, it takes a bit of strain off the peephole optimizer.
  * On -O2 and above, some node analysis is now done on the branch labels. Most of the time this just redirects it to the end
    label for empty blocks, but if the block contains a goto statement, it will redirect it to its destination instead,
    thus increasing performance by not having multiple jumps (this won't get picked up by the peephole optimiser if the label addresses are in a jump table).
  * Some checks now use what I call the 'true count' rather than the 'label count'. The true count includes each
    individual value in a range - for example, 0..2 counts as 3. This increases the chance that a jump table will be
    utilised in situations where it is more efficient than a linear list.
  * For jump tables, if the case block almost covers the entire range (32 entries or fewer from full coverage),
    the initial range check is removed and the gaps included in the jump table (pointing to the else label).

git-svn-id: trunk@40676 -
2018-12-27 18:31:55 +00:00
svenbarth
539ed761ba * a property access list must only consist of record or object fields; classes are not allowed
git-svn-id: trunk@40656 -
2018-12-26 11:26:01 +00:00
svenbarth
4afe3c6788 * regenerate msg*.inc files after addition of error message
git-svn-id: trunk@40655 -
2018-12-26 11:25:57 +00:00
svenbarth
425e9114f5 + add error message that a record or object type is required
git-svn-id: trunk@40654 -
2018-12-26 11:25:53 +00:00
Jonas Maebe
35c249eb70 * synchronised with trunk till r40648
git-svn-id: branches/debug_eh@40649 -
2018-12-25 18:23:59 +00:00
Jonas Maebe
d75ba7cb11 * suppress notes about unused $nestedvars local variable
git-svn-id: trunk@40648 -
2018-12-25 18:22:41 +00:00