------- Comment #12 from hubicka at ucw dot cz 2010-04-26 14:27 ------- Subject: Re: [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation due to extra stack alignment
> That is true. For tail call, we only need to align outgoing stack to > minimum of maximum local stack alignment and incoming stack alignment. Well, the tail call gets the same stack alignment as the function itself, so I guess when expanding a tail call, we need to bump up the incomming stack alignment to one needed by the call. We should special case the self recursion and do nothing in case of tail calls and in case of normal calls. In normal self recursive calls we need to remember the fact that function is self recursive and when finalizing be sure that outgoing stack alignment is at least as good as incomming. This can not be decided at expansion time since we do not know yet what alignment function has. Old preferred alignment code had this logic, I guess somehow this got broken during the merge of stack alignment branch? Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43884