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


Jan Hubicka <hubicka@ucw.cz> writes:

> Are you really sure we want to clear alloca too?  It has side effect.
> Only I know that given the semantic of alloca the side effect is useless
> when return value is thrown away.

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.

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.

zw


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