Commit Graph

21655 Commits

Author SHA1 Message Date
nickysn
3a58a6261a * link with -nopie on OpenBSD only if PIC code generation is disabled
git-svn-id: trunk@41652 -
2019-03-09 16:11:52 +00:00
Jonas Maebe
d34e0b091b * fixed aarch64 shifterop parsing in inline assembly
git-svn-id: trunk@41650 -
2019-03-09 16:11:31 +00:00
nickysn
b659720f04 * Do not link to /usr/libexec/ld.so as a shared library on OpenBSD. Based on 3/3
of OpenBSD ports patch patch-fpcsrc_compiler_systems_t_bsd_pas

git-svn-id: trunk@41639 -
2019-03-08 16:04:48 +00:00
nickysn
bd9f6170cd * always add -nopie to linker flags on OpenBSD. Based on 2/3 of OpenBSD ports
patch patch-fpcsrc_compiler_systems_t_bsd_pas

git-svn-id: trunk@41638 -
2019-03-08 16:01:30 +00:00
nickysn
c3c9e07867 * Correct library search path for OpenBSD. Based on 1/3 of OpenBSD ports patch
patch-fpcsrc_compiler_systems_t_bsd_pas

git-svn-id: trunk@41637 -
2019-03-08 15:59:00 +00:00
yury
b0535d8d0f * ppudump: Fixed a warning regarding text clipping.
git-svn-id: trunk@41628 -
2019-03-07 10:36:05 +00:00
yury
54756c0f60 * ppudump: Fixed formatting of a error message.
git-svn-id: trunk@41627 -
2019-03-07 10:33:04 +00:00
yury
37941d03cc * ppudump: Avoid using GetLastOSError on platforms that doesn't support it (e.g. go32v2).
git-svn-id: trunk@41625 -
2019-03-07 10:18:15 +00:00
pierre
973741c919 Fix tmoddiv4.pp test failure with -O1 option for powerpc64 as suggested by Jonas
git-svn-id: trunk@41610 -
2019-03-05 22:01:09 +00:00
Jonas Maebe
62cef8eb2b * initialize function result for variadic functions (fixup for r41420)
git-svn-id: trunk@41544 -
2019-03-02 09:37:49 +00:00
Jonas Maebe
f78e2072a1 * fix for r41416: 64 bit values on 32 bit platforms can of course also be
passed in memory

git-svn-id: trunk@41526 -
2019-02-28 20:45:34 +00:00
florian
075e3da334 * better alignment values
git-svn-id: trunk@41521 -
2019-02-27 22:13:54 +00:00
Jonas Maebe
aba3f8f162 * fixed over-eager rejection of tobjecttype.fieldname expression after r40785
(mantis #35149)

git-svn-id: trunk@41474 -
2019-02-25 21:17:24 +00:00
Jonas Maebe
c7834af354 * track va_uses_float_reg also for varargs functions without varargs
parameters (see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23070 )

git-svn-id: trunk@41472 -
2019-02-25 21:02:14 +00:00
Jonas Maebe
eb71a30933 * fix false possitive tconstexprint range errors after r41441 (mantis #35144)
git-svn-id: trunk@41469 -
2019-02-25 20:48:49 +00:00
yury
a04e4971fc * i386: Do not request GOT for every function call. GOT is requested only for external calls in thlcgcpu.a_call_name(). Local calls are always PC relative.
git-svn-id: trunk@41464 -
2019-02-25 15:48:41 +00:00
yury
039aee9568 * i386 PIC: Do not force EBX as a GOT register if tf_section_threadvars is not set. Actually forcing EBX here is a bad idea anyway.
git-svn-id: trunk@41463 -
2019-02-25 15:05:26 +00:00
yury
4da16992df * i386: Minor PIC initialization improvement if the GOT register is forced to EBX.
git-svn-id: trunk@41462 -
2019-02-25 14:43:46 +00:00
yury
e5c2d13671 * Do not set pi_needs_got in current_procinfo.flags at the node level, since the GOT usage can only be estimated there. Instead set the pi_needs_got flag at places where the GOT register is accessed during the code generation. This eliminates generation of the unneeded initialization of the GOT register and fixes linker errors when the _GLOBAL_OFFSET_TABLE_ symbol is referenced but no actual GOT references are present.
git-svn-id: trunk@41460 -
2019-02-25 13:35:40 +00:00
yury
9f88cae771 * Removed inline, since inherited is not supported.
git-svn-id: trunk@41458 -
2019-02-25 11:27:54 +00:00
yury
a277a5f8db * Removed unused local vars.
git-svn-id: trunk@41457 -
2019-02-25 11:22:49 +00:00
pierre
57ee0dd00a Fix fullcycle/fullinstall by adding missing armgen directory -Fu option if PPC_TARGET is armeb
git-svn-id: trunk@41455 -
2019-02-24 22:20:35 +00:00
Jonas Maebe
7c4e7d6bd3 * support OS_32/OS_64 in cgsize2subreg for ARM MM registers to handle
records passed in MM registers

git-svn-id: trunk@41449 -
2019-02-24 19:59:03 +00:00
Jonas Maebe
08791712d7 * also specify the byval alignment at the callee side
git-svn-id: trunk@41448 -
2019-02-24 19:59:00 +00:00
Jonas Maebe
bead1f8180 * properly set 8 byte parameter alignment for first parameter on ARM if
applicable

git-svn-id: trunk@41447 -
2019-02-24 19:58:57 +00:00
Jonas Maebe
6071263469 * use ` instead of ^ as replacement character in LLVM asmnodes, as ^ can
appear in ARM inline assembly

git-svn-id: trunk@41446 -
2019-02-24 19:58:54 +00:00
Jonas Maebe
a87a7270d5 * remove double "nocapture" attributes
* also add "noalias nocapture" to sret parameters

git-svn-id: trunk@41445 -
2019-02-24 19:58:51 +00:00
Jonas Maebe
e829596750 * type left-over parts of parameters as arrays of "stack slot alignment" if
they're an exact multiple of the ialignment size on LLVM. This prevents
    both overalignment (e.g. remainder of 8 individual bytes on ARM
    would be aligned to 8 bytes instead of 4 if typed as int64) and
    underalignment (e.g. 32 bytes remainder of a record that needs to be
    aligned to 8 bytes would be aligned to 1 or 4 bytes if types as
    array of resp. bytes or longints)

git-svn-id: trunk@41444 -
2019-02-24 19:58:47 +00:00
Jonas Maebe
bc77aad3d9 * give an error when trying to call through to a C varargs routine with a
high level code generator
   o we cannot create a high-level stub in that case

git-svn-id: trunk@41443 -
2019-02-24 19:58:44 +00:00
Jonas Maebe
07bd4ba517 * let all the case code generation work with tconstexprint instead of aint,
so it also works for 32 bit targets and a high level code generator
    (where aint is still 32 bit, but 64 bit operations are not decomposed)

git-svn-id: trunk@41441 -
2019-02-24 19:58:37 +00:00
pierre
c1e93bd2c2 + compiler/symdef.pas: Add missing call to tderef.reset methods in all tdef constructors.
+ compiler/sysmsym.pas: Do the same for for all tsym constructors.
  + compiler/symtype.pas: Generate internalerror in  tcompilerppufile.putderef
    if a deref field has index -1, as this means that buildderef was not called
    while it should have been called.
  + compiler/symtable.pas: Fix bug report itself by adding an extra local variable
    CHANGED to add extra cycles in tstoredsymtable.buildderef_referenced method.

New tests for this bug report: tests/webtbs/tw35139.pp and  tests/webtbs/tw35139a.pp

git-svn-id: trunk@41425 -
2019-02-23 23:03:29 +00:00
Jonas Maebe
ba22fe74c7 * don't corrupt the assembler reader mode on i386 and i8086 if the syntax
mode is set to something else but Delphi on the command line

git-svn-id: trunk@41422 -
2019-02-23 16:03:25 +00:00
Jonas Maebe
4e5f48a25e * add support for HFA parameter passing for ARM hardfloat
(fixes test/cg/tcalext6)

git-svn-id: trunk@41421 -
2019-02-23 15:42:48 +00:00
Jonas Maebe
8b9e90dc7a * keep track of whether a routine has a C-style variadic parameter in the
procoptions even when it's through an array-of-const parameter
  * always call create_varargs_paraloc_info() instead of create_paraloc_info()
    in the former case, even when no varargs parameters are specified (because
    on some platforms even some non-variadic parameters need to be passed
    differently, such as on ARM with gnueabihf)

git-svn-id: trunk@41420 -
2019-02-23 15:42:45 +00:00
Jonas Maebe
1a559f5c60 * move the homogenous float aggregate determination function to a common
unit for ARM and AArch64

git-svn-id: trunk@41419 -
2019-02-23 15:42:39 +00:00
Jonas Maebe
af36913469 * don't use cg64.a_load64_loc_cgpara() for 64 bit records passed in
non-integer registers

git-svn-id: trunk@41416 -
2019-02-23 15:08:29 +00:00
yury
382d5060a0 * aarch64: According to ARM64 ABI, function's arguments and the result are not required to be sign/zero extended to a full register size. Obey this rule for all targets except iOS where sign/zero extension is required.
git-svn-id: trunk@41412 -
2019-02-22 17:59:54 +00:00
yury
3a43ffd57b * arm: Include pi_needs_got to current_procinfo.flags when the GOT register is accessed. It forces proper initialization of the GOT register at the beginning of a procedure. This fixes storing of a double constant to a field in a packed record and other rare copy operations when PIC is enabled.
git-svn-id: trunk@41405 -
2019-02-20 20:06:32 +00:00
yury
3e8c7f66b7 * arm: Fixed crash while loading double constants with PIC enabled. This is the regression after r41129. The crash has occurred due to usage of a rare code path. It will be fixed in the next commit.
git-svn-id: trunk@41404 -
2019-02-20 20:00:06 +00:00
yury
fa4596a08f * ppudump: Fixed warnings with -O3.
git-svn-id: trunk@41394 -
2019-02-20 10:24:48 +00:00
yury
9a3ddf650c * ppudump: Use buffered write when outputting to json or xml. It improves the output speed a lot.
git-svn-id: trunk@41393 -
2019-02-20 10:13:18 +00:00
Jonas Maebe
d99d1f1f30 * let the ARM code generator use the generic tcg.a_load_ref_cgpara() instead
of its own buggy version
   o added support to the generic version to override part of the functionality
     needed to implement an ARM quirk

git-svn-id: trunk@41335 -
2019-02-16 10:45:46 +00:00
florian
e3546cf5af * properly quote pathes for objcopy calls, resolves #35072
git-svn-id: trunk@41324 -
2019-02-15 18:57:20 +00:00
pierre
d4e059bd41 Fix bug report #35065 using provided patch by J. Gareth Moreton
git-svn-id: trunk@41310 -
2019-02-12 07:19:04 +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
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