https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162
--- Comment #24 from dave.anglin at bell dot net --- On 2021-09-01 8:23 p.m., pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162 > > --- Comment #23 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > (In reply to Andrew Pinski from comment #22) >> The problem is in emit-rtl.c in set_mem_attributes_minus_bitpos: >> >> /* We can set the alignment from the type if we are making an object or if >> this is an INDIRECT_REF. */ >> if (objectp || TREE_CODE (t) == INDIRECT_REF) >> attrs.align = MAX (attrs.align, TYPE_ALIGN (type)); >> >> >> The type here is not the correct thing to do. > This has been a bug since r0-38512 (2001). Excellent work! I assume attrs.align should only be set from type when it is not set.