diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-05 17:02:26 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-05 17:02:26 +0000 |
commit | 4c170941ee7ac668687d0df2b619be6fc9646c62 (patch) | |
tree | acef4131d9a1dae649c2564c544c7027da6300d5 | |
parent | d6bff3e6520fc0288a2c6348b9c64c4b3df3cb92 (diff) | |
download | gcc-4c170941ee7ac668687d0df2b619be6fc9646c62.tar.gz |
* ipa-pure-const.c (propagate): Fix type in handling functions
that can not return; be more cureful about merging the results
with previously known.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160321 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-pure-const.c | 18 |
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f1c24a89d2..85b61fe0bee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-06-05 Jan Hubicka <jh@suse.cz> + + * ipa-pure-const.c (propagate): Fix type in handling functions + that can not return; be more cureful about merging the results + with previously known. + 2010-06-05 Matthias Klose <doko@ubuntu.com> * gcc.c (cc1_options, cpp_unique_options): Use find-plugindir spec diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index d785389191a..299019a145c 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1055,7 +1055,7 @@ propagate (void) pure_const_names[y_l->pure_const_state], y_l->looping); } - if (y_l->pure_const_state > ECF_PURE + if (y_l->pure_const_state > IPA_PURE && cgraph_edge_cannot_lead_to_return (e)) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -1108,10 +1108,17 @@ propagate (void) edge_looping = true; } } + + /* Merge the results with what we already know. + When we found function to be NEITHER, but we know + it is looping pure const, be sure to set the looping flag. */ pure_const_state = MAX (pure_const_state, MIN (edge_state, w_l->state_previously_known)); - looping = MAX (looping, MIN (edge_looping, - w_l->looping_previously_known)); + if (edge_state > w_l->state_previously_known) + looping = MAX (looping, w_l->looping_previously_known); + else + looping = MAX (looping, MIN (edge_looping, + w_l->looping_previously_known)); if (pure_const_state == IPA_NEITHER) break; } @@ -1134,7 +1141,10 @@ propagate (void) if (w_l->state_previously_known != IPA_NEITHER && this_state > w_l->state_previously_known) - this_state = w_l->state_previously_known; + { + this_state = w_l->state_previously_known; + this_looping |= w_l->looping_previously_known; + } if (!this_looping && self_recursive_p (w)) this_looping = true; if (!w_l->looping_previously_known) |