Declaring function pointers as instance variables causes an ICE (independent of the runtime). The example (I'll try to attach it as a file...): #include <objc/Object.h> @interface MyObject : Object { BOOL (*ivar)(id, SEL, id); } @end @implementation MyObject @end int main () { return(0); } compiled with: gccObjCI -fnext-runtime -lobjc fncptrivar.m will fail, (independent of -fgnu-runtime or -fnext-runtime). The compiler reports: fncptrivar.m:5: internal compiler error: tree check: expected identifier_node, have indirect_ref in add_instance_variable, at objc/objc-act.c:6601 Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs Konfiguriert mit: ../gcc/configure --enable-shared --enable-threads=posix --enable-languages=objc --enable-version-specific-runtime-libs --program-suffix=ObjCI Thread model: posix gcc-Version 3.4 20030722 (experimental)
Created attachment 4474 [details] Test to reproduce ICE on function pointers as instance variables compile with: gccObjCI -fnext-runtime -lobjc fncptrivar.m or gccObjCI -fgnu-runtime -lobjc fncptrivar.m
This does not fail with Apple's 3.3: gcc version 3.3 20030304 (Apple Computer, Inc. build 1409) So it looks like a merge problem.
It also happens on powerpc-apple-darwin6.6 on the branch: [omni:~/src/gccPRs] pinskia% /Volumes/UFS_Partition/pinskia/objc-in/bin/gcc pr11661.m -lobjc pr11661.m:5: internal compiler error: tree check: expected identifier_node, have indirect_ref in add_instance_variable, at objc/objc-act.c:6601 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Fixed see <http://gcc.gnu.org/ml/gcc-cvs/2003-07/msg01215.html>.
Fix committed to objc-improvements branch, along with a test case (gcc/testsuite/objc.dg/func- ptr-1.m). (Not sure why the bug was moved to RESOLVED/FIXED _before_ I fixed it, though...)