Commit Graph

692 Commits

Author SHA1 Message Date
Jonas Maebe
d8903ce6b3 - removed maxcrecordalign parameter/field from recordsymtables, as this value
cannot be modified in the settings (so we can directly use the one from
    current_settings)

git-svn-id: trunk@42447 -
2019-07-14 19:24:32 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
pierre
243c967967 Commit of new debug feature implemented by J. Gareth Moreton
Allows compilation of compiler using -dDEBUG_NODE_XML
  which will generate a NAME-node-dump.xml file for each 
  unit, program or library compiled,
  containing a XML description of the nodes handled during
  compilation of the unit, program or library.

git-svn-id: trunk@42271 -
2019-06-22 14:08:47 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
svenbarth
307ff071e6 * allow any untyped parameter to be passed to a untyped constref parameter
+ added test

git-svn-id: trunk@41829 -
2019-04-04 19:31:55 +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
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
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
b840db7228 * addition to r40631: also force inline self parameters that are already in
a temp into a new temp for LLVM, so their type gets updated

git-svn-id: trunk@40642 -
2018-12-25 15:36:28 +00:00
Jonas Maebe
eb769e3859 * force pointer-based self parameters of inlined routines in temps for LLVM
to ensure that their type gets updated

git-svn-id: trunk@40631 -
2018-12-24 22:09:55 +00:00
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
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
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
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
Jonas Maebe
011968e74b * replaced "is" test with faster field value test
git-svn-id: trunk@40156 -
2018-11-01 20:39:41 +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
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
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
florian
a34d4e715c Merged riscv_new branch
git-svn-id: trunk@39813 -
2018-09-26 19:49:08 +00:00
florian
7855b3cf1b * relax formula for max. nodes to inline
git-svn-id: trunk@39763 -
2018-09-16 19:15:30 +00:00
florian
4f052e4f90 o fix several issues with floating point exceptions
+ mask underflow and precision on startup
  + check for floating point exceptions after inlined float routine helpers
  - do not check for floating point exceptions after floating point moves 

git-svn-id: branches/laksen/riscv_new@39645 -
2018-08-19 15:26:00 +00:00
svenbarth
c1cfd87b56 * the call node takes ownership of the specialization context, so free it in the destructor
git-svn-id: trunk@39560 -
2018-08-03 20:24:15 +00:00
Jonas Maebe
cb7730a423 * fixed execution order of implicit finalization and class destructors: first
the latter, then the former

git-svn-id: trunk@38716 -
2018-04-08 15:41:00 +00:00
florian
bd27b7635b * also in case of constref make_not_regable with ra_addr_taken must be called, later on in pass_1 this happens anyways
* for in loops can generate temp. refs as loop counter, so when checking of the address of the for counter is taken, we have to check for a load node

git-svn-id: trunk@38692 -
2018-04-05 20:09:40 +00:00
florian
42d6e81c33 * made message about subroutines not being inlined a note instead of a hint, see also #33515
git-svn-id: trunk@38690 -
2018-04-05 09:51:25 +00:00
florian
c46cbc8411 * do not issue a hint of compiler procs are not inlined, resolves #33515
git-svn-id: trunk@38675 -
2018-04-03 21:39:47 +00:00
nickysn
3318703ece * moved nf_typedaddr to addrnodeflags (anf_typedaddr)
git-svn-id: trunk@38671 -
2018-04-03 16:41:01 +00:00
florian
3e7af376fe * fix issue #32539 and #20551 by some ugly hack
git-svn-id: trunk@38531 -
2018-03-15 20:37:50 +00:00
florian
5e200cad89 * write correct proc name when giving a hint that a procedure is not inlined.
git-svn-id: trunk@38480 -
2018-03-10 10:39:10 +00:00
florian
73aef1402b + compiler writes a hint if a subroutine marked as inline cannot be/is not inlined, resolves #31717
+ test

git-svn-id: trunk@38330 -
2018-02-24 14:35:12 +00:00
Jonas Maebe
53bef8d202 * fixed calculation of high parameter for arrays with non-integer bounds
(mantis #32645)

git-svn-id: trunk@37928 -
2018-01-07 13:01:14 +00:00
svenbarth
239d0704ca + add support for type helpers to also extend interface types
git-svn-id: trunk@37023 -
2017-08-21 20:49:20 +00:00
florian
54b5112284 * real constants should be propagated during inline expanding
git-svn-id: trunk@36277 -
2017-05-21 08:34:47 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
svenbarth
9fc420b546 - remove unused variable
git-svn-id: trunk@36157 -
2017-05-08 19:54:45 +00:00
svenbarth
1aa80f77cb - remove no longer needed global variable allow_array_constructor
git-svn-id: trunk@36103 -
2017-05-04 21:58:14 +00:00
Jonas Maebe
1adde89621 * copy tcallnode.right after copying the callinitblock, as right can be a
temprefnode referring to a temp from the init block (mantis #31421)

git-svn-id: trunk@35478 -
2017-02-24 19:57:40 +00:00
Jonas Maebe
7a57161b6d * in x:=f(..), we only checked for aliasing between x and any parameters of
f(..) before using x directly as function result for f(..) (instead of a
    temp) in case the function result of temp is passed via a hiddel
    call-by-reference parameter. After all, if the result is returned by
    value, then any changes to the function result inside the callee code
    won't affect whatever we will assign the result to until the callee
    has returned. However, this is not true in case of inlining: then
    the replaced function result node will be substituted directly in the
    inlined code -> also check for aliasing in that case.
   o fixes test/toperator5.pp on x86-64

git-svn-id: trunk@34893 -
2016-11-13 16:06:35 +00:00
florian
9bff3ac624 * copy also pushedparasize when copying call nodes, resolves #30923
git-svn-id: trunk@34885 -
2016-11-13 14:46:55 +00:00
florian
cfd38388ca * formatting so lazarus can handle it
git-svn-id: trunk@34737 -
2016-10-16 19:53:12 +00:00
florian
9c81e90e08 + extension to iso mode: reset/rewrite can take a file name as a second parameter
git-svn-id: trunk@34726 -
2016-10-16 07:55:08 +00:00
nickysn
657685a8b6 * use sizesinttype instead of ptrsinttype for the index and high parameter of
open arrays/dynarrays/string-like char arrays, etc.

git-svn-id: trunk@34665 -
2016-10-08 13:56:24 +00:00
Jonas Maebe
66be068365 * set the correct resultdef after converting a dynamic array to an open array
in ncnv
  * handle the fact that we overwrite the open array resultdef of a parameters'
    left node with the original resultdef (i.e., also for dynamic arrays) with
    regards to LLVM type rules
   o use the parameter's formal type (open array) instead of the value's type
     (dynamic array) when loading/using its value, since that's the type the
     value has been converted to
   o this change is not really nice since it adds several independent checks in
     different places, but I can't find a way to nicely unify the code to work
     around this (nor one to get rid of that hack in the first place)

git-svn-id: trunk@34515 -
2016-09-11 17:12:04 +00:00
Jonas Maebe
2f41434284 * fix crash while compiling webtbf/tw14849
git-svn-id: trunk@34454 -
2016-09-08 14:19:02 +00:00
Jonas Maebe
1e506ce1d5 * call beforedestruction if an exception happens in afterconstruction
(mantis #30570)

git-svn-id: trunk@34453 -
2016-09-08 14:18:59 +00:00
Jonas Maebe
388c047c8a - removed the code to check whether a parameter to an inline routine is
also the by-reference function result of a call node, now that this is
    properly checked in the general case (these parameters/function results
    are temp nodes in case of inlined calls)

git-svn-id: trunk@34446 -
2016-09-07 19:37:38 +00:00
Jonas Maebe
5ffd06392d * don't optimize "x:=f(x)" whereby the function result of f() is passed
by reference in case x is a temp (mantis #30572)

git-svn-id: trunk@34445 -
2016-09-07 19:37:35 +00:00
svenbarth
d46c015eb1 * when inlining a function we need to import symbols that were loaded from another unit (or the same unit if the inlined function is from another unit and uses another function in the same unit)
git-svn-id: trunk@34380 -
2016-08-26 13:47:10 +00:00
Jonas Maebe
179c1ab328 * changed ttemp*node.tempinfo^.flags to a private field, and added setters
and getters for the ttemp*node classes instead
   o this will allow descendants to prevent certain flags from being added
     or removed. E.g. for LLVM, certain temps must never be put in registers
     because it cannot typecast a value in a register from a non-record/array
     type to an array type without forcing it to memory (so if that is done
     on an lvalue, the result will be written to the memory temp instead of
     to the register)

git-svn-id: trunk@34358 -
2016-08-21 14:23:09 +00:00
Jonas Maebe
8e0ee6599c * store parameters to inline routines that are already in a temp into a new
temp if the original temp was marked as ti_const, and the new parameter
    gets modified (mantis #30015)

git-svn-id: trunk@34289 -
2016-08-12 13:35:56 +00:00