David Chandler wrote:
Dear GPC programmers,
Here at NPL we have Pascal compiler testing software that generates self checking, legal Pascal source code for the purpose of testing Pascal compilers. We used this tool to test your compiler and generated the following bug.
Your compiler version:
egcs-2.91.66 1990314 (egcs-1.1.2 release)
The results of this test show that your compiler failed during compilation of the following program:
program test(output);
type T9 = false..true;
var failed : boolean; V0 :T9 ; V2 :T9 ;
procedure P2;
begin failed := false; V0 := true; V2 := true = V0;
{ test code } writeln("V2: ",V2); writeln("V0: ",V0); writeln("true: ",true); end;
begin P2;
if V2 <> 1 then begin writeln('Verification test failed on line 93'); failed := true; end; end. {Lines of code generated = 104}
The problem appears to be that the compiler interprets the type type "false..true" as being different from boolean. If this type is changed to boolean, then the program runs correctly.
The compiler options used to generate the test executable were:
--standard-pascal no optimisations
The test platform was an Intel PC.
It seems to me that the test program is wrong, and GPC (at least the current alpha version; I don't have 19990314 here to check) reports this error correctly: The program compares V2, which is of type T9 which is equivalent to Boolean, with 1, an integer.
Perhaps this was just a mistake in the reproduction of the test program. We've had other bugs concerning types like "false..true", and if there are still such bugs left, we'd like to see a test program to show them...
I'm also interested in your test tool. Is it (or the NPL report you mentioned) available on the Web, or how can we get at it?
Frank