This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][TUPLES] Fix for Dead STMT in EH region seen during libstdc++-v3 build.
- From: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Diego Novillo" <dnovillo at google dot com>
- Date: Fri, 25 Apr 2008 16:09:06 -0700
- Subject: [PATCH][TUPLES] Fix for Dead STMT in EH region seen during libstdc++-v3 build.
Hi
I am going to commit this two-line change after this mail. The
old code in the tuples branch does not work because
maybe_clean_or_replace_eh_stmt uses the new GIMPLE statement to look
up the EH region from which we want to remove the old call statement.
Thus the call statement is not removed from its EH region even though
is it is removed after inline call expansion.
-Doug
2008-04-25 Doug Kwan <dougkwan@google.com>
* tree-inline.c (expand_call_inline): Save old call statement
and use it to look up correct EH region.
Index: gcc/gcc/tree-inline.c
===================================================================
--- gcc/gcc/tree-inline.c (revision 134671)
+++ gcc/gcc/tree-inline.c (working copy)
@@ -3242,6 +3242,7 @@ expand_call_inline (basic_block bb, gimp
'a = foo (...)', substitute the call with 'a = USE_RETVAR'. */
if (use_retvar && gimple_call_lhs (stmt))
{
+ gimple old_stmt = stmt;
stmt = gimple_build_assign (gimple_call_lhs (stmt), use_retvar);
gsi_replace (&stmt_gsi, stmt, false);
if (gimple_in_ssa_p (cfun))
@@ -3249,7 +3250,7 @@ expand_call_inline (basic_block bb, gimp
update_stmt (stmt);
mark_symbols_for_renaming (stmt);
}
- maybe_clean_or_replace_eh_stmt (stmt, stmt);
+ maybe_clean_or_replace_eh_stmt (old_stmt, stmt);
}
else
{