From patchwork Tue Jul 12 12:25:03 2022 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: 1655370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=YJbrsdIn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lj0Mb4cTxz9sB4 for ; Tue, 12 Jul 2022 22:25:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8B4438582B5 for ; Tue, 12 Jul 2022 12:25:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8B4438582B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1657628726; bh=RCQVuND/xYwGRQuJEKPjehkkEWjFptfD2ngRvxf2G1c=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YJbrsdIn6s78mhKBeSFdIpdcISTnLtBVayEjssqK9AMVQOhtterA63P8WatW/Wrwt 5NPzguVFgEtuvkxlE+8zi7FS1Ro6z22jEwwVtZqQUbzIlnp7Pm/uPMleMOz+3dDoQh Wd6fAOyB2PiqRI9rqaFuhkz6kmmOwfa6PooWNpow= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 369C1385734E for ; Tue, 12 Jul 2022 12:25:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 369C1385734E Received: by mail-ej1-x633.google.com with SMTP id ez10so13962656ejc.13 for ; Tue, 12 Jul 2022 05:25:06 -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=RCQVuND/xYwGRQuJEKPjehkkEWjFptfD2ngRvxf2G1c=; b=wZ+3KPKOXcYPwb0dE4iE8vzRz+xrkzA6j3j1ptoGRx7mu/F0V9ea/BvR+CqxJphQ7j kM3Sw0P9MpR/CSGO1BGbKxNmWO2V3GnKjnTG67SMtHT59+lyif3VsgUT/cAWsAYssBVh YrM2pvX68lzAB/Qzqd0EcAzEttt7YtUO60qdsqB0n7xtxkBSUB3R3MzEXJkEXSca7tHq Iqb1BiWyzTfmmc6IN5FpiYcFYwSVeIQz85C8PvpTmiqL//jesrbto3YDgLX1Qq8Cf3if Dugs9Zei6a3+EfPT7IsZHnp1oIcGq14/wxlI5QLE1sUGci6gdm6IuoRUREvRw8q9Hrr3 ht1w== X-Gm-Message-State: AJIora9SFLPmA2z8+PdKXy0boH/2JHsubhne2Q1R7/i+XgkhaZjafLjr zhITlwL8ZRIdpc/Trpld8ADwd0Eu+keabQ== X-Google-Smtp-Source: AGRyM1sws1vxEvxP8IVlRxIIP2Jx3a1FCdzpFJwBatnxj78js+iNXms3hUSKnBb0pL5EVKcKGdbisw== X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr23991282ejn.598.1657628704962; Tue, 12 Jul 2022 05:25:04 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id d6-20020a056402144600b004316f94ec4esm5879627edx.66.2022.07.12.05.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 05:25:04 -0700 (PDT) Date: Tue, 12 Jul 2022 12:25:03 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Remove excessive guard in detection of access-to-variable objects Message-ID: <20220712122503.GA3404497@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.2 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-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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" It is safe to call Is_Access_Variable without calling Is_Access_Object_Type before. Compiler cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Is_Variable): Remove excessive guard. diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -21896,7 +21896,6 @@ package body Sem_Util is or else (K = E_Component and then not In_Protected_Function (E)) or else (Present (Etype (E)) - and then Is_Access_Object_Type (Etype (E)) and then Is_Access_Variable (Etype (E)) and then Is_Dereferenced (N)) or else K = E_Out_Parameter