This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] BIND_EXPR removal
On Sun, Nov 02, 2003 at 12:29:12PM +0100, Zdenek Dvorak wrote:
> OK, the second attempt. It just records the variables in the gimple
> lowering phase, then expands those of them that were not optimized
> out afterwards (the code to determine this is taken from
> remove_unused_... in tree-cfg.c, so it should do exactly what we do now).
This seems ok for now.
About the only thing I'd change is to *not* keep the outermost
BIND_EXPR of the function, as you do. As far as I can tell, the
only difference this would make is that gimple_add_tmp_var would
add the variable to your list instead of either queue it in
gimplify_ctxp->temps or add it to that now missing bind_expr.
For the to-look-at-eventually list:
I've been wondering if we might be able to get better results
wrt aggregates if we associated basic blocks with scopes, and
constrained cfg operations to preserve that invariant. We might
be able to do reasoning such as noticing that
void f ()
We may tail-call to H because while we did leak local stack for
X into the global memory pool, it is no longer in scope, and so
a conforming program could not still access it.
We could compromise here too by only caring about scopes with
addressed variables. After all, this isn't particularly
interesting for non-addressed scalars.
Anyway, this isn't something that should slow up this patch.