From patchwork Mon Oct 25 15:09:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 46629 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 05B1E385843F for ; Mon, 25 Oct 2021 15:19:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05B1E385843F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635175149; bh=331vQP8ovHrI73jGNaE6lheIUh3R/8oP0s6IEDwCFFs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YNa++BHnzkjFRKbpRYOa/jvKewWrSf8i5pcMcLjkQCHqo9AWZuWJQbSdKnFt8xHY8 B+xICzEtz0maBc4eC9Ra5Zp40iq6lKalpXxt6GqwzyhUndOEb/MMM45T4ygJt5kdM5 wI1eWSXjaik1a4PcAABt7D89ClwlVcTf/IGvlnI0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id E5A153858023 for ; Mon, 25 Oct 2021 15:09:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5A153858023 Received: by mail-lf1-x12f.google.com with SMTP id j21so12133046lfe.0 for ; Mon, 25 Oct 2021 08:09:16 -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=331vQP8ovHrI73jGNaE6lheIUh3R/8oP0s6IEDwCFFs=; b=uKxFHz4yfOVCXDnKGq9oUHEb0W/H6TesrJcLRzLGb8U2AbXEv1NhMKMAZrUMy/9TyB M5vrtIt+V/M6asikVrl6O06kkDsI1teTeDCPV0Ox5ZXVWxDk6Nhji25iVLjbKvMqQWAL GG3rB2h0KtZvkpayAMrLlwEze6bOkXx5TfemNMjvU412EZXxALlStv4MGSbpQ1ioDZ1y rd3CDmMAqq2phHRI1k2s3tsDaDBKMo7y2Kr8Vk0OgfOgg7it6wSpDt4DY32L5qmIcdJd IRdOao7A88xTXwZx+PRzKaa+pm4b/zF9bTEN7T4DeQnMyEfd21PkCRf/2kBhvO9jpOlk BIOQ== X-Gm-Message-State: AOAM53331qCNLsNoBt/L1nUOQOgKnoYVTX6X1fEGKZJfsNbmbDzRJPGd vKN14yIRBDXgBy3ufLaNoEzNa+KDwqnHZ8Rr X-Google-Smtp-Source: ABdhPJwtK9DEqG5RxMyE2OygB+3AjNJuYTxo6W3IxxRBJ8q9v+h1jpq8U+C2hgVd48b342SqJqFJhQ== X-Received: by 2002:a05:6512:3f87:: with SMTP id x7mr17283158lfa.5.1635174555845; Mon, 25 Oct 2021 08:09:15 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id m9sm536948lfu.253.2021.10.25.08.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 08:09:15 -0700 (PDT) Date: Mon, 25 Oct 2021 15:09:14 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Remove redundant guard in expansion of dispatching calls Message-ID: <20211025150914.GA346573@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Piotr Trojanek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Routine Predefined_Primitive_Bodies, which create predefined primitives for derived tagged types, is only called with non-interface types entities (which is even enforced with an assertion at the very start of its body). There is no need to recheck this condition when creating individual primitive operations related to tasking and equality. Code cleanup related to handling of dispatching equality in SPARK. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Predefined_Primitive_Bodies): Remove redundant conditions related to interface types. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -11102,7 +11102,6 @@ package body Exp_Ch3 is -- they may be ancestors of synchronized interface types). if Ada_Version >= Ada_2005 - and then not Is_Interface (Tag_Typ) and then ((Is_Interface (Etype (Tag_Typ)) and then Is_Limited_Record (Etype (Tag_Typ))) @@ -11123,7 +11122,7 @@ package body Exp_Ch3 is Append_To (Res, Make_Disp_Timed_Select_Body (Tag_Typ)); end if; - if not Is_Limited_Type (Tag_Typ) and then not Is_Interface (Tag_Typ) then + if not Is_Limited_Type (Tag_Typ) then -- Body for equality