aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-11-06 09:29:48 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-11-06 09:29:48 +0100
commit36b6e793433a2558e6f0f83a49bd61ead46183e4 (patch)
treebb692f7913feb15169fc1eeed1c0b6a20bdfa55f /gcc/tree-inline.c
parentc563bcd1da29d2a3a107e39eb894427042df5973 (diff)
downloadgcc-36b6e793433a2558e6f0f83a49bd61ead46183e4.zip
gcc-36b6e793433a2558e6f0f83a49bd61ead46183e4.tar.gz
gcc-36b6e793433a2558e6f0f83a49bd61ead46183e4.tar.bz2
re PR tree-optimization/33458 (ICE "PHI def is not a GIMPLE value")
PR tree-optimization/33458 * tree-inline.c (copy_phis_for_bb): If PHI arg substitution creates !is_gimple_val PHI argument, gimplify it and insert it on edge. * g++.dg/opt/inline12.C: New test. From-SVN: r129921
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index ac8b5b5..e7abeff 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1193,6 +1193,17 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
walk_tree (&new_arg, copy_body_r, id, NULL);
gcc_assert (new_arg);
+ /* With return slot optimization we can end up with
+ non-gimple (foo *)&this->m, fix that here. */
+ if (TREE_CODE (new_arg) != SSA_NAME
+ && TREE_CODE (new_arg) != FUNCTION_DECL
+ && !is_gimple_val (new_arg))
+ {
+ tree stmts = NULL_TREE;
+ new_arg = force_gimple_operand (new_arg, &stmts,
+ true, NULL);
+ bsi_insert_on_edge_immediate (new_edge, stmts);
+ }
add_phi_arg (new_phi, new_arg, new_edge);
}
}