Commit f8cb36a9 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/59386 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu in 64-bit mode)

	PR tree-optimization/59386
	* tree-inline.c (remap_gimple_stmt): If not id->do_not_unshare,
	unshare_expr (id->retval) before passing it to gimple_build_assign.

	* gcc.c-torture/compile/pr59386.c: New test.

From-SVN: r205883
parent ba826792
2013-12-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59386
* tree-inline.c (remap_gimple_stmt): If not id->do_not_unshare,
unshare_expr (id->retval) before passing it to gimple_build_assign.
2013-12-11 Bin Cheng <bin.cheng@arm.com> 2013-12-11 Bin Cheng <bin.cheng@arm.com>
Reverted: Reverted:
2013-12-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59386
* gcc.c-torture/compile/pr59386.c: New test.
2013-12-11 Bin Cheng <bin.cheng@arm.com> 2013-12-11 Bin Cheng <bin.cheng@arm.com>
Reverted: Reverted:
......
/* PR tree-optimization/59386 */
struct S { int s; };
struct T { int t; struct S u; } c;
int b;
struct S
foo ()
{
struct T d;
if (b)
while (c.t)
;
else
return d.u;
}
struct S
bar ()
{
struct T a;
a.u = foo ();
return a.u;
}
...@@ -1273,7 +1273,9 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) ...@@ -1273,7 +1273,9 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
|| ! SSA_NAME_VAR (retval) || ! SSA_NAME_VAR (retval)
|| TREE_CODE (SSA_NAME_VAR (retval)) != RESULT_DECL))) || TREE_CODE (SSA_NAME_VAR (retval)) != RESULT_DECL)))
{ {
copy = gimple_build_assign (id->retvar, retval); copy = gimple_build_assign (id->do_not_unshare
? id->retvar : unshare_expr (id->retvar),
retval);
/* id->retvar is already substituted. Skip it on later remapping. */ /* id->retvar is already substituted. Skip it on later remapping. */
skip_first = true; skip_first = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment