ncgmem.pas 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for memory related nodes which are
  5. the same for all (most?) processors
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. { This unit generate assembler for memory related nodes.
  20. }
  21. unit ncgmem;
  22. {$i fpcdefs.inc}
  23. interface
  24. uses
  25. cgbase,cpuinfo,cpubase,
  26. node,nmem;
  27. type
  28. tcgloadvmtaddrnode = class(tloadvmtaddrnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgloadparentfpnode = class(tloadparentfpnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgaddrnode = class(taddrnode)
  35. procedure pass_2;override;
  36. end;
  37. tcgderefnode = class(tderefnode)
  38. procedure pass_2;override;
  39. end;
  40. tcgsubscriptnode = class(tsubscriptnode)
  41. procedure pass_2;override;
  42. end;
  43. tcgwithnode = class(twithnode)
  44. procedure pass_2;override;
  45. end;
  46. tcgvecnode = class(tvecnode)
  47. private
  48. procedure rangecheck_array;
  49. protected
  50. function get_mul_size : longint;
  51. {# This routine is used to calculate the address of the reference.
  52. On entry reg contains the index in the array,
  53. and l contains the size of each element in the array.
  54. This routine should update location.reference correctly,
  55. so it points to the correct address.
  56. }
  57. procedure update_reference_reg_mul(reg:tregister;l:aword);virtual;
  58. procedure second_wideansistring;virtual;
  59. procedure second_dynamicarray;virtual;
  60. public
  61. procedure pass_2;override;
  62. end;
  63. implementation
  64. uses
  65. {$ifdef delphi}
  66. sysutils,
  67. {$else}
  68. strings,
  69. {$endif}
  70. {$ifdef GDB}
  71. gdb,
  72. {$endif GDB}
  73. globtype,systems,
  74. cutils,verbose,globals,
  75. symconst,symdef,symsym,defutil,paramgr,
  76. aasmbase,aasmtai,
  77. procinfo,pass_2,
  78. pass_1,nld,ncon,nadd,
  79. cgobj,tgobj,ncgutil,symbase
  80. ;
  81. {*****************************************************************************
  82. TCGLOADVMTADDRNODE
  83. *****************************************************************************}
  84. procedure tcgloadvmtaddrnode.pass_2;
  85. var
  86. href : treference;
  87. begin
  88. location_reset(location,LOC_REGISTER,OS_ADDR);
  89. if (left.nodetype<>typen) then
  90. begin
  91. { left contains self, load vmt from self }
  92. secondpass(left);
  93. if is_object(left.resulttype.def) then
  94. begin
  95. case left.location.loc of
  96. LOC_CREFERENCE,
  97. LOC_REFERENCE:
  98. begin
  99. location_release(exprasmlist,left.location);
  100. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  101. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,href.base);
  102. end;
  103. else
  104. internalerror(200305056);
  105. end;
  106. end
  107. else
  108. begin
  109. case left.location.loc of
  110. LOC_REGISTER:
  111. begin
  112. {$ifdef cpu_uses_separate_address_registers}
  113. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  114. begin
  115. location_release(exprasmlist,left.location);
  116. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  117. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,href.base);
  118. end
  119. else
  120. {$endif}
  121. reference_reset_base(href,left.location.register,tobjectdef(left.resulttype.def).vmt_offset);
  122. end;
  123. LOC_CREGISTER,
  124. LOC_CREFERENCE,
  125. LOC_REFERENCE:
  126. begin
  127. location_release(exprasmlist,left.location);
  128. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  129. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,href.base);
  130. end;
  131. else
  132. internalerror(200305057);
  133. end;
  134. end;
  135. reference_release(exprasmlist,href);
  136. location.register:=cg.getaddressregister(exprasmlist);
  137. cg.g_maybe_testself(exprasmlist,href.base);
  138. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  139. end
  140. else
  141. begin
  142. reference_reset_symbol(href,
  143. objectlibrary.newasmsymboldata(tobjectdef(tclassrefdef(resulttype.def).pointertype.def).vmt_mangledname),0);
  144. location.register:=cg.getaddressregister(exprasmlist);
  145. cg.a_loadaddr_ref_reg(exprasmlist,href,location.register);
  146. end;
  147. end;
  148. {*****************************************************************************
  149. TCGLOADPARENTFPNODE
  150. *****************************************************************************}
  151. procedure tcgloadparentfpnode.pass_2;
  152. var
  153. currpi : tprocinfo;
  154. hsym : tvarsym;
  155. href : treference;
  156. begin
  157. if (current_procinfo.procdef.parast.symtablelevel=parentpd.parast.symtablelevel) then
  158. begin
  159. location_reset(location,LOC_REGISTER,OS_ADDR);
  160. location.register:=current_procinfo.framepointer;
  161. end
  162. else
  163. begin
  164. currpi:=current_procinfo;
  165. location_reset(location,LOC_REGISTER,OS_ADDR);
  166. location.register:=cg.getaddressregister(exprasmlist);
  167. { load framepointer of current proc }
  168. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  169. if not assigned(hsym) then
  170. internalerror(200309281);
  171. case hsym.localloc.loc of
  172. LOC_REFERENCE :
  173. begin
  174. reference_reset_base(href,hsym.localloc.reference.index,hsym.localloc.reference.offset);
  175. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  176. end;
  177. LOC_REGISTER :
  178. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,hsym.localloc.register,location.register);
  179. end;
  180. { walk parents }
  181. while (currpi.procdef.owner.symtablelevel>parentpd.parast.symtablelevel) do
  182. begin
  183. currpi:=currpi.parent;
  184. if not assigned(currpi) then
  185. internalerror(200311201);
  186. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  187. if not assigned(hsym) then
  188. internalerror(200309282);
  189. if hsym.localloc.loc<>LOC_REFERENCE then
  190. internalerror(200309283);
  191. reference_reset_base(href,location.register,hsym.localloc.reference.offset);
  192. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  193. end;
  194. end;
  195. end;
  196. {*****************************************************************************
  197. TCGADDRNODE
  198. *****************************************************************************}
  199. procedure tcgaddrnode.pass_2;
  200. begin
  201. secondpass(left);
  202. { when loading procvar we do nothing with this node, so load the
  203. location of left }
  204. if nf_procvarload in flags then
  205. begin
  206. location_copy(location,left.location);
  207. exit;
  208. end;
  209. location_release(exprasmlist,left.location);
  210. location_reset(location,LOC_REGISTER,OS_ADDR);
  211. location.register:=cg.getaddressregister(exprasmlist);
  212. { @ on a procvar means returning an address to the procedure that
  213. is stored in it }
  214. if (m_tp_procvar in aktmodeswitches) and
  215. (left.nodetype=loadn) and
  216. (tloadnode(left).resulttype.def.deftype=procvardef) and
  217. assigned(tloadnode(left).symtableentry) and
  218. (tloadnode(left).symtableentry.typ=varsym) then
  219. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register)
  220. else
  221. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  222. end;
  223. {*****************************************************************************
  224. TCGDEREFNODE
  225. *****************************************************************************}
  226. procedure tcgderefnode.pass_2;
  227. var
  228. paraloc1 : tparalocation;
  229. begin
  230. secondpass(left);
  231. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  232. case left.location.loc of
  233. LOC_REGISTER:
  234. begin
  235. {$ifdef cpu_uses_separate_address_registers}
  236. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  237. begin
  238. location_release(exprasmlist,left.location);
  239. location.reference.base := cg.getaddressregister(exprasmlist);
  240. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,
  241. location.reference.base);
  242. end
  243. else
  244. {$endif}
  245. location.reference.base := left.location.register;
  246. end;
  247. LOC_CREGISTER,
  248. LOC_CREFERENCE,
  249. LOC_REFERENCE:
  250. begin
  251. location_release(exprasmlist,left.location);
  252. location.reference.base:=cg.getaddressregister(exprasmlist);
  253. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  254. end;
  255. end;
  256. if (cs_gdb_heaptrc in aktglobalswitches) and
  257. (cs_checkpointer in aktglobalswitches) and
  258. not(cs_compilesystem in aktmoduleswitches) and
  259. (not tpointerdef(left.resulttype.def).is_far) then
  260. begin
  261. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  262. paramanager.allocparaloc(exprasmlist,paraloc1);
  263. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  264. paramanager.freeparaloc(exprasmlist,paraloc1);
  265. { FPC_CHECKPOINTER uses saveregisters }
  266. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  267. end;
  268. end;
  269. {*****************************************************************************
  270. TCGSUBSCRIPTNODE
  271. *****************************************************************************}
  272. procedure tcgsubscriptnode.pass_2;
  273. var
  274. paraloc1 : tparalocation;
  275. begin
  276. secondpass(left);
  277. if codegenerror then
  278. exit;
  279. { classes and interfaces must be dereferenced implicit }
  280. if is_class_or_interface(left.resulttype.def) then
  281. begin
  282. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  283. case left.location.loc of
  284. LOC_CREGISTER,
  285. LOC_REGISTER:
  286. begin
  287. {$ifdef cpu_uses_separate_address_registers}
  288. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  289. begin
  290. location_release(exprasmlist,left.location);
  291. location.reference.base:=rg.getaddressregister(exprasmlist);
  292. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,
  293. left.location.register,location.reference.base);
  294. end
  295. else
  296. {$endif}
  297. location.reference.base := left.location.register;
  298. end;
  299. LOC_CREFERENCE,
  300. LOC_REFERENCE:
  301. begin
  302. location_release(exprasmlist,left.location);
  303. location.reference.base:=cg.getaddressregister(exprasmlist);
  304. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  305. end;
  306. end;
  307. { implicit deferencing }
  308. if (cs_gdb_heaptrc in aktglobalswitches) and
  309. (cs_checkpointer in aktglobalswitches) and
  310. not(cs_compilesystem in aktmoduleswitches) then
  311. begin
  312. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  313. paramanager.allocparaloc(exprasmlist,paraloc1);
  314. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  315. paramanager.freeparaloc(exprasmlist,paraloc1);
  316. { FPC_CHECKPOINTER uses saveregisters }
  317. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  318. end;
  319. end
  320. else if is_interfacecom(left.resulttype.def) then
  321. begin
  322. tg.GetTempTyped(exprasmlist,left.resulttype.def,tt_normal,location.reference);
  323. cg.a_load_loc_ref(exprasmlist,OS_ADDR,left.location,location.reference);
  324. { implicit deferencing also for interfaces }
  325. if (cs_gdb_heaptrc in aktglobalswitches) and
  326. (cs_checkpointer in aktglobalswitches) and
  327. not(cs_compilesystem in aktmoduleswitches) then
  328. begin
  329. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  330. paramanager.allocparaloc(exprasmlist,paraloc1);
  331. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  332. paramanager.freeparaloc(exprasmlist,paraloc1);
  333. { FPC_CHECKPOINTER uses saveregisters }
  334. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  335. end;
  336. end
  337. else
  338. location_copy(location,left.location);
  339. inc(location.reference.offset,vs.fieldoffset);
  340. { also update the size of the location }
  341. location.size:=def_cgsize(resulttype.def);
  342. end;
  343. {*****************************************************************************
  344. TCGWITHNODE
  345. *****************************************************************************}
  346. procedure tcgwithnode.pass_2;
  347. {$ifdef GDB}
  348. const
  349. withlevel : longint = 0;
  350. var
  351. withstartlabel,withendlabel : tasmlabel;
  352. pp : pchar;
  353. mangled_length : longint;
  354. refnode : tnode;
  355. {$endif GDB}
  356. begin
  357. location_reset(location,LOC_VOID,OS_NO);
  358. {$ifdef GDB}
  359. if (cs_debuginfo in aktmoduleswitches) then
  360. begin
  361. { load reference }
  362. if (withrefnode.nodetype=derefn) and
  363. (tderefnode(withrefnode).left.nodetype=temprefn) then
  364. refnode:=tderefnode(withrefnode).left
  365. else
  366. refnode:=withrefnode;
  367. secondpass(refnode);
  368. location_release(exprasmlist,refnode.location);
  369. location_freetemp(exprasmlist,refnode.location);
  370. if not(refnode.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
  371. internalerror(2003092810);
  372. inc(withlevel);
  373. objectlibrary.getaddrlabel(withstartlabel);
  374. objectlibrary.getaddrlabel(withendlabel);
  375. cg.a_label(exprasmlist,withstartlabel);
  376. withdebugList.concat(Tai_stabs.Create(strpnew(
  377. '"with'+tostr(withlevel)+':'+tostr(symtablestack.getnewtypecount)+
  378. '=*'+tstoreddef(left.resulttype.def).numberstring+'",'+
  379. tostr(N_LSYM)+',0,0,'+tostr(refnode.location.reference.offset))));
  380. mangled_length:=length(current_procinfo.procdef.mangledname);
  381. getmem(pp,mangled_length+50);
  382. strpcopy(pp,'192,0,0,'+withstartlabel.name);
  383. if (target_info.use_function_relative_addresses) then
  384. begin
  385. strpcopy(strend(pp),'-');
  386. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  387. end;
  388. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  389. end;
  390. {$endif GDB}
  391. if assigned(left) then
  392. secondpass(left);
  393. {$ifdef GDB}
  394. if (cs_debuginfo in aktmoduleswitches) then
  395. begin
  396. cg.a_label(exprasmlist,withendlabel);
  397. strpcopy(pp,'224,0,0,'+withendlabel.name);
  398. if (target_info.use_function_relative_addresses) then
  399. begin
  400. strpcopy(strend(pp),'-');
  401. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  402. end;
  403. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  404. freemem(pp,mangled_length+50);
  405. dec(withlevel);
  406. end;
  407. {$endif GDB}
  408. end;
  409. {*****************************************************************************
  410. TCGVECNODE
  411. *****************************************************************************}
  412. function tcgvecnode.get_mul_size : longint;
  413. begin
  414. if nf_memindex in flags then
  415. get_mul_size:=1
  416. else
  417. begin
  418. if (left.resulttype.def.deftype=arraydef) then
  419. get_mul_size:=tarraydef(left.resulttype.def).elesize
  420. else
  421. get_mul_size:=resulttype.def.size;
  422. end
  423. end;
  424. procedure tcgvecnode.update_reference_reg_mul(reg:tregister;l:aword);
  425. var
  426. hreg: tregister;
  427. begin
  428. if location.reference.base=NR_NO then
  429. begin
  430. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  431. location.reference.base:=reg;
  432. end
  433. else if location.reference.index=NR_NO then
  434. begin
  435. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  436. location.reference.index:=reg;
  437. end
  438. else
  439. begin
  440. cg.ungetreference(exprasmlist,location.reference);
  441. hreg := cg.getaddressregister(exprasmlist);
  442. cg.a_loadaddr_ref_reg(exprasmlist,location.reference,hreg);
  443. reference_reset_base(location.reference,hreg,0);
  444. { insert new index register }
  445. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  446. location.reference.index:=reg;
  447. end;
  448. end;
  449. procedure tcgvecnode.second_wideansistring;
  450. begin
  451. end;
  452. procedure tcgvecnode.second_dynamicarray;
  453. begin
  454. end;
  455. procedure tcgvecnode.rangecheck_array;
  456. var
  457. freereg : boolean;
  458. hightree : tnode;
  459. poslabel,
  460. neglabel : tasmlabel;
  461. hreg : tregister;
  462. paraloc1,paraloc2 : tparalocation;
  463. begin
  464. if is_open_array(left.resulttype.def) or
  465. is_array_of_const(left.resulttype.def) then
  466. begin
  467. { cdecl functions don't have high() so we can not check the range }
  468. if not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
  469. begin
  470. { Get high value }
  471. hightree:=load_high_value_node(tvarsym(tloadnode(left).symtableentry));
  472. { it must be available }
  473. if not assigned(hightree) then
  474. internalerror(200212201);
  475. firstpass(hightree);
  476. secondpass(hightree);
  477. { generate compares }
  478. freereg:=false;
  479. if (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  480. hreg:=right.location.register
  481. else
  482. begin
  483. hreg:=cg.getintregister(exprasmlist,OS_INT);
  484. freereg:=true;
  485. cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,hreg);
  486. end;
  487. objectlibrary.getlabel(neglabel);
  488. objectlibrary.getlabel(poslabel);
  489. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,OC_LT,0,hreg,poslabel);
  490. location_release(exprasmlist,hightree.location);
  491. cg.a_cmp_loc_reg_label(exprasmlist,OS_INT,OC_BE,hightree.location,hreg,neglabel);
  492. if freereg then
  493. cg.ungetregister(exprasmlist,hreg);
  494. cg.a_label(exprasmlist,poslabel);
  495. cg.a_call_name(exprasmlist,'FPC_RANGEERROR');
  496. cg.a_label(exprasmlist,neglabel);
  497. { release hightree }
  498. hightree.free;
  499. end;
  500. end
  501. else
  502. if is_dynamic_array(left.resulttype.def) then
  503. begin
  504. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  505. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  506. paramanager.allocparaloc(exprasmlist,paraloc2);
  507. cg.a_param_loc(exprasmlist,right.location,paraloc2);
  508. paramanager.allocparaloc(exprasmlist,paraloc1);
  509. cg.a_param_loc(exprasmlist,left.location,paraloc1);
  510. paramanager.freeparaloc(exprasmlist,paraloc1);
  511. paramanager.freeparaloc(exprasmlist,paraloc2);
  512. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  513. cg.a_call_name(exprasmlist,'FPC_DYNARRAY_RANGECHECK');
  514. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  515. end
  516. else
  517. cg.g_rangecheck(exprasmlist,right.location,right.resulttype.def,left.resulttype.def);
  518. end;
  519. procedure tcgvecnode.pass_2;
  520. var
  521. extraoffset : longint;
  522. t : tnode;
  523. href : treference;
  524. otl,ofl : tasmlabel;
  525. newsize : tcgsize;
  526. mulsize: longint;
  527. isjump : boolean;
  528. paraloc1,paraloc2 : tparalocation;
  529. begin
  530. mulsize := get_mul_size;
  531. newsize:=def_cgsize(resulttype.def);
  532. secondpass(left);
  533. if left.location.loc=LOC_CREFERENCE then
  534. location_reset(location,LOC_CREFERENCE,newsize)
  535. else
  536. location_reset(location,LOC_REFERENCE,newsize);
  537. { an ansistring needs to be dereferenced }
  538. if is_ansistring(left.resulttype.def) or
  539. is_widestring(left.resulttype.def) then
  540. begin
  541. if nf_callunique in flags then
  542. internalerror(200304236);
  543. case left.location.loc of
  544. LOC_REGISTER,
  545. LOC_CREGISTER :
  546. location.reference.base:=left.location.register;
  547. LOC_CREFERENCE,
  548. LOC_REFERENCE :
  549. begin
  550. location_release(exprasmlist,left.location);
  551. location.reference.base:=cg.getaddressregister(exprasmlist);
  552. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.reference.base);
  553. end;
  554. else
  555. internalerror(2002032218);
  556. end;
  557. { check for a zero length string,
  558. we can use the ansistring routine here }
  559. if (cs_check_range in aktlocalswitches) then
  560. begin
  561. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  562. paramanager.allocparaloc(exprasmlist,paraloc1);
  563. cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paraloc1);
  564. paramanager.freeparaloc(exprasmlist,paraloc1);
  565. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  566. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_CHECKZERO');
  567. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  568. end;
  569. { in ansistrings/widestrings S[1] is p<w>char(S)[0] !! }
  570. if is_ansistring(left.resulttype.def) then
  571. dec(location.reference.offset)
  572. else
  573. dec(location.reference.offset,2);
  574. end
  575. else if is_dynamic_array(left.resulttype.def) then
  576. begin
  577. case left.location.loc of
  578. LOC_REGISTER,
  579. LOC_CREGISTER :
  580. location.reference.base:=left.location.register;
  581. LOC_REFERENCE,
  582. LOC_CREFERENCE :
  583. begin
  584. location_release(exprasmlist,left.location);
  585. location.reference.base:=cg.getaddressregister(exprasmlist);
  586. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,
  587. left.location.reference,location.reference.base);
  588. end;
  589. else
  590. internalerror(2002032219);
  591. end;
  592. end
  593. else
  594. location_copy(location,left.location);
  595. { offset can only differ from 0 if arraydef }
  596. if (left.resulttype.def.deftype=arraydef) and
  597. not(is_dynamic_array(left.resulttype.def)) then
  598. dec(location.reference.offset,mulsize*tarraydef(left.resulttype.def).lowrange);
  599. if right.nodetype=ordconstn then
  600. begin
  601. { offset can only differ from 0 if arraydef }
  602. case left.resulttype.def.deftype of
  603. arraydef :
  604. begin
  605. if not(is_open_array(left.resulttype.def)) and
  606. not(is_array_of_const(left.resulttype.def)) and
  607. not(is_dynamic_array(left.resulttype.def)) then
  608. begin
  609. if (tordconstnode(right).value>tarraydef(left.resulttype.def).highrange) or
  610. (tordconstnode(right).value<tarraydef(left.resulttype.def).lowrange) then
  611. begin
  612. { this should be caught in the resulttypepass! (JM) }
  613. if (cs_check_range in aktlocalswitches) then
  614. CGMessage(parser_e_range_check_error)
  615. else
  616. CGMessage(parser_w_range_check_error);
  617. end;
  618. end
  619. else
  620. begin
  621. { range checking for open and dynamic arrays needs
  622. runtime code }
  623. secondpass(right);
  624. if (cs_check_range in aktlocalswitches) then
  625. rangecheck_array;
  626. end;
  627. end;
  628. stringdef :
  629. begin
  630. if (cs_check_range in aktlocalswitches) then
  631. begin
  632. case tstringdef(left.resulttype.def).string_typ of
  633. { it's the same for ansi- and wide strings }
  634. st_widestring,
  635. st_ansistring:
  636. begin
  637. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  638. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  639. paramanager.allocparaloc(exprasmlist,paraloc2);
  640. cg.a_param_const(exprasmlist,OS_INT,tordconstnode(right).value,paraloc2);
  641. href:=location.reference;
  642. dec(href.offset,7);
  643. paramanager.allocparaloc(exprasmlist,paraloc1);
  644. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  645. paramanager.freeparaloc(exprasmlist,paraloc1);
  646. paramanager.freeparaloc(exprasmlist,paraloc2);
  647. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  648. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  649. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  650. end;
  651. st_shortstring:
  652. begin
  653. {!!!!!!!!!!!!!!!!!}
  654. end;
  655. st_longstring:
  656. begin
  657. {!!!!!!!!!!!!!!!!!}
  658. end;
  659. end;
  660. end;
  661. end;
  662. end;
  663. inc(location.reference.offset,
  664. mulsize*tordconstnode(right).value);
  665. end
  666. else
  667. { not nodetype=ordconstn }
  668. begin
  669. if (cs_regvars in aktglobalswitches) and
  670. { if we do range checking, we don't }
  671. { need that fancy code (it would be }
  672. { buggy) }
  673. not(cs_check_range in aktlocalswitches) and
  674. (left.resulttype.def.deftype=arraydef) then
  675. begin
  676. extraoffset:=0;
  677. if (right.nodetype=addn) then
  678. begin
  679. if taddnode(right).right.nodetype=ordconstn then
  680. begin
  681. extraoffset:=tordconstnode(taddnode(right).right).value;
  682. t:=taddnode(right).left;
  683. { First pass processed this with the assumption }
  684. { that there was an add node which may require an }
  685. { extra register. Fake it or die with IE10 (JM) }
  686. t.registers32 := taddnode(right).registers32;
  687. taddnode(right).left:=nil;
  688. right.free;
  689. right:=t;
  690. end
  691. else if taddnode(right).left.nodetype=ordconstn then
  692. begin
  693. extraoffset:=tordconstnode(taddnode(right).left).value;
  694. t:=taddnode(right).right;
  695. t.registers32 := right.registers32;
  696. taddnode(right).right:=nil;
  697. right.free;
  698. right:=t;
  699. end;
  700. end
  701. else if (right.nodetype=subn) then
  702. begin
  703. if taddnode(right).right.nodetype=ordconstn then
  704. begin
  705. extraoffset:=-tordconstnode(taddnode(right).right).value;
  706. t:=taddnode(right).left;
  707. t.registers32 := right.registers32;
  708. taddnode(right).left:=nil;
  709. right.free;
  710. right:=t;
  711. end
  712. { You also have to negate right.right in this case! I can't add an
  713. unaryminusn without causing a crash, so I've disabled it (JM)
  714. else if right.left.nodetype=ordconstn then
  715. begin
  716. extraoffset:=right.left.value;
  717. t:=right.right;
  718. t^.registers32 := right.registers32;
  719. putnode(right);
  720. putnode(right.left);
  721. right:=t;
  722. end;}
  723. end;
  724. inc(location.reference.offset,
  725. mulsize*extraoffset);
  726. end;
  727. { calculate from left to right }
  728. if not(location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  729. internalerror(200304237);
  730. isjump:=(right.location.loc=LOC_JUMP);
  731. if isjump then
  732. begin
  733. otl:=truelabel;
  734. objectlibrary.getlabel(truelabel);
  735. ofl:=falselabel;
  736. objectlibrary.getlabel(falselabel);
  737. end;
  738. secondpass(right);
  739. if cs_check_range in aktlocalswitches then
  740. begin
  741. if left.resulttype.def.deftype=arraydef then
  742. rangecheck_array;
  743. end;
  744. { if mulsize = 1, we won't have to modify the index }
  745. location_force_reg(exprasmlist,right.location,OS_32,mulsize = 1);
  746. if isjump then
  747. begin
  748. truelabel:=otl;
  749. falselabel:=ofl;
  750. end;
  751. { produce possible range check code: }
  752. if cs_check_range in aktlocalswitches then
  753. begin
  754. if left.resulttype.def.deftype=arraydef then
  755. begin
  756. { done defore (PM) }
  757. end
  758. else if (left.resulttype.def.deftype=stringdef) then
  759. begin
  760. case tstringdef(left.resulttype.def).string_typ of
  761. { it's the same for ansi- and wide strings }
  762. st_widestring,
  763. st_ansistring:
  764. begin
  765. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  766. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  767. paramanager.allocparaloc(exprasmlist,paraloc2);
  768. cg.a_param_reg(exprasmlist,OS_INT,right.location.register,paraloc2);
  769. href:=location.reference;
  770. dec(href.offset,7);
  771. paramanager.allocparaloc(exprasmlist,paraloc1);
  772. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  773. paramanager.freeparaloc(exprasmlist,paraloc1);
  774. paramanager.freeparaloc(exprasmlist,paraloc2);
  775. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  776. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  777. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  778. end;
  779. st_shortstring:
  780. begin
  781. {!!!!!!!!!!!!!!!!!}
  782. end;
  783. st_longstring:
  784. begin
  785. {!!!!!!!!!!!!!!!!!}
  786. end;
  787. end;
  788. end;
  789. end;
  790. { insert the register and the multiplication factor in the
  791. reference }
  792. update_reference_reg_mul(right.location.register,mulsize);
  793. end;
  794. location.size:=newsize;
  795. end;
  796. begin
  797. cloadvmtaddrnode:=tcgloadvmtaddrnode;
  798. cloadparentfpnode:=tcgloadparentfpnode;
  799. caddrnode:=tcgaddrnode;
  800. cderefnode:=tcgderefnode;
  801. csubscriptnode:=tcgsubscriptnode;
  802. cwithnode:=tcgwithnode;
  803. cvecnode:=tcgvecnode;
  804. end.
  805. {
  806. $Log$
  807. Revision 1.83 2003-12-06 01:15:22 florian
  808. * reverted Peter's alloctemp patch; hopefully properly
  809. Revision 1.82 2003/12/03 23:13:20 peter
  810. * delayed paraloc allocation, a_param_*() gets extra parameter
  811. if it needs to allocate temp or real paralocation
  812. * optimized/simplified int-real loading
  813. Revision 1.81 2003/11/23 17:03:35 peter
  814. * fixed parentfp loading, it was using the offset of the current
  815. nested proc instead of the parent
  816. Revision 1.80 2003/11/04 15:35:13 peter
  817. * fix for referencecounted temps
  818. Revision 1.79 2003/10/10 17:48:13 peter
  819. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  820. * tregisteralloctor renamed to trgobj
  821. * removed rgobj from a lot of units
  822. * moved location_* and reference_* to cgobj
  823. * first things for mmx register allocation
  824. Revision 1.78 2003/10/09 21:31:37 daniel
  825. * Register allocator splitted, ans abstract now
  826. Revision 1.77 2003/10/01 20:34:48 peter
  827. * procinfo unit contains tprocinfo
  828. * cginfo renamed to cgbase
  829. * moved cgmessage to verbose
  830. * fixed ppc and sparc compiles
  831. Revision 1.76 2003/09/29 20:58:56 peter
  832. * optimized releasing of registers
  833. Revision 1.75 2003/09/28 21:45:52 peter
  834. * fix register leak in with debug
  835. Revision 1.74 2003/09/28 17:55:03 peter
  836. * parent framepointer changed to hidden parameter
  837. * tloadparentfpnode added
  838. Revision 1.73 2003/09/23 17:56:05 peter
  839. * locals and paras are allocated in the code generation
  840. * tvarsym.localloc contains the location of para/local when
  841. generating code for the current procedure
  842. Revision 1.72 2003/09/10 08:31:47 marco
  843. * Patch from Peter for paraloc
  844. Revision 1.71 2003/09/07 22:09:35 peter
  845. * preparations for different default calling conventions
  846. * various RA fixes
  847. Revision 1.70 2003/09/03 15:55:00 peter
  848. * NEWRA branch merged
  849. Revision 1.69.2.1 2003/08/29 17:28:59 peter
  850. * next batch of updates
  851. Revision 1.69 2003/08/10 17:25:23 peter
  852. * fixed some reported bugs
  853. Revision 1.68 2003/08/09 18:56:54 daniel
  854. * cs_regalloc renamed to cs_regvars to avoid confusion with register
  855. allocator
  856. * Some preventive changes to i386 spillinh code
  857. Revision 1.67 2003/07/23 11:01:14 jonas
  858. * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
  859. pairs round calls to helpers
  860. Revision 1.66 2003/07/06 21:50:33 jonas
  861. * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
  862. so that it doesn't include ebp and esp anymore
  863. Revision 1.65 2003/07/06 15:31:20 daniel
  864. * Fixed register allocator. *Lots* of fixes.
  865. Revision 1.64 2003/06/17 19:24:08 jonas
  866. * fixed conversion of fpc_*str_unique to compilerproc
  867. Revision 1.63 2003/06/17 16:34:44 jonas
  868. * lots of newra fixes (need getfuncretparaloc implementation for i386)!
  869. * renamed all_intregisters to paramanager.get_volatile_registers_int(pocall_default) and made it
  870. processor dependent
  871. Revision 1.62 2003/06/13 21:19:30 peter
  872. * current_procdef removed, use current_procinfo.procdef instead
  873. Revision 1.61 2003/06/09 16:45:41 jonas
  874. * fixed update_reference_reg_mul() so that it won't modify CREGISTERs
  875. in a reference
  876. * cache value of get_mul_size()
  877. * if get_mul_size = 1, the index can be a CREGISTER since it won't be
  878. modified
  879. Revision 1.60 2003/06/07 18:57:04 jonas
  880. + added freeintparaloc
  881. * ppc get/freeintparaloc now check whether the parameter regs are
  882. properly allocated/deallocated (and get an extra list para)
  883. * ppc a_call_* now internalerrors if pi_do_call is not yet set
  884. * fixed lot of missing pi_do_call's
  885. Revision 1.59 2003/06/03 21:11:09 peter
  886. * cg.a_load_* get a from and to size specifier
  887. * makeregsize only accepts newregister
  888. * i386 uses generic tcgnotnode,tcgunaryminus
  889. Revision 1.58 2003/06/03 13:01:59 daniel
  890. * Register allocator finished
  891. Revision 1.57 2003/06/02 22:35:45 florian
  892. * better handling of CREGISTER in subscript nodes
  893. Revision 1.56 2003/06/01 21:38:06 peter
  894. * getregisterfpu size parameter added
  895. * op_const_reg size parameter added
  896. * sparc updates
  897. Revision 1.55 2003/05/30 23:49:18 jonas
  898. * a_load_loc_reg now has an extra size parameter for the destination
  899. register (properly fixes what I worked around in revision 1.106 of
  900. ncgutil.pas)
  901. Revision 1.54 2003/05/15 16:10:37 florian
  902. * fixed getintparaloc call for ansi- and widestring range checking
  903. Revision 1.53 2003/05/11 21:37:03 peter
  904. * moved implicit exception frame from ncgutil to psub
  905. * constructor/destructor helpers moved from cobj/ncgutil to psub
  906. Revision 1.52 2003/05/11 14:45:12 peter
  907. * tloadnode does not support objectsymtable,withsymtable anymore
  908. * withnode cleanup
  909. * direct with rewritten to use temprefnode
  910. Revision 1.51 2003/05/09 17:47:02 peter
  911. * self moved to hidden parameter
  912. * removed hdisposen,hnewn,selfn
  913. Revision 1.50 2003/05/07 09:16:23 mazen
  914. - non used units removed from uses clause
  915. Revision 1.49 2003/04/27 11:21:33 peter
  916. * aktprocdef renamed to current_procinfo.procdef
  917. * procinfo renamed to current_procinfo
  918. * procinfo will now be stored in current_module so it can be
  919. cleaned up properly
  920. * gen_main_procsym changed to create_main_proc and release_main_proc
  921. to also generate a tprocinfo structure
  922. * fixed unit implicit initfinal
  923. Revision 1.48 2003/04/22 23:50:22 peter
  924. * firstpass uses expectloc
  925. * checks if there are differences between the expectloc and
  926. location.loc from secondpass in EXTDEBUG
  927. Revision 1.47 2003/04/22 13:47:08 peter
  928. * fixed C style array of const
  929. * fixed C array passing
  930. * fixed left to right with high parameters
  931. Revision 1.46 2003/04/22 10:09:35 daniel
  932. + Implemented the actual register allocator
  933. + Scratch registers unavailable when new register allocator used
  934. + maybe_save/maybe_restore unavailable when new register allocator used
  935. Revision 1.45 2003/04/06 21:11:23 olle
  936. * changed newasmsymbol to newasmsymboldata for data symbols
  937. Revision 1.44 2003/03/28 19:16:56 peter
  938. * generic constructor working for i386
  939. * remove fixed self register
  940. * esi added as address register for i386
  941. Revision 1.43 2003/03/12 22:43:38 jonas
  942. * more powerpc and generic fixes related to the new register allocator
  943. Revision 1.42 2003/02/19 22:00:14 daniel
  944. * Code generator converted to new register notation
  945. - Horribily outdated todo.txt removed
  946. Revision 1.41 2003/01/30 21:46:57 peter
  947. * self fixes for static methods (merged)
  948. Revision 1.40 2003/01/08 18:43:56 daniel
  949. * Tregister changed into a record
  950. Revision 1.39 2002/12/20 18:13:19 peter
  951. * no rangecheck for openarrays with cdecl
  952. Revision 1.38 2002/12/17 22:19:33 peter
  953. * fixed pushing of records>8 bytes with stdcall
  954. * simplified hightree loading
  955. Revision 1.37 2002/12/08 13:39:03 carl
  956. + some documentation added
  957. Revision 1.36 2002/12/07 14:14:19 carl
  958. * bugfix on invalid typecast
  959. Revision 1.35 2002/11/25 17:43:18 peter
  960. * splitted defbase in defutil,symutil,defcmp
  961. * merged isconvertable and is_equal into compare_defs(_ext)
  962. * made operator search faster by walking the list only once
  963. Revision 1.34 2002/11/24 18:19:20 carl
  964. + checkpointer for interfaces also
  965. Revision 1.33 2002/11/23 22:50:06 carl
  966. * some small speed optimizations
  967. + added several new warnings/hints
  968. Revision 1.32 2002/11/15 01:58:51 peter
  969. * merged changes from 1.0.7 up to 04-11
  970. - -V option for generating bug report tracing
  971. - more tracing for option parsing
  972. - errors for cdecl and high()
  973. - win32 import stabs
  974. - win32 records<=8 are returned in eax:edx (turned off by default)
  975. - heaptrc update
  976. - more info for temp management in .s file with EXTDEBUG
  977. Revision 1.31 2002/10/09 20:24:47 florian
  978. + range checking for dyn. arrays
  979. Revision 1.30 2002/10/07 21:30:45 peter
  980. * rangecheck for open arrays added
  981. Revision 1.29 2002/10/05 12:43:25 carl
  982. * fixes for Delphi 6 compilation
  983. (warning : Some features do not work under Delphi)
  984. Revision 1.28 2002/09/17 18:54:02 jonas
  985. * a_load_reg_reg() now has two size parameters: source and dest. This
  986. allows some optimizations on architectures that don't encode the
  987. register size in the register name.
  988. Revision 1.27 2002/09/07 15:25:03 peter
  989. * old logs removed and tabs fixed
  990. Revision 1.26 2002/09/01 18:46:01 peter
  991. * fixed generic tcgvecnode
  992. * move code that updates a reference with index register and multiplier
  993. to separate method so it can be overriden for scaled indexing
  994. * i386 uses generic tcgvecnode
  995. Revision 1.25 2002/08/23 16:14:48 peter
  996. * tempgen cleanup
  997. * tt_noreuse temp type added that will be used in genentrycode
  998. Revision 1.24 2002/08/15 08:13:54 carl
  999. - a_load_sym_ofs_reg removed
  1000. * loadvmt now calls loadaddr_ref_reg instead
  1001. Revision 1.23 2002/08/11 14:32:26 peter
  1002. * renamed current_library to objectlibrary
  1003. Revision 1.22 2002/08/11 13:24:12 peter
  1004. * saving of asmsymbols in ppu supported
  1005. * asmsymbollist global is removed and moved into a new class
  1006. tasmlibrarydata that will hold the info of a .a file which
  1007. corresponds with a single module. Added librarydata to tmodule
  1008. to keep the library info stored for the module. In the future the
  1009. objectfiles will also be stored to the tasmlibrarydata class
  1010. * all getlabel/newasmsymbol and friends are moved to the new class
  1011. Revision 1.21 2002/08/11 11:36:57 jonas
  1012. * always first try to use base and only then index
  1013. Revision 1.20 2002/08/11 06:14:40 florian
  1014. * fixed powerpc compilation problems
  1015. Revision 1.19 2002/08/10 14:46:29 carl
  1016. + moved target_cpu_string to cpuinfo
  1017. * renamed asmmode enum.
  1018. * assembler reader has now less ifdef's
  1019. * move from nppcmem.pas -> ncgmem.pas vec. node.
  1020. Revision 1.18 2002/07/28 21:34:31 florian
  1021. * more powerpc fixes
  1022. + dummy tcgvecnode
  1023. Revision 1.17 2002/07/11 14:41:28 florian
  1024. * start of the new generic parameter handling
  1025. Revision 1.16 2002/07/07 09:52:32 florian
  1026. * powerpc target fixed, very simple units can be compiled
  1027. * some basic stuff for better callparanode handling, far from being finished
  1028. Revision 1.15 2002/07/01 18:46:23 peter
  1029. * internal linker
  1030. * reorganized aasm layer
  1031. Revision 1.14 2002/07/01 16:23:53 peter
  1032. * cg64 patch
  1033. * basics for currency
  1034. * asnode updates for class and interface (not finished)
  1035. Revision 1.13 2002/05/20 13:30:40 carl
  1036. * bugfix of hdisponen (base must be set, not index)
  1037. * more portability fixes
  1038. Revision 1.12 2002/05/18 13:34:09 peter
  1039. * readded missing revisions
  1040. Revision 1.11 2002/05/16 19:46:37 carl
  1041. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1042. + try to fix temp allocation (still in ifdef)
  1043. + generic constructor calls
  1044. + start of tassembler / tmodulebase class cleanup
  1045. Revision 1.9 2002/05/12 16:53:07 peter
  1046. * moved entry and exitcode to ncgutil and cgobj
  1047. * foreach gets extra argument for passing local data to the
  1048. iterator function
  1049. * -CR checks also class typecasts at runtime by changing them
  1050. into as
  1051. * fixed compiler to cycle with the -CR option
  1052. * fixed stabs with elf writer, finally the global variables can
  1053. be watched
  1054. * removed a lot of routines from cga unit and replaced them by
  1055. calls to cgobj
  1056. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1057. u32bit then the other is typecasted also to u32bit without giving
  1058. a rangecheck warning/error.
  1059. * fixed pascal calling method with reversing also the high tree in
  1060. the parast, detected by tcalcst3 test
  1061. Revision 1.8 2002/04/20 21:32:23 carl
  1062. + generic FPC_CHECKPOINTER
  1063. + first parameter offset in stack now portable
  1064. * rename some constants
  1065. + move some cpu stuff to other units
  1066. - remove unused constents
  1067. * fix stacksize for some targets
  1068. * fix generic size problems which depend now on EXTEND_SIZE constant
  1069. Revision 1.7 2002/04/15 18:58:47 carl
  1070. + target_info.size_of_pointer -> pointer_Size
  1071. Revision 1.6 2002/04/04 19:05:57 peter
  1072. * removed unused units
  1073. * use tlocation.size in cg.a_*loc*() routines
  1074. }