------- Comment #7 from jakub at gcc dot gnu dot org  2010-09-16 11:57 -------
For the ix86/x86_64 alignment issue, I believe the problem here is that
      max_align = MAX (crtl->max_used_stack_slot_alignment,
                       PREFERRED_STACK_BOUNDARY);
is fine for !SUPPORTS_STACK_ALIGNMENT targets, but for ix86/x86_64 if
max_used_stack_slot_alignment is really small, we might end up with deciding to
use a smaller alignment.
Perhaps for SUPPORTS_STACK_ALIGNMENT we should use here instead
max_align = MAX (crtl->max_used_stack_slot_alignment,
                 INCOMING_STACK_BOUNDARY);
and if the align we compute is bigger than crtl->max_used_stack_slot_alignment
ensure we will keep using that alignment (e.g. by bumping also
crtl->stack_align_needed/estimated).  If INCOMING_STACK_BOUNDARY is 128 bits
aligned, I think using 128 bit alignment shouldn't cost us anything extra.
The problem with using INCOMING_STACK_BOUNDARY is that it is on ix86/x86-64
computed only too late (in expand_stack_alignment by
targetm.calls.update_stack_boundary (); ).  The comment above it says it is
computed again, but I can't actually find another call.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45678

Reply via email to