This is the mail archive of the gcc@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]

Re: Testing m68k changes on AmigaOS and Linux/m68k


Gunther Nikl wrote:

With the varargs form, the compiler will push all arguments on the
stack before calling foo(), effectively wasting the same amount of
stack space of the local array.

The array is allocated at _frame generation_. Now imagine using a lot of such calls where every array is only used _one_ time. The varargs form uses the stackspace only temorary when making the call and cleans up soon after the call returns.

I should have guessed GCC would handle it like that. However, since the scope of the array is within a nested block, a smarter compiler might do the right thing. That's another missing optimization.

And, btw, SAS/C did it right ;-)

--
 // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html




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