I'm in the process of merging ObjC 2.0 Apple stuff into gcc 4.3.0 for the cocotron project; we build a cross-compiler to build Windows/Linux binaries from Darwin. In the progress we got an ICE when compiling any ObjC++ code that would cause an __objc_gnu_init constructor to be emitted with optimizations: "internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in setup_one_parameter, at tree-inline.c: 1535".
While trying to fix this problem, I noticed that build_module_initializer_routine contains the line objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node)); Replacing this with #ifdef OBJCPLUS objc_push_parm (build_decl (PARM_DECL, NULL_TREE, ptr_type_node)); #else objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node)); #endif fixed the problem. I don't have the first idea on why; maybe this is just masking a deeper problem. It certainly seems wrong somehow (the __objc_gnu_init should take a void, shouldn't it?)... Maybe someone with more knowledge on gcc stuff could shed a little light on this? -- Summary: wrong pointer type in build_module_initializer_routine? Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: johannes dot fortmann at gmail dot com GCC build triplet: i686-apple-darwin9 GCC host triplet: i686-apple-darwin9 GCC target triplet: i386-mingw32msvc http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35891