public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Remove a couple of unreachable statements
@ 2023-01-09 14:45 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-01-09 14:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: Eric Botcazou

From: Eric Botcazou <ebotcazou@adacore.com>

The "then" arm of these nested if-statements is trivially unreachable.

gcc/ada/

	* exp_ch7.adb (Make_Adjust_Call): Remove unreachable statement.
	(Make_Final_Call): Likewise.

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

---
 gcc/ada/exp_ch7.adb | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index f29a97a0ceb..86878616f6a 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -6043,11 +6043,7 @@ package body Exp_Ch7 is
       --  Derivations from [Limited_]Controlled
 
       elsif Is_Controlled (Utyp) then
-         if Has_Controlled_Component (Utyp) then
-            Adj_Id := Find_Optional_Prim_Op (Utyp, TSS_Deep_Adjust);
-         else
-            Adj_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Adjust_Case));
-         end if;
+         Adj_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Adjust_Case));
 
       --  Tagged types
 
@@ -8396,11 +8392,7 @@ package body Exp_Ch7 is
       --  Derivations from [Limited_]Controlled
 
       elsif Is_Controlled (Utyp) then
-         if Has_Controlled_Component (Utyp) then
-            Fin_Id := Find_Optional_Prim_Op (Utyp, TSS_Deep_Finalize);
-         else
-            Fin_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Finalize_Case));
-         end if;
+         Fin_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Finalize_Case));
 
       --  Tagged types
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-09 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 14:45 [COMMITTED] ada: Remove a couple of unreachable statements Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).