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


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