Commit Graph

752 Commits

Author SHA1 Message Date
nickysn
96de6c4b96 * synchronize with trunk
git-svn-id: branches/wasm@47877 -
2020-12-28 18:45:24 +00:00
marco
185f20b9ec * fix comment typo mentioned by Bart
git-svn-id: trunk@47866 -
2020-12-28 10:46:35 +00:00
Jonas Maebe
5d51a788f7 - revert r47208
* properly fix the internalerror it hid: only replace the local symbols
    migrated to the parentfpstruct right before generating debug information,
    so that internally generated self/result loads during optimisation passes
    don't get confused by the replacement absolutevarsyms (those are normally
    never encountered during optimisation, as regular absolutevarsyms are
    replaced during parsing)

git-svn-id: trunk@47855 -
2020-12-27 13:18:50 +00:00
nickysn
47ff701db7 * synchronized with trunk
git-svn-id: branches/wasm@47778 -
2020-12-14 23:07:56 +00:00
florian
00af340feb * cleanup
git-svn-id: trunk@47774 -
2020-12-14 21:55:41 +00:00
nickysn
91e9558f5b * synchronized with trunk
git-svn-id: branches/wasm@47766 -
2020-12-12 23:20:33 +00:00
yury
8b7c5666a2 * Renamed fc_block_with_exit to fc_no_direct_exit to expand its usage.
* Set fc_no_direct_exit in case when a routine has an additional implicit exit code, such as calling FreeInstance in the destructor.

git-svn-id: trunk@47749 -
2020-12-10 17:38:37 +00:00
nickysn
dc5b78d5f0 * synchronized with trunk
git-svn-id: branches/wasm@47716 -
2020-12-08 06:57:57 +00:00
pierre
a7232669ff * Adapted from patch node-dump-pass-1.patch submitted by J. Gareth Moreton from bug report 38156.
This patch extends the DEBUG_NODE_XML debug feature by also outputting, 
     to the *-node-dump.xml files, the node tree as it appears after the first pass, 
     since it often contains many more internal nodes like temporary allocations that may need
     to be evaluated for debugging and development purposes, or node-level optimisation opportunities.

git-svn-id: trunk@47709 -
2020-12-07 07:28:04 +00:00
florian
9c6bdcfbb7 * fix in r47632 should be enabled for all targets as it is a stack tainting
parameter

git-svn-id: trunk@47680 -
2020-12-03 21:22:07 +00:00
nickysn
4676146e3d * synchronized with trunk
git-svn-id: branches/wasm@47662 -
2020-12-02 03:53:02 +00:00
pierre
af17e9460b Apply patch proposed by J. Gareth Moreton in:
bug report #0036882: [Feature] Class and record definition XML dump extension

  These patches extend the node dump feature (enabled with DEBUG_NODE_XML)
  so it also dumps class and record definitions to the XML file. They are contained within <definition> tags.
  Currently only fields and constants are dumped to the XML file. Methods, constant and variable definitions may be added later.

git-svn-id: trunk@47658 -
2020-12-01 11:45:14 +00:00
nickysn
aeafe42144 * synchronized with trunk
git-svn-id: branches/wasm@47653 -
2020-12-01 03:27:01 +00:00
florian
c47d6d7af0 * check if an invisible parameter for the result occupies parameter space
git-svn-id: trunk@47632 -
2020-11-29 13:38:33 +00:00
florian
fbb2e63fea + #QLvember work: stack frame optimization for m68k
git-svn-id: trunk@47629 -
2020-11-29 10:16:00 +00:00
nickysn
48b81da877 * synchronized with trunk
git-svn-id: branches/wasm@47249 -
2020-10-29 10:49:36 +00:00
florian
3baddff71e + inline subroutines with formal parameters as well
git-svn-id: trunk@47214 -
2020-10-26 22:18:03 +00:00
nickysn
8f059a6b8a * synchronized with trunk
git-svn-id: branches/wasm@47106 -
2020-10-14 02:41:25 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
nickysn
d7559d7a38 * synchronized with trunk
git-svn-id: branches/wasm@46798 -
2020-09-07 21:56:01 +00:00
florian
93eef547ae * improve call0 calling conventions
git-svn-id: trunk@46797 -
2020-09-07 20:28:38 +00:00
nickysn
325c91d152 * synchronized with trunk
git-svn-id: branches/wasm@46710 -
2020-08-26 21:20:01 +00:00
florian
250c0750a2 * Xtensa: several issues with parameter passing of the windowed api fixed
git-svn-id: trunk@46708 -
2020-08-26 21:03:42 +00:00
nickysn
988a833836 * synchronized with trunk
git-svn-id: branches/wasm@46665 -
2020-08-23 15:31:53 +00:00
svenbarth
c2c7ac634a * fix for Mantis #37616: apply patch by Kai Burghardt to complain about the correct type used by setjmp/longjmp
git-svn-id: trunk@46542 -
2020-08-22 13:33:53 +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
nickysn
62cb7c2d12 * synchronized with trunk
git-svn-id: branches/wasm@46214 -
2020-08-03 21:15:39 +00:00
nickysn
6e7bb5927e [PATCH 04/83] update for Wasm target. adapting Karoly's changes from webassembly branch
From 8acd7baf8d14236dc12781dd15bac188581ccecf Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Thu, 29 Aug 2019 15:09:58 -0400

git-svn-id: branches/wasm@45881 -
2020-07-29 16:28:18 +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
svenbarth
c45c543faa * fix typo (no code changes)
git-svn-id: trunk@45644 -
2020-06-13 18:42:21 +00:00
yury
2808873d1b * Reworked the optimization of unused $parentfp for nested routines.
- Do not remove the $parentfp parameter as was done in the previous optimization approach. Instead when $parentfp is unused to the following:
      - On the caller side: Omit passing the value for $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=false (classic CPU targets). 
          Pass 0/nil as $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=true;
      - On the callee side: Prevent allocation of registers/resources for $parentfp.
  - When possible keep $parentfp in a register.
  - Set the pio_nested_access flag in tprocinfo.set_needs_parentfp() to properly handle deep nesting levels;

git-svn-id: trunk@45436 -
2020-05-19 13:17:47 +00:00
florian
af0ba7be83 * when auto-inlining is used, do not require that inlining is explicitly turned on
git-svn-id: trunk@45405 -
2020-05-17 18:14:48 +00:00
florian
2a2ec77b10 * improved heuristics for auto-inlining
git-svn-id: trunk@45328 -
2020-05-10 19:41:13 +00:00
yury
254d0c0e2c * Do not perform optimization of nested procedures for:
- targets which use a special struct to access parent's variables;
  - pure assembler procedures (for compatibility with old code).

git-svn-id: trunk@45322 -
2020-05-09 20:45:00 +00:00
yury
40504a6f9d * If a nested procedure does not access its parent's frame pointer, optimize it by removing the hidden $parentfp parameter.
* Improved the tisogoto1.pp test.

git-svn-id: trunk@45292 -
2020-05-06 14:43:49 +00:00
svenbarth
2b59000d56 + implement compiler support for SEH on Win64
Note: due to the way we access variables in a nested function (which in this case includes exception filters) we can not extract the finally handlers and call them (like we do on i386 and x86_64, but instead we duplicate the finally code)

git-svn-id: trunk@44941 -
2020-04-21 06:06:05 +00:00
svenbarth
fed17122f8 * as a variant for SEH exception filters we allow them to be *duplicated* instead of being extracted; this can be done unconditionally as for extracted ones their code is set to Nil after they're done and thus won't be picked up by generate_code_exceptionfilters
git-svn-id: trunk@44934 -
2020-04-21 06:05:35 +00:00
svenbarth
12ef066897 + add functionality to store a node tree's required temp nodes and their flag upon entering the tree
git-svn-id: trunk@44924 -
2020-04-21 06:04:59 +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
aca9727418 + OptimizeForLoop: convert for-loops into zero-based backward for-loops if possible, for most architectures, this results in simpler code
git-svn-id: trunk@44287 -
2020-03-08 14:30:59 +00:00
svenbarth
147559349b * fix for Mantis #36652: gracefully handle the error if one tries to implement a method of a type from another unit
+ added test

git-svn-id: trunk@44170 -
2020-02-14 16:48:58 +00:00
Jonas Maebe
254b85c352 + new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
2020-01-29 22:21:17 +00:00
Jonas Maebe
b625afe800 * never inline routines that call get_frame (otherwise get_frame would return
the frame of the caller rather than of the current routine, which could
    cause e.g. stackframes to be missed in RTL helpers that are known to be
    only called from run time error routines)

git-svn-id: trunk@44064 -
2020-01-29 22:21:14 +00:00
florian
931d4dcfee * ensure the rtl and the packages for embedded compile with features exceptions and classes disabled
git-svn-id: trunk@43931 -
2020-01-13 21:20:03 +00:00
florian
2f2b378c03 * moved conversion of for into while loops in a separate pass, so node optimizations on the node tree can be
carried out without losing information from for loops

git-svn-id: trunk@43910 -
2020-01-11 16:08:45 +00:00
florian
6f87a572af * factored out tcgprocinfo.OptimizeNodeTree
git-svn-id: trunk@43907 -
2020-01-10 21:47:20 +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
svenbarth
f13200d68b * restore localswitch settings after the initialization and finalization code was generated
git-svn-id: trunk@43535 -
2019-11-21 21:44:19 +00:00
florian
af8783e8d2 * i386: with a fixed stack, exception handling does not need a frame pointer
git-svn-id: trunk@43218 -
2019-10-17 20:55:39 +00:00