* cfghooks.c (cgraph_debug_gimple_stmt): Handle a null
current_function_decl.
From-SVN: r193269
+2012-11-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * cgraph.c (cgraph_debug_gimple_stmt): Handle a null
+ current_function_decl.
+
2012-11-06 Richard Henderson <rth@redhat.com>
* tree-ssa-tail-merge.c (find_duplicate): Do not consider
static void
cgraph_debug_gimple_stmt (struct function *this_cfun, gimple stmt)
{
+ bool fndecl_was_null = false;
/* debug_gimple_stmt needs correct cfun */
if (cfun != this_cfun)
set_cfun (this_cfun);
+ /* ...and an actual current_function_decl */
+ if (!current_function_decl)
+ {
+ current_function_decl = this_cfun->decl;
+ fndecl_was_null = true;
+ }
debug_gimple_stmt (stmt);
+ if (fndecl_was_null)
+ current_function_decl = NULL;
}
/* Verify that call graph edge E corresponds to DECL from the associated