Waldek Hebisch wrote:
Adriaan van Os wrote:
Waldek Hebisch wrote:
That looks like error in runtime system. Did you re-built `libgpc.a'? Re-making after applying patch will _not_ re-make `libgpc.a', one has to remove object files in `gcc/p/rts/' subdirectory by hand (including `stamp-error-gpi').
I had noticed that libgpc.a wasn't rebuilt and did a fresh rebuild. I believe there is a problem in the runtime system.
My working hypothesis is that range-checking code got mis-optimized (the patch I posted was intended to correct this). So turning off range-checking (also for libgpc) should eliminate failures. One could try removing (or commentig out) line:
TREE_SIDE_EFFECTS (t) = side_effects;
from my patch. Removing this line will produce many surious warnings, but the chance of mis-optimization is then smaller (however I was unable to see any change in generated code with this change).
It doesn't help, same segmentation fault.
I had a look at one of the test programs (pack2.pas). When I add writeln's like this:
Program Pack2;
Var a: packed array [ 1..188 ] of Boolean; {$W-} ai: Integer absolute a; i: Integer; {$W+}
begin writeln('ai:= 0;'); ai:= 0; writeln('a [ 1 ]:= true;'); a [ 1 ]:= true; writeln('a [ 2 ]:= true;'); a [ 2 ]:= true; writeln('a [ 3 ]:= true;'); a [ 3 ]:= true; writeln('for i:= 1 to 188 do'); for i:= 1 to 188 do begin writeln('i = ', i); writeln('if not a [ i ] then'); if not a [ i ] then begin writeln('a [ i ]:= true;'); a [ i ]:= true; end end; writeln('if ( SizeOf ( a ) = 24 ) and ( ai = -1 ) then'); if ( SizeOf ( a ) = 24 ) and ( ai = -1 ) then writeln ( 'OK' ) else writeln ( 'failed: ', SizeOf ( a ), ' ', ai ); end.
the crash occurs at
i = 33 if not a [ i ] then a [ i ]:= true; ./test_run: line 345: 16298 Segmentation fault ./"$A_OUT" "$1"
(for the backtrace see previous email).
Regards,
Adriaan van Os