[fpc-devel] Compiling for libgdb, and using make -j on larger SPARC systems

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Fri Aug 9 23:19:26 CEST 2013


Sven Barth wrote:

> Ok, so it is indeed a record that calculates the wrong size. Could you 
> please add the following code after the assignment of "len" and tell me 
> the output, so that we'll know which record exactly is the one that fails?
> 
> === code begin ===
> 
> if len=0 then
>   begin
>     if left.resultdef.typ=recorddef then
>       writeln('=======> objname: ',trecorddef(left.resultdef).objname^);
>     len:=sizeof(pint);
>   end;
> 
> === code end ===
> 
> I'll meanwhile investigate how a record calculates its size.

Code reads (indent adjusted):

len:=left.resultdef.size;

if len = 0 then begin
   WriteLn('=====> len: ', len);
   WriteLn('=====> typ: ', left.resultdef.typ)
end;
if len=0 then
   begin
     if left.resultdef.typ=recorddef then
       writeln('=======> objname: ',trecorddef(left.resultdef).objname^);
     len:=sizeof(pint);
   end;
// if len <= 0 then
//   len := sizeof(aint);
{ data smaller than an aint has less alignment requirements }
alignmentrequirement:=min(len,sizeof(aint));
if (right.location.reference.offset mod alignmentrequirement<>0) or
..

Output is:

..
Using assembler: /usr/bin/as
=====> len: 0
=====> typ: recorddef
=======> objname: TVECTORREGS
=====> len: 0
=====> typ: recorddef
=======> objname: TVECTORREGS
=====> len: 0
=====> typ: recorddef
=======> objname: TVECTORREGS
=====> len: 0
=====> typ: recorddef
=======> objname: TVECTORREGS
/usr/local/src/fpc/fpcbuild-2.6.2/fpcsrc/libgdb/linux/sparc/libgdb.a(ada-lang.o): 
In function `scaling_factor':
..

I'm just about to add your next tests and redo. Recompilation is slow, 
and I don't think that firing up a bigger machine and using make -j 
helps that much.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

p.s. I now seem to have a Mac Classic II with a 68030. Wonder if it's 
any use for anything?



More information about the fpc-devel mailing list