diff options
author | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-14 07:08:45 +0000 |
---|---|---|
committer | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-14 07:08:45 +0000 |
commit | 8cb78e283c17b81509565a53ddbf9dacec10c67e (patch) | |
tree | 2daf4a110eab8df41f750f62efd0d842360f7b19 /gcc/et-forest.c | |
parent | 6ca8178c9af76898425447d0e54db96b052522c8 (diff) | |
download | gcc-8cb78e283c17b81509565a53ddbf9dacec10c67e.tar.gz |
2010-10-14 Zdenek Dvorak <rakdver@kam.uniff.cz>
* et-forest.c (et_nca): Return NULL immediately when
the dominance forest has disjoint components.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/et-forest.c')
-rw-r--r-- | gcc/et-forest.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/et-forest.c b/gcc/et-forest.c index c15b6d8f2c3..94757c0afa9 100644 --- a/gcc/et-forest.c +++ b/gcc/et-forest.c @@ -661,7 +661,7 @@ et_nca (struct et_node *n1, struct et_node *n2) if (r) r->parent = o1; } - else + else if (r == o2 || (r && r->parent != NULL)) { ret = o2->prev; @@ -669,6 +669,15 @@ et_nca (struct et_node *n1, struct et_node *n2) if (l) l->parent = o1; } + else + { + /* O1 and O2 are in different components of the forest. */ + if (l) + l->parent = o1; + if (r) + r->parent = o1; + return NULL; + } if (0 < o2->depth) { |