https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78804

--- Comment #20 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to jos...@codesourcery.com from comment #17)
> Presumably the bit-field issue is RX defaulting to MS bit-field layout 
> (rx_is_ms_bitfield_layout suggests making the structure itself packed 
> should help).

Yep, the following also fixes the issue.

Index: libgcc/fp-bit.h
===================================================================
--- libgcc/fp-bit.h     (revision 251045)
+++ libgcc/fp-bit.h     (working copy)
@@ -355,7 +355,7 @@
 #endif

 #ifdef FLOAT_BIT_ORDER_MISMATCH
-  struct
+  struct __attribute__((__packed__))
     {
       fractype fraction:FRACBITS __attribute__ ((packed));
       unsigned int exp:EXPBITS __attribute__ ((packed));
@@ -365,7 +365,7 @@
 #endif

 #ifdef _DEBUG_BITFLOAT
-  struct
+  struct __attribute__((__packed__))
     {
       unsigned int sign:1 __attribute__ ((packed));
       unsigned int exp:EXPBITS __attribute__ ((packed));
@@ -373,7 +373,7 @@
     }
   bits_big_endian;

-  struct
+  struct __attribute__((__packed__))
     {
       fractype fraction:FRACBITS __attribute__ ((packed));
       unsigned int exp:EXPBITS __attribute__ ((packed));


But what's the point of having the bit-field code for little endian, while
there is already shift-and-mask code for big endian?

Reply via email to