https://gcc.gnu.org/g:43ce88299a47e13927219947e449fd75d649f3fd

commit r16-4986-g43ce88299a47e13927219947e449fd75d649f3fd
Author: Viljar Indus <[email protected]>
Date:   Tue Oct 14 12:02:13 2025 +0300

    ada: Fix Put_Image for Multiway_Trees
    
    Put_Image should start printing the tree from the Root instead
    of the First_Child.
    
    gcc/ada/ChangeLog:
    
            * libgnat/a-cbmutr.adb (Put_Image): Fix the condition and starting 
point
            for printing the tree.
            * libgnat/a-cimutr.adb (Put_Image): Likewise.
            * libgnat/a-comutr.adb (Put_Image): Likewise.

Diff:
---
 gcc/ada/libgnat/a-cbmutr.adb | 4 ++--
 gcc/ada/libgnat/a-cimutr.adb | 4 ++--
 gcc/ada/libgnat/a-comutr.adb | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/libgnat/a-cbmutr.adb b/gcc/ada/libgnat/a-cbmutr.adb
index 9d9d21d2c39e..bd6b1359f964 100644
--- a/gcc/ada/libgnat/a-cbmutr.adb
+++ b/gcc/ada/libgnat/a-cbmutr.adb
@@ -2357,11 +2357,11 @@ is
       end Rec;
 
    begin
-      if First_Child (Root (V)) = No_Element then
+      if Is_Empty (V) then
          Array_Before (S);
          Array_After (S);
       else
-         Rec (First_Child (Root (V)));
+         Rec (Root (V));
       end if;
    end Put_Image;
 
diff --git a/gcc/ada/libgnat/a-cimutr.adb b/gcc/ada/libgnat/a-cimutr.adb
index b84eb16024be..0c6d33828b1a 100644
--- a/gcc/ada/libgnat/a-cimutr.adb
+++ b/gcc/ada/libgnat/a-cimutr.adb
@@ -1910,11 +1910,11 @@ is
       end Rec;
 
    begin
-      if First_Child (Root (V)) = No_Element then
+      if Is_Empty (V) then
          Array_Before (S);
          Array_After (S);
       else
-         Rec (First_Child (Root (V)));
+         Rec (Root (V));
       end if;
    end Put_Image;
 
diff --git a/gcc/ada/libgnat/a-comutr.adb b/gcc/ada/libgnat/a-comutr.adb
index df3741bbbb07..2d6393db35aa 100644
--- a/gcc/ada/libgnat/a-comutr.adb
+++ b/gcc/ada/libgnat/a-comutr.adb
@@ -1844,11 +1844,11 @@ is
       end Rec;
 
    begin
-      if First_Child (Root (V)) = No_Element then
+      if Is_Empty (V) then
          Array_Before (S);
          Array_After (S);
       else
-         Rec (First_Child (Root (V)));
+         Rec (Root (V));
       end if;
    end Put_Image;

Reply via email to