Commit Graph

716 Commits

Author SHA1 Message Date
florian
b36597c76a * better calculation of estimated stack frame size
git-svn-id: trunk@46733 -
2020-08-30 20:53:59 +00:00
Jonas Maebe
453bfcd370 * emit the correct declaration for procdefs used to force a procname in LLVM
o fixes lazarus startup on macOS/AArch64 when compiled with the LLVM cg

git-svn-id: trunk@46675 -
2020-08-23 21:11:09 +00:00
Jonas Maebe
d1d3d7cd08 * never create a regular temp for inline parameters that can be modified by
the caller (mantis #37465)a
   o in theory, the regular checks for doing so should never trigger, but due
     to compiler-generated nodes (such as calls to fpc_ansistr_unique), they
     could. Internal address nodes can deal with taking the address of the
     function result in this case.

git-svn-id: trunk@46660 -
2020-08-23 11:27:59 +00:00
yury
e5a923eb7a * 8086: Proper implementation of: If a far procvar is called, it must be in a memory location. This fixes a hack to emulate CALL reg1:reg2.
git-svn-id: trunk@46641 -
2020-08-23 10:26:54 +00:00
yury
aefc1be555 * Reverted accidentally committed files.
git-svn-id: trunk@46416 -
2020-08-13 18:48:19 +00:00
yury
7b65f85a0b * Accidental commit.
git-svn-id: trunk@46415 -
2020-08-13 18:46:57 +00:00
svenbarth
b412259c1c * fix for Mantis #37355: the method name and the named parameters need to be separated by a single #0
+ added test

git-svn-id: trunk@45974 -
2020-07-31 15:55:37 +00:00
Jonas Maebe
924ffe6538 * removed initialisation of unused fparacopyback from tcallparanode.copy_value_by_ref_para
git-svn-id: trunk@45822 -
2020-07-21 17:57:45 +00:00
yury
e63c03125a * Reworked tprocdef.is_implemented to fix a bug with the parentfp optimization. The bug was detected when using the llvm backend.
+ Added a test.

git-svn-id: trunk@45675 -
2020-06-21 19:52:14 +00:00
yury
7bffafdf8b * Improved the parentfp optimization to properly handle cases when a nested routine calls other nested routines.
git-svn-id: trunk@45665 -
2020-06-20 18:34:26 +00:00
yury
627fcb4354 * Do not use the LOC_VOID location to indicate unused parameters.
* Added the tprocdef.parentfpsym property. Set parentfpsym.varstate to vs_read instead of using the pio_needs_parentfp flag.
* Replaced tcgcallparanode.push_zero_sized_value_para by tparamanager.has_strict_proc_signature.

git-svn-id: trunk@45454 -
2020-05-21 09:36:40 +00:00
yury
a316229ef6 * Always use parentfp for forward-declared nested procedures.
git-svn-id: trunk@45320 -
2020-05-09 17:52:17 +00:00
Jonas Maebe
0fbb1b259e * re-added "protected" accidentally removed in r45236, fixes JVM compilation
(mantis #37016)

git-svn-id: trunk@45257 -
2020-05-04 17:08:00 +00:00
florian
b80d051249 * make fparainit and fparacopyback public
+ process fparainit and fparacopyback in foreachnode
  + print fparainit and fparacopyback
  + do not break if tcallparanode.copy_value_by_ref_para is called multiple times

git-svn-id: trunk@45236 -
2020-05-03 20:37:07 +00:00
florian
0794878b41 * allow recursive inlines, meanwhile, there are other means to avoid too deep recursion of inlining
git-svn-id: trunk@45214 -
2020-05-01 20:50:19 +00:00
nickysn
5be4ce281f * don't reorder LOC_REFERENCE parameters on the Z80 also
git-svn-id: branches/z80@45122 -
2020-04-26 19:49:17 +00:00
svenbarth
068f0d2ec8 * fix for Mantis #36935: apply patch by J. Gareth Moreton to fix a typo in cs_opt_remove_empty_proc
git-svn-id: trunk@44888 -
2020-04-20 18:42:30 +00:00
florian
1993c5d1ef * cosmetics
git-svn-id: trunk@44094 -
2020-02-02 14:30:44 +00:00
florian
98226d33b7 * do not optimize inline nodes which are part of call node which has an init and/or cleanup block, resolves #36323
git-svn-id: trunk@43553 -
2019-11-21 22:15:06 +00:00
svenbarth
0a915e883e * keep track of static symbols that a global function references, as those must now be exported from a dynamic package as well if the function can potentially be inlined
git-svn-id: trunk@43544 -
2019-11-21 21:44:53 +00:00
florian
60b3296594 * relax conditions in tcallnode.optimize_funcret_assignment, resolves #36279
git-svn-id: trunk@43501 -
2019-11-16 17:16:16 +00:00
Jonas Maebe
ac1e0f96bd * replaced tentryfile.get/putsmall/normalset() with a common tget/putset
that expects an open array of byte, and use it for all sets
   o since all sets need to be typecasted to an array type of the appropriate
     size, we'll get a compilation error in case this needs to be done and
     that also tells us at the same time that the ppu version will need to
     be increased
  * enabled {$packset 1} for the compiler, as this is now safe with the above
    changes

git-svn-id: trunk@43407 -
2019-11-06 21:50:19 +00:00
Jonas Maebe
a051b8d225 - remmoved doregister parameter from t*sym constructors, as the registration
is handled automatically nowadays

git-svn-id: trunk@42998 -
2019-09-14 17:30:45 +00:00
Jonas Maebe
956aab3be0 * implement support for the Objective-C "related result type" convention
as described on
    http://releases.llvm.org/8.0.0/tools/clang/docs/LanguageExtensions.html#objective-c-features
    (rest of mantis #35994)

git-svn-id: trunk@42816 -
2019-08-25 15:23:53 +00:00
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