From 57dbdc5a66ce818e168dc5f3d364b9d9cad3826a Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Mon, 11 Apr 2011 16:25:55 +0200 Subject: [PATCH] re PR tree-optimization/48195 (ICE: vector VEC(ipa_node_params_t,base) index domain error, in ipa_analyze_node at ipa-prop.c:1525 with -flto --param partial-inlining-entry-probability=101) 2011-04-11 Martin Jambor PR tree-optimization/48195 * ipa-cp.c (ipcp_driver): Call ipa_check_create_node_params and ipa_check_create_edge_args. (ipcp_generate_summary): Do not call ipa_check_create_node_params and ipa_check_create_edge_args. * ipa-inline.c (inline_generate_summary): Do not call ipa_check_create_node_params and ipa_check_create_edge_args. * ipa-prop.c (ipa_analyze_node): Call ipa_check_create_node_params and ipa_check_create_edge_args. * testsuite/gcc.dg/ipa/pr48195.c: New test. From-SVN: r172256 --- gcc/ChangeLog | 12 ++++++++++++ gcc/ipa-cp.c | 4 ++-- gcc/ipa-inline.c | 6 +----- gcc/ipa-prop.c | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/ipa/pr48195.c | 24 ++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr48195.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ec51f2346c..2ecd35cce59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2011-04-11 Martin Jambor + + PR tree-optimization/48195 + * ipa-cp.c (ipcp_driver): Call ipa_check_create_node_params and + ipa_check_create_edge_args. + (ipcp_generate_summary): Do not call ipa_check_create_node_params and + ipa_check_create_edge_args. + * ipa-inline.c (inline_generate_summary): Do not call + ipa_check_create_node_params and ipa_check_create_edge_args. + * ipa-prop.c (ipa_analyze_node): Call ipa_check_create_node_params and + ipa_check_create_edge_args. + 2011-04-09 Anatoly Sokolov * expr.c (expand_expr_real_1): Use add_to_hard_reg_set function diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 2b1e50dcb61..a2928dbee6c 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1539,6 +1539,8 @@ ipcp_driver (void) ipa_print_all_params (dump_file); ipa_print_all_jump_functions (dump_file); } + ipa_check_create_node_params (); + ipa_check_create_edge_args (); /* 2. Do the interprocedural propagation. */ ipcp_iterate_stage (); /* 3. Insert the constants found to the functions. */ @@ -1566,8 +1568,6 @@ ipcp_generate_summary (void) if (dump_file) fprintf (dump_file, "\nIPA constant propagation start:\n"); - ipa_check_create_node_params (); - ipa_check_create_edge_args (); ipa_register_cgraph_hooks (); for (node = cgraph_nodes; node; node = node->next) diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index c41c20bc9f1..38d55bc843b 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -2066,11 +2066,7 @@ inline_generate_summary (void) cgraph_add_function_insertion_hook (&add_new_function, NULL); if (flag_indirect_inlining) - { - ipa_register_cgraph_hooks (); - ipa_check_create_node_params (); - ipa_check_create_edge_args (); - } + ipa_register_cgraph_hooks (); for (node = cgraph_nodes; node; node = node->next) if (node->analyzed) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index edeffc2533c..0587844e354 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1522,10 +1522,13 @@ ipa_analyze_params_uses (struct cgraph_node *node, void ipa_analyze_node (struct cgraph_node *node) { - struct ipa_node_params *info = IPA_NODE_REF (node); + struct ipa_node_params *info; struct param_analysis_info *parms_info; int i, param_count; + ipa_check_create_node_params (); + ipa_check_create_edge_args (); + info = IPA_NODE_REF (node); push_cfun (DECL_STRUCT_FUNCTION (node->decl)); current_function_decl = node->decl; ipa_initialize_node_params (node); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3b4d574a62e..cb7e7695f02 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 Martin Jambor + + PR tree-optimization/48195 + * gcc.dg/ipa/pr48195.c: New test. + 2011-04-10 Eric Botcazou * gnat.dg/return3.adb: Remove unused switch. diff --git a/gcc/testsuite/gcc.dg/ipa/pr48195.c b/gcc/testsuite/gcc.dg/ipa/pr48195.c new file mode 100644 index 00000000000..1cf7a7f71d4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr48195.c @@ -0,0 +1,24 @@ +/* { dg-do link } */ +/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=101" } */ + +extern void abort(void); + +int i; + +void __attribute__ ((constructor)) +c2 () +{ + if (i) + abort (); +} + +void __attribute__ ((destructor)) +d1 () +{ + if (i) + abort (); +} + +void main () +{ +} -- 2.30.2