Happens at least with 4.1 and 4.2. Maybe Andrew can find a C testcase? (sid)88:tbm@chico: ~] /usr/lib/gcc-snapshot/bin/gcc -x objective-c -O -c sope-NGActiveSocket.m sope-NGActiveSocket.m:18: warning: cannot find interface declaration for 'NGActiveSocket' sope-NGActiveSocket.m:22: warning: '@end' missing in implementation context sope-NGActiveSocket.m: In function '+[NGActiveSocket socketPair:inDomain:]': sope-NGActiveSocket.m:21: internal compiler error: in expand_expr_real_1, at expr.c:6932 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. (sid)89:tbm@chico: ~] /usr/lib/gcc-snapshot/bin/gcc -x objective-c -c sope-NGActiveSocket.m sope-NGActiveSocket.m:18: warning: cannot find interface declaration for 'NGActiveSocket' sope-NGActiveSocket.m:22: warning: '@end' missing in implementation context (sid)90:tbm@chico: ~] gcc-4.1 -x objective-c -O -c sope-NGActiveSocket.m sope-NGActiveSocket.m:18: warning: cannot find interface declaration for ‘NGActiveSocket’ sope-NGActiveSocket.m:22: warning: ‘@end’ missing in implementation context sope-NGActiveSocket.m: In function ‘+[NGActiveSocket socketPair:inDomain:]’: sope-NGActiveSocket.m:21: internal compiler error: in expand_expr_real_1, at expr.c:6763 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. (sid)91:tbm@chico: ~] (sid)91:tbm@chico: ~] cat sope-NGActiveSocket.m typedef unsigned char BOOL; @protocol NSObject - (Class) class; @end @ interface NSObject < NSObject > @end typedef struct _NSRange { } NSRange; @interface NSException:NSObject @end static inline BOOL NGIsStreamErrorException (NSException * _exception) { } @protocol NGSocketAddress < NSObject > @end @ protocol NGSocket < NSObject > -(id < NGSocketAddress >) localAddress; @end @ protocol NGSocketDomain < NSObject > -(id < NGSocketAddress >) addressWithRepresentation:(void *) _data size:(unsigned int) _size; @end @ implementation NGActiveSocket + (BOOL) socketPair:(id < NGSocket >[2]) _pair inDomain:(id < NGSocketDomain >) _domain { _pair[0] = (id) 0; }
Confirmed, reduced testcase: @ implementation NGActiveSocket + (void) socketPair:(int [2]) _pair { _pair[0] = 0; } @end ------ I think this is an objc only bug.
The problem is that the decl mode is DImode which is wrong.
The problem is with objc_push_parm where we forgot to relayout the decl. I have an obvious fix which I will apply after testing.
objc_push_parm is borken for other problems, guess I have to fix the other problems too.
(In reply to comment #4) > objc_push_parm is borken for other problems, guess I have to fix the other > problems too. But I will enter them as other bugs.
Subject: Bug 29195 Author: pinskia Date: Tue Sep 26 15:36:21 2006 New Revision: 117229 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117229 Log: 2006-09-26 Andrew Pinski <pinskia@physics.uc.edu> PR objc/29195 * objc-act.c (objc_push_parm): If we change the type of the decl, relayout the decl. 2006-09-26 Andrew Pinski <pinskia@physics.uc.edu> PR objc/29195 * objc/compile/method-1.m: New test. Added: trunk/gcc/testsuite/objc/compile/method-1.m Modified: trunk/gcc/objc/ChangeLog trunk/gcc/objc/objc-act.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 29195 Author: pinskia Date: Tue Oct 3 16:23:48 2006 New Revision: 117402 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117402 Log: 2006-09-26 Andrew Pinski <pinskia@physics.uc.edu> PR objc/29195 * objc-act.c (objc_push_parm): If we change the type of the decl, relayout the decl. 2006-09-26 Andrew Pinski <pinskia@physics.uc.edu> PR objc/29195 * objc/compile/method-1.m: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/objc/compile/method-1.m - copied unchanged from r117229, trunk/gcc/testsuite/objc/compile/method-1.m Modified: branches/gcc-4_1-branch/gcc/objc/ChangeLog branches/gcc-4_1-branch/gcc/objc/objc-act.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed.