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

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Fri Sep 13 12:20:29 CEST 2013


Mark Morgan Lloyd wrote:
> Sven Barth wrote:
> 
>>>> It will be interesting to see what minimal code will trigger the 
>>>> problem. Maybe it will point to a more serious problem inside the 
>>>> compiler.
>>>
>>> I've now got a standalone test_fpregs.pas which fails to compile in 
>>> the expected way, i.e. a compile-time error in ncgld.pas. I've got 
>>> other jobs to do for a few hours but will see what I can rip out 
>>> without losing the erroneous behaviour.
>>>
>>
>> Take your time. A few hours/days more or less won't hurt and at least 
>> we already know a fix for the resulting problem, but I'd also like to 
>> fix the cause :)
> 
> It's not triggered by fpregs.pas. It's triggered by importing one or 
> more of FPViews FPVars FPDebug which suggests to me that it's in some 
> common file that those three (but not FPConst) themselves import.

Wrong. The problem with that approach is that those three files 
themselves import an unmodified fpregs.pas, so investigation has to be 
done "in vivo".

The divide-by-zero is caused when the compiler attempts to compile an 
assignment of a tVectorregs inside TVectorView.Draw, i.e. as minimal code:

   procedure TVectorView.Draw;

     var
        rs : tVectorregs; { stuff commented out here }

     begin
       rs := rs; { more stuff commented out here }
     end;

All of the tVectorregs assignments in that method cause the problem, not 
just the artificial one I show above.

I ended up doing a full build for tests, since I think I found a 
situation where once a compiler was OK it stayed OK and I wanted to be 
absolutely certain of my facts rather than crying wolf over a problem 
that might be difficult to reproduce.

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

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



More information about the fpc-devel mailing list