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

--- Comment #2 from Bernd Edlinger <edlinger at gcc dot gnu.org> ---
Hmm, for whatever reason the decl-align of the
"to" is 256 bit normally but when -fpack-struct
is used only 8 bit aligned, but it is a reg.

The reason for the ICE is that the movmisalign
optab is rightfully confused when it is invoked
with reg + reg.

I think the following should fix the ICE:

Index: expr.c
===================================================================
--- expr.c      (revision 275063)
+++ expr.c      (working copy)
@@ -5004,7 +5004,8 @@ expand_assignment (tree to, tree from, bool nontem
        || TREE_CODE (to) == TARGET_MEM_REF
        || DECL_P (to))
       && mode != BLKmode
-      && (DECL_P (to) || !mem_ref_refers_to_non_mem_p (to))
+      && (DECL_P (to) ? MEM_P (DECL_RTL (to))
+                     : !mem_ref_refers_to_non_mem_p (to))
       && ((align = get_object_alignment (to))
          < GET_MODE_ALIGNMENT (mode))
       && (((icode = optab_handler (movmisalign_optab, mode))

Reply via email to