ipa-ref.c (ipa_remove_stmt_references): Fix references traversal when removing references.

* ipa-ref.c (ipa_remove_stmt_references): Fix references
       traversal when removing references.

From-SVN: r206697
This commit is contained in:
Ilya Enkovich 2014-01-17 05:36:19 +00:00 committed by Kirill Yukhin
parent b5407ad1ef
commit c68b3f5291
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-01-16 Ilya Enkovich <ilya.enkovich@intel.com>
* ipa-ref.c (ipa_remove_stmt_references): Fix references
traversal when removing references.
2014-01-16 Jan Hubicka <jh@suse.cz>
PR ipa/59775

View File

@ -291,11 +291,13 @@ void
ipa_remove_stmt_references (symtab_node *referring_node, gimple stmt)
{
struct ipa_ref *r = NULL;
int i;
int i = 0;
for (i = 0; ipa_ref_list_reference_iterate (&referring_node->ref_list, i, r); i++)
while (ipa_ref_list_reference_iterate (&referring_node->ref_list, i, r))
if (r->stmt == stmt)
ipa_remove_reference (r);
else
i++;
}
/* Remove all stmt references in non-speculative references.