[PATCH, PR 48613] Don't stream jump functions if there are none

Martin Jambor mjambor@suse.cz
Tue Jun 14 20:53:00 GMT 2011


the patch below fixes PR 48613 which is an ICE with -O0
-findirect-inlining.  Rather than adding "&& optimize" here and there,
at this place we can easily see whether there is something to do or
not by testing ipa_node_params_vector for NULL.  And the
flag-triggering combinations can -and are - dealt elsewhere.

Bootstrapped and tested on trunk on x86_64-linux.  OK for trunk and
subsequently for the 4.6 branch too?



2011-06-13  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/48613
	* ipa-prop.c (ipa_prop_write_jump_functions): Return immediately if
	ipa_node_params_vector is NULL.

Index: src/gcc/ipa-prop.c
--- src.orig/gcc/ipa-prop.c
+++ src/gcc/ipa-prop.c
@@ -2900,12 +2900,15 @@ void
 ipa_prop_write_jump_functions (cgraph_node_set set)
   struct cgraph_node *node;
-  struct output_block *ob = create_output_block (LTO_section_jump_functions);
+  struct output_block *ob;
   unsigned int count = 0;
   cgraph_node_set_iterator csi;
-  ob->cgraph_node = NULL;
+  if (!ipa_node_params_vector)
+    return;
+  ob = create_output_block (LTO_section_jump_functions);
+  ob->cgraph_node = NULL;
   for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
       node = csi_node (csi);

More information about the Gcc-patches mailing list