Message ID | 20240802071210.413366-8-poulhies@adacore.com |
---|---|
State | Committed |
Commit | d32a5294de92637680accd17d68421f485eaba32 |
Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> 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 22573385E827 for <patchwork@sourceware.org>; Fri, 2 Aug 2024 07:15:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id BB6FA385DDEE for <gcc-patches@gcc.gnu.org>; Fri, 2 Aug 2024 07:12:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB6FA385DDEE 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 BB6FA385DDEE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; cv=none; b=WuYnqsk0+tZi0ErIhiDJ+UXzIKUYOElF5sZEboF1iwiHVkrhAvZp2or+6w+VDjTrhK5pka8Qah+a2uORZp8ws0jj3us1ETkYoWdnA7F36jIDoZdWwoW05i9ViMOVDm+x1bfXSAvxlSHrarPZDIxfJdYvejCgPyFv6Dq9TMPbxqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582752; c=relaxed/simple; bh=p9F3ahqRTCN1Lhpu1LIaE4QWwERwq2OnF2slLzNQ/P4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oUeb69bIvtrMtTW3mmal0Z6cRiXLbNPau4MA8csChe0DQb27xR7MO4kKAgaGctyngGfz388+jr6nAZ6WK2JOSuLyP7u/R/ndiXED1sSC0dq3ZjWb1A3Tdg3jeIcne7tfK7M9P8ekUGJm2VZeOrIaA95b5ICNUXYAGcNk+GaS8xA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-367963ea053so4945948f8f.2 for <gcc-patches@gcc.gnu.org>; Fri, 02 Aug 2024 00:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582749; x=1723187549; 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=AIhrzaVcH8q3XGWIlZgUwjDXaN/TOhOGH49WRdJakwg=; b=e5i3gEwGsENCHdk046ZO5+drI397WVYMbrhmZIglEQiLFUGpOVdhaMbAg9VgcyYZhk ozQPzeH5yQ3C4HW/dMH2tJcWQiyhYRKTdsTW3BzM37jHHRhwb1u4df5i5M47vuoWoEjs HGzcgWSjAz3l+ta+mhEJ7cW5TDqltH6VlZY50Vpft7SoYR4lUehJNklP0jv4kIy8/noX sglu0Ka6j0Kv1zJlYBoz5BMDWCnfaYzeG5e95BHLf475mH70O5QxASJLVOEKgKFzPo8C wc1vFcdiIy56uXf0LD7IKYODsWvqIpUMzQf4MNDk8HNvo8s1cEegsBB5+gltG4PWd14s i71w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582749; x=1723187549; 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=AIhrzaVcH8q3XGWIlZgUwjDXaN/TOhOGH49WRdJakwg=; b=oAVZ1zgv4gLkeU9UO5N/fIWNBXrodPzZnGc/NSiRcygqDui1Xu+Xmc3RIBLZFf0Sd1 WDm1Up62H0wkZBKdpnu2pdGO+th+DPcp71iCMJdfWwT59kUORpPKFJQOftMK8t8HJEsO iK4k8nw76g3N10oZjDfKJrIfmG7C3AEYkqorfQP710W01tbzQKVWdj4PAzBrUyfZSzdV 0+RN3McfIihOdAtrVsXTEeMnvA1zvPpG6ekhLMv5js2LcGG3TVWe11+5FFOo3rnRK7/A jC+Chfg09EvwwwGUAIRyrDfi1YSQMCStwjdo0NI780nFrIa2PApcMEOEOC8Fyl5vIvdx Dsww== X-Gm-Message-State: AOJu0YzMMfoJoxMFl/LZpiM6HqAKbzWRbOFGE20A2qbewuJLdWoFQPcG pUU9A9uPynRhKRGBki8SXskEOsemDKMQx+iyZmkbn+Qj4gvxz89Tj5vi4JPytlxghiuAfFZRdd5 Q9g== X-Google-Smtp-Source: AGHT+IHxHW78MrU2ivALGu+Eq/rAdtIn4SAIlq8h9i8us929ULyexgiD5/8R3PsXv9tW0jK14QUtOw== X-Received: by 2002:a05:6000:18c1:b0:368:3b5c:7a5d with SMTP id ffacd0b85a97d-36bbc0ff29bmr1652529f8f.20.1722582749377; Fri, 02 Aug 2024 00:12:29 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:28 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Viljar Indus <indus@adacore.com> Subject: [COMMITTED 08/26] ada: Fix handling reference warnings with slices Date: Fri, 2 Aug 2024 09:11:25 +0200 Message-ID: <20240802071210.413366-8-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
Series |
[COMMITTED,01/26] ada: Fix detection of suspicious loop patterns
|
|
Commit Message
Marc Poulhiès
Aug. 2, 2024, 7:11 a.m. UTC
From: Viljar Indus <indus@adacore.com>
gcc/ada/
* sem_util.adb (Set_Referenced_Modified): Set referenced as LHS
for the prefixes of array slices.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 7901eb8ee38..7b575c09c30 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -27787,9 +27787,10 @@ package body Sem_Util is Pref : Node_Id; begin - -- Deal with indexed or selected component where prefix is modified + -- Deal with indexed components, selected components, or slices where + -- the prefix is modified. - if Nkind (N) in N_Indexed_Component | N_Selected_Component then + if Nkind (N) in N_Indexed_Component | N_Selected_Component | N_Slice then -- Grab the original node to avoid looking at internally generated -- objects.