This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/47581] [4.6 regression] Unnecessary adjustments to stack pointer


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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-02 12:12:23 UTC ---
(In reply to comment #3)
> Before Richard's commit apparently expand_one_var wasn't updating
> stack_alignment_needed, just stack_alignment_estimated, now it updates both.
> As PREFERRED_STACK_BOUNDARY is 128 (the default), ix86_minimum_alignment:
>   if (TARGET_64BIT || align != 64 || ix86_preferred_stack_boundary >= 64)
>     return align;
> returns 64 instead of 32.
> 
> So, to fix this, either the stack_alignment_needed updating in expand_one_var
> isn't strictly necessary and we could undo that part of the changes.
> 
> Or return 32 as MINIMUM_ALIGNMENT for DImode long long even for
> ix86_preferred_stack_boundary >= 64.
> 
> Or we could perhaps the
>   /* Align start of frame for local function.  */
>   offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed;
> in ix86_compute_frame_layout perform only if
>   if (offset != frame->sse_reg_save_offset
>       || size != 0
>       || !current_function_is_leaf
>       || cfun->calls_alloca
>       || ix86_current_function_calls_tls_descriptor)
> (i.e. if frame size is 0 and no outgoing calls, it doesn't make sense to
> align).

I think we align the stack for reload (which might still happen without
outgoing calls, simply with enough register pressure).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]