Prof A Olowofoyeku (The African Chief) wrote:
On 15 Feb 2006 at 4:39, Waldek Hebisch wrote:
I have put a new gpc snapshot at:
http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20060215.tar.bz2
[...] Generates an ICE in my OOP framework (Mingw, based on gcc-3.4.5).
"cwindows.pas:345: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.mingw.org/bugs.shtml for instructions. gpc1.exe: gpc exited with status 1"
This one has me stumped! It happens even when I pas "-S" or "-fsyntax- only".
AFAICS, there is no reason why there should be an ICE. The ICE happens in the interface section of a unit, in the middle of object declarations. The code has compiled under all GPC versions for the past 3 years or so (including 20051116), and under Delphi, Virtual Pascal, and FreePascal. It is valid Pascal code, and, AFAICS, the declarations do not contain any errors that should cause even a compiler error, least of all an ICE.
I am still trying to reduce the problem to a small program, but so far, I am not succeeding.
With this data I can not give any specific advice. But generally in similar cases I use debugger just on original testcase. You need to start a debugger (say gdb) on the compiler proper (gpc1.exe) and give it correct arguments (running gpc -v will tell you which one). The debugger will (assuming that you have compiled your gpc with debugging support, which is a default) tell you offending line number and its file. In gdb typing `bt' will give you a backtrace (the whole call chain with arguments).
BTW. When testing gpc it us usefull to give `--enable-checking' option to `configure' -- the compiler build in such way performs extra internal checks (the checks make the compiler slower and larger, so they are disabled by default).