This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: CALL_EXPR should set TREE_SIDE_EFFECTS
- From: Jason Merrill <jason at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Mark Mitchell <mitchell at codesourcery dot com>
- Date: Fri, 22 Aug 2003 10:51:31 -0400
- Subject: Re: [PATCH]: CALL_EXPR should set TREE_SIDE_EFFECTS
- References: <3F45D659.1020401@codesourcery.com>
On Fri, 22 Aug 2003 09:37:45 +0100, Nathan Sidwell <nathan@codesourcery.com> wrote:
> In tracking down the regressions I'v caused in C++ wrt no-effect
> expressions, I discovered that building a CALL_EXPR does not automatically
> set TREE_SIDE_EFFECTS. Both C & C++ frontends set it explicitly immediately
> afterwards (but C++ forgets a few places).
On the tree-ssa branch we've adopted the convention that a call to a const
function does not have TREE_SIDE_EFFECTS set. This could stay limited to
the optimizers, but it seems reasonable to warn about ignoring the return
value of a call to a const function.
Jason