This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Loop clean up fixes
>>>>> "Alexandre" == Alexandre Oliva <oliva@lsd.ic.unicamp.br> writes:
Alexandre> On Jan 19, 2000, Michael Hayes
Alexandre> <m.hayes@elec.canterbury.ac.nz> wrote:
>> + loop->info = (struct loop_info *) alloca (sizeof (struct
>> loop_info)); + memset (loop->info, 0, sizeof (struct
>> loop_info));
Alexandre> Do we really have to use alloca? Mark Mitchell has
Alexandre> recently killed a lot of situations in which it was
Alexandre> used, in favor of garbage-collectable memory regions,
Alexandre> or at least in favor of explicit memory management.
Alexandre> How's that for you?
Yes. I really think we should use alloca in no new places in GCC.
The only good uses of it are things like temporary string buffers --
and even those are usually easily handled either via GC or with
explicit malloc and free.
If there's any possibility at all that the amount of space allocated
grows in an arbitrary way (say that if there were 100,000 nested loops
then there would be 100,000 alloca's active) then we shouldn't use it.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com