http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46888
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-11-13 01:18:52 UTC --- http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00952.html Will improve the testcase at the tree level for little-endian: _4 = (unsigned char) a_3(D); _5 = (<unnamed-unsigned:5>) _4; BIT_FIELD_REF <D.1727, 10, 0> = 65; D.1727.c = 3; D.1727.d = _5; return D.1727; And will fix it on big-endian: D.1354_2 = (unsigned char) a_1(D); D.1355_3 = (<unnamed-unsigned:5>) D.1354_2; BIT_FIELD_REF <D.1356, 15, 0> = 1091; D.1356.d = D.1355_3;