https://gcc.gnu.org/g:8c1f9a754d4dcd4cf085f1f9b5628b58e8ae1d30

commit r17-1349-g8c1f9a754d4dcd4cf085f1f9b5628b58e8ae1d30
Author: Richard Sandiford <[email protected]>
Date:   Thu Jun 4 16:40:45 2026 +0100

    bitmap: Tweak bitmap_tree_unlink_element
    
    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.

Diff:
---
 gcc/bitmap.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 476358c12764..005f0abdf6f7 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);

Reply via email to