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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
It might be possible to re-write the aarch64 assert to be instead

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index f4ef22ce02f..9da46a5e45d 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -7489,13 +7489,15 @@ aarch64_function_arg_alignment (machine_mode mode,
const_tree type,
         any attributes applied.  Normally this is the alignment of the
         TYPE_MAIN_VARIANT, but not always; see PR108910 for a counterexample.
         For now we just handle the known exceptions explicitly.  */
+      tree orig_type = type;
       type = TYPE_MAIN_VARIANT (type);
       if (POINTER_TYPE_P (type))
        {
          gcc_assert (known_eq (POINTER_SIZE, GET_MODE_BITSIZE (mode)));
          return POINTER_SIZE;
        }
-      gcc_assert (!TYPE_USER_ALIGN (type));
+      gcc_assert (TYPE_ALIGN (type) == TYPE_ALIGN (orig_type)
+                 || TYPE_USER_ALIGN (orig_type));
       return TYPE_ALIGN (type);
     }

I'm not sure if that captures the original intent of the assert though.
Maybe instead || !TYPE_USER_ALIGN (type)?

Reply via email to