bitmap_tree_unlink_element can avoid a splay operation if the maximal
node is at the root.

gcc/
        * bitmap.cc (bitmap_tree_unlink_element): Optimize the handling
        of the maximal node.
---
 gcc/bitmap.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 476358c1276..005f0abdf6f 100644
--- a/gcc/bitmap.cc
+++ b/gcc/bitmap.cc
@@ -563,6 +563,8 @@ bitmap_tree_unlink_element (bitmap head, bitmap_element *e)
 
   if (e->prev == NULL)
     t = e->next;
+  else if (e->next == NULL)
+    t = e->prev;
   else
     {
       t = bitmap_tree_splay (head, e->prev, e->indx);
-- 
2.54.0

Reply via email to