Message ID | 20240517083207.130391-5-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=WOJov9Wj; 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 4VggFx3jMTz1yfq for <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 18:33:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A26703849AC6 for <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 08:33:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 97138384AB42 for <gcc-patches@gcc.gnu.org>; Fri, 17 May 2024 08:32:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97138384AB42 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 97138384AB42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715934749; cv=none; b=SmlmEZaIftRd/GdEVYt9IhO0UnYXRH4eXC7wjcAEe8ygtI4Y5BPWjTdrz6H8w8dA00odTV/ZgY+zH8JhKoCEKFiL5D+r3tfaruKUw+9IH1Y+/GPG64E5VkrxFzF+FUCNHb9khQuH4MQ6hZfAptqjYGidUX92eLG3WbfuJlnsFp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715934749; c=relaxed/simple; bh=5IsiSXO08joPBM3WhTfY2AZ3hj93e63BifFxmyfkPl8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HuAnCemqsPLiRk81b4CvtVW+mxSqnG1MnWw1ro9xYKN7YrNLW16k+fYz7xHmYleb8jpIwka2GpgSFnX9NoZOyz/scMWBbrZseyA77exRDp48UD+tiCFgmDUreDFgYwuWWE4q3b3syImVgKsAfFJHhzoSsTF7Xk8d/QC7mr3TMp4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2e1fa1f1d9bso5563941fa.0 for <gcc-patches@gcc.gnu.org>; Fri, 17 May 2024 01:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715934743; x=1716539543; 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=vOa8cOPBGQN+WfGPFaDAGQk8jVmz2IarTUIczqnzeI0=; b=WOJov9WjiV4fA0AqZUei93KBDMmXT8bPE/+a9n7i+BS7+Hf6nkPWOP9mC39jSXHT/o I9bY/Nw7yXDlCiVysJqIG3IBaiUd2Ux4b/h9I5A9550QdMUnEV3uIXztK2f+cZbr+7tR mgYD8RXKm0nLCzvH8lSDgXR0HpbxI5NQINWs4Cf8r2jpzLuVVxAbMkmc8Hgt22pV6i3t RuEVg50N3vcbGyR3VqdIBpUE9XP9d1aXI1iZ61qYsovyGKRM92RJK+wFQDcQrw5Jt4j9 dJbW3+cXZoODj89HE28picwCDd3gqz48ybI+3u95W4vSjUvWXzB/v1V7H1Vj6OTrAgD5 +V5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715934743; x=1716539543; 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=vOa8cOPBGQN+WfGPFaDAGQk8jVmz2IarTUIczqnzeI0=; b=MwHjI7W7f9yx9RT8w+xV2UUwvoSJS+SK3WD+1tOBBjbwFPyCHbcy6cclLIouX0JZvk MtFwdA5ry9vl9emRT1T05AE+7aQ+zrRldOBfKD8RBqmWViDAA0a53+89xiOYjBOoLskl FCRVDea0chx9g20p5Nqhr+w7V7jarvjZJWRGi/GdsOL1Ps2qc/Zjy0lb4UV2hCUGWLVS KNHzJ78AulOYLW6THmwUGyKX7tC1PYeP5r+Jc6cjCF1L6gY7Pf4Kp8JlcLNMy4Zeq1nX som5C9zca+vZj4ZKJBvKfGU36SjpS12tufMGZLim3akAWb7YBapcumg/1GYYD6KS2LQx EmGw== X-Gm-Message-State: AOJu0YzRhVzpoMBPk85QZF8gwo1OLrNsHmnPy4Pt3bn8tRvrpu75Vgk3 igX572KdjKoRFgEF38EOp6Z+fgjCZS50tD6HwOF4kshK4YpwMnWc/pj4toHLySYxOz8pbeuydco = X-Google-Smtp-Source: AGHT+IF5M5/ANpVNQwZsNqyMfUJ7UNBGPqEuHogK+HVOtFZWeJ5np2oSlQ6GTWsLfDfXW3ZJuC0PvQ== X-Received: by 2002:a05:651c:a0f:b0:2e2:812:4c4 with SMTP id 38308e7fff4ca-2e51fe57d49mr202164071fa.29.1715934743083; Fri, 17 May 2024 01:32:23 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:de37:8b1c:1f33:2610]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420273cff03sm75197045e9.26.2024.05.17.01.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 01:32:22 -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 05/35] ada: Check subtype to avoid a precondition failure Date: Fri, 17 May 2024 10:31:37 +0200 Message-ID: <20240517083207.130391-5-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240517083207.130391-1-poulhies@adacore.com> References: <20240517083207.130391-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 <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/35] ada: Add support for 'Object_Size to pragma Compile_Time_{Warning, Error}
|
expand
|
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 7ee4ca299d9..263be607ec1 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2029,8 +2029,9 @@ package body Sem_Ch3 is while Present (Target_Index) loop if Nkind (Subt_Index) in N_Expanded_Name | N_Identifier - and then Nkind - (Scalar_Range (Entity (Subt_Index))) = N_Range + and then Is_Scalar_Type (Entity (Subt_Index)) + and then + Nkind (Scalar_Range (Entity (Subt_Index))) = N_Range then Apply_Range_Check (Expr => Scalar_Range (Entity (Subt_Index)),
From: Viljar Indus <indus@adacore.com> gcc/ada/ * sem_ch3.adb (Analyze_Component_Declaration): Apply range checks only for Scalar_Types to ensure that they have the Scalar_Range attribute. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)