Commit Graph

21655 Commits

Author SHA1 Message Date
Jonas Maebe
8845f4d1ce * fixed type consistency in handler for array parameters on platforms where
these have to be passed on the caller side (i.e., AArch64)

git-svn-id: trunk@40574 -
2018-12-16 20:44:38 +00:00
Jonas Maebe
ac8411f3cf * pass dynamic array parameters of cdecl routines by value on AArch64
(like on onther platforms)
   o it was passed by reference as a side effect of the fact arrays in C are
     pointers, but a dynamic array already is a pointer

git-svn-id: trunk@40573 -
2018-12-16 20:44:35 +00:00
Jonas Maebe
e69b4d2d9a * replaced some stray cpointerdef.create() calls with cpointerdef.getreusable()
git-svn-id: trunk@40572 -
2018-12-16 20:44:31 +00:00
Jonas Maebe
95171a1e22 * initialise cgpara with valid data for the C-style "array of const" para
(necessary for the LLVM backend)

git-svn-id: trunk@40571 -
2018-12-16 20:44:28 +00:00
Jonas Maebe
820d2f7135 * support OS_32/OS_64 in AArch64 cgsize2subreg() for MM registers (can happen
for records with floating point fields with the LLVM code generator)

git-svn-id: trunk@40570 -
2018-12-16 20:44:24 +00:00
Jonas Maebe
93e39fb0cd * only coerce the type of the leftover bytes of a record if the location
size doesn't match the number of remaining bytes
   o prevents a second "single" field of a record getting interpreted as a
     "cardinal"

git-svn-id: trunk@40569 -
2018-12-16 20:44:21 +00:00
Jonas Maebe
ff002e2664 * set paralocations correctly for LLVM/AArch (must be register-type instead
of parameter-type based)

git-svn-id: trunk@40568 -
2018-12-16 20:44:18 +00:00
Jonas Maebe
6b58185bda * fixed shifval for big endian (bits instead of bytes)
git-svn-id: trunk@40567 -
2018-12-16 20:44:15 +00:00
Jonas Maebe
6e453a1477 * fixed paraloc def when changing the size to OS_32
git-svn-id: trunk@40566 -
2018-12-16 20:44:12 +00:00
Jonas Maebe
97bc58d248 * fixed bug that caused the "sret" argument attribute to never be used (and
a guaranteed internalerror on AArch64/llvm)

git-svn-id: trunk@40565 -
2018-12-16 20:44:09 +00:00
Jonas Maebe
52fec8a94a * when optimising subsetreg moves for aarch64, take into account the fact
that the subsetreg itself can be 32 or 64 bit (mantis #33607)

git-svn-id: trunk@40512 -
2018-12-09 14:46:52 +00:00
Jonas Maebe
32a51d7b62 * add nocapture and dereferenceable/dereferenceable_or_null decorators to
parameters for llvm where appropriate

git-svn-id: trunk@40503 -
2018-12-08 15:31:54 +00:00
Jonas Maebe
51502874af * emit temp lifetime information for llvm
o also allow freeing temps in the middle of a routine for llvm (we won't
     reuse them, but it results in better lifetime information)

git-svn-id: trunk@40502 -
2018-12-08 15:31:51 +00:00
Jonas Maebe
3b7efb5123 * only free the temp holding the function result after we've loaded it into
the function return register (so we won't load from an already freed
    temp once we emit lifetime info for temps on LLVM)

git-svn-id: trunk@40501 -
2018-12-08 15:31:48 +00:00
Jonas Maebe
8a4947dba2 * don't do anything in thlcgllvm.allocallcpuregisters() like in
deallocallcpuregisters()

git-svn-id: trunk@40499 -
2018-12-08 15:31:41 +00:00
yury
ad269dedd4 * If ds_dwarf_cpp (C++ emulation) is enabled, add DW_AT_linkage_name attribute for methods.
LLDB uses it to display fully qualified method names. Add a simple C++ mangled name without params to achieve at least "Class::Method()" instead of just "Method" in LLDB.

git-svn-id: trunk@40498 -
2018-12-07 20:55:50 +00:00
yury
f0d42db82d * When ds_dwarf_cpp option is enabled, use dwarf2 implementation of strings debug info. It makes LLDB happy.
git-svn-id: trunk@40492 -
2018-12-07 16:14:02 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
Jonas Maebe
b7da7cd654 * ensure the generic version of tcgshlshrnode gets used for llvm
git-svn-id: trunk@40464 -
2018-12-04 19:53:16 +00:00
Jonas Maebe
2109612fa3 - disable cs_opt_use_load_modify_store because for llvm because it is
apparently buggy as far as type information is concerned, and it also
    results in tons of spilling

git-svn-id: trunk@40463 -
2018-12-04 19:53:13 +00:00
florian
eeadf618b8 + abi tag for i386
* arm abi tag moved into pascal file

git-svn-id: trunk@40454 -
2018-12-02 22:56:12 +00:00
Károly Balogh
6629e72d79 m68k: reinstate the inc/dec tempregister type hack again in an isolated way (it was removed in r40385, as it was breaking llvm target)
git-svn-id: trunk@40453 -
2018-12-02 18:54:04 +00:00
Jonas Maebe
e8512d19b5 * set constalignmax to the same value as varalignmax for all targets where
constalignmax was lower (which does not make sense)

git-svn-id: trunk@40443 -
2018-12-01 23:07:09 +00:00
Jonas Maebe
95d79296bd * fixed alignment of tfiledef (same as corresponding file recorddef)
* cap set alignment to sizeof(aint)

git-svn-id: trunk@40442 -
2018-12-01 23:07:05 +00:00
pierre
67fe756642 Regenerate msgid and msgtxt include files after commit 40422
git-svn-id: trunk@40425 -
2018-12-01 16:18:58 +00:00
marco
b60cbf3329 * systematically capitalize first word of errormsg/sentence, patch by J. Gareth Moreton, mantis 34618
git-svn-id: trunk@40422 -
2018-11-30 11:21:50 +00:00
Jonas Maebe
758a8dd34a * fixed dwarf debug info after r40398 (mantis #34622)
git-svn-id: trunk@40421 -
2018-11-29 23:21:15 +00:00
Jonas Maebe
50ab607676 + customint torddef type to create arbitraty bit-width integers
o use this to handle non-power-of-two-sized parameters for llvm
   o no general support in the parser/code generator, so don't expose

git-svn-id: trunk@40398 -
2018-11-29 20:57:08 +00:00
Jonas Maebe
63847f1948 * disable explicitly calling class constructors on the JVM platform, as that
is forbidden there

git-svn-id: trunk@40386 -
2018-11-28 19:23:34 +00:00
Jonas Maebe
026d06cffb - reverted r39188, as this hack removes the type correctness of the
instructions, which breaks the llvm code generator. Put such hacks
    in CPU-specific overrides

git-svn-id: trunk@40385 -
2018-11-28 19:23:31 +00:00
Jonas Maebe
3a5a69619e * moved initialisation of parentfpstruct to just behind where the local vars
get initialised, so that parameters in this struct are already available
    in any wrappers generated for the parent routine (e.g. in case self is
    moved to the parentfpstruct in a destructor, which calls beforestruction
    in its wrapper)

git-svn-id: trunk@40384 -
2018-11-28 19:23:28 +00:00
Jonas Maebe
97b40dc16d * fixed dynamic array constants for llvm
git-svn-id: trunk@40383 -
2018-11-28 19:23:25 +00:00
Jonas Maebe
413a3599c1 * thlcgobj.g_unreachable() dummy implementation + llvm override
git-svn-id: trunk@40382 -
2018-11-28 19:23:22 +00:00
pierre
b64e9700aa Avoid range errors or overflows on for AVR cpu, when computing address offsets
git-svn-id: trunk@40378 -
2018-11-27 10:21:37 +00:00
pierre
044fae62ea Fix bug report 34605 and add corresponding test
git-svn-id: trunk@40377 -
2018-11-27 10:19:36 +00:00
Jonas Maebe
20fea3607c * pass volatility information to llvm.memcpy
git-svn-id: trunk@40376 -
2018-11-26 22:30:05 +00:00
Jonas Maebe
09b6306f02 - removed outdated comment after r40373
git-svn-id: trunk@40375 -
2018-11-26 22:30:01 +00:00
Jonas Maebe
f98a9bea3c * cap the assumed alignment of pass-by-reference parameters to the minimum of
their default alignment, the alignment of locals, globals and constants
    (so that we don't overestimate the alignment of global normal set
     constants to 32 bytes, while the maximum const alignment is often only
     8 bytes)

git-svn-id: trunk@40374 -
2018-11-26 22:27:35 +00:00
Jonas Maebe
9a157a7749 * don't overwrite the alignment of locals set by the temp manager with the
standard alignment for the type (the maximum alignment for locals may
    be less, and it's set correctly by the temp manager)

git-svn-id: trunk@40373 -
2018-11-26 22:27:31 +00:00
Jonas Maebe
a7cb99f012 * when transforming the structure of a node tree involving full boolean
evaluation flags, also move the full boolean evaluation flags

git-svn-id: trunk@40367 -
2018-11-25 20:56:58 +00:00
florian
c43cae9231 * disable MovOpMov2MovOp optimization on x86-64 for now as it seems to break
git-svn-id: trunk@40361 -
2018-11-21 21:22:54 +00:00
florian
477d7be651 * building on i386-linux fixed
git-svn-id: trunk@40360 -
2018-11-21 19:19:24 +00:00
florian
ac37a54d79 + MovOpMov2MovOp optimization
git-svn-id: trunk@40359 -
2018-11-20 22:20:43 +00:00
Jonas Maebe
b96a8aee61 * don't generate tempsfinalize nodes in except filter procdefs, as that would
finalize the parent's temps twice (fix for r40345, mantis #34574)

git-svn-id: trunk@40357 -
2018-11-20 19:25:06 +00:00
florian
ccb8e86560 * fixes arm
git-svn-id: trunk@40350 -
2018-11-18 14:16:20 +00:00
Jonas Maebe
ea69a5b372 * finalizetemps nodes should never be considered equal and have side effects
git-svn-id: trunk@40348 -
2018-11-18 11:07:28 +00:00
pierre
0052e4da81 * Use getasizeint/putasizeint for tfieldvarsym.fieldoffset
* Change CurrentPPUVersion

git-svn-id: trunk@40347 -
2018-11-18 10:32:13 +00:00
florian
9d56387e7f + new spilling heuristics which takes care of the usage weigth of a register,
not yet activated, can be selected by passing SPILLING_NEW when compiling the compiler

git-svn-id: trunk@40346 -
2018-11-18 10:11:13 +00:00
Jonas Maebe
3b9f5a5e96 * moved finalization of code generator temps to a node, so it can be getcopy'd
(needed for LLVM, where we need two copies of the finally code: one in case
     an exception occurs, and one in case none is raised)
   o also first finalize parameters and only then code generator temps, since
     in theory the former could create more of the latter

git-svn-id: trunk@40345 -
2018-11-17 22:38:36 +00:00
Jonas Maebe
d1361ca6ed * fixed adjustments of lower/upper bounds in range test optimization in case
of strictly smaller/greater comparisons (mantis #34385)

git-svn-id: trunk@40344 -
2018-11-17 22:38:31 +00:00
florian
cefb38b605 * better alignment of while loop heads
git-svn-id: trunk@40340 -
2018-11-17 15:08:24 +00:00
florian
ae8304f657 * set nf_write flag properly for vec. nodes of types with implicit dereferencing
git-svn-id: trunk@40339 -
2018-11-17 15:08:23 +00:00
florian
08d6ca7260 * better alignment on 386-linux
git-svn-id: trunk@40338 -
2018-11-17 15:08:22 +00:00
florian
6dbde11f5a * three operand shl for shifting by 2, 4 or 8 can be simulated by lea
git-svn-id: trunk@40337 -
2018-11-17 15:08:22 +00:00
pierre
bee9421f2a Change local variables offsetdec and extraoffset type to ASizeInt
git-svn-id: trunk@40326 -
2018-11-16 13:28:26 +00:00
pierre
23570bed33 Use same parameter type for update_reference_offset override
git-svn-id: trunk@40325 -
2018-11-16 13:26:56 +00:00
pierre
2761448f44 * Disable range check for m68k/aoptcpu unit
* Add missing change of var parameter p to next instruction
    in TryToOptimizeMove method after instruction removal.

git-svn-id: trunk@40324 -
2018-11-16 10:27:42 +00:00
pierre
11851d274c Fix riscv32 compilation error introduced in last commit
git-svn-id: trunk@40323 -
2018-11-16 10:24:27 +00:00
pierre
aebc8527ef Also disable range checking in arm/aoptcpu unit
git-svn-id: trunk@40322 -
2018-11-15 22:01:25 +00:00
florian
095bd6da7d * do not re-used gottpoff symbols as they are PC-relative
git-svn-id: trunk@40321 -
2018-11-15 20:07:56 +00:00
pierre
53a27fe7b3 Disable range check in m68k:tiscv32 and riscv64 cgcpu units
git-svn-id: trunk@40319 -
2018-11-15 16:58:40 +00:00
pierre
7c92412c74 Avoid overflow error in riscv code generator
git-svn-id: trunk@40318 -
2018-11-15 16:57:57 +00:00
florian
6a6ea6729f * i8086 compiler fixed, resolves #34552
git-svn-id: trunk@40316 -
2018-11-14 18:05:35 +00:00
pierre
4657f45e74 * Change first parameter type of function is_continuous_maks to aword type.
Add typecasts where needed to allow for successful compilation of arm-linux target
    with -CriotR options when building the compiler.

git-svn-id: trunk@40314 -
2018-11-14 13:13:19 +00:00
pierre
cacd8f28eb Try to avoid expectloc not set after first pass error for call node
git-svn-id: trunk@40309 -
2018-11-13 15:51:32 +00:00
pierre
b4315f0f4f + Introduce PPC_SUFFIXES, new make variable that lists all ppc suffixes
for all different CPUs supported.
  * Use PPC_SUFFIXES in execlean and CPU_clean targets.
  * Also delete CPU/bin subbirectory.

git-svn-id: trunk@40307 -
2018-11-13 15:10:21 +00:00
svenbarth
251dfb6776 * don't allow constants of the record type that is currently being parsed; this would fail as soon as another field is added after the constant declaration
+ added tests
Note: unlike what bug report 27880 suggests Delphi also does *NOT* allow this (at least a current Delphi Tokyo) and fails with a "type is not completely defined" error, so this test belongs into the "failure" category

git-svn-id: trunk@40285 -
2018-11-11 22:08:29 +00:00
svenbarth
446f89719c * move checking whether a field's type is valid for the field to a separate function
git-svn-id: trunk@40284 -
2018-11-11 22:08:24 +00:00
florian
e8ebc00b3b * redundant code removed, work is meanwhile done by aasmcpu.optimize_ref
git-svn-id: trunk@40282 -
2018-11-11 17:32:21 +00:00
florian
72416edcc4 + support for tlsm_general on i386-linux
git-svn-id: trunk@40281 -
2018-11-11 17:32:20 +00:00
pierre
c3914c1f38 Downgrade EXTDEBUG warning to note about zero size temp, as it is used for empty sets
git-svn-id: trunk@40278 -
2018-11-08 20:19:54 +00:00
pierre
796db4cef5 Implement mark_write override for tinilinenode
git-svn-id: trunk@40277 -
2018-11-08 20:18:30 +00:00
florian
a40335de34 * non-linux arm targets fixed
git-svn-id: trunk@40276 -
2018-11-08 19:57:30 +00:00
florian
e157939b41 * compilation on x86-64 and i8086 fixed
git-svn-id: trunk@40275 -
2018-11-08 18:45:16 +00:00
florian
4d2d26c318 * define renamed into tls_threadvars
git-svn-id: trunk@40274 -
2018-11-07 22:03:04 +00:00
florian
063415fa72 + i386-linux support for tls-based threadvars
git-svn-id: trunk@40272 -
2018-11-07 22:03:02 +00:00
florian
0d50a63c7d + tsettings.tlsmodel
git-svn-id: trunk@40271 -
2018-11-07 22:03:01 +00:00
florian
c37c485eb7 + check if initialization/finalization code uses implicitly thread vars
git-svn-id: trunk@40269 -
2018-11-07 22:03:00 +00:00
florian
9f16c34329 + initial work for tls-based threadvar support on arm-linux
git-svn-id: trunk@40267 -
2018-11-07 22:02:58 +00:00
yury
5c5dc2ed50 * Changed verbosity of ""???" not yet supported inside inline procedure/function" to note to be consistent with note "Call to subroutine "?" marked as inline is not inlined".
git-svn-id: trunk@40255 -
2018-11-07 12:57:23 +00:00
yury
dd60397165 + Added the pio_inline_not_possible flag to timplprocoption. It is set if a function can't be inline (contains an assembler block, etc). When calling such functions, no note "Call to subroutine "?" marked as inline is not inlined" is emitted.
git-svn-id: trunk@40254 -
2018-11-07 12:20:30 +00:00
yury
b115886930 * po_inline can't be removed from procoptions when the interface part is already parsed. It changes the interface's CRC and causes other units to recompile.
git-svn-id: trunk@40238 -
2018-11-06 10:21:06 +00:00
pierre
8d5cfa8731 Disable range checking in rax86int unit
git-svn-id: trunk@40237 -
2018-11-06 07:41:15 +00:00
pierre
d55f80d2f9 Really change extension of hs1 local variable in get_exepath
git-svn-id: trunk@40236 -
2018-11-06 07:40:31 +00:00
yury
5f1933eecf * Addition to r40225: Forgot to remove inline in the implementation.
git-svn-id: trunk@40227 -
2018-11-05 14:46:09 +00:00
yury
f5ce7c572b * Removed inline for Unix2AmigaPath since it is not necessary and can't be inlined anyway due to ansistring conversion.
git-svn-id: trunk@40226 -
2018-11-05 14:37:01 +00:00
yury
a7642b70c1 * Removed inline for functions which access private variables and can't be inlined from outside.
git-svn-id: trunk@40225 -
2018-11-05 14:35:23 +00:00
yury
c2c942374d * Removed inline for methods which are too big.
git-svn-id: trunk@40224 -
2018-11-05 14:33:39 +00:00
yury
95d18cd052 * If a function can't be inline (contains an assembler block, etc) remove the po_inline flag from its procoptions.
git-svn-id: trunk@40223 -
2018-11-05 14:18:27 +00:00
yury
8fba43609d + Added overloaded version of stringdup() for ansistring to allow stringdup to be inlined.
git-svn-id: trunk@40221 -
2018-11-05 14:00:51 +00:00
yury
c9a7503bbb * Rearranged the code to place implementation of inline methods before their usage within this unit.
git-svn-id: trunk@40220 -
2018-11-05 13:59:59 +00:00
yury
0a3c94bc72 * Moved inline methods to the beginning in order to allow them to be actually inlined in this unit.
git-svn-id: trunk@40219 -
2018-11-04 19:50:09 +00:00
Károly Balogh
7bd590c9a7 fix the missing semicolos in the previous fix..
git-svn-id: trunk@40218 -
2018-11-04 18:15:24 +00:00
Károly Balogh
12a22b593d initialize result before passing it to FindFile()
git-svn-id: trunk@40217 -
2018-11-04 18:03:00 +00:00
yury
4682ac269d * Further improvement for r40180:
An uninitialized function Result of a managed type needs special handling.
    When passing it as a var parameter a warning need to be emitted, since a user
    may expect Result to be empty (nil) by default as it happens with local vars
    of a managed type. But this is not true for Result and may lead to serious issues.

    The only exception is SetLength(Result, ?) for a string Result. A user always
    expects undefined contents of the string after calling SetLength(). In such
    case a hint need to be emitted.
+ Tests for this.

git-svn-id: trunk@40216 -
2018-11-04 15:37:52 +00:00
florian
34d11046e0 * wrapcomplexinlinepara takes care of function results which need different temp. handling, resolves #34438
* tw34438 failed with -O3, fixes also dfa for inline functions returning results as "complex" parameter

git-svn-id: trunk@40202 -
2018-11-03 17:31:10 +00:00
florian
42e54c1ad5 * max_operands needs only to be 2 on avr
git-svn-id: trunk@40197 -
2018-11-03 10:39:58 +00:00
pierre
0e546d47ca Fix 3 operand version of MatchOpType
git-svn-id: trunk@40196 -
2018-11-02 23:18:54 +00:00
florian
9b0ff05ee8 - get rid of MaxOps, it is redundant with max_operands
* MatchOpType with three operands is only available of max_operands>2

git-svn-id: trunk@40190 -
2018-11-02 21:32:29 +00:00
Jonas Maebe
513481ad71 * fixed overzealous removal of an assigned(t1) check in r40142 (it was for a
ttryexceptnode instead of for a ttryfinally node)

git-svn-id: trunk@40189 -
2018-11-02 21:12:18 +00:00
yury
30d64cec68 * Removed unused local vars.
git-svn-id: trunk@40185 -
2018-11-02 18:51:19 +00:00
yury
a026252508 * Commented out unused "size" local var.
git-svn-id: trunk@40184 -
2018-11-02 18:47:34 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
yury
2dc64e5fae * Reverted r40181 because the "not inlined" notes are issued not due to access to private fields, but due to string conversion. It need to be fixed by overloaded versions of some methods.
git-svn-id: trunk@40182 -
2018-11-02 18:21:26 +00:00
yury
fa2d82f879 * Removed 'inline' from public methods of TFPObjectList and TFPHashObjectList since they use private fields and can not be inlined when called from other units.
git-svn-id: trunk@40181 -
2018-11-02 16:55:33 +00:00
yury
1b151df89f * Make SetLength() to emit hint "Local variable "s" of a managed type does not seem to be initialized" instead of the warning. This change is needed because when calling a regular procedure with a ver parameter of a managed type the hint is generated. Now SetLength() behaves the same.
git-svn-id: trunk@40180 -
2018-11-02 16:19:18 +00:00
pierre
2a9ce2ed6c Disable three operand overload of MatchOpType for avr and jvm targets, which only have 2 operands max
git-svn-id: trunk@40170 -
2018-11-01 23:04:18 +00:00
pierre
e49025a086 More -CriotR fixes:
* entfile.pas: Change PPU header falgs filed from longint to dword.
  * ngtcon.pas: Change local variable startoffset type to aword.
  * omfbase.pas: Avoid calling move with a nil string s indexed as s[1],
    to avoid a range check error.
  * owomflib.pas: Disable range check explicitly in hash computation.
  * utils/ppuutils/ppudump.pp: Adapt to flags type change in entfile.pas

git-svn-id: trunk@40163 -
2018-11-01 21:58:54 +00:00
florian
59d5d6ec95 + factored out TX86AsmOptimizer.PrePeepholeOptIMUL, used now by x86-64 and i386
* generalized and simplified the code

git-svn-id: trunk@40162 -
2018-11-01 20:49:20 +00:00
florian
2a016889de * skip align directives after unconditional jumps
git-svn-id: trunk@40160 -
2018-11-01 20:49:18 +00:00
florian
a092da723a + new fields for more precise control of alignment
+ support of new alignment control values for GNU AS writer
+ support of new alignment control values for binary writer
* better alignment settings on i386-win32
* improved inserted align directives for if nodes

git-svn-id: trunk@40159 -
2018-11-01 20:49:17 +00:00
florian
64e8557180 + introduce tai_align_abstract.create_max which limits the maximal number of bytes being inserted for alignment
git-svn-id: trunk@40158 -
2018-11-01 20:49:15 +00:00
florian
cdce68451a - x86 align does not use a register anymore, code removed
git-svn-id: trunk@40157 -
2018-11-01 20:49:15 +00:00
Jonas Maebe
011968e74b * replaced "is" test with faster field value test
git-svn-id: trunk@40156 -
2018-11-01 20:39:41 +00:00
Jonas Maebe
1a9eb77698 * fixed compilation with -O3 (one false positive, one real error)
git-svn-id: trunk@40155 -
2018-11-01 20:39:38 +00:00
Jonas Maebe
0cd85d73e4 * ttryfinallynode now inherits from tbinarynode instead of tloopnode, as its
t1 field was always set to tnothingnode

git-svn-id: trunk@40142 -
2018-11-01 13:19:33 +00:00
pierre
3b49fda0a2 Only call moved if len>0, as otherwise astring local variable is nil, which leads to a range check error for astring[1]
git-svn-id: trunk@40132 -
2018-11-01 07:09:47 +00:00
pierre
96460b70b2 Remove another wrong typecast when testing that a tai is an instruction
git-svn-id: trunk@40131 -
2018-11-01 07:01:02 +00:00
pierre
9c90f593ab Add global range check disable for i8086 cgcpu and x86 nx86add units
git-svn-id: trunk@40124 -
2018-10-31 23:20:29 +00:00
pierre
a015c779ff Remove unneeded typecasts in TryTOptimizeMove
git-svn-id: trunk@40123 -
2018-10-31 23:19:39 +00:00
pierre
fbffd2a38f Fix typecast in FindRegDeAlloc call
git-svn-id: trunk@40122 -
2018-10-31 23:18:09 +00:00
pierre
bb219cd05a Add check about tloadnode.symtableentry type before typecast
git-svn-id: trunk@40121 -
2018-10-31 23:16:51 +00:00
pierre
0abc978cc4 Change RemoveCurrentP parameter type to tai, because GetNextInstruction does not always return a taicpu, adapt code in avr/aoptcpu unit
git-svn-id: trunk@40120 -
2018-10-31 23:15:22 +00:00
pierre
9c2ac7b3dd Avoid range check error in ReadPosInfo
git-svn-id: trunk@40115 -
2018-10-31 22:53:11 +00:00
pierre
bf3bedb2d4 Add explicit rtlclean/rtl targets in fullcycle rule if DOWPOCYCLE is set
git-svn-id: trunk@40114 -
2018-10-31 15:50:26 +00:00
pierre
ae0c180e0b Avoid overflow in code
git-svn-id: trunk@40113 -
2018-10-31 15:49:14 +00:00
pierre
e42ccccecf Disable range check completely in arm/cgcpu unit
git-svn-id: trunk@40112 -
2018-10-31 15:48:32 +00:00
pierre
04fd1a6397 Complement commit 40104, by changing type of executionweight in toptinfo record and adapt pass_2 code
git-svn-id: trunk@40111 -
2018-10-31 15:47:53 +00:00
pierre
e5dffebdc7 Avoid range check error in MaskLength evaluation
git-svn-id: trunk@40110 -
2018-10-31 14:51:23 +00:00
pierre
8f7707d474 Use correct field for sl_absolutetype or sl_typeconv ppropaccesslistitem type (revealed by compilation with -CriotR)
git-svn-id: trunk@40109 -
2018-10-31 14:43:18 +00:00
pierre
8cd55d4603 Use longint type instead of AWord for Initial parameter in CalcExecutionWeigths (to avoid range error for avr compiler)
git-svn-id: trunk@40104 -
2018-10-31 10:21:51 +00:00
pierre
7a07f848e8 Use pdword to avoid range check erro in tentryfile.getdword method
git-svn-id: trunk@40103 -
2018-10-31 09:59:45 +00:00
florian
18a45d94a3 * version update
git-svn-id: trunk@40068 -
2018-10-28 16:21:06 +00:00
yury
bf4eda478d * SetExecutionWeight(): Set execution weight also for nodes with special handling. Minor code cleanup/improvements.
* Restore previous execution weight before exiting secondpass().
* It all improves register allocation for variables inside loops in some cases.

git-svn-id: trunk@40059 -
2018-10-27 18:13:33 +00:00
yury
2b459b30d2 * Optimized generic implementations of tcg.a_op_const_ref() and tcg.a_op_reg_ref() for PIC and CPUs which need 2 or more instructions to load a symbol's value by reference.
First the symbol's address is taken and then it is used to load the value and also store the result. It eliminates extra calculation of the symbol's address needed to store the result.
  x86 and other CPUs which can handle refs ops directly or more efficiently already have overloaded versions of these methods and are not affected by this change.

git-svn-id: trunk@40050 -
2018-10-27 11:32:22 +00:00
pierre
d26fb3b663 Try to fix compilation error after commit #40027
git-svn-id: trunk@40028 -
2018-10-25 06:39:42 +00:00
pierre
740a26d879 Fix compilation of RTL for watcom target
git-svn-id: trunk@40027 -
2018-10-24 21:37:54 +00:00
pierre
c6977a0a7a Explicitly disable range checking
git-svn-id: trunk@40026 -
2018-10-24 21:37:22 +00:00
florian
112fb4613b * take care of the fact that x and w registers overlap when carrying out the Str/LdrAdd/Sub2Str/Ldr Postindex optimization
git-svn-id: trunk@40023 -
2018-10-24 17:38:51 +00:00
florian
0a5e6d29cb + implement assembler optimization Str/LdrAdd/Sub2Str/Ldr Postindex done
git-svn-id: trunk@40017 -
2018-10-23 20:41:27 +00:00
florian
379c2fe821 * cleanup debug code
git-svn-id: trunk@40016 -
2018-10-22 21:27:36 +00:00
florian
f27fee5566 + make use of the BFI instruction in tcgaarch64.a_load_ref_reg_unaligned
git-svn-id: trunk@40015 -
2018-10-22 21:23:48 +00:00
Jonas Maebe
9bd931e931 * make "formal const/var" parameters the least preferred conversion
(mantis #32179)
  - removed code to handle conversion to formaldef parameters that are not by
    reference (so the default conversion preference is kept)

git-svn-id: trunk@40012 -
2018-10-21 21:02:17 +00:00
Jonas Maebe
2a3eeab96d * support for constant char/bool/enum indices in typed constant
index expressions (mantis #34055)
  * prevent all indirect structure indexing instead of only
    ansi/wide/unicodestrings

git-svn-id: trunk@40010 -
2018-10-21 18:48:41 +00:00
Jonas Maebe
2c7c0d1144 * handle widechar constants directly in the scanner, instead of in the
overload selection (where you can't even know whether the string is
    a valid widechar constant) (mantis #33875)

git-svn-id: trunk@40009 -
2018-10-21 17:34:00 +00:00
Jonas Maebe
60277dda09 * fix crash when checking load nodes during inlining in case they don't
have a symtable set (happens for internally generated labels, like
    $raiseaddr) (mantis #34442)

git-svn-id: trunk@40008 -
2018-10-21 15:53:46 +00:00
florian
88589fb99d * make install shall not make assumptions about FPC, if one was provided
git-svn-id: trunk@40007 -
2018-10-21 14:52:21 +00:00
florian
02e03cbd86 * use the built compiler to install files, so the version is set correctly
git-svn-id: trunk@40006 -
2018-10-21 13:35:44 +00:00
florian
6521918269 * fullinstall builds (and installs) utils now only once
git-svn-id: trunk@40005 -
2018-10-21 13:16:57 +00:00
florian
af7dfbc970 * typo
git-svn-id: trunk@40004 -
2018-10-21 12:14:26 +00:00
florian
9febce6ffb * remove .NOTPARALLEL: from compiler Makefile, accelerates make fullcycle with -j a lot
* few cleanups

git-svn-id: trunk@40003 -
2018-10-21 11:40:57 +00:00
pierre
378e1dfaa4 Add explicit typecast to avoid range check error
git-svn-id: trunk@40001 -
2018-10-20 22:19:08 +00:00
pierre
0bcf9a51d9 Avoid range check error when compiled with -CR
git-svn-id: trunk@40000 -
2018-10-20 18:49:53 +00:00
pierre
3715dbdf41 Avoid run time error if compiled with -CR option
git-svn-id: trunk@39999 -
2018-10-20 18:44:05 +00:00
florian
0cc3be49fa * GAS readers and writers can handle section flags
git-svn-id: trunk@39998 -
2018-10-20 18:23:24 +00:00
pierre
d512d8cae1 Also fix first_abs_real like in rev 39988
git-svn-id: trunk@39997 -
2018-10-20 18:11:25 +00:00
florian
2cbb9895be * pass float abi always to the arm assembler
git-svn-id: trunk@39996 -
2018-10-20 16:48:31 +00:00
florian
3078cc4b0d * same fix as in r39988 for fpc_first_sqrt
git-svn-id: trunk@39991 -
2018-10-20 10:18:45 +00:00
florian
116f36fe56 * avoid range check errors
git-svn-id: trunk@39990 -
2018-10-20 10:17:34 +00:00
florian
d4cf97a755 * wrong ifdef exposed by warning with -O3 fixed
git-svn-id: trunk@39989 -
2018-10-20 09:16:51 +00:00
pierre
7d7f966ccb Fix wrong explicit typecast that lead to memory corruption in first_sqr_real
git-svn-id: trunk@39988 -
2018-10-19 23:04:55 +00:00
yury
48fcbb3f6c * Create the ".note.gnu.build-id" section for android. It fixes debugging of shared libs in Android Studio.
git-svn-id: trunk@39987 -
2018-10-19 20:23:08 +00:00
pierre
92acd38f40 Fix for bug report #34380
git-svn-id: trunk@39986 -
2018-10-18 20:21:54 +00:00
florian
9805214d34 * properly take care of register allocations between the first and second instruction for the FoldLea optimization
* check for ait_instruction after a GetNextInstruction function call
* cosmetics

git-svn-id: trunk@39983 -
2018-10-18 18:28:03 +00:00
yury
4643a0b1ff * Register external gas assembler for aarch64-android and x86_64-android.
git-svn-id: trunk@39969 -
2018-10-18 11:48:27 +00:00
yury
e8d43c8fed * Fixed range check errors.
git-svn-id: trunk@39963 -
2018-10-17 19:12:27 +00:00
yury
7eb9b23fa5 * Reverted r39961.
git-svn-id: trunk@39962 -
2018-10-17 18:56:29 +00:00
yury
692c287c3e * Undef FPC_HAS_TYPE_EXTENDED for x86_64-android.
git-svn-id: trunk@39961 -
2018-10-17 18:46:04 +00:00
yury
a29290202f * Regenerated makefiles to support x86_64-android.
git-svn-id: trunk@39958 -
2018-10-17 17:12:20 +00:00
yury
e367577bf1 + added support for x86_64-android target.
git-svn-id: trunk@39956 -
2018-10-17 16:56:27 +00:00
yury
e60a5ebfe7 * Fixed overflow error for the qword version of align() when i=0.
git-svn-id: trunk@39954 -
2018-10-17 13:18:45 +00:00
yury
93d672bf16 * aarch64: Fixed loading of a function result which is returned in 4 32-bit MM registers to 2 64-bit int registers. Bug #30329.
git-svn-id: trunk@39953 -
2018-10-17 11:41:34 +00:00
yury
c306f57ecb * Reverted r39947. According to Sven, the $self parameters is not required to be first parameter in RTTI. Appropriate tests will be fixed.
git-svn-id: trunk@39952 -
2018-10-17 08:52:57 +00:00
yury
7c94d00a4a * Fixed bug #17413 (and the tw17413 test) for aarch64 by adding additional check.
git-svn-id: trunk@39951 -
2018-10-16 21:16:30 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
yury
9ee1682955 * Fixed interface delegation for aarch64 (tdel1 and tdel2 tests).
It was broken by r31676 which did not take in account r29953. As a consequence $self was passed in register x1 instead of x0 when the method result is of a managed type.
  This fix enables changing order of the $self and $result parameters only for aarch64 AND llvm combination where it is actually needed.
  The issue with interface delegation still exists for aarch64-llvm and need to be fixed separately. Probably by applying llvm-specific workarounds as it was made in r29953 for regular aarch64 targets.

git-svn-id: trunk@39948 -
2018-10-16 20:32:02 +00:00
yury
84b5129f1d * Fixed writing of method's RTTI for aarch64 by explicitly writing the $self parameter first.
git-svn-id: trunk@39947 -
2018-10-16 17:24:07 +00:00
pierre
4c0a213f0d Add -Tlinux and -Tembedded help lines for riscv32 and riscv64 compilers
git-svn-id: trunk@39945 -
2018-10-16 10:41:27 +00:00
pierre
293973b306 Add missing setting of expectloc for multiplications
git-svn-id: trunk@39935 -
2018-10-14 22:18:50 +00:00
florian
eea088c5f5 * allow nil to be assigned to generic types, resolves #34037
* niln is also a constant node

git-svn-id: trunk@39934 -
2018-10-14 07:38:13 +00:00
pierre
c9c8ff1eef Set MaxLocalsSize according to address size not register size
git-svn-id: trunk@39925 -
2018-10-13 12:00:31 +00:00
pierre
5ccced201a Downgrade some warnings to notes for EXTDEBUG
git-svn-id: trunk@39924 -
2018-10-13 11:35:34 +00:00
pierre
aa89182bf5 Fix compilation with -dEXTDEBUG
git-svn-id: trunk@39923 -
2018-10-13 11:34:53 +00:00
pierre
68bcffc3e0 Fix riscv64 compiler compilation with -dEXTDEBUG
git-svn-id: trunk@39922 -
2018-10-13 09:47:29 +00:00
yury
d0b6f427d3 * Fixed checks for exceeding limit of locals space. Prevent range and overflow errors during the checks. Introduced the MaxLocalsSize constant which provides the maximum possible size of locals space (stack frame) depending of bitness of a cpu.
git-svn-id: trunk@39916 -
2018-10-12 14:43:17 +00:00
yury
4860f3934a * Fixed overflow error when calling align() with corner case values such as align($7FFFFFFC, 4) for the longint variant.
git-svn-id: trunk@39915 -
2018-10-12 14:38:14 +00:00
pierre
a898ae856f Adapt ppudump to fix introduced in revision 39912
git-svn-id: trunk@39914 -
2018-10-12 06:05:50 +00:00
pierre
66e7c78a8f fix position of ppuload_platform for trecorddef
git-svn-id: trunk@39913 -
2018-10-11 21:02:25 +00:00
pierre
88bddc2cb0 Fix ppuload for string type for i8086, use getasizeint for all string defs but short string
git-svn-id: trunk@39912 -
2018-10-11 20:38:39 +00:00
yury
9d7308df42 * Android: Reworked the startup code to use no assembly instructions. Generic assembler startup files contains only section data and are compiled for each CPU.
* Android: argc and argv are correct for shared libraries.

git-svn-id: trunk@39905 -
2018-10-08 16:48:41 +00:00
yury
88365b6d92 * Enabled safecall support for aarch64 to be on par with other cpus.
git-svn-id: trunk@39903 -
2018-10-08 08:37:18 +00:00
svenbarth
b9ec7e1e06 * generate RTTI for *all* parameters of a method or procedure variable
git-svn-id: trunk@39885 -
2018-10-07 12:25:33 +00:00
svenbarth
a8b2ad31d1 * fix for Mantis #34355: correctly check whether the array constructor is empty (aka []) or not
git-svn-id: trunk@39882 -
2018-10-07 12:25:24 +00:00
svenbarth
2f74a51eb8 * fix .seh_savereg: the offset is checked with a bitmask, not a divisor, so use "and", not "mod"
git-svn-id: trunk@39877 -
2018-10-07 12:25:09 +00:00
florian
8943c0584e + patch by J. Gareth Moreton to support BMI2 instructions
+ extended avx test generator with the newly added BMI2 instructions

git-svn-id: trunk@39875 -
2018-10-07 10:10:19 +00:00
yury
8c59eb1ce5 * Regenerated makefiles to support aarch64-android.
git-svn-id: trunk@39863 -
2018-10-06 09:36:03 +00:00
yury
671d31df1d + Added support for the aarch64-android target.
git-svn-id: trunk@39862 -
2018-10-06 09:33:09 +00:00
florian
c7a0022146 * fix building with LLVM=1, thanks to Karl-Michael Schindler for the hint
git-svn-id: trunk@39861 -
2018-10-05 20:56:56 +00:00
pierre
0e0b43889f Use vfpv2 as default fpu for eabihf if cpu is below armv7
git-svn-id: trunk@39849 -
2018-10-01 21:50:13 +00:00
florian
be1bd043a7 * only i386 uses oldfpccall for interrupts, all other architectures use now stdcall, resolves #34317
git-svn-id: trunk@39838 -
2018-09-27 21:00:35 +00:00