The attached program ICEs the Objective C compiler. Two situations in which it won't are if it is compiled with -DNOCRASH1 or -DNOCRASH2. $ gcc -v Reading specs from /packages/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs Configured with: /src/gcc/configure --prefix=/packages/gcc --srcdir=/src/gcc Thread model: posix gcc version 4.0.0 20041112 (experimental)
Created attachment 7530 [details] Objective C file that crashes compiler Compiling with no -D preprocessor defines will ICE gcc 4.0.0 20041112
Confirmed.
Created attachment 8070 [details] Patch: handle all types in gen_type_name_0. There are really two bugs here. First, the frontend is issuing a bogus warning about incompatible types for the methods. I haven't investigated this part yet. Building the warning message triggers the next bug: gen_type_name_0 ICE:s because it can't handle function pointers (among other types). The attached patch fixes this part by only using IDENTIFIER_POINTER on IDENTIFIER_NODE:s and using "<anonymous>" for other types. I'll also attach a test case that triggers this bug regardless of the bogus warning issue. (Should we open a new PR for one of these bugs instead of keeping them both here?) No new failures with 'make check-objc', but not yet bootstrapped.
Created attachment 8071 [details] Test case that triggers the ICE without relying on the bogus warning.
Objective-C is not release-critical; removing target milestone.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Closing 4.1 branch.
Closing 4.2 branch.
The ICE is fixed in trunk (4.5), 4.4 and 4.3.3 The original test case still produces a bogus warning. Posted an RFA for the second test case here: http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01826.html I'll close this once that second tests have been installed, since the ICE is fixed and the bogus warning is a different issue.
Subject: Bug 18456 Author: ayers Date: Thu Apr 2 21:46:00 2009 New Revision: 145478 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145478 Log: 2009-04-02 David Ayers <ayers@fsfe.org> PR objc/18456 * objc.dg/bad-receiver-type-2.m: New test contributed by Alexander Mamberg. Added: trunk/gcc/testsuite/objc.dg/bad-receiver-type-2.m Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 18456 Author: ayers Date: Thu Apr 2 21:49:37 2009 New Revision: 145479 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145479 Log: 2009-04-02 David Ayers <ayers@fsfe.org> PR objc/18456 * objc.dg/bad-receiver-type-2.m: New test contributed by Alexander Mamberg. Added: branches/gcc-4_4-branch/gcc/testsuite/objc.dg/bad-receiver-type-2.m Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Subject: Bug 18456 Author: ayers Date: Thu Apr 2 21:51:26 2009 New Revision: 145480 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145480 Log: 2009-04-02 David Ayers <ayers@fsfe.org> PR objc/18456 * objc.dg/bad-receiver-type-2.m: New test contributed by Alexander Mamberg. Added: branches/gcc-4_3-branch/gcc/testsuite/objc.dg/bad-receiver-type-2.m Modified: branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
The test case which would trigger the ICE have now been committed to all active branches. The more specific test case wrt protocols and typedefs will be committed once an issue wrt a bogus warning has been addressed. Yet that's a separate diagnostics issue, which will only be addressed on the trunk with a separate patch. I'm closing this regression.