This is the mail archive of the
mailing list for the GCC project.
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Tue, 25 Jan 2005 23:36:09 +0100
- Subject: PR tree-optimization/19421
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 <firstname.lastname@example.org>
* tree-inline.c (copy_body_r): Do not walk subtrees after substituting.
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. */
*tp = new_decl;
+ *walk_subtrees = 0;
else if (TREE_CODE (*tp) == STATEMENT_LIST)