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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
diff --git a/gcc/stor-layout.cc b/gcc/stor-layout.cc
index 45bf2d18639..b44335dd406 100644
--- a/gcc/stor-layout.cc
+++ b/gcc/stor-layout.cc
@@ -3089,7 +3089,8 @@ get_best_mode (int bitsize, int bitpos,
            causes store_bit_field to keep a 128-bit memory reference,
            so that the final bitfield reference still has a MEM_EXPR
            and MEM_OFFSET.  */
-        && GET_MODE_ALIGNMENT (mode) <= align
+        && (GET_MODE_ALIGNMENT (mode) <= align
+            || (!STRICT_ALIGNMENT && currently_expanding_to_rtl))
         && GET_MODE_BITSIZE (mode) <= largest_mode_bitsize)
     {
       *best_mode = mode;


Should fix it, I still need to update the comment since it does say the check
should be disable while expanding and that is what the above does ...

To get rid of the check the rest of the way is remove part of fold which does
the comparison combing which I think might be too early to that ...

Reply via email to