public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: woudshoo@xs4all.nl To: gcc-gnats@gcc.gnu.org Subject: objc/3822: gcc crashes when compiling class that contains bitfield with enums Date: Wed, 25 Jul 2001 13:46:00 -0000 [thread overview] Message-ID: <20010725204319.16791.qmail@sourceware.cygnus.com> (raw) >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:
next reply other threads:[~2001-07-25 13:46 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-07-25 13:46 woudshoo [this message] 2002-07-03 6:13 sayle
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010725204319.16791.qmail@sourceware.cygnus.com \ --to=woudshoo@xs4all.nl \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).