This is the mail archive of the gcc-patches@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]

PR tree-optimization/19421


Hi,
I would say that I sent this while ago but but can't find it in the
archives.  Sorry for the duppe if I just missed it.

The problem is retval being mapped to "&this".  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 seem to be able to convince myself that we never need recursion on the substituted values.

Bootstrapped/regtested i686-linux, OK?

2005-01-25  Jan Hubicka  <jh@suse.cz>
	PR tree-optimization/19421
	* tree-inline.c (copy_body_r): Do not walk subtrees after substituting.
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);


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