Internal error 200706094

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Internal error 200706094

Виктор Матузенко
Hi!

I have a large project and it compiles under 32 bits cpu,
but doesn't under 64 bits. Here is a minimal problematic
part:

=====================================================
[doj@larion ~/temp]$ cat ptrtransform.pas
{$MODE OBJFPC}
const
   C = -1;
var
   A: array[0..1] of Pointer;
begin
   Writeln(Integer(Pointer((PtrUInt(@A[1]) + C * SizeOf(Pointer)))^));
end.

[doj@larion ~/temp]$ fpc ptrtransform.pas
ptrtransform.pas(7,66) Fatal: Internal error 200706094
Fatal: Compilation aborted
Error: /home/doj/fpc/2.7.1/bin/ppcx64 returned an error exitcode

[doj@larion ~/temp]$ fpc -iW
2.7.1

=====================================================

IMO the problem is the transformation -1 into an unsigned value.
(Unsigned(-1) > Max(Signed).)

How can I rewrite this code to make it correct? I want to use
constants to calculate offsets from untyped pointer.

--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Internal error 200706094

wkitty42
On 9/29/2014 5:48 AM, Victor Matuzenko wrote:
> IMO the problem is the transformation -1 into an unsigned value.
> (Unsigned(-1) > Max(Signed).)
>
> How can I rewrite this code to make it correct? I want to use
> constants to calculate offsets from untyped pointer.

have you tried using a typed const?

const
   C : int64 = -1;


--
  NOTE: No off-list assistance is given without prior approval.
        Please *keep mailing list traffic on the list* unless
        private contact is specifically requested and granted.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Internal error 200706094

leledumbo
Administrator
In reply to this post by Виктор Матузенко
> How can I rewrite this code to make it correct? I want to use
constants to calculate offsets from untyped pointer.

You don't have to:
http://wiki.freepascal.org/Lazarus_Faq#.27Fatal:_Internal_error_XXXXYYZZW.27
so just report and wait for a fix, or fix it yourself if you can then post a patch (unless it's already fixed). You are using development version so a feature break is normal.