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:29:06 -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:29 -------
Giovanni is probably right about BLKmode. I believe the problem is in expr.c's
get_inner_reference which is given a type whose size field is explicitly
(const_int 24), but unless the mode is BLKmode, the code insists that the
bitsize is the GET_MODE_BITSIZE(mode).
expr.c:5348 onwards is:
if (mode == BLKmode)
size_tree = TYPE_SIZE (TREE_TYPE (exp));
else
*pbitsize = GET_MODE_BITSIZE (mode);
I believe that a possible cure would be
if (mode != BLKmode)
*pbitsize = GET_MODE_BITSIZE (mode);
size_tree = TYPE_SIZE (TREE_TYPE (exp));
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17112