Something is bad with function inlining, when debug info is
being generated:
[pas]% uname -a ; gpc -v
Linux localhost.localdomain 2.4.2-2 #1 Sun Apr 8 19:37:14 EDT 2001 i586 unknown
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gpc version 20011222, based on 2.95.2 19991024 (release)
[pas]% cat crash.pas
program P (Output);
(* FLAG -g -O -finline-functions *)
var
A: Integer;
procedure S;
var
B: 0 .. 1;
begin
A := B
end;
begin
S;
WriteLn ('OK')
end.
[pas]% gpc -g -O -finline-functions crash.pas
gpc: Internal compiler error: program gpc1 got fatal signal 11
[pas]% gdb /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/gpc1 core
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/gpc1 /tmp/ccoAW9qr.i -quiet -du'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 print_int_cst_octal (c=0x8257cbc)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:1597
1597 int width = TYPE_PRECISION (TREE_TYPE (c));
(gdb) bt
#0 print_int_cst_octal (c=0x8257cbc)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:1597
#1 0x08140986 in dbxout_type (type=0x8259fc0, full=0, show_arg_types=0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:1171
#2 0x0814230c in dbxout_symbol_location (decl=0x825a920, type=0x8259fc0,
suffix=0x0, home=0x825a8a4) at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2161
#3 0x08141ebc in dbxout_symbol (decl=0x825a920, local=1)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:1944
#4 0x0814245b in dbxout_syms (syms=0x825a920)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2230
#5 0x08142a6d in dbxout_block (block=0x825a984, depth=4, args=0x0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2585
#6 0x08142bc8 in dbxout_block (block=0x825a9cc, depth=3, args=0x0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2644
#7 0x08142bc8 in dbxout_block (block=0x8279134, depth=2, args=0x0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2644
#8 0x08142bc8 in dbxout_block (block=0x827917c, depth=1, args=0x0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2644
#9 0x08142bc8 in dbxout_block (block=0x82791ac, depth=0, args=0x0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2644
#10 0x08142d07 in dbxout_function (decl=0x82776c0)
at ../../../gcc-2.95.2/gcc/p/../dbxout.c:2706
#11 0x08171879 in rest_of_compilation (decl=0x82776c0)
at ../../../gcc-2.95.2/gcc/p/../toplev.c:4419
#12 0x08189a28 in finish_function (nested=0)
at ../../../gcc-2.95.2/gcc/p/gpc-decl.c:9708
#13 0x081a41d2 in yyparse () at parse.y:525
#14 0x0816fb91 in compile_file (name=0xbffffb69 "/tmp/ccoAW9qr.i")
at ../../../gcc-2.95.2/gcc/p/../toplev.c:3265
#15 0x08172e7a in main (argc=11, argv=0xbffff9ec)
at ../../../gcc-2.95.2/gcc/p/../toplev.c:5440
#16 0x40041e5e in __libc_start_main (main=0x8171ec4 <main>, argc=11,
ubp_av=0xbffff9ec, init=0x8049194 <_init>, fini=0x81bcf80 <_fini>,
rtld_fini=0x4000d3c4 <_dl_fini>, stack_end=0xbffff9dc)
at ../sysdeps/generic/libc-start.c:129
Emil Jerabek