This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/79697] unused realloc(0, n) not eliminated


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79697

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #5)
> Why do we have to special case these functions?  Why can't we do this for
> all functions that are marked as const/pure, since we know they have no side
> effects other than their return value?

* I expect we already optimize pure/const functions. Do you have an example
where we don't?
* malloc, strdup, etc are not pure!

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