Testing m68k changes on AmigaOS and Linux/m68k
Bernardo Innocenti
bernie@develer.com
Sat Oct 25 06:04:00 GMT 2003
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
More information about the Gcc
mailing list