diff mbox

Fix uninitialized memory access in cgraph.c

Message ID 20130919124229.GB25304@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Sept. 19, 2013, 12:42 p.m. UTC
Hi,
Richard pointed out to me that we use speculative flag before we initialize
it. 

Bootstrapped/regtested x86_64-linux, comitted.

Honza
diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 202739)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@ 
+2013-09-19  Jan Hubicka  <jh@suse.cz>
+
+	* cgraph.c (cgraph_create_edge_1): Avoid uninitialized read
+	of speculative flag.
+
 2013-09-19  Jakub Jelinek  <jakub@redhat.com>
 
 	* omp-low.c (expand_omp_sections): Always pass len - 1 to
Index: cgraph.c
===================================================================
--- cgraph.c	(revision 202739)
+++ cgraph.c	(working copy)
@@ -870,12 +870,12 @@  cgraph_create_edge_1 (struct cgraph_node
     edge->call_stmt_cannot_inline_p = true;
   else
     edge->call_stmt_cannot_inline_p = false;
-  if (call_stmt && caller->call_site_hash)
-    cgraph_add_edge_to_call_site_hash (edge);
 
   edge->indirect_info = NULL;
   edge->indirect_inlining_edge = 0;
   edge->speculative = false;
+  if (call_stmt && caller->call_site_hash)
+    cgraph_add_edge_to_call_site_hash (edge);
 
   return edge;
 }