On Tue, 6 Nov 2001, J. David Bryan wrote:
David, Mr. Frank Heckenbach,
Maybe it has something to do with the fact that I run GPC on Alpha 64-bit processor?
Perhaps. First, though, I would upgrade to the latest GPC release (20010924), as this may have been a bug that has now been fixed.
I took some effort to investigate on this: I've rebuilt GPC, both on Ultra1/Solaris7 and Alpha/DU4.0b:
% gpc -v Reading specs from /usr/local/lib/gcc-lib/alpha-dec-osf4.0b/2.95.2/specs gpc version 20010924, based on 2.95.2 19991024 (release)
Both are 64 bit processors (but I'm not sure whether gcc on Solaris was built to be true 64-bit compiler!) - and on Solaris prime numbers with sieve of Erastothenes test passed!!! (While on DEC Alpha/osf4.0b (patched) it still miserably fails).
This could have been caused by the fact that SET is represented by a 64-bit bit-field, and upper 32 bits of each bit field are treated wrong way...
Yes, that is very possible. If upgrading to the latest version of GPC does not help, I would recommend creating a very small test program that initializes the set with only 0..63. Compile with "gpc -S" and examine the resulting assembler code to see if you can spot the error and report your results back to the list.
OK, I tried isolate bug by minimizing the example (even switching from automatic set construction to ``Include'' didn't make it work!):
--- marvin00.pas: ------------------------------------------------------- PROGRAM settest00(input,output); {Test of SET construction; known to fail on alpha-dec-osf4.0b?!?}
CONST maxN = 255; VAR a_set: SET OF 0..maxN;
BEGIN {a_set := a_set + [33];} Include (a_set, 33); {neither works!}
IF (NOT(33 IN a_set)) THEN writeln('Failed: 33 NOT IN SET after putting it IN!') ELSE writeln('OK');
END. --------------------------------------------------------------------------
You will probably guess that even this simple example on my Alpha fails.
Does my thinking make any sense to you?
Yes it does. Unfortunately, I do not use any 64-bit machines, so I cannot test this problem (nor do I understand DEC Alpha assembler). Therefore, unless Frank Heckenbach has a 64-bit system available, we need you to help us determine what the problem is.
Unfortunatelly, I'm not an expert on DEC alpha assembler either, yet I will give the marvin00.s here just in case somebody reading the list *is*, later on ... Anyway, by surface analisys of the listing it seemed to me that it will not show much, since it just calls _p_set_include and _p_set_in (these are as I suspect probably in RTL library?) ...
Anyway - if I could be of more help (even including giving you access to our Alpha machine) - I'm very interrested in this SET feature in PASCAL, I think it's a great thing!!!
Also, if that may help, I've defined -DEGCS95 while compiling (I think that last time it did not compile without defining no -DEGCS....). Then again, I've used the same -DEGCS95 on Solaris and it works ...
Regards to all, Mirsad
--- marvin00.s:----------------------------------------------------------- .verstamp 3 11 .set noreorder .set volatile .set noat .arch ev4 .file 1 "marvin00.pas" .lcomm A_set,32 .rdata .quad 0 $LC0: .ascii "Failed: 33 NOT IN SET after putting it IN!\0" $LC1: .ascii "OK\0" .text .align 5 .globl pascal_main_program .ent pascal_main_program pascal_main_program: .frame $15,32,$26,0 .mask 0x4008000,-16 ldgp $29,0($27) $pascal_main_program..ng: lda $30,-32($30) stq $26,16($30) stq $15,24($30) mov $30,$15 .prologue 1 lda $16,A_set mov $31,$17 lda $18,255 lda $19,33 jsr $26,_p_set_include ldgp $29,0($26) lda $16,A_set mov $31,$17 lda $18,255 lda $19,33 jsr $26,_p_set_in ldgp $29,0($26) mov $0,$1 bne $1,$L3 lda $1,22 stq $1,0($30) lda $16,_p_stdout lda $17,384 lda $18,2 lda $19,17 lda $20,$LC0 lda $21,42 jsr $26,_p_write ldgp $29,0($26) lda $1,_p_InOutRes ldl $2,0($1) beq $2,$L4 jsr $26,_p_check_inoutres ldgp $29,0($26) $L4: br $31,$L5 $L3: lda $1,22 stq $1,0($30) lda $16,_p_stdout lda $17,384 lda $18,2 lda $19,17 lda $20,$LC1 lda $21,2 jsr $26,_p_write ldgp $29,0($26) lda $1,_p_InOutRes ldl $2,0($1) beq $2,$L5 jsr $26,_p_check_inoutres ldgp $29,0($26) $L6: $L5: $L2: mov $15,$30 ldq $26,16($30) ldq $15,24($30) lda $30,32($30) ret $31,($26),1 .end pascal_main_program .data ctor_run_condition_0.4: .byte 1 .text .align 5 .globl init_pascal_main_program .ent init_pascal_main_program init_pascal_main_program: .frame $15,16,$26,0 .mask 0x4008000,-16 ldgp $29,0($27) $init_pascal_main_program..ng: lda $30,-16($30) stq $26,0($30) stq $15,8($30) mov $30,$15 .prologue 1 lda $2,ctor_run_condition_0.4 ldq_u $1,0($2) extbl $1,$2,$3 and $3,0xff,$1 beq $1,$L8 lda $1,ctor_run_condition_0.4 mov $31,$2 ldq_u $3,0($1) mov $1,$4 mskbl $3,$4,$3 insbl $2,$4,$2 bis $2,$3,$2 stq_u $2,0($1) lda $16,fini_pascal_main_program jsr $26,_p_atexit ldgp $29,0($26) $L8: $L7: mov $15,$30 ldq $26,0($30) ldq $15,8($30) lda $30,16($30) ret $31,($26),1 .end init_pascal_main_program .align 5 .globl fini_pascal_main_program .ent fini_pascal_main_program fini_pascal_main_program: .frame $15,16,$26,0 .mask 0x4008000,-16 $fini_pascal_main_program..ng: lda $30,-16($30) stq $26,0($30) stq $15,8($30) mov $30,$15 .prologue 0 $L9: mov $15,$30 ldq $26,0($30) ldq $15,8($30) lda $30,16($30) ret $31,($26),1 .end fini_pascal_main_program .align 5 .globl main .ent main main: .frame $15,48,$26,0 .mask 0x4008000,-48 ldgp $29,0($27) $main..ng: lda $30,-48($30) stq $26,0($30) stq $15,8($30) mov $30,$15 .prologue 1 mov $16,$1 stq $17,24($15) stq $18,32($15) stl $1,16($15) ldl $1,16($15) mov $1,$16 ldq $17,24($15) ldq $18,32($15) jsr $26,_p_initialize ldgp $29,0($26) jsr $26,init_pascal_main_program ldgp $29,0($26) jsr $26,pascal_main_program ldgp $29,0($26) jsr $26,_p_finalize ldgp $29,0($26) mov $31,$0 br $31,$L10 $L10: mov $15,$30 ldq $26,0($30) ldq $15,8($30) lda $30,48($30) ret $31,($26),1 .end main ------------------------------------------------------------------------ -- This message has been made up using recycled ideas and language constructs. No plant or animal has been injured in process of making this message.