diff options
author | Richard Guenther <rguenther@suse.de> | 2008-09-10 15:07:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-09-10 15:07:04 +0000 |
commit | bfb0b886347527f7747735d030a112b773b45098 (patch) | |
tree | ae5ffeb146ccb202a3b56336dbc28fbaa24e2149 /gcc/tree-inline.c | |
parent | b70e977531af718dc6b3173d0645583f2b9a4808 (diff) | |
download | gcc-bfb0b886347527f7747735d030a112b773b45098.zip gcc-bfb0b886347527f7747735d030a112b773b45098.tar.gz gcc-bfb0b886347527f7747735d030a112b773b45098.tar.bz2 |
re PR tree-optimization/37432 (ICE in VN_INFO, at tree-ssa-sccvn.c:180)
2008-09-10 Richard Guenther <rguenther@suse.de>
PR middle-end/37432
* tree-inline.c (insert_init_stmt): Make sure to not
insert invalid gimple stores.
* gcc.c-torture/compile/pr37432.c: New testcase.
From-SVN: r140233
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index decdd6c..c38c322 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1907,6 +1907,22 @@ insert_init_stmt (basic_block bb, gimple init_stmt) { gimple_stmt_iterator si = gsi_last_bb (bb); + /* We can end up with init statements that store to a non-register + from a rhs with a conversion. Handle that here by forcing the + rhs into a temporary. gimple_regimplify_operands is not + prepared to do this for us. */ + if (!is_gimple_reg (gimple_assign_lhs (init_stmt)) + && is_gimple_reg_type (TREE_TYPE (gimple_assign_lhs (init_stmt))) + && gimple_assign_rhs_class (init_stmt) == GIMPLE_UNARY_RHS) + { + tree rhs = build1 (gimple_assign_rhs_code (init_stmt), + gimple_expr_type (init_stmt), + gimple_assign_rhs1 (init_stmt)); + rhs = force_gimple_operand_gsi (&si, rhs, true, NULL_TREE, false, + GSI_NEW_STMT); + gimple_assign_set_rhs_code (init_stmt, TREE_CODE (rhs)); + gimple_assign_set_rhs1 (init_stmt, rhs); + } gsi_insert_after (&si, init_stmt, GSI_NEW_STMT); gimple_regimplify_operands (init_stmt, &si); mark_symbols_for_renaming (init_stmt); |