[ast-optimizer-branch] Bootstrap fixes [patch]

Daniel Berlin dberlin@dberlin.org
Tue May 7 15:42:00 GMT 2002


On 7 May 2002, Diego Novillo wrote:

> On Tue, 2002-05-07 at 14:41, Daniel Berlin wrote:
> 
> > I only need to disable simplify_self_mod_expr and simplify_save_expr to be 
> > able to bootstrap before.
> > 
> > This includes simplifying statement expressions.
> > 
> Oh, that's good news.  Could you post the patch?  I'm now tracking the
> C++ library failure.
> 

It's actually all about handling save_expr's properly.

If you add 
   if (TREE_CODE (TREE_OPERAND (expr, 0)) == SAVE_EXPR)
        expr_s = expr;
      else
        expr_s = copy_node (expr);

to all the cases where we do
expr_s = expr, except the default case, and remove the 
expr_s = copy_node (expr)  at the top, it works.


This is because it's not really bugs in simplification causing errors, 
AFAICT,it's sharing of nodes and in particular, sharing of things pointing to 
save_exprs f*cking us over.

I'll post a patch that does the above ugly crap, if you like, but it's an 
obvious hack.

If you s/expr_s = copy_node (expr)/expr_s = expr/g , you'll get cute 
crashes.

SAVE_EXPR's wouldn't be so bad, it's that the references to them are 
shared as well (IE an INDIRECT_REF pointing to a SAVE_EXPR is shared, 
rather than having two seperate INDIRECT_REF's pointing to the same 
SAVE_EXPR).

It's an ugly hack.

I've a got a slightly less ugly version that doesn't do that, it does it 
at the top.

But all my changes are related to when we copy nodes, nothing more.
--Dan




More information about the Gcc-patches mailing list