This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] More simplification fixes [patch]
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 01 May 2002 10:00:33 -0400
- Subject: Re: [ast-optimizer-branch] More simplification fixes [patch]
- References: <Pine.LNX.4.44.0205010931280.2938-100000@dberlin.org>
On Wed, 2002-05-01 at 09:32, Daniel Berlin wrote:
> > add_stmt() (SIMPLIFIED)
> > {
> > [ ... ]
> > if (current_function_decl != 0)
> > {
> > T.23 = (
> > {
> > union tree_node * __t = current_function_decl;
> > T.21 = *__t.common.code;
> > T.22 = T.21 != 30;
> > if (T.22 != 0)
> > {
> > T.17 = "/home/dnovillo/ast-optimizer-branch/src/gcc/c-semantics.c";
> > T.18 = T.17;
> > T.19 = "add_stmt";
> > T.20 = T.19;
> > tree_check_failed (__t, 30, T.18, 95, T.20);
> > }
> > __t;
> > }
> > );
> > T.24 = *T.23.decl.u1.i;
> > *T.23.decl.u1.i = T.24 + 1;
> > *T.23.decl.u1.i;
> > }
> > return t;
> > }
> > -----------------------------------------------------------------------------
> >
> > But maybe there's something I'm missing?
>
> That's an *awfully* complex right hand side of T.23. My question is
> whether it's valid SIMPLE.
>
It is valid SIMPLE for the time being. We have temporarily defined a
statement expression to be in SIMPLE form if the contained statement is
in SIMPLE form.
int
is_simple_unary_expr (t)
tree t;
{
[ ... ]
/* Additions to the original grammar. FIXME: Statement-expressions should
really be expanded. */
if (TREE_CODE (t) == STMT_EXPR
&& is_simple_stmt (STMT_EXPR_STMT (t)))
return 1;
[ ... ]
}
This is why I mentioned that we need to take them appart when
simplifying. We need to decide how we are going to deal with the
variables declared inside statement expressions, for instance.
Diego.