http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50325

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org

--- Comment #17 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-11-19 
18:38:48 UTC ---
> we are talking about bit fields - i.e contiguous blocks of bits - so, if 
> memory
> serves me correctly, we are not in the realm of padding rules  (but I need to
> double-check the ABI doc).
> 
> so:
> 
> When BIG-Endian && !BLKMode ... you are copying the data in reverse order
> (pushing the bitfield into the least significant bits of the destination) -
> ergo the remaining fragment needs to be stored at the "higher" sub-address of
> the fragmented last word.
> 
> When BE && BLKmode you are copying in ascending address order (i.e. aligning
> the bits to the MS) .. ergo the remaining fragment needs to be copied to the
> "lower" sub-address of the last fragmented word.

In any case, the new code probably needs to be coordinated with this:

      /* Here we transfer the words of the field
     in the order least significant first.
     This is because the most significant word is the one which may
     be less than full.
     However, only do that if the value is not BLKmode.  */

      unsigned int backwards = WORDS_BIG_ENDIAN && fieldmode != BLKmode;

Reply via email to