From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 1CDA33858C2D; Mon, 16 Jan 2023 14:48:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CDA33858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673880497; bh=68CBRJmNknXR98f+HCxOwZINsqyAXAT/n8DJfiQRccs=; h=From:To:Subject:Date:From; b=vCsPJ90YMEZULhbyM16uNZ2sW5CIN6QGeWRSeODzYUlB9Xu6rnEc7L35BWbQl+bI7 FelN7VKwN/8GT+pPu90AeFj1xo+MaMej1b1wYzhiSzUMnXDSMqqALyTHSTM5AzxH5W i1MIdn1MCopH359p4iSd2XqaaUC4mMmJMeEeAHyg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5205] ada: Put back conversion to interface in more cases X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 24993939b7e405cdb8fa7ab6b388913a5d9fb6ce X-Git-Newrev: e59cd0db822e325868128281a81ee356a6914f52 Message-Id: <20230116144817.1CDA33858C2D@sourceware.org> Date: Mon, 16 Jan 2023 14:48:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e59cd0db822e325868128281a81ee356a6914f52 commit r13-5205-ge59cd0db822e325868128281a81ee356a6914f52 Author: Eric Botcazou Date: Tue Jan 3 08:20:30 2023 +0100 ada: Put back conversion to interface in more cases This needs to be done for all expressions with class-wide type. gcc/ada/ * exp_ch3.adb (Make_Allocator_For_Return): Put back an interface conversion for expressions with non-interface class-wide type. Diff: --- gcc/ada/exp_ch3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index c866a9c40f5..84594ed106b 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -7185,7 +7185,7 @@ package body Exp_Ch3 is -- remove earlier in the processing. if Is_Interface (Typ) - and then Is_Interface (Etype (Alloc_Expr)) + and then Is_Class_Wide_Type (Etype (Alloc_Expr)) and then Typ /= Etype (Alloc_Expr) then Alloc_Expr := Convert_To (Typ, Alloc_Expr);