https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120839
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #4)
> User alignment is ignored for parameters passed on stack:
>
> static 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
> align = GET_MODE_ALIGNMENT (mode);
>
> But RTL expansion has
>
> (insn 5 2 6 2 (set (reg:XF 100)
> (mem/c:XF (reg/f:DI 92 virtual-incoming-args) [1 f.a+0 S16 A256]))
> "x.c":9:8 -1
> (nil))
>
> It should be A128, not A256.
Either the ABI says the stack slot needs to be aligned according to the type
(from experiments it seems it is?), then the above looks wrong and alignment
needs to be taken from the formal argument type. Or the ABI does not
gurarantee
this, then the backend has to arrange for a callee copy to a stack slot
of appropriate alignment.