Commit Graph

186 Commits

Author SHA1 Message Date
florian
0f06a7205b * do not create full copies of objects when object checking is on, resolves #36863
git-svn-id: trunk@44598 -
2020-04-05 16:26:10 +00:00
florian
424c8a0ac0 * simple record accesses have not side effects
git-svn-id: trunk@44269 -
2020-03-06 16:16:36 +00:00
florian
9819df6fe1 * calculate complexity of an rtti node correctly
git-svn-id: trunk@44261 -
2020-03-03 21:29:52 +00:00
florian
5a87855b06 + might_have_sideeffects takes care of vo_volatile now (it is not exposed yet)
git-svn-id: trunk@44085 -
2020-02-01 20:30:15 +00:00
florian
d479069f8c * might_have_sideeffects takes care of absolute
git-svn-id: trunk@44083 -
2020-02-01 18:00:38 +00:00
Jonas Maebe
e1d9be897a * fixed (harmless) wrong typecast
git-svn-id: trunk@43834 -
2020-01-01 19:19:15 +00:00
florian
f6c16323fa * unified loadnf_load_self_pointer into loadnf_load_addr
+ var parameters are now allowed when doing tail recursion optimziation, resolves #32811

git-svn-id: trunk@43824 -
2019-12-30 22:43:10 +00:00
pierre
7eb0be6127 Fix invalid typecast revealed by -CriotR by changing order of terms in boolean expression
git-svn-id: trunk@43515 -
2019-11-19 22:47:39 +00:00
florian
851accbb4b * cse adjusted
git-svn-id: trunk@43496 -
2019-11-16 14:07:59 +00:00
Jonas Maebe
d23c7980aa * properly perform (or not) range/overflow checking when performing constant
propagation into inlined routines, regardless of the range/overflow
    checking state at the caller site

git-svn-id: trunk@43436 -
2019-11-10 12:00:05 +00:00
florian
b7f58dd8c8 * load nodes for variables in registers do not generated instructions, so their complexity is zero
git-svn-id: trunk@43319 -
2019-10-27 16:53:26 +00:00
florian
31e5b2d9a4 * more precise estimation of subscript node complexity
git-svn-id: trunk@43314 -
2019-10-27 12:40:08 +00:00
florian
e80eee5da5 * generate better code for length(<dyn. type>)=0, resolves #36060
git-svn-id: trunk@43272 -
2019-10-20 13:03:45 +00:00
Jonas Maebe
14a7429e19 * factored out inlinenode check whether it may have a side effect
o also added register assert as having a side-effect (if asserts are
     enabled)

git-svn-id: trunk@42728 -
2019-08-18 15:55:03 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +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
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
florian
e24449bcfd * if sub nodes of a commutative node contain conditionally executed nodes, these sub nodes might not be swapped
as this might result in some nodes not being executed, like temp. create nodes with init. code, see e.g. issue #34653, resolves #34653

git-svn-id: trunk@40934 -
2019-01-20 12:55:20 +00:00
Jonas Maebe
9630eb7ce9 * synchronised with trunk till r40466
git-svn-id: branches/debug_eh@40467 -
2018-12-04 19:54:31 +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
03013cf2e1 * make ttryfinallynode inherit from ttertiary node so it has a "third" node
member. This one will be used by the LLVM descendent to keep a copy of
    the finally code, as it must use a separate version for the code that
    gets executed when an exception is caught and when no exception happens

git-svn-id: branches/debug_eh@40416 -
2018-11-29 21:31:34 +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
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
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
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
florian
88f83280dc * correctly take care of short boolean evaluation when rearranging nodes during CSE
git-svn-id: branches/laksen/riscv_new@39803 -
2018-09-25 20:31:03 +00:00
Jeppe Johansen
f828d8700c A subscript can also trigger an exception.
git-svn-id: branches/laksen/riscv_new@39718 -
2018-09-09 14:41:37 +00:00
florian
32a58ba7d1 * might_have_sideeffects gets flags: if mhs_exceptions is passed, nodes which might cause an exception are considered as having a side effect
git-svn-id: branches/laksen/riscv_new@39483 -
2018-07-22 13:11:21 +00:00
florian
c59bd8c29a + calculate loop unrolling using node_count_weighted which takes care of nodes generating no code
* optimized unrolling calculation

git-svn-id: trunk@38688 -
2018-04-04 21:39:46 +00:00
florian
3d514856a4 * improve node complexity calculations for type nodes
git-svn-id: trunk@37151 -
2017-09-06 20:34:56 +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
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
nickysn
b6d05dba9e * mark the sar/shl/shr/rol/ror_assign nodes as having side effects
git-svn-id: trunk@35781 -
2017-04-12 12:17:08 +00:00
nickysn
7b40bdaa6e + treat the new modify-in-place inline nodes as having side effects in
check_for_sideeffect()

git-svn-id: trunk@35774 -
2017-04-11 14:59:38 +00:00
Károly Balogh
5426c11611 marked a few uses of TConstExprInt as const during parameter passing, to avoid a few unnecessary record copying
git-svn-id: trunk@35509 -
2017-03-03 17:29:59 +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
pierre
1e9491550d nutils.pas: Add new procedure:
procedure node_change_local_switch(p : tnode;cs : tlocalswitch;enable : boolean);
    to add/remove cs local switch from all p tnode tree localsettings.

    modify second_prefetch implementation in arm, ppcgen and x86 subdirectories
    to use node_change_local_settings to temporarily disabled
    checkpointer local switch, as prefetch is allowed even on unaccessible addresses.
    (previous code was buggy because I frogot that each node has it own localswitches).

git-svn-id: trunk@34576 -
2016-09-29 21:34:34 +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
8df1d1f9b8 * fixed compilation of tw15391 with range checking enabled after r34034:
support maybe_call_procvar() on internal block nodes, which return
    their result via the last statement

git-svn-id: trunk@34051 -
2016-07-02 21:09:59 +00:00
Károly Balogh
e0c21b6f8b ARM: avoid some range check errors, while running a compiler compiled with -CR
git-svn-id: trunk@33257 -
2016-03-16 10:08:44 +00:00
nickysn
96f331038d * fixed crash in node_complexity() on the callparan nodes of SetLength() (and
perhaps calaparans of other inline nodes as well?)

git-svn-id: trunk@33256 -
2016-03-15 23:46:46 +00:00
Jonas Maebe
9ea38f4577 * support static fields in nested types in records, by always including
support for nested types when generating an access to a static fied;
    we also always do that when generating the mangled name of a static
    field declaration in symcreat.make_field_static() (mantis #29030)

git-svn-id: trunk@32517 -
2015-11-24 16:04:19 +00:00
florian
27828d41e7 * extended nodes which return true from is_const
git-svn-id: trunk@31472 -
2015-08-31 20:03:52 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
919c539ff5 * better estimation of callparanode complexity
git-svn-id: trunk@31038 -
2015-06-13 16:50:55 +00:00
Jonas Maebe
3f736f6114 * handle the loading of VMT entries at the node level, so it's done in a
type-safe way (for LLVM, and also internal consistency checking between
    the VMT as generated in nobj.pas and ncgvmt.pas)
   o also converted the VMT validity checking to the node level

git-svn-id: trunk@30950 -
2015-05-31 16:50:47 +00:00
Jonas Maebe
caea5ac8be * record a load node for the self/vmt tree of the current routine in the
tcallnode constructor, so that when it's needed later during pass 1,
    its value doesn't depend on the context in which pass 1 is executed
    (e.g. when inlining) (mantis #18121)

git-svn-id: trunk@30908 -
2015-05-25 12:55:40 +00:00
florian
0dfbba86f3 * properly firstpass nodes when inc(...) is converted into ...:=...+x, resolves #27471
git-svn-id: trunk@29742 -
2015-02-17 21:14:45 +00:00
svenbarth
5115c3e680 Fix for Mantis #26481. This is a regression.
nutils.pas, handle_staticfield_access:
  * generics don't have staticvarsyms for their static fieldvarsyms so we need to simulate a non-static access to avoid 1) an exception and 2) incorrect errors that instance methods can't be accessed

+ added tests

git-svn-id: trunk@29484 -
2015-01-16 16:05:53 +00:00
florian
6dd2edb10d * better complexity estimation for some inline nodes
git-svn-id: trunk@27674 -
2014-04-27 14:28:01 +00:00