As a matter of fact, this program generates a GPC segmentation fault under Linux Debian x86 and SPARC Solaris 2.6 too.
gpc 20051116, based on gcc-3.4.4 on both platforms
Regards
Pascal Viandier
-----Message d'origine----- De : gpc-owner@gnu.de [mailto:gpc-owner@gnu.de] De la part de Adriaan van Os Envoyé : February 14, 2006 09:11 À : gpc@gnu.de Objet : ICE on bad forward declaration
The following testprogram causes an ICE in the compiler.
[G5:~/gpc/testgpc/adriaan] adriaan% cat ice3.pas
program ice3;
type Str44 = record sLength: Byte; sChars: packed array[ 1..44] of char end;
procedure P (s: str44); forward;
procedure P (const s: str44); begin end;
begin end.
[G5:~/gpc/testgpc/adriaan] adriaan% gpc ice3.pas ice3.pas:9: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions.
[G5:~/gpc/testgpc/adriaan] adriaan% gpc -v Reading specs from /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin7/3.4.5/specs Configured with: ../gcc-3.4.5/configure --enable-languages=pascal,c --enable-threads=posix --target=powerpc-apple-darwin7 --host=powerpc-apple-darwin7 --build=powerpc-apple-darwin7 --prefix=/Developer/Pascal/gpc345u2 Thread model: posix gpc version 20051116, based on gcc-3.4.5
Date/Time: 2006-02-14 15:06:50 +0100 OS Version: 10.3.9 (Build 7W98) Report Version: 2
Command: gpc1 Path: /Developer/Pascal/gpc345u2/libexec/gcc/powerpc-apple-darwin7/3.4.5/gpc1 Version: ??? (???) PID: 21604 Thread: 0
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000008
Thread 0 Crashed: 0 gpc1 0x00017198 check_routine_decl + 0x1f8 1 gpc1 0x0001ac5c start_routine + 0x644 2 gpc1 0x0000ad84 yyuserAction + 0x7714 3 gpc1 0x00011560 main_yyparse + 0x888 4 gpc1 0x000c30c4 toplev_main + 0x840 5 gpc1 0x00002468 _start + 0x188 6 dyld 0x8fe1a278 _dyld_start + 0x64
PPC Thread State: srr0: 0x00017198 srr1: 0x0200f930 vrsave: 0x00000000 cr: 0x44022222 xer: 0x20000000 lr: 0x00017060 ctr: 0x000c3ccc r0: 0x0000000f r1: 0xbfffe7f0 r2: 0x14080000 r3: 0x405eb680 r4: 0x405eb180 r5: 0x00000000 r6: 0x00000000 r7: 0x00000000 r8: 0x00000000 r9: 0x405eb580 r10: 0x00000000 r11: 0x00000000 r12: 0x24024242 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000 r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000 r20: 0x00000000 r21: 0x00000000 r22: 0x00000000 r23: 0x00000000 r24: 0x405e8840 r25: 0x405e8828 r26: 0x405ea1c0 r27: 0x00000000 r28: 0x405eb700 r29: 0x405eb380 r30: 0x405eb480 r31: 0x00016fb8
Binary Images Description: 0x1000 - 0x457fff gpc1 /Developer/Pascal/gpc345u2/libexec/gcc/powerpc-apple-darwin7/3.4.5/ gpc1 0x8fe00000 - 0x8fe4ffff dyld /usr/lib/dyld 0x93a50000 - 0x93a54fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib 0x95f30000 - 0x9601efff libiconv.2.dylib /usr/lib/libiconv.2.dylib 0x98d8e000 - 0x98eddfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
The same happens with the implicit forward declaration in a unit's interface.
Regards,
Adriaan van Os