------- Comment #12 from hjl dot tools at gmail dot com 2008-08-04 19:38
-------
(In reply to comment #11)
> (In reply to comment #10)
> > Did you mean we needed 2 "additional 'and $-16, sp" insns to align the
> > stack? I don't think so.
> Definitely not.
> Solution 1: Just ignore it. __m128 parameter shouldn't be passed with
> -mpreferred-stack-boundary=2, or
That will defeat the whole purpose for stack alignment. How do you
align __m1256 when -mpreferred-stack-boundary=4?
> Solution 2. Record max alignment of all outgoing parameter, and
> crtl->preferred_stack_boundary >= max_parameter_alignment
crtl->preferred_stack_boundary is correct.
I think the problem is in
/* Set offset to aligned because the realigned frame tarts from here. */
if (stack_realign_fp)
offset = (offset + stack_alignment_needed -1) & -stack_alignment_needed;
This code assumes that offset 0 is properly aligned to any alignment,
which isn't true. It happens to work with -maccumulate-outgoing-args.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37010