Bug 11661 - [objc-improvements-branch] ICE on function pointers as ivars
Summary: [objc-improvements-branch] ICE on function pointers as ivars
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc (show other bugs)
Version: unknown
: P1 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-07-24 13:58 UTC by David Ayers
Modified: 2003-12-09 18:10 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: *-*-*
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-07-24 18:06:32


Attachments
Test to reproduce ICE on function pointers as instance variables (142 bytes, text/plain)
2003-07-24 14:07 UTC, David Ayers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Ayers 2003-07-24 13:58:20 UTC
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)
Comment 1 David Ayers 2003-07-24 14:07:43 UTC
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
Comment 2 Andrew Pinski 2003-07-24 14:23:23 UTC
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.
Comment 3 Andrew Pinski 2003-07-24 18:06:31 UTC
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.
Comment 4 Andrew Pinski 2003-07-29 23:10:35 UTC
Fixed see <http://gcc.gnu.org/ml/gcc-cvs/2003-07/msg01215.html>.
Comment 5 Ziemowit Laski 2003-07-29 23:19:54 UTC
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...)