Bug 10549 - [3.3/3.4 regression] ICE in store_bit_field on bitfields that exceed the precision of the declared type.
Summary: [3.3/3.4 regression] ICE in store_bit_field on bitfields that exceed the prec...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 3.3
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-04-29 18:46 UTC by Gabriel Dos Reis
Modified: 2004-07-13 17:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
1.C (279 bytes, application/octet-stream)
2003-05-21 15:17 UTC, Gabriel Dos Reis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Dos Reis 2003-04-29 18:46:00 UTC

Release:
3.x

Environment:
I believe plateform independent

How-To-Repeat:
Compile the snippet in attachement.
Comment 1 Gabriel Dos Reis 2003-04-29 18:46:00 UTC
Fix:
http://gcc.gnu.org/ml/gcc-patches/2003-04/msg02184.html
Comment 2 Wolfgang Bangerth 2003-04-29 19:07:31 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. Too bad, another regression (this worked in 3.0,
    but ICEs in 3.2, 3.3 and 3.4. This is the shortest one
    can get:
    --------------------------
    union u1 {
       char m1 : 16;
    } x;
    
    int main () {
       x.m1 = 256;
    }
    ------------------------
    g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
    x.cc:2: warning: width of `u1::m1' exceeds its type
    x.cc: In function `int main()':
    x.cc:6: internal compiler error: in store_bit_field, at expmed.c:668
    
    
    W.
Comment 3 Mark Mitchell 2003-04-29 20:48:26 UTC
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-Why: Working on a fix.
Comment 4 Mark Mitchell 2003-04-29 21:28:41 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10549
Date: 29 Apr 2003 21:28:41 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-04-29 21:28:41
 
 Modified files:
 	gcc/cp         : ChangeLog class.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/other: bitfield1.C 
 
 Log message:
 	PR c++/10549
 	* class.c (layout_class_type): Mark overlong bitfields as having
 	the maximum size permitted by their type, after layout.
 	
 	PR c++/10549
 	* g++.dg/other/bitfield1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3350&r2=1.3351
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.534&r2=1.535
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2633&r2=1.2634
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/bitfield1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 5 Mark Mitchell 2003-04-29 21:28:41 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10549
Date: 29 Apr 2003 21:28:41 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-04-29 21:28:41
 
 Modified files:
 	gcc/cp         : ChangeLog class.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/other: bitfield1.C 
 
 Log message:
 	PR c++/10549
 	* class.c (layout_class_type): Mark overlong bitfields as having
 	the maximum size permitted by their type, after layout.
 	
 	PR c++/10549
 	* g++.dg/other/bitfield1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3350&r2=1.3351
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.534&r2=1.535
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2633&r2=1.2634
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/bitfield1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 6 Mark Mitchell 2003-04-29 21:34:50 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10549
Date: 29 Apr 2003 21:34:50 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-29 21:34:50
 
 Modified files:
 	gcc/cp         : ChangeLog class.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/other: bitfield1.C 
 
 Log message:
 	PR c++/10549
 	* class.c (layout_class_type): Mark overlong bitfields as having
 	the maximum size permitted by their type, after layout.
 	
 	PR c++/10549
 	* g++.dg/other/bitfield1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.124&r2=1.3076.2.125
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.499.2.12&r2=1.499.2.13
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.161&r2=1.2261.2.162
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/bitfield1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 

Comment 7 Mark Mitchell 2003-04-29 21:34:50 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10549
Date: 29 Apr 2003 21:34:50 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-29 21:34:50
 
 Modified files:
 	gcc/cp         : ChangeLog class.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/other: bitfield1.C 
 
 Log message:
 	PR c++/10549
 	* class.c (layout_class_type): Mark overlong bitfields as having
 	the maximum size permitted by their type, after layout.
 	
 	PR c++/10549
 	* g++.dg/other/bitfield1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.124&r2=1.3076.2.125
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.499.2.12&r2=1.499.2.13
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.161&r2=1.2261.2.162
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/bitfield1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 
Comment 8 Mark Mitchell 2003-04-29 21:38:27 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in GCC 3.3, GCC 3.4.