[PR 79579] Avoid segfault on NULL ipa_edge_args_vector

Martin Jambor mjambor@suse.cz
Tue Feb 21 13:53:00 GMT 2017


Hi,

in, PR 79579, early inliner creates ipa_node_params_sum which is then
tested by ipa_prop_write_jump_functions to figure out whether there
has been anything to stream out when there is not.

The following patch improves the test - when there are no jump
function, there is no point in streaming jump functions or any ipa-cp
info in general.

Bootstrapped and tested on x86_64-linux, I will commit it momentarily
as obvious.

Thanks,

Martin


2017-02-20  Martin Jambor  <mjambor@suse.cz>

	PR lto/79579
	* ipa-prop.c (ipa_prop_write_jump_functions): Bail out if no edges
	have been analyzed.
---
 gcc/ipa-prop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index e4e44ce20c6..33503d4befc 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -5040,7 +5040,7 @@ ipa_prop_write_jump_functions (void)
   lto_symtab_encoder_iterator lsei;
   lto_symtab_encoder_t encoder;
 
-  if (!ipa_node_params_sum)
+  if (!ipa_node_params_sum || !ipa_edge_args_vector)
     return;
 
   ob = create_output_block (LTO_section_jump_functions);
-- 
2.11.0



More information about the Gcc-patches mailing list