public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: objc/3822: gcc crashes when compiling class that contains bitfield with enums
@ 2002-07-03 6:13 sayle
0 siblings, 0 replies; 2+ messages in thread
From: sayle @ 2002-07-03 6:13 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, woudshoo
Synopsis: gcc crashes when compiling class that contains bitfield with enums
State-Changed-From-To: open->closed
State-Changed-By: sayle
State-Changed-When: Wed Jul 3 06:13:40 2002
State-Changed-Why:
This PR has been fixed by Nicola Pero's 12 Dec 2001 patch.
I've confirmed that the ICE is no longer present on mainline.
Wed Dec 12 08:35:33 2001 Nicola Pero <n.pero@mi.flashnet.it>
* objc/objc-act.c (encode_complete_bitfield): Fixed encoding
enumeral types - encode them using 'i'.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3822
^ permalink raw reply [flat|nested] 2+ messages in thread
* objc/3822: gcc crashes when compiling class that contains bitfield with enums
@ 2001-07-25 13:46 woudshoo
0 siblings, 0 replies; 2+ messages in thread
From: woudshoo @ 2001-07-25 13:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 3822
>Category: objc
>Synopsis: gcc crashes when compiling class that contains bitfield with enums
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 25 13:46:04 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: woudshoo@xs4all.nl
>Release: gcc version 3.0
>Organization:
>Environment:
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc-3.0/configure --prefix=/usr --with-threads=posix : (reconfigured) ../gcc-3.0/configure --prefix=/usr --enable-threads
Thread model: posix
>Description:
compiling a class that contains a enum bitfield type crashes with the following error message (See source in How-To-Repeat):
PROMPT> gcc bugsource.m
bugsource.m:20: Internal compiler error in encode_complete_bitfield, at objc/objc-act.c:6879
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
>How-To-Repeat:
typedef enum
{
a, b
} countingType;
@interface Test
{
struct {
countingType x : 3;
} i;
}
@end
@implementation Test
@end
int main (void)
{
return 1;
}
>Fix:
Workaround: Do not use enum bitfields.
Partial fix: Apply the patch below following diff to objc/objc-act.c. Two remarks:
- I have no idea if this is a correct fix.
- If the fix is correct, it probably should also be applied to
encode_type and perhaps a few other places
-------------
*** gcc/objc/objc-act-orig.c Wed Jul 25 21:54:56 2001
--- gcc/objc/objc-act.c Wed Jul 25 21:55:50 2001
***************
*** 6830,6840 ****
static void
encode_complete_bitfield (int position, tree type, int size)
{
- enum tree_code code = TREE_CODE (type);
char buffer[40];
char charType = '?';
! if (code == INTEGER_TYPE)
{
if (integer_zerop (TYPE_MIN_VALUE (type)))
{
--- 6830,6839 ----
static void
encode_complete_bitfield (int position, tree type, int size)
{
char buffer[40];
char charType = '?';
! if (INTEGRAL_TYPE_P (type))
{
if (integer_zerop (TYPE_MIN_VALUE (type)))
{
***************
*** 6853,6858 ****
--- 6852,6859 ----
}
else if (TYPE_MODE (type) == DImode)
charType = 'Q';
+ else
+ abort ();
}
else
***************
*** 6872,6877 ****
--- 6873,6880 ----
else if (TYPE_MODE (type) == DImode)
charType = 'q';
+ else
+ abort ();
}
}
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-07-03 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-03 6:13 objc/3822: gcc crashes when compiling class that contains bitfield with enums sayle
-- strict thread matches above, loose matches on Subject: below --
2001-07-25 13:46 woudshoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).