IPA ICF: make algorithm stable to survive -fcompare-debug
authorMartin Liska <mliska@suse.cz>
Tue, 10 Jan 2017 14:39:33 +0000 (15:39 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 10 Jan 2017 14:39:33 +0000 (14:39 +0000)
commita0843aedb8ad71a7b14847fb4d52a64f8ce5a501
treea5471d89995f98f8c69ea88a47d31962fe9e6ab0
parent3746a4b2bc625d48a8178b247cace162e62a32f1
IPA ICF: make algorithm stable to survive -fcompare-debug

2017-01-10  Martin Liska  <mliska@suse.cz>

* gcc.dg/ipa/ipa-icf-1.c: Change scanned pattern.
* gcc.dg/ipa/ipa-icf-10.c: Likewise.
* gcc.dg/ipa/ipa-icf-11.c: Likewise.
* gcc.dg/ipa/ipa-icf-12.c: Likewise.
* gcc.dg/ipa/ipa-icf-13.c: Likewise.
* gcc.dg/ipa/ipa-icf-16.c: Likewise.
* gcc.dg/ipa/ipa-icf-18.c: Likewise.
* gcc.dg/ipa/ipa-icf-2.c: Likewise.
* gcc.dg/ipa/ipa-icf-20.c: Likewise.
* gcc.dg/ipa/ipa-icf-21.c: Likewise.
* gcc.dg/ipa/ipa-icf-23.c: Likewise.
* gcc.dg/ipa/ipa-icf-25.c: Likewise.
* gcc.dg/ipa/ipa-icf-26.c: Likewise.
* gcc.dg/ipa/ipa-icf-27.c: Likewise.
* gcc.dg/ipa/ipa-icf-3.c: Likewise.
* gcc.dg/ipa/ipa-icf-35.c: Likewise.
* gcc.dg/ipa/ipa-icf-36.c: Likewise.
* gcc.dg/ipa/ipa-icf-37.c: Likewise.
* gcc.dg/ipa/ipa-icf-5.c: Likewise.
* gcc.dg/ipa/ipa-icf-7.c: Likewise.
* gcc.dg/ipa/ipa-icf-8.c: Likewise.
* gcc.dg/ipa/pr64307.c: Likewise.
* gcc.dg/ipa/pr77653.c: Likewise.
2017-01-10  Martin Liska  <mliska@suse.cz>

* ipa-icf.c (sort_sem_items_by_decl_uid): New function.
(sort_congruence_classes_by_decl_uid): Likewise.
(sort_congruence_class_groups_by_decl_uid): Likewise.
(sem_item_optimizer::merge_classes): Sort class, groups in these
classes and members in the groups by DECL_UID of declarations.
This would make merge operations stable.

From-SVN: r244273
26 files changed:
gcc/ChangeLog
gcc/ipa-icf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/ipa-icf-1.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-10.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-11.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-12.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-13.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-16.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-18.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-2.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-20.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-23.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-25.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-26.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-27.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-3.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-35.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-36.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-37.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-5.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-7.c
gcc/testsuite/gcc.dg/ipa/ipa-icf-8.c
gcc/testsuite/gcc.dg/ipa/pr64307.c
gcc/testsuite/gcc.dg/ipa/pr77653.c