Commit Graph

12907 Commits

Author SHA1 Message Date
florian
ce070c93fc + patch by Jeppe Johansen to support the SC32442B
git-svn-id: trunk@20081 -
2012-01-14 21:39:32 +00:00
florian
bf290cadae + include avr in fullcycle
git-svn-id: trunk@20080 -
2012-01-14 20:48:33 +00:00
sergei
fde1695961 * tcgx86_64.g_proc_exit: restore stack pointer using value that was calculated and stored in tcgx86.g_proc_entry, instead of recalculating it again.
git-svn-id: trunk@20078 -
2012-01-14 18:04:45 +00:00
sergei
149218408b * Factored part of tcgrpocinfo.generate_code (responsible for setting up tempgen and stack frame) into a separate method.
git-svn-id: trunk@20077 -
2012-01-14 16:45:01 +00:00
sergei
898fbdcd26 * Disallow placing hidden 'high' parameter in register if it will be accessed from implicit finally block (happens for <value open array of managed type> parameters).
git-svn-id: trunk@20072 -
2012-01-14 04:34:39 +00:00
Jonas Maebe
56161e608d * do not interpret procsyms followed by ./^/( as potential procvar
expressions in case of TP/Mac-style procvar modes (mantis #21073)

git-svn-id: trunk@20062 -
2012-01-12 21:37:59 +00:00
Jonas Maebe
1f614b7efc * use correct source code position for error messages about invalid
published fields (mantis #21035)

git-svn-id: trunk@20060 -
2012-01-12 20:09:08 +00:00
Jonas Maebe
3b8ae840c1 * avoid range check errors when inlining not-nodes (mantis #21029)
git-svn-id: trunk@20046 -
2012-01-10 22:23:25 +00:00
sergei
40f29ffd7a * Generate direct order of indexes passed to fpc_dynarray_setlength at compile time, eliminates the need of reversing them at runtime (in DynArraySetLength).
* 'dimcount' parameter is now of type sizeint everywhere (was dword in fpc_dynarray_setlength and  longint generated by compiler).
Since multi-dimensional dynarrays are not used in compiler code, this change does not break cycling.

git-svn-id: trunk@20041 -
2012-01-10 18:58:20 +00:00
florian
9375945082 * toper.val : aint => tcgint, needed at least for avr
git-svn-id: trunk@20018 -
2012-01-08 22:22:09 +00:00
florian
0e7e45d423 * avoid warnings in the avr code generator
git-svn-id: trunk@20015 -
2012-01-08 20:10:59 +00:00
florian
7ec6201fb3 * mark label as used if address is taken
git-svn-id: trunk@20000 -
2012-01-07 21:53:21 +00:00
sergei
fa98e0523d * Safecall handling: forgot to free cgpara before doing the call, fixed.
git-svn-id: trunk@19976 -
2012-01-05 19:12:56 +00:00
florian
e0d7af703a * proper feature handling for gba
* slinebreak shall be a real constant

git-svn-id: trunk@19973 -
2012-01-05 17:27:02 +00:00
florian
957c819035 * don't try to build a native compiler for arm-gba
git-svn-id: trunk@19969 -
2012-01-04 23:31:08 +00:00
florian
4765728fc4 * use SarInt64 to optimize 64 bit divs on 32 bit platforms, resolves #20998
git-svn-id: trunk@19968 -
2012-01-04 22:58:25 +00:00
florian
fd07f51f35 * handle LOC_JUMP correctly for 64 bit boolean assignments
git-svn-id: trunk@19967 -
2012-01-04 22:32:31 +00:00
sergei
49700e675c * Changed code generation for variant assignments to typecast arguments to TVarData instead of using pointers. Fixes one (probably the ugliest one) case of non-disposed temp variables:
When arguments are temps, they are supposed to be released by tcgcallnode.release_para_temps. However, taking address with taddrnode effectively changes original location of temp to some LOC_REGISTER, tcgcallnode.release_para_temps no longer sees the original location and therefore does not free such temps.

git-svn-id: trunk@19959 -
2012-01-03 19:31:58 +00:00
sergei
b1cbf30a94 * Managed types passed to out formal parameters must be completely cleaned (decrementing refcount is not enough) at caller side, because callee side doesn't know their actual type and cannot initialize them. Resolves #20962.
git-svn-id: trunk@19956 -
2012-01-03 09:07:08 +00:00
sergei
f8e921e478 * Fixed code generation for constructors compiled in {$implicitexeptions off} state, or having no implicit finally frame. Exit label and finalization code have to be placed before call to AfterConstruction, so exit statements do not jump over AfterConstruction, and overall control flow is the same as in default {$implicitexceptions on} state.
* A second attempt to remove unconditional pi_needs_implicit_finally from constructors, should hopefully be correct this time due to the changes described above.
+ Test (a copy of tctr1.pp with additional {$implicitexceptions off} directive)

git-svn-id: trunk@19955 -
2012-01-02 20:07:24 +00:00
svenbarth
17a276aabc * compiler\pdecl.pas:
in "array_dec" and "procvar_dec" "parse_generic" needs to be true if the currently
      parsed declaration (array or procvar) is declared inside a generic, because only then
      specializations of other types (it does not matter whether they are inline or in a type
      section of the current generic) are parsed correctly (this fixes Mantis #20577 and
      Mantis #20955 )
+ add tests for the mentioned bug reports (testing only the array case) (tests\webtbs) and
  tests for the procvar case (tests\test)

git-svn-id: trunk@19953 -
2012-01-02 16:02:51 +00:00
sergei
f6761d7939 * Handle safecall exceptions entirely in tcgtryfinallynode pass2. This simplifies things and removes the need in hidden safe_result variable.
git-svn-id: trunk@19950 -
2012-01-02 14:23:31 +00:00
sergei
66ec137f09 * Partially reverted r19668. It turns out that the implicit finally block in constructors, besides its intended purpose, provides correct position of the exit label (more precisely, it relocates exit label to the start of 'finally' part without subsequent restoring it to original value). Optimizing it away causes exit statements in constructors to jump over AfterConstruction call.
+ Test to prevent it from happening again.

git-svn-id: trunk@19948 -
2012-01-02 09:43:43 +00:00
florian
f79dc85033 * typo fixed
git-svn-id: trunk@19937 -
2011-12-31 16:25:19 +00:00
florian
862f9dacea * handle int_to_bool for qwordbools correctly on arm
git-svn-id: trunk@19933 -
2011-12-31 14:14:21 +00:00
florian
2dc2d65b1a + on windows, search %ALLUSERSPROFILE% and %USERPROFILE% for fpc.cfg
git-svn-id: trunk@19927 -
2011-12-30 16:20:27 +00:00
Jonas Maebe
930883edf6 * also report currency as automatable on non-x87 platforms
(may fix mantis #20986)

git-svn-id: trunk@19924 -
2011-12-30 12:30:12 +00:00
Jonas Maebe
3b32e6986b * fixed maketojumpbool() for 32 bit targets when used with a
64 bit destination

git-svn-id: trunk@19923 -
2011-12-30 12:12:39 +00:00
Jonas Maebe
3a6fb7c9ef - removed stray if-statement
git-svn-id: trunk@19922 -
2011-12-30 12:11:33 +00:00
Jonas Maebe
f5568b86e6 + support for OP_NOT and OP_NEG in a_op64_reg_reg() (required since
r19912)

git-svn-id: trunk@19921 -
2011-12-30 12:11:09 +00:00
Jonas Maebe
4d12a8b1ba * fixed not(qwordbool): take all 64 bits into account, not only the
lower 32 ones

git-svn-id: trunk@19920 -
2011-12-30 12:09:43 +00:00
Jonas Maebe
d0ba14ecab * fixed webtbs/tw20874b for non-x86 32 bit targets: tcgobj methods (by
default) cannot deal with 64 bit locations on 32 bit platforms

git-svn-id: trunk@19919 -
2011-12-30 11:58:49 +00:00
florian
5defdf86ba * handle for-loops correctly if the limits contain the counter variable
git-svn-id: trunk@19918 -
2011-12-30 10:54:08 +00:00
florian
cd644c4ecb * VER2_0 overleft removed
git-svn-id: trunk@19915 -
2011-12-29 17:40:12 +00:00
florian
c4a5499d2a * handle flag to reg./ref. conversion correctly for boolean64
git-svn-id: trunk@19914 -
2011-12-29 17:28:35 +00:00
florian
7070fef055 * patch by Jeppe Johansen to fix postprocessexecutable for the embedded target if host and target OS have different endianess, resolves #20926
git-svn-id: trunk@19913 -
2011-12-29 17:27:28 +00:00
florian
a59a37dddd * handle assignments of qword bools with LOC_FLAGS correctly, resolves #20874
git-svn-id: trunk@19912 -
2011-12-29 16:48:46 +00:00
florian
61eb25ea30 * qwordbool is obviously a 64 bit type, resolves #20889
git-svn-id: trunk@19911 -
2011-12-29 16:46:50 +00:00
florian
ea8ae7c867 * update of Portuguese compiler message file by Marcelo B Paula, resolves #20963
git-svn-id: trunk@19898 -
2011-12-28 17:44:46 +00:00
sergei
aea30f9bb2 * Added a lower limit on tdynamicarray block size. Certain values less than dynamicblockbasesize+alignment, e.g. 8 on x86_64, cause grow() to enter an infinite loop. Such values come e.g. from cloning tdataconstnode, which abuses blocksize argument as data size. Mantis #20929.
git-svn-id: trunk@19873 -
2011-12-18 22:34:56 +00:00
Jonas Maebe
40a9762ac6 * objcprotocol symbols have to be weak in the non-fragile abi to prevent
conflicts in case a protocol is adopted by classes in multiple object
    files part of the same binary (mantis #20875)

git-svn-id: trunk@19865 -
2011-12-17 12:43:42 +00:00
Jonas Maebe
22dd93858d * don't try to write rtti for fields in Pascal records/classes/objects/...
whose type is an objc type (objcclass, objcprotocol): they only need
    objc-style rtti, which is generated elsewhere (and to prevent bugs
    they give an internal error if we try to generate FPC-style rtti for
    them) (mantis #20876)

git-svn-id: trunk@19861 -
2011-12-17 11:43:13 +00:00
sergei
b3335abe75 * MOVSXD destination operand cannot be in memory, resolves #20850.
git-svn-id: trunk@19848 -
2011-12-13 22:56:24 +00:00
svenbarth
52a6699d55 Check whether the globalsymtable is not Nil before using it! Otherwise an access violation occurs when compiling a program that contains specializations.
git-svn-id: trunk@19819 -
2011-12-11 16:10:02 +00:00
svenbarth
fca525a85b When checking whether the current specialization was already done before we also need to check the globalsymtable if we're currently in the implementation section. Otherwise the specialization will be generated twice and will result in a "duplicate identifier" error. This fixes mantis #20872 .
git-svn-id: trunk@19818 -
2011-12-11 16:03:55 +00:00
sergei
b223e104ac Refactoring:
- Removed references to global variables current_procinfo and current_structdef from the methods of tcgprocinfo.
* Changed nested procedure do_generate_code into public method of tcgprocinfo.

git-svn-id: trunk@19784 -
2011-12-09 02:07:11 +00:00
florian
4a79262728 * make asciinr string long enough for binary char constants as pointed out by Matti Kronman, resolves #20821
git-svn-id: trunk@19782 -
2011-12-08 22:04:32 +00:00
marco
28c27c409e * fixed up messages compilation after last commit.
git-svn-id: trunk@19780 -
2011-12-08 20:49:18 +00:00
pierre
887f43f084 *Use newly generated fpcmkcfg binary if available
git-svn-id: trunk@19778 -
2011-12-08 14:50:22 +00:00
svenbarth
a1ef0add65 When searching for the generic def of nested types inside specializations we first need to check local declarations inside the method if we are in one. Only then we may search inside the type's declaration. Fixes #20836 .
git-svn-id: trunk@19777 -
2011-12-08 08:59:33 +00:00