Commit Graph

16807 Commits

Author SHA1 Message Date
svenbarth
f1bfb398e4 Fix for Mantis #26456.
symtable.pas, searchsym_in_helper:
  * check whether extendeddef is assigned as this function is called when parsing the extended type and it was not found (the second pass is to display a more accurate error message and was added some weeks ago)

+ added test

git-svn-id: trunk@28242 -
2014-07-20 13:40:01 +00:00
Jonas Maebe
4ff597afae * call "message" rather than "cgmessage" when throwing fatal errors, because
cgmessage won't do anything in case cgerror is already set (and in several
    places we assume that the compiler will immediately abort after throwing a
    fatal error)

git-svn-id: trunk@28229 -
2014-07-18 09:09:21 +00:00
Jonas Maebe
9e29fd424d * changed the "laststatement" parameter of internalstatements() from "var"
to "out"

git-svn-id: trunk@28228 -
2014-07-18 09:09:16 +00:00
Jonas Maebe
627c83e828 * when creating a bare procdef copy, don't copy the funcret parameter.
This is useful if you want to change the calling convention of the copy.
   o call insert_funcret_para() after creating a bare copy
  * don't copy aliasnames of copied procdefs either (can at best result
    in duplicate symbol errors)

git-svn-id: trunk@28227 -
2014-07-18 09:09:11 +00:00
Jonas Maebe
256f2fcf69 * fixed finish_copied_procdef() in case newstruct is nil after support for
generics was added to it

git-svn-id: trunk@28226 -
2014-07-18 09:09:03 +00:00
nickysn
6d54046300 * output a proper error message in case number+nil is encountered (just like
it's already done for nil+number and nil-number)

git-svn-id: trunk@28225 -
2014-07-15 22:26:58 +00:00
nickysn
9b3d41d9c7 * the default value of tpointerdef.pointer_subtraction_result_type changed to
ptrsinttype

git-svn-id: trunk@28220 -
2014-07-15 06:51:56 +00:00
nickysn
d86a8ebc99 * defutil.get_int_result_type_from_pointer_subtraction moved to a virtual
method tpointerdef.pointer_subtraction_result_type

git-svn-id: trunk@28219 -
2014-07-14 23:30:29 +00:00
nickysn
99c555cea8 + implemented huge pointer subtraction
* the result of far pointer subtraction changed to word (for TP7 compatibility)

git-svn-id: trunk@28218 -
2014-07-13 23:40:43 +00:00
nickysn
200df7a136 * set expectloc correctly for far pointer comparison as well
git-svn-id: trunk@28217 -
2014-07-13 16:25:20 +00:00
nickysn
04234c733f * set expectloc correctly (LOC_JUMP instead of LOC_FLAGS) for non-normalized
huge pointer comparison

git-svn-id: trunk@28216 -
2014-07-13 15:20:58 +00:00
nickysn
5818451bb5 * non-normalized huge pointer comparison made unsigned
git-svn-id: trunk@28214 -
2014-07-13 12:54:12 +00:00
Tomas Hajny
82d62aa883 * added description for option @ and missing bracket at the end of list for -P
git-svn-id: trunk@28188 -
2014-07-08 22:33:18 +00:00
Tomas Hajny
109d890adf * added description for option @ and missing bracket at the end of list for -P
git-svn-id: trunk@28187 -
2014-07-08 22:33:00 +00:00
Tomas Hajny
dfb44e1642 * improve identation of long options and add support for displaying parameter @
git-svn-id: trunk@28186 -
2014-07-08 22:30:43 +00:00
sergei
b7da785688 * m68k: support stack cleanup at caller side, fixed calculation of pushed parameters size and offsets and cleaned out another pile of junk.
* Parameter offsets are now calculated similar to other targets, target_info,first_parm_offset is applied only to callee side, while at caller side offsets start from 0.
* For cdecl procedures, parameters are removed by caller, for the rest it's still done by callee (resembles i386 target, except there is no 'register' calling convention).

git-svn-id: trunk@28185 -
2014-07-08 19:08:56 +00:00
sergei
cfe13734e0 * m68k: Fixed damage caused by r27573 and r28177:
* longjmp: restored loading of function result (d0) which got removed in r28177.
  * While at the point, added test for zero, because longjmp must never return zero values.
  * Assembler reader: 'fp' refers to frame pointer, not the stack pointer.

git-svn-id: trunk@28183 -
2014-07-08 15:04:54 +00:00
sergei
15ff2c1236 * m68k: Fixed name of ELF interpreter, and updated cprt0.as to somewhat working state. Now a "hello world" program using libc can be linked and launched, but anything more complex needs another round of fixing the parameter passing code, in order to get the stack properly balanced.
git-svn-id: trunk@28181 -
2014-07-07 20:08:50 +00:00
nickysn
8604372da3 + implemented far pointer comparison operating only on the offset (+ added test)
git-svn-id: trunk@28179 -
2014-07-06 22:45:19 +00:00
sergei
df60309d96 * m68k: fixed the last remaining warning and removed "$WARNINGS OFF" directive.
git-svn-id: trunk@28176 -
2014-07-06 11:36:33 +00:00
sergei
e4fea2ebc8 * Dummy implementations of a_bit_scan_reg_reg and g_stackpointer_alloc in tcg, removes the need to override these methods in every descendant code generator solely to avoid "constructing a class with abstract method" warning.
git-svn-id: trunk@28175 -
2014-07-06 11:34:04 +00:00
Károly Balogh
e5656a6f7e m68k assembler reader: fixed parsing of slash-separated movem/fmovem register lists. only the first register was stored.
git-svn-id: trunk@28174 -
2014-07-06 11:29:45 +00:00
sergei
1678fcdc2d - m68k assembler reader: removed Oper.InitRef which was causing failure of tbs/tb0142.pp and, in general, making impossible calls/jumps to non-alias procedure names.
git-svn-id: trunk@28173 -
2014-07-06 10:35:35 +00:00
svenbarth
441e6c6083 Fix for Mantis #26177. Use the correct value for the method data when using a method pointer of a type or record helper.
Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!

ncgld.pas, tcgloadnode.pass_generate_code:
  * only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)

+added test

git-svn-id: trunk@28160 -
2014-07-05 08:54:10 +00:00
nickysn
2b2224494b * call first_addpointer and first_cmppointer in pass_1 for pchars as well. Fixes
huge pointer arithmetic/comparison on huge pchars.

git-svn-id: trunk@28159 -
2014-07-04 23:58:26 +00:00
nickysn
c8130843b2 * fixed 'cannot convert type' error when comparing two voidhugepointers with
= or <>

git-svn-id: trunk@28158 -
2014-07-04 23:54:47 +00:00
nickysn
3bb730d5b9 + implemented normalized huge pointer comparison
git-svn-id: trunk@28157 -
2014-07-04 23:22:33 +00:00
nickysn
e80ecd4d5b + moved handling of pointer comparison in pass_1 to new virtual method
taddnode.first_cmppointer. To be overriden for i8086 huge pointer comparisons.

git-svn-id: trunk@28156 -
2014-07-04 22:47:21 +00:00
nickysn
7f9fa145e8 + added error message in case the HUGEPOINTERNORMALIZATION directive is used
with an invalid argument

git-svn-id: trunk@28152 -
2014-07-04 17:16:58 +00:00
nickysn
63305cc2e6 + added directive {$HUGEPOINTERARITHMETICNORMALIZATION} to control the
cs_hugeptr_arithmetic_normalization local setting
+ added the cs_hugeptr_comparison_normalization local setting and corresponding
  directive {$HUGEPOINTERCOMPARISONNORMALIZATION} to set it
* the {HUGEPOINTERNORMALIZATION} changed to set both of the huge pointer
  normalization settings, according to the specified compiler type ('BORLANDC',
  'MICROSOFTC' or 'WATCOMC')

git-svn-id: trunk@28151 -
2014-07-04 14:43:46 +00:00
nickysn
a3b48b79cb - rm the scan_w_hugepointernormalization_not_support message, replaced with
scanner_w_directive_ignored_on_target

git-svn-id: trunk@28150 -
2014-07-04 14:03:18 +00:00
nickysn
aee568e6fc * cs_hugeptr_normalization renamed to cs_hugeptr_arithmetic_normalization,
because we're going to also introduce cs_hugeptr_comparison_normalization as
  an independent option

git-svn-id: trunk@28149 -
2014-07-04 13:14:06 +00:00
nickysn
d9e94ffab7 + implemented huge pointer arithmetic
git-svn-id: trunk@28139 -
2014-07-03 16:53:22 +00:00
nickysn
da77535631 * the handling of pointer arithmetic in pass_1 moved to a new virtual method
taddnode.first_addpointer. This will be overridden in the i8086 code generator
  in order to implement huge pointer arithmetic.

git-svn-id: trunk@28138 -
2014-07-03 13:47:47 +00:00
svenbarth
30be5d8d33 As discussed on core enable the abstract class construction warning by default and also make it controllable with {$warn constructing_abstract ...}.
* scandir.pas, dir_warn: also adjust the message state for type_w_instance_abstract_class if the identifier is CONSTRUCTING_ABSTRACT
* msg/errore.msg: enable type_w_instance_abstract_class by default

* msgidx.inc, msgtxt.inc: updated

git-svn-id: trunk@28137 -
2014-07-02 19:40:22 +00:00
Jonas Maebe
43839d1bda * update of German error message files by Karl-Michael Schindler
(mantis #26282)

git-svn-id: trunk@28129 -
2014-07-02 17:17:38 +00:00
svenbarth
a7a9440692 Add a new warning message that is generated if an instance of an abstract class is created. This message is disabled by default, but can be switched on by using {$warn 4122 on} or {$warn 4122 error}.
Please note that this warning won't be triggered if an instance of that class is created using a class variable of that class type as the compiler can not know the type contained in the variable at compile time (see also the added test).

+ msg/errore.msg: added disabled message which informs about the instantiation of an abstract class
* pexpr.pas, do_member_read: generate the message if we have a constructor call for an abstract class using a loadvmtaddrnode (thus the type name is used and not a class variable)

* msg{idx,txt}.inc: updated

+ added test

git-svn-id: trunk@28127 -
2014-07-01 20:41:05 +00:00
sergei
847adff94d * Load double-precision locations from integer registers directly into cgpara if sizes match and destination has a single location.
git-svn-id: trunk@28102 -
2014-06-30 17:50:34 +00:00
sergei
b91d965096 * m68k: initial support for ROL/ROR operations, defining 'cpurox' for CPU target can actually enable them. However it cannot be done outright because these instructions do not exits on Coldfire, and internal processing of RoX,Sar,BsX, etc. can not yet be switched depending on CPU subtype.
git-svn-id: trunk@28101 -
2014-06-29 17:49:30 +00:00
sergei
15e374f3c6 * m68k: fixed comparison of small sets, it should not modify sides. tw18013 is now correct when compiled with -O2.
git-svn-id: trunk@28100 -
2014-06-29 12:35:03 +00:00
sergei
0262514939 * m68k: Transform 32-bit div/mod nodes into helper calls during pass 1. This is consistent with the way other targets do it, and results in pretty much nicer code.
git-svn-id: trunk@28098 -
2014-06-28 13:28:01 +00:00
sergei
535218e837 * m68k: fixed OP_NOT/OP_NEG with two registers, it must never modify the source register.
git-svn-id: trunk@28097 -
2014-06-28 05:22:03 +00:00
sergei
85c0ba96e2 * tm68knotnode brought up to speed:
- removed code for everything but booleans (it is handled perfectly well by generic code)
 + operate directly on references when possible
 + added handling for 64-bit data.

git-svn-id: trunk@28096 -
2014-06-28 05:14:27 +00:00
sergei
4df49964ca * tcg68k.a_op_reg_reg: renamed parameters 'reg1' and 'reg2' to 'src' and 'dst' to make it clear what's what.
* tcg68k.fixref method made public.

git-svn-id: trunk@28095 -
2014-06-28 05:09:34 +00:00
nickysn
89db1e4118 + add proper int type conversions for huge pointer arithmetic in pass_typecheck
of the add node

git-svn-id: trunk@28094 -
2014-06-27 23:37:08 +00:00
sergei
04eb925776 * tcgtypeconvnode.second_int_to_int: disabled optimization from r25067 for m68k, because reg_cgsize() does not return expected values on that target.
git-svn-id: trunk@28093 -
2014-06-27 19:49:18 +00:00
sergei
c2ab16c320 - m68k: dropped t68kaddnode.second_cmpboolean, apparently its presence just breaks tbs/tb0246 without any value added.
git-svn-id: trunk@28090 -
2014-06-27 16:34:14 +00:00
nickysn
b3bb9df19f + added a $HUGEPOINTERNORMALIZATION switch
git-svn-id: trunk@28088 -
2014-06-27 13:56:12 +00:00
sergei
193fa2b95e - m68k: removed some definitely misplaced code, comparison nodes are never handled in second_addfloat.
git-svn-id: trunk@28087 -
2014-06-27 13:23:12 +00:00
sergei
3851c1f494 - m68k: removed a_loadmm_* methods, no need to override because they produce internal error already in base class.
git-svn-id: trunk@28086 -
2014-06-27 12:15:00 +00:00