From patchwork Tue Dec 19 14:30:37 2023 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: 181015 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1981802dyi; Tue, 19 Dec 2023 06:37:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHG8gI/aIBtQVl5jZGftcnRhcSHDx5FkylSGNRYEOPj3gpg5hT3JC9IVcwWlCw5xBylbzq4 X-Received: by 2002:a05:6102:f95:b0:466:a711:e666 with SMTP id e21-20020a0561020f9500b00466a711e666mr1434078vsv.13.1702996653812; Tue, 19 Dec 2023 06:37:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702996653; cv=pass; d=google.com; s=arc-20160816; b=V8UuzrWsuEALh3MRBkoUWSFzDPnpnqyw3oeeeL218JX3RJmDaWkMRgz5l6kSTufaQs 6+9xOkHUpqUwqRsrkuOKrpjuTN8bB2UABDxsQkc8p6CczFj1o9ZmVkpP76L/KovDDjt9 Q2xdyV9D5O3yXnXsds3LwOo9PdtYL2KoKmnXFcCurYlkO3PDt4ntGlylmSkFI9AQvYgJ e3GAsDZq1qMHIoOfDmOLReeK1CTCbIx0Y+lTS4hzOKqySOLK09koQfYGO+8782Q2SyoQ UZY8CqDDT047sBhJor33e7WTMmRj9TtQIy8lZaESpbzx/s29E2HioLn2K72qFQ7Qnd96 UUbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=k7Jg7j4oyzjMAAn+v+dsbOYqyUuChi7tOklx4QmuYd4=; fh=hOhsC1930eHatDPYd2EALQ9Ry/g++vvN4vxlQkRuX+0=; b=w36n0O8IKG6W/aVB6T10oHFNftbMEDOTQErvahtExid4obum0xNxe5n+ievJjZD7OQ /81iObRx1nSMEDNHDbIbxlKX71XmvWfqomk/7mqQOXykZJAXglYKrX1MI1CrEnvwOrSt zgCPH+kMNaW4B5DmHGU60pb1BFdcuSbppDbqfJb34Au42cOMiDQPcShmsuFkmkzqdBvL R16Joh1tS/+lSR2CpechE2ng03RDpyKSQK8Qx/N0a4EXy/vu0BRvXQcReHTXHAfEsGKf g09KznapEk0XFUO3njxnZXjy+sCE5ZGjpD8lq6BEA+6h/9rzDLzoaw8kPEeIocOTgUKh uDoA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=j12Ob54L; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p12-20020a056102124c00b004669f85e902si565391vsg.323.2023.12.19.06.37.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=j12Ob54L; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEE87386F44D for ; Tue, 19 Dec 2023 14:36:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 6AE603858439 for ; Tue, 19 Dec 2023 14:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AE603858439 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 6AE603858439 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702996241; cv=none; b=LD1KsZHZQM4V6Q2zUczP/69orhzIsX7i2GpsfnZPv31/s93XANkhoXhP7hKDLAHoRUC34bwoNTtnspT64E9qlNajTTN+xh2mTfIKxtBri6uW6PsN3uExKDeH3pQ7QIK0D17e5nvulAZ05/jVbkK0ygmzrMZz7J3KK/UJ8D3Twuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702996241; c=relaxed/simple; bh=JqrMf1F3R10TDv2Dmt7lv/723WLOIMUp4U++XT+b/Hs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=w/3riRzfg1TEePaU+183nyeNIxYW+b/kRXF0QvyGo0AToPkUUJ1AhHnT0xLklhW5sEIgQ++I4+TRrs6sV7DVUSW9/aaGxtgy56YHpZTmzBYFQ0HFLzHNQYF4OnKpSBkDcMsmNDYX6OVxIPlAIte02bFDwxKMrONI0yykNIHck8A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c41b43e1eso58463205e9.1 for ; Tue, 19 Dec 2023 06:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1702996239; x=1703601039; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=k7Jg7j4oyzjMAAn+v+dsbOYqyUuChi7tOklx4QmuYd4=; b=j12Ob54Ll61ZmUQ6xBTPJVoBeRao89Jp1rcp4NpimWD/QHT6yDpeTZjfzXGO7EmUr5 gwbFu7ToAs/spvulyTEtIS4E0rpvejRJGxDienmdTaLJZ5mE4sh5LpxT09gqvkN6g/wj 0VEK21r7DDEV2j0FtEEHsTbHicPOCk3I1iQFegqT6fS/O9FO/vNnbKEp/5kZLbZhjb35 WvZYjmLfkM08rOKFwIOcS+/X7HP0l+zq0XL9msA20D3CzsYa57Z9i7gnhePgix7XdkPI kQyZbFNotwG2KrCSVJK7nLDBz+Imgf4PD9a5IptgjU77gLXftHq73h/hStYf8UF0wLa3 IDRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702996239; x=1703601039; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=k7Jg7j4oyzjMAAn+v+dsbOYqyUuChi7tOklx4QmuYd4=; b=f9FVLeVX9g2hbTH0DpFte3HEbuF/s+Ca8ABxRdO3jKdz29KNXA/fABG262doLs4uf3 66LddopQsiaWKHhNuT5ee7hKE+1Io47+KqTIVlMGj34qhNqDvEts4ld0SFB5EbflJH8P CETTiOTY8SKeX1nsCxF9Fu3UvqD6eUmoDu7uL1Z69BcjC2FNApiuHTeWmL0sfhBdpyeg elEUOkkeTWBDL4QOu0q9akwV2+wVuKBuXzC91zfkd3jmc9hjLLxW+mAJMfu5RQ8CVWnu OLpxwSmIuZ3iMHNLHjjSnoXNx78bDtz4B2lwAL2Cjmi4ANx2FCzDnbsGWta40ReIsH3v d5rQ== X-Gm-Message-State: AOJu0Ywf+rbPtA5ouBKjazEeFuF9jvpkUVisWp8KJ/RdnSgni4vSMqXK ZAKK+MEm8l/X5j6SaOQydvExKPLRxbWcFMlw9ww= X-Received: by 2002:a7b:c7c6:0:b0:40b:5e4a:4086 with SMTP id z6-20020a7bc7c6000000b0040b5e4a4086mr8392066wmk.166.1702996239232; Tue, 19 Dec 2023 06:30:39 -0800 (PST) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:fe1e:443:c34f:edaa]) by smtp.gmail.com with ESMTPSA id iv6-20020a05600c548600b0040c45cabc34sm3074939wmb.17.2023.12.19.06.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:30:38 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Add missing guard to previous change Date: Tue, 19 Dec 2023 15:30:37 +0100 Message-ID: <20231219143037.455041-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785721419310529118 X-GMAIL-MSGID: 1785721419310529118 From: Eric Botcazou Ancestor_Type is overloaded with Aggregate_Bounds on N_Aggregate nodes so its access needs to be guarded in Copy_Generic_Node. gcc/ada/ * sem_ch12.adb (Copy_Generic_Node): Add guard for Ancestor_Type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch12.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 2b8436d7c18..bfb400f5642 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -8518,10 +8518,12 @@ package body Sem_Ch12 is -- Moreover, for a full aggregate, if the type is a derived tagged -- type and has a global ancestor, then also restore the full view - -- of this ancestor, and do so up to the root type. + -- of this ancestor and do so up to the root type. Beware that the + -- Ancestor_Type field is overloaded, so test that it's an entity. if Nkind (N) = N_Aggregate and then Present (Ancestor_Type (N)) + and then Nkind (Ancestor_Type (N)) in N_Entity then declare Root_Typ : constant Entity_Id :=