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: Wed, 1 May 2002 08:03:07 -0400
- Subject: Re: [ast-optimizer-branch] More simplification fixes [patch]
- Organization: Red Hat Canada
- References: <20020501003224.GA15531@tornado.toronto.redhat.com> <Pine.LNX.4.44.0205010218140.6258-100000@dberlin.org>
On Wed, 01 May 2002, Daniel Berlin wrote:
> On Tue, 30 Apr 2002, Diego Novillo wrote:
>
> > This patch gets us almost all the way through stage1. There is
> > no new functionality, just bug fixes.
>
> Are you bootstrapping without checking on?
>
Yup. I caught several bugs that way.
$ grep _CHECKING auto-host.h
#define ENABLE_CHECKING 1
#define ENABLE_TREE_CHECKING 1
/* #undef ENABLE_RTL_CHECKING */
#define ENABLE_GC_CHECKING 1
> All the checking macros use statement expressions, and you didn't seem to
> add proper support for them yet in the patch below, so i can't see how it
> gets you that far with checking on.
>
Statement expressions are handled by recursively simplifying the
body of the expression from simplify_expr(). Here's an example
function from c-semantics.c:
-----------------------------------------------------------------------------
add_stmt() (ORIGINAL)
{
[ ... ]
if (current_function_decl != 0)
++*(
{
union tree_node * __t = current_function_decl;
if (*__t.common.code != 30)
tree_check_failed (__t, 30, "/home/dnovillo/ast-optimizer-branch/src/gcc/c-semantics.c", 95, "add_stmt");
__t;
}
).decl.u1.i;
return t;
}
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? I don't particularly
like the way we deal with stmt expressions now. I'd like the
simplifier to make them go away, but ignoring them now is easier.
Thanks. Diego.