From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGHT+IGRQ1Mt/7E2v35ZwgGfR3kCksueLYkfTp4KpPMEbXjwcUr9HOMP16BYCkwUYertiq38dtECkw== 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=20Poulhi=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 Content-Transfer-Encoding: 8bit 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 List-Id: 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 := -- 2.43.0