[COMMITTED,15/31] ada: Fix regression in Root_Type -- adjustment

Message ID 20250911091904.1505690-15-poulhies@adacore.com
State Committed
Commit f1887efb6df1db8986bbb34ae1b9bf5525cb51bc
Headers
Series [COMMITTED,01/31] ada: Disable new warning for composite equality ops that can raise Program_Error |

Commit Message

Marc Poulhiès Sept. 11, 2025, 9:18 a.m. UTC
  From: Bob Duff <duff@adacore.com>

Recent changes "Fix regression in Root_Type" and
"Crash on b3a1004 with assertions enabled" are partially
redundant; they are addressing the same bug.
This patch adjusts the former in the case of Root_Type.
But we leave Root_Type_If_Set alone; debugging printouts
should survive bugs when possible.

gcc/ada/ChangeLog:

	* einfo-utils.adb (Root_Type): Do not deal with missing Etype.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/einfo-utils.adb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Patch

diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index 450d4c36b211..290ae331d37a 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -2585,11 +2585,7 @@  package body Einfo.Utils is
             loop
                Etyp := Etype (T);
 
-               if No (Etyp) then
-                  Check_Error_Detected;
-               end if;
-
-               exit when No (Etyp) or else T = Etyp
+               exit when T = Etyp
                  or else
                    (Is_Private_Type (T) and then Etyp = Full_View (T))
                  or else