PR tree-optimization/19421
Jan Hubicka
jh@suse.cz
Tue Jan 25 22:36:00 GMT 2005
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);
More information about the Gcc-patches
mailing list