Hi, Compile the following C code with GCC 2.96 + latest patches: void func(void) { int i; #line 1 "/foo/foo.h" if (1) i = 1; else i #line 2 = 0; } The compiler will segfault: $ gcc -c foo.c /foo/foo.h: In function `f': /foo/foo.h:2: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Of course the code is not correct but the compiler should not segfault. Note: Similar code is generated by KAI C++. This prevents from compiling with KAI C++ on Red Hat 7, or at least from getting meaningful error messages from the GCC back-end. Thanks, Dimitri
Oh, I see now that the KAI C++ code is _not_ incorrect. Actually it does not look like the code previously posted. It looks like this: void func(void) { int i; #line 1 "/foo/foo.h" if (1) i = 1; else i #line 1 = 0; } The code is really meant to hold in a single line. Now I have read paragraph 16.4.3 of ISO C++ and it is not very clear what happens in this special case. Unfortunately I don't have the ISO C standard available here, so I cannot check in the ISO C standard. In any case KAI C++ works fine with other compilers so I guess this should be fixed in GCC. Dimitri
I've fixed it in my tree, the fix will appear in gcc-2.96-75.