On Tue, Jul 1, 2025 at 9:37 PM Jason Merrill <ja...@redhat.com> wrote: > > On 6/30/25 7:03 PM, H.J. Lu wrote: > > On Mon, Jun 30, 2025 at 10:36 PM Jason Merrill <ja...@redhat.com> wrote: > >> > >> On 6/28/25 7:00 AM, H.J. Lu wrote: > >>> Since a backend may ignore user type alignment for arguments passed on > >>> stack, check backend for argument alignment on stack when evaluating > >>> __alignof. > >> > >> I assume that's reflected in DECL_ALIGN, so could we just add PARM_DECL to > > > > No. targetm.calls.function_arg_boundary may have special handling for it. > > Why wouldn't we adjust DECL_ALIGN of the PARM_DECL to reflect the actual > alignment of the argument? Are you saying it could be different from > one call to another?
Function argument alignment is different from other places in memory if the main variant type alignment is different: tatic unsigned int ix86_function_arg_boundary (machine_mode mode, const_tree type) { unsigned int align; if (type) { /* Since the main variant type is used for call, we convert it to the main variant type. */ type = TYPE_MAIN_VARIANT (type); align = TYPE_ALIGN (type); if (TYPE_EMPTY_P (type)) return PARM_BOUNDARY; } > >>> else if (VAR_OR_FUNCTION_DECL_P (expr)) > >>> t = size_int (DECL_ALIGN_UNIT (expr)); > >> > >> ? > >> > >> Jason > >> > > > > > -- H.J.