diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-11 22:15:14 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-11 22:15:14 +0000 |
commit | de9b51e4e28aafce9ee88865d22f7d6feb0b9f52 (patch) | |
tree | a9cb801a8330eb419428ec94b56e79153311866b /gcc | |
parent | 0899d31e53ecf88d3fe2c5551352b69583edf255 (diff) | |
download | linaro-gcc-de9b51e4e28aafce9ee88865d22f7d6feb0b9f52.tar.gz linaro-gcc-de9b51e4e28aafce9ee88865d22f7d6feb0b9f52.tar.bz2 linaro-gcc-de9b51e4e28aafce9ee88865d22f7d6feb0b9f52.zip |
PR rtl-optimization/59446
* tree-ssa-threadupdate.c (mark_threaded_blocks): Properly
test for crossing a loop header.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205905 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 56 |
2 files changed, 28 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d95ce52d7bc..d580c4d41b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-12-11 Jeff Law <law@redhat.com> + + PR rtl-optimization/59446 + * tree-ssa-threadupdate.c (mark_threaded_blocks): Properly + test for crossing a loop header. + 2013-12-11 Sriraman Tallam <tmsriram@google.com> PR target/59390 diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 6f978e20c2b..af8fd850835 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -1449,44 +1449,32 @@ mark_threaded_blocks (bitmap threaded_blocks) { vec<jump_thread_edge *> *path = THREAD_PATH (e); - /* Basically we're looking for a situation where we can see - 3 or more loop structures on a jump threading path. */ - - struct loop *first_father = (*path)[0]->e->src->loop_father; - struct loop *second_father = NULL; - for (unsigned int i = 0; i < path->length (); i++) + for (unsigned int i = 0, crossed_headers = 0; + i < path->length (); + i++) { - /* See if this is a loop father we have not seen before. */ - if ((*path)[i]->e->dest->loop_father != first_father - && (*path)[i]->e->dest->loop_father != second_father) + basic_block dest = (*path)[i]->e->dest; + crossed_headers += (dest == dest->loop_father->header); + if (crossed_headers > 1) { - /* We've already seen two loop fathers, so we - need to trim this jump threading path. */ - if (second_father != NULL) - { - /* Trim from entry I onwards. */ - for (unsigned int j = i; j < path->length (); j++) - delete (*path)[j]; - path->truncate (i); - - /* Now that we've truncated the path, make sure - what's left is still valid. We need at least - two edges on the path and the last edge can not - be a joiner. This should never happen, but let's - be safe. */ - if (path->length () < 2 - || (path->last ()->type - == EDGE_COPY_SRC_JOINER_BLOCK)) - { - delete_jump_thread_path (path); - e->aux = NULL; - } - break; - } - else + /* Trim from entry I onwards. */ + for (unsigned int j = i; j < path->length (); j++) + delete (*path)[j]; + path->truncate (i); + + /* Now that we've truncated the path, make sure + what's left is still valid. We need at least + two edges on the path and the last edge can not + be a joiner. This should never happen, but let's + be safe. */ + if (path->length () < 2 + || (path->last ()->type + == EDGE_COPY_SRC_JOINER_BLOCK)) { - second_father = (*path)[i]->e->dest->loop_father; + delete_jump_thread_path (path); + e->aux = NULL; } + break; } } } |