From 8acdd6b325e8189a00f108206ecae5f9a50a9fca Mon Sep 17 00:00:00 2001
From: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 25 Sep 2006 17:50:25 +0000
Subject: [PATCH]         * cgraph.c (dump_cgraph_varpool_node): Don't crash if
 called         before cgraph_function_flags_ready.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117203 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog | 5 +++++
 gcc/cgraph.c  | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 245b081ee9f7..49c51ced7a78 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-25  Richard Henderson  <rth@redhat.com>
+
+	* cgraph.c (dump_cgraph_varpool_node): Don't crash if called
+	before cgraph_function_flags_ready.
+
 2006-09-24  Zdenek Dvorak <dvorakz@suse.cz>
 	    Adam Nemet  <anemet@caviumnetworks.com>
 
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 372b90d5eaa7..3e5dab1f94eb 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -786,7 +786,10 @@ void
 dump_cgraph_varpool_node (FILE *f, struct cgraph_varpool_node *node)
 {
   fprintf (f, "%s:", cgraph_varpool_node_name (node));
-  fprintf (f, " availability:%s", availability_names [cgraph_variable_initializer_availability (node)]);
+  fprintf (f, " availability:%s",
+	   cgraph_function_flags_ready
+	   ? availability_names[cgraph_variable_initializer_availability (node)]
+	   : "not-ready");
   if (DECL_INITIAL (node->decl))
     fprintf (f, " initialized");
   if (node->needed)
-- 
GitLab