This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] dead const/pure/alloca call removal
> "Zack Weinberg" <zack@codesourcery.com> writes:
>
> > I don't know what the right thing is, but I'd point out that this
> > optimization applies to all functions whose side effect is to
> > allocate a new block of memory, the sole pointer to which is
> > returned. malloc and calloc (but not realloc) are the obvious
> > examples.
>
> No, they set errno.
>
> > However, I am a little worried about deleting calls to memory
> > allocation functions whose return value is discarded. People may be
> > doing clever things, like using a dummy call to alloca to force
> > extra stack alignment.
>
> I don't understand how one could use alloca to force stack
> alignment...
By relaying on knowledge of GCC internal implementation that does align
stack boundary to some alignment supplied by machine description.
This one may be greater than one specified by ABI (for i386 ABI specify
4 bytes, while alloca does 16)
Honza
>
> --
> Falk