------- Additional Comments From hubicka at ucw dot cz  2005-01-12 23:47 -------
Subject: Re:  [4.0 Regression] ICE in make_decl_rtl with inliner

Hi,
the problem is retval being mapped to &temporary.  When copy_body_p
replaces retval by this expression, the addr_expr is walked recursively
and temporary is not in the decl map so it is remapped to newly
allocated decls that never gets placed in bind_expr.

I think we either can insert map temporary == temporary when creating
the expression or avoid recursing when remapping happens.  The seconds
sounds cheaper and I think it is valid, so I am testing the attached
fix.  I am not familiar with inliner implementation enought to say for
sure that we never recurse into the replacements for reason tought.

Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.162
diff -c -3 -p -r1.162 tree-inline.c
*** tree-inline.c       4 Jan 2005 01:54:25 -0000       1.162
--- tree-inline.c       12 Jan 2005 23:43:04 -0000
*************** copy_body_r (tree *tp, int *walk_subtree
*** 503,508 ****
--- 503,509 ----
        /* Replace this variable with the copy.  */
        STRIP_TYPE_NOPS (new_decl);
        *tp = new_decl;
+       *walk_subtrees = 0;
      }
    else if (TREE_CODE (*tp) == STATEMENT_LIST)
      copy_statement_list (tp);



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19241

Reply via email to