This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR 42985] Do a better job at checking ipa-prop info after streaming it in
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 9 Feb 2010 20:17:45 +0100
- Subject: [PATCH, PR 42985] Do a better job at checking ipa-prop info after streaming it in
Hi,
checking for variable number of arguments requires that we already
have the all numbers of the formal parameters counted and so the
counting must happen independently first. The patch below does
exactly that and so fixes PR 42985.
I have not been able to add a testcase to the suite in a way that
would fail with an unpatched compiler. I tried to specify -O1 in
dg-lto-options and -O2 in dg-extra-ld-options but that did not work
(it just stubbornly refused to ICE). I'll be glad to add a testcase
if someone suggests a way of doing it.
Bootstrapped and tested on x86_64-linux. OK for trunk?
Thanks,
Martin
2010-02-09 Martin Jambor <mjambor@suse.cz>
PR lto/42985
* ipa-prop.c (ipa_update_after_lto_read): Count parameters and
check for variable argument counts independently.
Index: gcc/ipa-prop.c
===================================================================
--- gcc/ipa-prop.c (revision 156596)
+++ gcc/ipa-prop.c (working copy)
@@ -2206,17 +2206,17 @@ ipa_update_after_lto_read (void)
ipa_check_create_edge_args ();
for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
+ if (node->analyzed)
ipa_initialize_node_params (node);
+
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->analyzed)
for (cs = node->callees; cs; cs = cs->next_callee)
{
if (ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
!= ipa_get_param_count (IPA_NODE_REF (cs->callee)))
ipa_set_called_with_variable_arg (IPA_NODE_REF (cs->callee));
}
- }
}
/* Walk param call notes of NODE and set their call statements given the uid