This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Bootstrap failure on powerpc-apple-darwin


> > The tree-ssa branch has a bootstrap failure on 
> > powerpc-apple-darwin7.0.0.
> > 
> > The compiler goes into an infinite loop in decl_function_context with 
> > the following reduced source code:
> > extern void gen_movstrsi_8reg (void);
> > int expand_block_move (int i)
> > {
> >     int bytes;
> >     {
> >         union {
> >             void (*movstrsi) (void);
> >         } gen_func;
> >         gen_func.movstrsi = gen_movstrsi_8reg;
> >         (*gen_func.movstrsi) ();
> >     }
> > 
> >     return 1;
> > }
> 
> Hi,
> I got suck here.  It seems to be related to Richard's double linking
> work, but I am not quite sure.
> The problem is that we get block whose supercontext is pointing to
> itself.  This happens because we re-gimplify bind_expr.  I am attaching
> simple patch to make re-gimplification happen properly, but the reason
> why we re-gimplify is still behind me.
> It happens wen the function itself does:
>   lower_stmt_body (&BIND_EXPR_BODY (stmt), data);
> the first stamement of BIND_EXPR_BODY seems to be the BIND_EXPR itself
> that looks very wrong, but I can't figure out how it happens.
> I am also no longer able to dump the insn chains.  How this is done?
The patch...

Index: gimple-low.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimple-low.c,v
retrieving revision 1.1.4.11
diff -c -3 -p -r1.1.4.11 gimple-low.c
*** gimple-low.c	12 Nov 2003 22:06:25 -0000	1.1.4.11
--- gimple-low.c	15 Nov 2003 01:06:12 -0000
*************** lower_bind_expr (tree_stmt_iterator *tsi
*** 157,163 ****
    tree old_block = data->block;
    tree stmt = tsi_stmt (*tsi);
  
!   if (BIND_EXPR_BLOCK (stmt))
      {
        data->block = BIND_EXPR_BLOCK (stmt);
  
--- 157,163 ----
    tree old_block = data->block;
    tree stmt = tsi_stmt (*tsi);
  
!   if (BIND_EXPR_BLOCK (stmt) && BIND_EXPR_BLOCK (stmt) != old_block)
      {
        data->block = BIND_EXPR_BLOCK (stmt);
  
*************** expand_used_vars (void)
*** 339,345 ****
    cfun->unexpanded_var_list = nreverse (cfun->unexpanded_var_list);
  
    for (cell = cfun->unexpanded_var_list; cell; cell = TREE_CHAIN (cell))
!     expand_var (TREE_VALUE (cell));
  
    cfun->unexpanded_var_list = NULL_TREE;
  }
--- 339,355 ----
    cfun->unexpanded_var_list = nreverse (cfun->unexpanded_var_list);
  
    for (cell = cfun->unexpanded_var_list; cell; cell = TREE_CHAIN (cell))
!     if (TREE_CODE (TREE_VALUE (cell)) != FUNCTION_DECL)
!       expand_var (TREE_VALUE (cell));
! }
! void
! expand_nested_functions (void)
! {
!   tree cell;
! 
!   for (cell = cfun->unexpanded_var_list; cell; cell = TREE_CHAIN (cell))
!     if (TREE_CODE (TREE_VALUE (cell)) == FUNCTION_DECL)
!       expand_var (TREE_VALUE (cell));
  
    cfun->unexpanded_var_list = NULL_TREE;
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]