[fpc-devel] large constant and qword comparison broken in fixes_2_4 rev 15403

Seth Grover sethdgrover at gmail.com
Thu Jun 10 20:06:19 CEST 2010


Given this example (http://pastebin.com/JQVqF7SV):

==============================
program project1;

{$mode objfpc}{$H+}

uses
  SysUtils;

const
  BIG_A = $AB09CD87EF653412;
  BIG_B = qword($AB09CD87EF653412);
var
  q : qword;
begin
  writeln('BIG_A: $', IntToHex(BIG_A, sizeof(BIG_A) * 2));
  writeln('BIG_B: $', IntToHex(BIG_B, sizeof(BIG_B) * 2));

  q := BIG_A;
  write('q:     $', IntToHex(q, sizeof(q) * 2), '   ');
  if (q = BIG_A) then begin
    writeln('same');
  end else begin
    writeln('different');
  end;

  q := BIG_B;
  write('q:     $', IntToHex(q, sizeof(q) * 2), '   ');
  if (q = BIG_B) then begin
    writeln('same');
  end else begin
    writeln('different');
  end;
end.
==============================

A recent change to fixes_2_4 (I think it was rev 15403) has broken
this example. With yesterday's code the code prints out "same" both
times (which is correct), but after pulling today's revision it only
works if the constant is cast as a qword (it fails in the first
example, works in the second). It should work correctly whether I cast
the constant or not.

I was going to log a bug on it but mantis isn't letting me,
bug_report_page.php keeps just coming up blank for me.

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com



More information about the fpc-devel mailing list