This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Removing useless/redundant "const" calls
- From: Michael Matz <matz at suse dot de>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Jun 2003 08:44:20 +0200 (CEST)
- Subject: Re: [tree-ssa] Removing useless/redundant "const" calls
Hi,
On Wed, 11 Jun 2003 law@redhat.com wrote:
> This is the final patch needed to allow the compiler to remove
> useless or redundant calls to "const" functions. It fixes
> gcc.dg/tree-ssa/20030611-1.c.
There is no reason to not also remove useless calls to "pure" functions.
They too have by definition no side-effects. Sure, they can read global
memory (and hence proving "redundant" is harder), but this isn't a
side-effect in the sense that it prevents removal. So, shouldn't
TREE_SIDE_EFFECTS also be cleared for pure functions?
Ciao,
Michael.