diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/et-forest.c | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cb07b23752f..d567d60c55e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2010-10-14 Zdenek Dvorak <rakdver@kam.uniff.cz> + * et-forest.c (et_nca): Return NULL immediately when + the dominance forest has disjoint components. + 2010-10-13 Vladimir Makarov <vmakarov@redhat.com> * ira.c (setup_class_hard_regs): Fix typo in indexing 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) { |