[COMMITTED] ada: Reuse code in Is_Fully_Initialized_Type

Message ID 20230706113856.1766127-1-poulhies@adacore.com
State Accepted
Headers
Series [COMMITTED] ada: Reuse code in Is_Fully_Initialized_Type |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Marc Poulhiès July 6, 2023, 11:38 a.m. UTC
  From: Viljar Indus <indus@adacore.com>

gcc/ada/

	* sem_util.adb (Is_Fully_Initialized_Type): Avoid recalculating
	the underlying type twice.

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

---
 gcc/ada/sem_util.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 736751f5fae..821aacf1ccb 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -17333,7 +17333,7 @@  package body Sem_Util is
                   declare
                      Init : constant Entity_Id :=
                               (Find_Optional_Prim_Op
-                                 (Underlying_Type (Typ), Name_Initialize));
+                                 (Utyp, Name_Initialize));
 
                   begin
                      if Present (Init)