diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-03 09:21:56 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-03 09:21:56 +0000 |
commit | 796859e5ef73aa9e7811ba944d76f6b395df29d3 (patch) | |
tree | 2f1787ece400c6ec88d79b288ef226c14672cd57 /gcc/ipa-icf.c | |
parent | 49a1b909a619d6033a9ab02758bc4c88a8bd20ec (diff) | |
download | gcc-796859e5ef73aa9e7811ba944d76f6b395df29d3.tar.gz |
Fix PR ipa/65087.
PR ipa/65087
* ipa-icf.c (sem_item_optimizer::execute): Change function
return value to boolean.
(sem_item_optimizer::merge_classes): Likewise.
(ipa_icf_driver): Return TODO_remove_functions in case there's
a merge operation processed.
* ipa-icf.h: Change function return value to boolean.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221133 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r-- | gcc/ipa-icf.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 31fcbec6615..9cdd73eb9d2 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -2167,9 +2167,11 @@ sem_item_optimizer::filter_removed_items (void) m_items.safe_push (filtered[i]); } -/* Optimizer entry point. */ +/* Optimizer entry point which returns true in case it processes + a merge operation. True is returned if there's a merge operation + processed. */ -void +bool sem_item_optimizer::execute (void) { filter_removed_items (); @@ -2214,10 +2216,12 @@ sem_item_optimizer::execute (void) process_cong_reduction (); dump_cong_classes (); verify_classes (); - merge_classes (prev_class_count); + bool merged_p = merge_classes (prev_class_count); if (dump_file && (dump_flags & TDF_DETAILS)) symtab_node::dump_table (dump_file); + + return merged_p; } /* Function responsible for visiting all potential functions and @@ -2870,9 +2874,10 @@ sem_item_optimizer::dump_cong_classes (void) /* After reduction is done, we can declare all items in a group to be equal. PREV_CLASS_COUNT is start number of classes - before reduction. */ + before reduction. True is returned if there's a merge operation + processed. */ -void +bool sem_item_optimizer::merge_classes (unsigned int prev_class_count) { unsigned int item_count = m_items.length (); @@ -2882,6 +2887,8 @@ sem_item_optimizer::merge_classes (unsigned int prev_class_count) unsigned int non_singular_classes_count = 0; unsigned int non_singular_classes_sum = 0; + bool merged_p = false; + for (hash_table<congruence_class_group_hash>::iterator it = m_classes.begin (); it != m_classes.end (); ++it) for (unsigned int i = 0; i < (*it)->classes.length (); i++) @@ -2952,9 +2959,12 @@ sem_item_optimizer::merge_classes (unsigned int prev_class_count) alias->dump_to_file (dump_file); } - source->merge (alias); + if (source->merge (alias)) + merged_p = true; } } + + return merged_p; } /* Dump function prints all class members to a FILE with an INDENT. */ @@ -3031,12 +3041,12 @@ ipa_icf_driver (void) { gcc_assert (optimizer); - optimizer->execute (); + bool merged_p = optimizer->execute (); delete optimizer; optimizer = NULL; - return 0; + return merged_p ? TODO_remove_functions : 0; } const pass_data pass_data_ipa_icf = |