Bug 18456 - [4.3/4.4/4.5 Regression] ICE compiling Objective C code with protocol-qualified objects
Summary: [4.3/4.4/4.5 Regression] ICE compiling Objective C code with protocol-qualifi...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc (show other bugs)
Version: 4.0.0
: P5 normal
Target Milestone: 4.3.4
Assignee: ayers
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-11-12 17:01 UTC by Marcus Daniels
Modified: 2009-04-02 21:58 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.3 4.4.0 4.5.0
Known to fail: 4.0.4
Last reconfirmed: 2009-03-31 21:08:24


Attachments
Objective C file that crashes compiler (230 bytes, text/plain)
2004-11-12 17:02 UTC, Marcus Daniels
Details
Patch: handle all types in gen_type_name_0. (382 bytes, patch)
2005-01-26 01:05 UTC, Alexander Malmberg
Details | Diff
Test case that triggers the ICE without relying on the bogus warning. (179 bytes, text/x-objcsrc)
2005-01-26 01:06 UTC, Alexander Malmberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Daniels 2004-11-12 17:01:41 UTC
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)
Comment 1 Marcus Daniels 2004-11-12 17:02:56 UTC
Created attachment 7530 [details]
Objective C file that crashes compiler

Compiling with no -D preprocessor defines will ICE gcc 4.0.0 20041112
Comment 2 Andrew Pinski 2004-11-12 17:12:21 UTC
Confirmed.
Comment 3 Alexander Malmberg 2005-01-26 01:05:29 UTC
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.
Comment 4 Alexander Malmberg 2005-01-26 01:06:13 UTC
Created attachment 8071 [details]
Test case that triggers the ICE without relying on the bogus warning.
Comment 5 Mark Mitchell 2005-08-22 02:20:22 UTC
Objective-C is not release-critical; removing target milestone.
Comment 6 Mark Mitchell 2006-05-25 02:35:34 UTC
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Comment 7 Joseph S. Myers 2008-07-04 16:35:43 UTC
Closing 4.1 branch.
Comment 8 Joseph S. Myers 2009-03-31 16:40:51 UTC
Closing 4.2 branch.
Comment 9 ayers 2009-03-31 21:08:24 UTC
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.
Comment 10 ayers 2009-04-02 21:46:14 UTC
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

Comment 11 ayers 2009-04-02 21:49:51 UTC
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

Comment 12 ayers 2009-04-02 21:51:36 UTC
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

Comment 13 ayers 2009-04-02 21:58:09 UTC
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.