Bug 76008

Summary: bit fileds in derived class cause gcc to fail
Product: [Retired] Red Hat Linux Reporter: Yue Luo <luo>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-16 01:32:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yue Luo 2002-10-15 18:44:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0; Q312461)

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. My gcc -v shows:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-112)

2. Try complie the following program (bit_field.cc):

#include <stdio.h>
class __attribute__((packed))base {
public:
  int b1:2;
  int b2:1;
};

class __attribute__((packed)) bitf1:public base{
public:
  int m1:2;
  int m2:3;
};

int main(){
  bitf1 a;
  a.m1=1;
  printf("sizeof(bitf1)=%d\n", sizeof (bitf1));
  return 0;
}

3. You will get:
bit_field.cc:8: Internal compiler error in tree_low_cst, at tree.c:4325
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Additional info:

Comment 1 Alan Cox 2002-12-16 01:32:02 UTC
Tests ok with g++ 3.2 / RH 8.0