Commit Graph

277 Commits

Author SHA1 Message Date
Jonas Maebe
3ac703506c * rest of the previous accidental partial commit
git-svn-id: branches/fixes_3_2@41250 -
2019-02-07 19:56:21 +00:00
pierre
92cd9502ef Merge of revisions 40277
40307
40309
40314
40319
40322
40324
40326
40377
40378 from trunk to fixes_3_2
------------------------------------------------------------------------
r40277 | pierre | 2018-11-08 20:18:30 +0000 (Thu, 08 Nov 2018) | 1 line

 Implement mark_write override for tinilinenode
------------------------------------------------------------------------
--- Merging r40277 into '.':
U    compiler/ninl.pas
--- Recording mergeinfo for merge of r40277 into '.':
 U   .
------------------------------------------------------------------------
r40307 | pierre | 2018-11-13 15:10:21 +0000 (Tue, 13 Nov 2018) | 6 lines

  + 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.


------------------------------------------------------------------------
--- Merging r40307 into '.':
U    compiler/Makefile
U    compiler/Makefile.fpc
--- Recording mergeinfo for merge of r40307 into '.':
 G   .
------------------------------------------------------------------------
r40309 | pierre | 2018-11-13 15:51:32 +0000 (Tue, 13 Nov 2018) | 1 line

 Try to avoid expectloc not set after first pass error for call node
------------------------------------------------------------------------
--- Merging r40309 into '.':
U    compiler/ncal.pas
--- Recording mergeinfo for merge of r40309 into '.':
 G   .
------------------------------------------------------------------------
r40314 | pierre | 2018-11-14 13:13:19 +0000 (Wed, 14 Nov 2018) | 4 lines

  * 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.

------------------------------------------------------------------------
--- Merging r40314 into '.':
U    compiler/arm/cpubase.pas
U    compiler/arm/cgcpu.pas
--- Recording mergeinfo for merge of r40314 into '.':
 G   .
------------------------------------------------------------------------
r40319 | pierre | 2018-11-15 16:58:40 +0000 (Thu, 15 Nov 2018) | 1 line

 Disable range check in m68k:tiscv32 and riscv64 cgcpu units
------------------------------------------------------------------------
--- Merging r40319 into '.':
   C compiler/riscv64
U    compiler/m68k/cgcpu.pas
   C compiler/riscv32
--- Recording mergeinfo for merge of r40319 into '.':
 G   .
Summary of conflicts:
  Tree conflicts: 2
------------------------------------------------------------------------
r40322 | pierre | 2018-11-15 22:01:25 +0000 (Thu, 15 Nov 2018) | 1 line

 Also disable range checking in arm/aoptcpu unit
------------------------------------------------------------------------
--- Merging r40322 into '.':
U    compiler/arm/aoptcpu.pas
--- Recording mergeinfo for merge of r40322 into '.':
 G   .
------------------------------------------------------------------------
r40324 | pierre | 2018-11-16 10:27:42 +0000 (Fri, 16 Nov 2018) | 4 lines

  * Disable range check for m68k/aoptcpu unit
  * Add missing change of var parameter p to next instruction
    in TryToOptimizeMove method after instruction removal.

------------------------------------------------------------------------
--- Merging r40324 into '.':
U    compiler/m68k/aoptcpu.pas
--- Recording mergeinfo for merge of r40324 into '.':
 G   .
------------------------------------------------------------------------
r40326 | pierre | 2018-11-16 13:28:26 +0000 (Fri, 16 Nov 2018) | 1 line

 Change local variables offsetdec and extraoffset type to ASizeInt
------------------------------------------------------------------------
--- Merging r40326 into '.':
U    compiler/ncgmem.pas
--- Recording mergeinfo for merge of r40326 into '.':
 G   .
------------------------------------------------------------------------
r40377 | pierre | 2018-11-27 10:19:36 +0000 (Tue, 27 Nov 2018) | 1 line

 Fix bug report 34605 and add corresponding test
------------------------------------------------------------------------
--- Merging r40377 into '.':
A    tests/webtbs/tw34605.pp
U    compiler/nutils.pas
--- Recording mergeinfo for merge of r40377 into '.':
 G   .
------------------------------------------------------------------------
r40378 | pierre | 2018-11-27 10:21:37 +0000 (Tue, 27 Nov 2018) | 1 line

 Avoid range errors or overflows on for AVR cpu, when computing address offsets
------------------------------------------------------------------------
--- Merging r40378 into '.':
U    compiler/ncgset.pas
U    compiler/ngtcon.pas
--- Recording mergeinfo for merge of r40378 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40716 -
2018-12-31 15:48:08 +00:00
nickysn
42432d4ef3 * use sizeuinttype, instead of ptruinttype for the indexdef conversion in
tcgvecnode.pass_generate_code. This avoids a meaningless conversion to 32-bit
  (and using the cwd instruction) on i8086 in the far data memory models.

git-svn-id: trunk@39472 -
2018-07-19 15:27:14 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
florian
2251e87e41 * fix compilation for jvm, resolves #33195
git-svn-id: trunk@38283 -
2018-02-18 17:31:09 +00:00
florian
2e9f6f9dfb * wrong alignment was used in r38252: alignment for a class returns the alignment of the implict pointer, but we really need the alignment of the data structure
git-svn-id: trunk@38261 -
2018-02-16 20:56:15 +00:00
florian
a21f462a93 * references of fields for types using indirect addressing get proper alignment
git-svn-id: trunk@38252 -
2018-02-16 18:45:54 +00:00
florian
6f338bb4b5 + tcgsubscriptnode.pass_generate_code makes use of a_loadmm_reg_intreg to avoid location_force_mem calls
git-svn-id: trunk@37373 -
2017-10-01 16:13:20 +00:00
florian
8ea9e3d344 * avoid range check errors on avr
git-svn-id: trunk@36360 -
2017-05-28 08:59:51 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
pierre
abaea9959f Fix parameter loading of FPC_CHECKPOINTER to handle correctly references with offsets
git-svn-id: trunk@34743 -
2016-10-18 21:48:59 +00:00
pierre
4d09dfca95 Remember usage of checkpointer (-gc) option:
Use new cs_checkpointer_called moduleswitches set element.
     Use new uf_checkpointer_called PPU flag (reusing obsolete uf_local_browser flag value)
     Emit warning if compiled library/program has any code using checkpointer.
  
 * ppu.pas: New constant: uf_checkpointer_called
 * globtype.pas: New constant: cs_checkpointer_called
 * fppu.pas: Set uf_checkpointer_called flag if cs_checkpointer_called is set in current_settings.module_switches
 * i8086/n8086mem.pas: Include cs_checkpointer_called in current_settings.moduleswitches
 *  ncgmem.pas: Likewise.
 * msg/errore.msg: Add new message saying that -gc and -Ur options are incompatible
   Add description to -gc option, saying it is experimental.
   Add warning at link time for program/library if checkpointer is used in any unit or main code.
 * options.pas: if -gc and -Ur options are used, never enable checkpointer code,
   instead output a warning that release is incompatible with -gc option.
 * pmodules.pas: proc_program: Check all modules for uf_checkpointer_called flag,
   emit a warning if checkpointer is used.
 * utils/ppuutils/ppudump.pp: Add code for uf_codepointer_called option.

git-svn-id: trunk@34567 -
2016-09-27 14:46:09 +00:00
Jonas Maebe
db171702f3 * vecn: don't use left.location.reference.alignment if left is not in a
LOC_(C)REFERENCE

git-svn-id: trunk@34545 -
2016-09-20 21:43:32 +00:00
Jonas Maebe
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
yury
e3d9dbbeef * Removed unused vars.
git-svn-id: trunk@34404 -
2016-09-01 19:55:45 +00:00
svenbarth
54874cccd6 * reference the VMT's assembler symbol if it's from another unit
git-svn-id: trunk@34342 -
2016-08-19 14:00:24 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
a821c47252 * converted dynarray range checking to the high level code generator
git-svn-id: trunk@34115 -
2016-07-14 15:16:52 +00:00
Jonas Maebe
996e325175 * converted range checking for open arrays/array of const from the code
generator to the typecheck pass, so that it also works for platforms
    that use the parentfpstruct way to handle accesses to nested frames
    in case the array has been migrated to such a parentfpstruct
   o additionally, the number of comparisons for such range checks
     has been reduced from 3 (for signed indices) or 2 (for unsigned
     indices) to 1 in all cases
   o the range checking code is disabled for the JVM target, as the
     JVM automatically range checks all array accesses itself anyway

git-svn-id: trunk@34034 -
2016-06-30 15:33:47 +00:00
Jonas Maebe
cef5cac4fa * converted tcgvecnode.rangecheck_string to the high level code generator
git-svn-id: trunk@33961 -
2016-06-12 09:21:05 +00:00
Jonas Maebe
5af40f22e8 * handle enums with a packenum setting that is larger than necessary to store
all of their values, when kept in a bitpacked array, properly via
    pass_typecheck rather than hacking location.size in pass_generate_code:
   o the old fix was incomplete (it didn't handle non-constant indices)
   o the old fix didn't work for llvm (since it uses defs rather than
     location.size)

git-svn-id: trunk@33943 -
2016-06-09 22:00:14 +00:00
Károly Balogh
778a0b737e * removed ancient (since r5554) special handling code for m68k from tcgvecnode, which is no longer necessary
git-svn-id: trunk@33650 -
2016-05-04 21:39:37 +00:00
svenbarth
9857a27ad8 Generate and use an indirect symbol for VMTs.
Note: the merged code has been adjusted to a) use the typed constant builder and b) to not use the indirect symbol when its not necessary (non-Windows or same unit)

Merged revision(s) 28340, 28350 from branches/svenbarth/packages:
Generate an indirect VMT symbol for each generated VMT.

ncgvmt.pas, TVMTWriter:
  * writevmt: write a symbol with the indirect VMT name that references the direct VMT symbol
........
Load the VMT using the indirect symbol if the target supports packages.

ncgmem.pas, tcgloadvmtaddrnode:
  * pass_generate_code: if tf_supports_packages is set in target_info.flags we load the VMT using the indirect symbol, otherwise we load it using the direct symbol

........

git-svn-id: trunk@33448 -
2016-04-08 14:21:51 +00:00
Jonas Maebe
9788bb1316 * fixed check regarding whether a field is in the first or second word of
of 2*sizeof(aword) bitpacked record that's kept in registers
    (mantis #29669)

git-svn-id: trunk@33177 -
2016-03-06 13:20:16 +00:00
Jonas Maebe
dacfb1a6ff * load an objc classrefdef as objc_idtype, as that is also how we type
the self parameter in Objective-C class methods

git-svn-id: trunk@32913 -
2016-01-10 17:22:09 +00:00
Jonas Maebe
9e4806f21a * made Objective-C non-fragile ABI field indexing type safe for LLVM
git-svn-id: trunk@32911 -
2016-01-10 17:22:03 +00:00
Jonas Maebe
d0f97a6441 * converted open array range checking to the high level code generator
git-svn-id: trunk@32543 -
2015-11-27 14:44:29 +00:00
Jonas Maebe
9dc5f1acb4 * support LOC_(C)SUBSETREG in tcgvecnode.pass_generate_code, can also occur
for function results (patch by Do-wan Kim, mantis #29064)

git-svn-id: trunk@32516 -
2015-11-24 15:03:34 +00:00
Jonas Maebe
56a4051296 * replaced another {$ifdef x86} with a virtual method call (the pointer type
of voidpointertype corresponds to the default pointer type)

git-svn-id: trunk@32181 -
2015-10-28 18:25:26 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
d60f60154a * fixed the def used to load non-objc loadvmtaddr nodes (for llvm)
git-svn-id: trunk@31064 -
2015-06-13 22:48:48 +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
florian
e791f534d2 * fix tcgvecnode.update_reference_reg_packed if OS_INT<>OS_ADDR
git-svn-id: trunk@30659 -
2015-04-19 10:34:14 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Károly Balogh
0021ad714f * fixed some ancient code behind cpu_uses_separate_address_registers define to at least compile again, for some m68k experiment
git-svn-id: trunk@30130 -
2015-03-07 22:11:43 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
d6de2c03cb * generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
o in particular, add tdef size information to the update_reference*()
     methods, and factored out offset adjustments into its own method
   o also make sure the passed size to update_reference*() corresponds to the
     actual size of the index, as it's no longer guaranteed to be ptruint
     since the previous commit

git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
Jonas Maebe
67c9d60b72 * factored out the check regarding whether the index of a vecn needs to be
loaded into a register because of its size
   o by default, also allow if the size is the same as OS_ADDR but with a
     different sign

git-svn-id: trunk@29827 -
2015-02-23 22:48:08 +00:00
sergei
d4969ca2ee * Fixed subscripting records of size OS_PAIR on big endian targets and enabled placing such records into registers. Tested and shows no regressions on mips-linux.
git-svn-id: trunk@29493 -
2015-01-17 11:30:19 +00:00
sergei
11201164e7 * Fixed type of parameter passed to FPC_CHECKPOINTER after r23325, must be the pointer itself, not what it points to. Was causing IE 200306031 when compiling for i386 with -gc.
git-svn-id: trunk@28644 -
2014-09-12 18:50:09 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
florian
417d444376 * do not crash with an internal error if an indexed access is done on a constant pointer node
git-svn-id: trunk@27789 -
2014-05-14 17:35:09 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
de1b8cf5d6 * use def_cgsize(parentfpvoidpointertype) instead of OS_ADDR in
tcgloadparentfpnode.pass_generate_code (should've been part of r27690)

git-svn-id: trunk@27693 -
2014-04-30 17:37:47 +00:00
nickysn
cb33e51425 * tcgloadparentfpnode.pass_generate_code converted to the high level code
generator. This fixes nested access to parentfp in i8086 memory models where
  DS<>SS.

git-svn-id: trunk@27690 -
2014-04-29 23:32:22 +00:00
florian
701cdf8ea2 * fix for #25956: left is not necessarily the array load node when accessing an open array/array of const element
git-svn-id: trunk@27487 -
2014-04-06 15:15:16 +00:00
Jonas Maebe
338c064beb * moved x86-specific tpointerdef functionality to architecture-specific
descendants

git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00