This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] tree-ssa vs. fold
- From: Jason Merrill <jason at redhat dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 28 Jun 2003 21:57:52 -0400
- Subject: Re: [tree-ssa] tree-ssa vs. fold
- References: <Pine.LNX.4.44.0306282038520.28765-100000@ops2.one-point.com>
On Sat, 28 Jun 2003 20:55:25 -0400 (EDT), Jeff Sturm <jsturm@one-point.com> wrote:
> On Sat, 28 Jun 2003, Jason Merrill wrote:
>> How about checking TREE_SIDE_EFFECTS instead of looking for SSA_NAME?
>
> If we can be confident that TREE_SIDE_EFFECTS == TREE_THIS_VOLATILE for
> GIMPLE binop nodes
A GIMPLE binop node can never have side effects; as of my recent change to
is_gimple_val, a volatile decl will be copied into a temporary.
> * fold-const.c (fold): Don't save_expr unless TREE_SIDE_EFFECTS.
OK.
> * tree-ssa.c (rewrite_and_optimize_stmt): Check has_volatile_ops
> before folding.
I don't think this is necessary anymore.
Jason