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

Sven Barth pascaldragon at googlemail.com
Fri Sep 13 19:20:17 CEST 2013


Am 13.09.2013 12:20 schrieb "Mark Morgan Lloyd" <
markMLl.fpc-devel at telemetry.co.uk>:
>
> 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.
>

So if you put the declaration of TVectorRegs in a program and add a
function that does the above assignment, you can reproduce it as well?

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130913/9c08f595/attachment.html>


More information about the fpc-devel mailing list