Waldek Hebisch wrote:
I have discovered code generation problem on AMD64. The patch below corrects code generation. It causes spurious warnings in some other tests (fjf1014.pas, fjf1021h.pas, fjf1021i.pas, fjf768c.pas, fjf768e.pas, fjf768f.pas) but those will require separate fix.
In principle other platforms may be affected -- in particular the problem on Mac OSX looks related.
New test results on Mac OS X
[G5:gcc/p/test] adriaan% make EXTRA_PFLAGS=--longjmp-all-nonlocal-labels ... Native configuration is powerpc-apple-darwin7 (G5.local)
=== gpc tests ===
Running target any Running testsuite ...
UNSUPPORTED: agettext2test.pas UNSUPPORTED: agettexttest.pas UNSUPPORTED: aregextest.pas UNSUPPORTED: asmtest.pas FAIL: avo4.pas FAIL: az20.pas FAIL: filehand.pas FAIL: fjf1021h.pas FAIL: fjf1021i.pas UNSUPPORTED: fjf165a.pas FAIL: fjf659o.pas FAIL: fjf684.pas FAIL: fjf746.pas FAIL: fjf751k.pas FAIL: fjf751l.pas FAIL: fjf800.pas FAIL: fjf980b.pas FAIL: fjf998r.pas UNSUPPORTED: gmptest.pas FAIL: longr2.pas FAIL: pack10.pas FAIL: pack12.pas FAIL: pack2.pas FAIL: pack4.pas FAIL: random.pas FAIL: systemtest.pas
=== gpc Summary ===
# of tests 4537 # of expected passes 4511 # of unexpected failures 20 # of unsupported tests 6
gpc version 20050217, based on gcc-3.4.3
TEST avo4.pas: ./test_run: line 345: 1590 Segmentation fault ./"$A_OUT" "$1"
TEST az20.pas: ./test_run: line 345: 1969 Segmentation fault ./"$A_OUT" "$1"
TEST filehand.pas: ./filehand.pas: In main program: ./filehand.pas:11: error: statement used as an expression failed
TEST fjf1021h.pas: ./fjf1021h.pas:6: error: expressions with side-effects are not allowed in schema types failed
TEST fjf1021i.pas: ./fjf1021i.pas:8: error: expressions with side-effects are not allowed in schema types failed
TEST fjf659o.pas: ./test_run: line 345: 16058 Segmentation fault ./"$A_OUT" "$1"
TEST fjf684.pas: ./fjf684.pas: In main program: ./fjf684.pas:12: error: invalid operands to `=' failed
TEST fjf746.pas: ./test_run: line 345: 20132 Segmentation fault ./"$A_OUT" "$1"
TEST fjf751k.pas: ./fjf751k.pas: In main program: ./fjf751k.pas:8: error: argument to `WriteLn' is of wrong type failed
TEST fjf751l.pas: ./fjf751l.pas: In main program: ./fjf751l.pas:8: error: argument to `WriteLn' is of wrong type failed
TEST fjf800.pas: ./fjf800.pas:65: error: redeclaration of `Fjf800' ./fjf800.pas:1: error: previous declaration ./fjf800.pas:65: error: redeclaration of `Fjf800' ./fjf800.pas:1: error: previous declaration failed
TEST fjf980b.pas: ./test_run: line 345: 2583 Segmentation fault ./"$A_OUT" "$1"
TEST longr2.pas: dummy.pas: In main program: dummy.pas:2: error: real constant out of range
TEST pack10.pas: ./test_run: line 345: 16476 Segmentation fault ./"$A_OUT" "$1"
TEST pack12.pas: ./test_run: line 345: 16516 Segmentation fault ./"$A_OUT" "$1"
TEST pack2.pas: ./test_run: line 345: 16537 Segmentation fault ./"$A_OUT" "$1"
TEST pack4.pas: ./test_run: line 345: 16577 Segmentation fault ./"$A_OUT" "$1"
TEST random.pas: ./random.pas: In main program: ./random.pas:22: error: invalid operands to `*' ./random.pas:22: error: invalid operands to `*' failed
TEST systemtest.pas: ./test_run: line 345: 22603 Segmentation fault ./"$A_OUT" "$1"
typical backtrace for the segmentation faults:
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x000d703c
Thread 0 Crashed: 0 a.out 0x00008260 _p_FileHandle + 0x4 (files.pas:1015) 1 a.out 0x00003760 _p_WriteErrorMessage + 0x10c (error.pas:750) 2 a.out 0x00003a40 _p__rts_Error_S24_Writestackdump + 0x2cc (error.pas:772) 3 a.out 0x00004438 _p_EndRuntimeError + 0x38 (error.pas:862) 4 a.out 0x00004544 _p__rts_Error_S32_Strerror + 0 (error.pas:875) 5 a.out 0x00002998 _p_IORangeCheckError + 0 (error.pas:585) 6 a.out 0x000026ac _p__M0_main_program + 0x23c (pack2.pas:18) 7 a.out 0x00002808 main + 0x34 (<implicit code>:22) 8 a.out 0x000020a8 _start + 0x188 (crt.c:267) 9 dyld 0x8fe1a558 _dyld_start + 0x64