Bug 29195 - [4.1 Regression] ICE in expand_expr_real_1, at expr.c:6932
Summary: [4.1 Regression] ICE in expand_expr_real_1, at expr.c:6932
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.2
Assignee: Andrew Pinski
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-09-23 20:29 UTC by Martin Michlmayr
Modified: 2006-10-03 16:24 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.0 4.2.0
Known to fail: 4.1.0
Last reconfirmed: 2006-09-24 02:37:21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-09-23 20:29:14 UTC
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;
}
Comment 1 Andrew Pinski 2006-09-24 02:37:21 UTC
Confirmed, reduced testcase:
@ implementation NGActiveSocket
+ (void) socketPair:(int [2])
     _pair
{
  _pair[0] = 0;
}
@end

------
I think this is an objc only bug.
Comment 2 Andrew Pinski 2006-09-24 02:50:27 UTC
The problem is that the decl mode is DImode which is wrong.
Comment 3 Andrew Pinski 2006-09-24 02:56:38 UTC
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.
Comment 4 Andrew Pinski 2006-09-24 02:59:29 UTC
objc_push_parm is borken for other problems, guess I have to fix the other problems too.
Comment 5 Andrew Pinski 2006-09-24 03:01:01 UTC
(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.
Comment 6 Andrew Pinski 2006-09-26 15:36:30 UTC
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

Comment 7 Andrew Pinski 2006-10-03 16:23:57 UTC
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

Comment 8 Andrew Pinski 2006-10-03 16:24:37 UTC
Fixed.