This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/17112] Copying of packed bitfields is wrong


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]