From patchwork Tue Aug 6 09:02:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1969386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=jPU806eF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WdS7Q0n02z1ydt for ; Tue, 6 Aug 2024 19:05:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB3D2385B50B for ; Tue, 6 Aug 2024 09:05:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 244C43858435 for ; Tue, 6 Aug 2024 09:03:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 244C43858435 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 244C43858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722934984; cv=none; b=goSHNu745IFk7Bx6WlAVlXIjwleOnk9nsh11CNycZmBt8kieQ9FB2JPIniYHqnuQkDEE9rFUGsJWXq2jjWPkMm5vLuFHET09/Vw2uyvnl980C/yB1jPoIbyjgZfe2AJDJtxyN7WEqvolFY2qZKZCrA+gbHKFmkiRWwnsn+9lqc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722934984; c=relaxed/simple; bh=NRpthLQjtmUdFGqXkgH9SCQk2oWsev09rQKuM2QbSTs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WiZTOs2Cqdv2m/xzNLouapW1MLwXdnosuKnOybtitkFmye7UAAMCPHbFtwpHli/+0gl7Mp/mUfzI7+KDOliIylfsZ4OMi6m/0fzZu8SOnSKIKNobFSAvViWH4KwRFYsAZw0KXxeOuPF2ZzWHu/PcOCTpshNT30gEB+T6U5IvoCE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ef27bfd15bso3342901fa.2 for ; Tue, 06 Aug 2024 02:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722934980; x=1723539780; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4y7qTLj+ymSIQAGLGH+2E93mN/sUexZ3/V0XOyr8dt0=; b=jPU806eFCulRjyyUDts7CQYQlQ5IOYGay/fdnoVsB+/vs8S7BPFBEbiTfH7eOFUxnU mpjyR3Q8ElkWtWnEl8Pi+4bhipxAwg1rGm/cUpZtz7hCOArpGCeP3oP4vgpeQ4cp2b++ xgIu3Bm2YxoYv2WfKIzHe4q6cLfiShcSIg76K+RJs27g3Rzg4ZHFFrNa9DGDH/U3CsbD 9LynKAuVunf7V+Dbaw+q+23Bh6f4L260oyfxo7TpFtBwtglk3jtIkIYZki49M7mQRkeH zXPNLIUp12WH3wbz/Ww7sYLkvOjE/XL0cxqcDSzxLrpYnUiFEGD1TZ+aZ52w91HNF5n6 pMeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722934980; x=1723539780; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4y7qTLj+ymSIQAGLGH+2E93mN/sUexZ3/V0XOyr8dt0=; b=qh/rQJxGF1twXusBzzTwOTqay1yWXzrBTW92LqCu1bFguFjq5mvCrlIzstkIP0GMaj bCe5DoK9cWCwQ/I4Kxym4sYnussijFo0eBdFiTyRbcxy1U1AloevPXfl3yWRtANskuE3 /cbep0SPbv3KvVzFEEFwXyr5DSwrnRbZxWUkd0GGsP8WMOSZSLSibz59w9wTsYY4eeON oFg05CW8tVnUR1Nf28HZT+rkUzBywg7eNUNxOdvpm/HN+HDEyTaO5bOjT78MEit1Lybn nzGzjHo9eTQK87N/+3rA2Xc9DXmTS8I7SRj2FhstVjEWNcJ7Q2+txCuKKHMa9InndpQe YfZA== X-Gm-Message-State: AOJu0Yy32prGt+WdgiBn71/zlV+iYxibvOMZPdboXoPJFQmg7jMFqDoi iIY+9X7XGGEs/HkoKpFuEAWZyGQMK8DVjksqFw3Z6B15hGtTMMv9Q+Uch8JQkFvDv0n4pKL9vkN AmQ== X-Google-Smtp-Source: AGHT+IF+iMC2cuX9B6Ir9JPH8FpQuk3ovFBu364nli+XjTOP8AECdmQ15MftiqFgJLteV+xlezG/Ig== X-Received: by 2002:a2e:9956:0:b0:2ef:23a2:7efa with SMTP id 38308e7fff4ca-2f15aab2849mr92140771fa.27.1722934980299; Tue, 06 Aug 2024 02:03:00 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6e03c4csm173461085e9.13.2024.08.06.02.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 02:02:59 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [COMMITTED 9/9] ada: Fix error in GNATprove inlining with array concatenation Date: Tue, 6 Aug 2024 11:02:41 +0200 Message-ID: <20240806090241.576862-9-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806090241.576862-1-poulhies@adacore.com> References: <20240806090241.576862-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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.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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Yannick Moy Wrong interpretation of the type of the concatenation can lead to a spurious error in GNATprove when inlining code. Now fixed. gcc/ada/ * sem_ch4.adb (Analyze_Concatenation_Rest): Do not add a wrong interpretation of the concatenation, using the type of the operand already recognized as of the element type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch4.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index fc3a2a43c3c..9b77a81e43e 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -1995,6 +1995,7 @@ package body Sem_Ch4 is (Root_Type (LT) = Standard_String or else Scope (LT) /= Standard_Standard) and then Etype (R) = Any_String + and then not Is_Component_Left_Opnd (N) then Add_One_Interp (N, Op_Id, LT); @@ -2002,6 +2003,7 @@ package body Sem_Ch4 is (Root_Type (RT) = Standard_String or else Scope (RT) /= Standard_Standard) and then Etype (L) = Any_String + and then not Is_Component_Right_Opnd (N) then Add_One_Interp (N, Op_Id, RT);