This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17112] Copying of packed bitfields is wrong
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2004 13:03:40 -0000
- Subject: [Bug middle-end/17112] Copying of packed bitfields is wrong
- References: <20040819232250.17112.gene@digilicious.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From roger at eyesopen dot com 2004-09-23 13:03 -------
As far as the RTL expansion is concerned the problem seems to be that we're
wrapping a 32-bit component-ref around a 24-bit array-ref, such that bitsize
in store_bit_field is 32. I've also confirmed that this behaviour is common
to both the C and C++ front-ends.
If the assignment is changed to y[1].int24 = x[1].int24 (in both C and C++)
everything works as expected (though the generated code looks fairly hideous,
but I know how to fix that :>). This is why the explicit assignment operator works
in C++, it copies the field and not the structure. Now to work out where the
component_ref with the incorrect tree type is coming from...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17112