Message ID | 20240802071210.413366-10-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org> 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=RNwapMVS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WZxxN41JJz1yYq for <incoming@patchwork.ozlabs.org>; Fri, 2 Aug 2024 17:17:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB8CD386075E for <incoming@patchwork.ozlabs.org>; Fri, 2 Aug 2024 07:17:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 8C820385DDCE for <gcc-patches@gcc.gnu.org>; Fri, 2 Aug 2024 07:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C820385DDCE 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 8C820385DDCE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582755; cv=none; b=iLqG2bKQRhm4oNSF05nl1aqSafGXhrJSLuvHlv16KwjMPSX/Q8ecaZ0k8UDSstUIYlVZ5D41h5Xu2g6afupF18P3aoPkVBiMOvHz6JKEzgy2DEgYf1TLehrP0xvJrvEcGKoZg+ltvxWwW8DeNkCOO5kJ6ttYO5/OfkoR0y+5i5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582755; c=relaxed/simple; bh=lcNwtBacVQLuvHeckHwRuQL2gmEC7MzJu7VPJ6+WtVQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fIvoSFMxtQjU5XHNLTJrxikxeJ6OVb6NAvmkbMs5UB3ibsn3idpV19SMW0I60BA57T1CyjOg0tt0OlQ5Esmw7EgWQ/gRS+Fxyhuh4/5qVH6o9WHgy9RrrYC8LjNEh+Bsbs84ecUc/ZC3dDRz90qIDrT+8vuUzSa2o5rQ67xvpF8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2eeb1051360so86518991fa.0 for <gcc-patches@gcc.gnu.org>; Fri, 02 Aug 2024 00:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582751; x=1723187551; 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=ZR1zRSOFs2pVkCOBxAaCd9kPIdCFVb7aafXgFm7zAJs=; b=RNwapMVSxSGkol2//+ueIc4KfKp9K/meeexAR6FwwWHuMOyxsf++njKnMF9SIU/CU+ 8agiaWplwaTI6rxEk89TO7hHJgW0umz2ccr25FZXTiWfI1lWYs4A+ziQ1GTayMlZiElB yRa3OoBu0g8GhWxkmY2PReVTbb04Ow5EbFq6YKgCrtQYfUd2YqUQq1+xtEjLSU39OOjr w2glklCE+GGe3rSvt+uUQ0EWf2pGz1RkSP4AXCpkTUJWKvNrwBATcH0K6GDgJb5Jk24H D1AsS6kpC6cJULD7UZ7+NQfH+o7avmgD2C8MlXHVmLCI00KtlwEWnZkznpzZq4L+spuR USUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582751; x=1723187551; 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=ZR1zRSOFs2pVkCOBxAaCd9kPIdCFVb7aafXgFm7zAJs=; b=b/qRB7+o2rxlVBvXF0MXEhngWvpvK80vtTywfqnzCuUtVGdf/zN8DwUjd9Dl0Pz4PS 2pUV5wSAxuhSETqQVXt0rEklypc4O43Jl3k2mkn5VUrATc27G4lmblr6IIP0idqUpa/0 ZetrU9ARRa9YHzfaqAgOeldJtl92OAEXxp6Yy3k5UljNJ0hbFMaAdslDJQIjVcUoJM8b BYw21b44JBVyDte4MDvQKG02S0IzvGN2uMQUwMRAMgAt2+kPPhqEgQz/M6gCH+u2WBq+ PFBlDlZdpd/x18O8YTvmymc8Ey2/lixOVWRdHwkqx004O6ms4SXCA0PjZjG/AuoX0NWA 82sg== X-Gm-Message-State: AOJu0Yxr38xrSPKnUVxZwftTtSxYF0XIFfQP+WyJA9XDg/SXUnhe9YK+ 1LARvEHqbQVIf9yXTomEiVeradUbQKKUr28s1f15jbwKcyVw0ER7ngku3KhH/Q2mu/4iSJ9Vlai htg== X-Google-Smtp-Source: AGHT+IEp2l04Dui9gYt+Rnx2i3m3IBgNmds17GtXgWoF10/z1F9dRkjhUpN8undrsN7ggK6GJmLs1Q== X-Received: by 2002:a2e:8885:0:b0:2ef:2575:de11 with SMTP id 38308e7fff4ca-2f15aa91143mr17520601fa.15.1722582750954; Fri, 02 Aug 2024 00:12:30 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:30 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Steve Baird <baird@adacore.com> Subject: [COMMITTED 10/26] ada: Compiler accepts illegal assignment to reference type target. Date: Fri, 2 Aug 2024 09:11:27 +0200 Message-ID: <20240802071210.413366-10-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~incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,01/26] ada: Fix detection of suspicious loop patterns
|
expand
|
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 4db3a1a26ee..d44a12d1dd1 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -437,14 +437,6 @@ package body Sem_Ch5 is then null; - -- This may be a call to a parameterless function through an - -- implicit dereference, so discard interpretation as well. - - elsif Is_Entity_Name (Lhs) - and then Has_Implicit_Dereference (It.Typ) - then - null; - elsif Has_Compatible_Type (Rhs, It.Typ) then if T1 = Any_Type then T1 := It.Typ;
From: Steve Baird <baird@adacore.com> An assignment statement whose LHS is of a reference type is never legal. If no other legality rule is violated, then it is ambiguous. In some cases this ambiguity was not correctly detected. gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Delete code that was incorrectly implementing a preference rule. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 8 -------- 1 file changed, 8 deletions(-)