This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9704: [3.3/3.4 regression] miscompilation of classes with bit fields
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mark at codesourcery dot com, matz at suse dot de, mmitchel at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 14 Feb 2003 22:14:06 -0000
- Subject: Re: c++/9704: [3.3/3.4 regression] miscompilation of classes with bit fields
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mark at codesourcery dot com, matz at suse dot de, mmitchel at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: miscompiles openoffice (deals with bitfield members)
New Synopsis: [3.3/3.4 regression] miscompilation of classes with bit fields
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-By: bangerth
Responsible-Changed-When: Fri Feb 14 22:14:05 2003
Responsible-Changed-Why:
Possibly the one who's guilty ;-)
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Feb 14 22:14:05 2003
State-Changed-Why:
Confirmed. Cleaned-up code:
--------------------------
extern "C" void abort(void);
struct Dummy {
void *p;
Dummy() {}
Dummy(const Dummy&) {}
};
struct X {
int :1;
int n:1;
X () : n(1) {}
};
struct Y {
Dummy dummy;
X x;
};
int main()
{
Y y1;
Y y2(y1);
if (y1.x.n != y2.x.n)
abort ();
}
------------------------------
This aborts with 3.3 and 3.4, though it shouldn't, of
course (original and copy should be equal).
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9704