Fix tree-inlinine ICE with uninitializer return value
Jan Hubicka
hubicka@ucw.cz
Tue May 3 19:28:00 GMT 2016
Hi,
the code path handling the case where callee is missing return statement but calle
statement has LHS is broken in tree-inline since anonymous SSA_NAMEs was introduced.
This code is not not used because all those inlines are disabled by
gimple_check_call_matching_types, but since I would like to drop the checks it seems
good idea to fix the code path rather than dropping it. This copies what Jakub's
code does when redirecting to unreachable.
Bootstrapped/regtesetd x86_64-linux, OK?
Honza
* tree-inline.c (expand_call_inline): Fix path inlining function
with no return statement.
Index: tree-inline.c
===================================================================
--- tree-inline.c (revision 235839)
+++ tree-inline.c (working copy)
@@ -4708,7 +4708,7 @@ expand_call_inline (basic_block bb, gimp
{
tree name = gimple_call_lhs (stmt);
tree var = SSA_NAME_VAR (name);
- tree def = ssa_default_def (cfun, var);
+ tree def = var ? ssa_default_def (cfun, var) : NULL;
if (def)
{
@@ -4719,6 +4719,11 @@ expand_call_inline (basic_block bb, gimp
}
else
{
+ if (!var)
+ {
+ tree var = create_tmp_reg_fn (cfun, TREE_TYPE (name), NULL);
+ SET_SSA_NAME_VAR_OR_IDENTIFIER (name, var);
+ }
/* Otherwise make this variable undefined. */
gsi_remove (&stmt_gsi, true);
set_ssa_default_def (cfun, var, name);
More information about the Gcc-patches
mailing list