aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2012-11-06 23:55:20 +0000
committerRichard Henderson <rth@gcc.gnu.org>2012-11-06 15:55:20 -0800
commit27f7e1c331267244a7dbace1f38192f98ef8fad0 (patch)
treeb19c3c68dfde40d634b1a42aece91948dc212c0f /gcc
parent7ec887015f685ed3d6146b1fd464b7bf31dc7a19 (diff)
downloadgcc-27f7e1c331267244a7dbace1f38192f98ef8fad0.zip
gcc-27f7e1c331267244a7dbace1f38192f98ef8fad0.tar.gz
gcc-27f7e1c331267244a7dbace1f38192f98ef8fad0.tar.bz2
Handle null current_function_decl in cgraph_debug_gimple_stmt
* cfghooks.c (cgraph_debug_gimple_stmt): Handle a null current_function_decl. From-SVN: r193269
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cgraph.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7cc4051..1cde0fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index c9ff5c6..556eaff 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2250,10 +2250,19 @@ verify_edge_count_and_frequency (struct cgraph_edge *e)
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