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


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