diff options
author | Richard Biener <rguenther@suse.de> | 2018-12-10 12:39:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-12-10 12:39:07 +0000 |
commit | d9611f55eb143d526b97b032b7169313d73515e0 (patch) | |
tree | 8e14c2df811b0547cdd50bc0d2ee2f978d487928 /gcc/gimple.c | |
parent | 48428c18142e5c726f2dc5f92b0759fd3c7df890 (diff) | |
download | gcc-d9611f55eb143d526b97b032b7169313d73515e0.zip gcc-d9611f55eb143d526b97b032b7169313d73515e0.tar.gz gcc-d9611f55eb143d526b97b032b7169313d73515e0.tar.bz2 |
re PR tree-optimization/88415 (ICE: verify_gimple failed (error: dead STMT in EH table))
2018-12-10 Richard Biener <rguenther@suse.de>
PR middle-end/88415
* gimple.c (gimple_assign_set_rhs_with_ops): Transfer EH
info to a newly allocated stmt.
* gcc.dg/gomp/pr88415.c: New testcase.
From-SVN: r266951
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 23ccbae..3222a21 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1729,16 +1729,15 @@ gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code, { unsigned new_rhs_ops = get_gimple_rhs_num_ops (code); gimple *stmt = gsi_stmt (*gsi); + gimple *old_stmt = stmt; /* If the new CODE needs more operands, allocate a new statement. */ if (gimple_num_ops (stmt) < new_rhs_ops + 1) { - tree lhs = gimple_assign_lhs (stmt); - gimple *new_stmt = gimple_alloc (gimple_code (stmt), new_rhs_ops + 1); - memcpy (new_stmt, stmt, gimple_size (gimple_code (stmt))); - gimple_init_singleton (new_stmt); - gsi_replace (gsi, new_stmt, false); - stmt = new_stmt; + tree lhs = gimple_assign_lhs (old_stmt); + stmt = gimple_alloc (gimple_code (old_stmt), new_rhs_ops + 1); + memcpy (stmt, old_stmt, gimple_size (gimple_code (old_stmt))); + gimple_init_singleton (stmt); /* The LHS needs to be reset as this also changes the SSA name on the LHS. */ @@ -1752,6 +1751,8 @@ gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code, gimple_assign_set_rhs2 (stmt, op2); if (new_rhs_ops > 2) gimple_assign_set_rhs3 (stmt, op3); + if (stmt != old_stmt) + gsi_replace (gsi, stmt, true); } |