https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65956
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Untested fix:
--- gcc/tree-sra.c.jj 2015-04-20 14:35:47.000000000 +0200
+++ gcc/tree-sra.c 2015-05-01 01:08:34.092636496 +0200
@@ -4427,7 +4427,11 @@ turn_representatives_into_adjustments (v
gcc_assert (repr->base == parm);
adj.base_index = index;
adj.base = repr->base;
- adj.type = repr->type;
+ /* Drop any special alignment on the type if it's not on the
+ main variant. This avoids issues with weirdo ABIs like
+ AAPCS. */
+ adj.type = build_qualified_type (TYPE_MAIN_VARIANT (repr->type),
+ TYPE_QUALS (repr->type));
adj.alias_ptr_type = reference_alias_ptr_type (repr->expr);
adj.offset = repr->offset;
adj.by_ref = (POINTER_TYPE_P (TREE_TYPE (repr->base))
Though, wonder how many workaround we'll need for this AAPCS bogosity :(.