This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/79697] unused realloc(0, n) not eliminated
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Feb 2017 20:00:51 +0000
- Subject: [Bug tree-optimization/79697] unused realloc(0, n) not eliminated
- Auto-submitted: auto-generated
- References: <bug-79697-4@http.gcc.gnu.org/bugzilla/>
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!