From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id B405E3857C5D for ; Wed, 6 Jul 2022 13:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B405E3857C5D Received: by mail-wr1-x433.google.com with SMTP id b26so22119964wrc.2 for ; Wed, 06 Jul 2022 06:31:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=V+hyclMTPDghKuzMUFhAo58gI8JGtzsLW47odccTE1w=; b=aYyJncEHdM+dmFSgAlBy4nJ7lwPcUv8H1T7El6jnmX2KSK+0nzSs+tRmPLamZIf9sx lQJyrAQh2U/W2IyFPDQuMkJPJVnzIs600kOE5H0nVqEi09oJzv9ups6nuh+idGds98a+ t9KuBd+QhHs/95HdRofF08y+TMMOhDC/or+Bql9+z9BQT8FNj1+QVUBG8+8d1Z/hiJlr TRWmhNhdXQItHyN0qn9Xf4n42YBlaOCzEckaHAkdEtCnx+UQEXpKTNqX3+Gu6qvuMX/o +3RXLk3NfiY4OZ0KJLE6lbr0XK6G6dYnXnWx+UY446fKEo4T6jjsKUFnQSxQBfi4l7kG i7vw== X-Gm-Message-State: AJIora+aP11Xaqkhd+9REOHHaoAdmwh+PWPSg4R1cAdjoLaDElxeZwig AnY0C8TS09+WPdySFHfLKEY0skW0ABfW1w== X-Google-Smtp-Source: AGRyM1sZnH4/WQxk9XHftofuvKrzTooYx5o7e9tES4iaY1DuJuqnFWP+wl7pDV6gYFvTNv8JDQV1Kg== X-Received: by 2002:a5d:648a:0:b0:21d:2cd8:8b87 with SMTP id o10-20020a5d648a000000b0021d2cd88b87mr35442163wri.241.1657114279477; Wed, 06 Jul 2022 06:31:19 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id r12-20020a05600c35cc00b003a04e900552sm25933368wmq.1.2022.07.06.06.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 06:31:18 -0700 (PDT) Date: Wed, 6 Jul 2022 13:31:18 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Remove explicit call to Make_Unchecked_Type_Conversion Message-ID: <20220706133118.GA2201500@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2022 13:31:22 -0000 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Respect a comment in sinfo.ads, which says: "Unchecked type conversion nodes should be created by calling Tbuild.Unchecked_Convert_To, rather than by directly calling Nmake.Make_Unchecked_Type_Conversion." No test appears to be affected by this change, so this is just a cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Build_Static_Check_Helper_Call): Replace explicit call to Make_Unchecked_Type_Conversion with a call to Unchecked_Convert_To. * tbuild.adb (Unchecked_Convert_To): Fix whitespace. --FL5UXtIhxfXey3p5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -7578,9 +7578,7 @@ package body Exp_Ch6 is and then Etype (F) /= Etype (A) then Append_To (Actuals, - Make_Unchecked_Type_Conversion (Loc, - New_Occurrence_Of (Etype (F), Loc), - New_Copy_Tree (A))); + Unchecked_Convert_To (Etype (F), New_Copy_Tree (A))); else Append_To (Actuals, New_Copy_Tree (A)); end if; diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -882,8 +882,8 @@ package body Tbuild is -- We don't really want to allow E_Void here, but existing code passes -- it. - Loc : constant Source_Ptr := Sloc (Expr); - Result : Node_Id; + Loc : constant Source_Ptr := Sloc (Expr); + Result : Node_Id; begin -- If the expression is already of the correct type, then nothing --FL5UXtIhxfXey3p5--