Peter Schorn wrote:
I am using the new gpc snapshot on OSX 10.4.10 (PPC) and compile the following program:
program prog;
procedure dcp; type pv = record x, y: Extended; v: array[1..2] of Boolean; end; var sp: pv; z: Boolean;
procedure d(p: pv); begin writeln('access z before'); if z then writeln('z is true'); end;
begin { dcp } z := True; d(sp); end;
begin dcp; end.
petersch% /Developer/Pascal/gpc412/bin/gpc -o prog prog.pas petersch% prog access z before Bus error
Note that the program works ok with gpc 20060325, based on gcc-3.4.5. The program also works with the latest compiler when making variable z global.
On an Intel Mac, I get
[p17:~/gpc/testgpc/adriaan] adriaan% gpc schorn1.pas schorn1.pas: In procedure `d': schorn1.pas:18: error: unable to find a register to spill in class 'CREG' schorn1.pas:18: error: this is the insn: (insn 8 7 9 0 (parallel [ (set (reg:SI 0 ax [73]) (const_int 0 [0x0])) (set (reg/f:SI 5 di [70]) (plus:SI (ashift:SI (reg:SI 0 ax [73]) (const_int 2 [0x2])) (reg/f:SI 5 di [70]))) (set (reg/f:SI 4 si [71]) (plus:SI (ashift:SI (reg:SI 0 ax [73]) (const_int 2 [0x2])) (reg/f:SI 4 si [71]))) (set (mem/s/c:BLK (reg/f:SI 5 di [70]) [0 P+0 S48 A128]) (mem/s/c:BLK (reg/f:SI 4 si [71]) [0 P+0 S48 A32])) (use (reg:SI 0 ax [73])) (use (reg:SI 19 dirflag)) ]) 518 {*rep_movsi} (nil) (expr_list:REG_UNUSED (reg/f:SI 4 si [71]) (expr_list:REG_UNUSED (reg/f:SI 5 di [70]) (expr_list:REG_UNUSED (reg:SI 0 ax [73]) (expr_list:REG_DEAD (reg:SI 19 dirflag) (expr_list:REG_UNUSED (reg/f:SI 4 si [71]) (expr_list:REG_UNUSED (reg/f:SI 5 di [70]) (expr_list:REG_UNUSED (reg:SI 0 ax [73]) (nil))))))))) schorn1.pas:18: confused by earlier errors, bailing out
[p17:~/gpc/testgpc/adriaan] adriaan% gpc -v Using built-in specs. Configured with: ../gcc-4.1.2/configure --enable-languages=pascal,c --enable-threads=posix --target=i386-apple-darwin8 --host=i386-apple-darwin8 --build=i386-apple-darwin8 --prefix=/Developer/Pascal/gpc412d2 --with-arch=pentium-m --with-tune=prescott Thread model: posix gpc version 20070904, based on gcc-4.1.2
[p17:~/gpc/testgpc/adriaan] adriaan% uname -a Darwin p17 8.6.2 Darwin Kernel Version 8.6.2: Thu Apr 13 18:48:29 PDT 2006; root:xnu-792.9.59.obj~1/RELEASE_I386 i386 i386
Did you patch the compiler with my diff for OS X or not ? Did you test on a powerpc or Intel Mac ? How was the compiler configured and built ?
Regards,
Adriaan van Os