This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix uninitialized memory access in cgraph.c
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Sep 2013 14:42:29 +0200
- Subject: Fix uninitialized memory access in cgraph.c
- Authentication-results: sourceware.org; auth=none
Hi,
Richard pointed out to me that we use speculative flag before we initialize
it.
Bootstrapped/regtested x86_64-linux, comitted.
Honza
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;
}