From patchwork Tue May 30 07:21:09 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: 100585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1995779vqr; Tue, 30 May 2023 00:24:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+h41N93A6FhALUjVR15yZrsA8JRy8ApenPdPu1xxYYWOLQDe5rUoZcmBxhJjSrQD2NDWX X-Received: by 2002:a17:907:94cf:b0:965:b2c3:9575 with SMTP id dn15-20020a17090794cf00b00965b2c39575mr1294063ejc.57.1685431471820; Tue, 30 May 2023 00:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685431471; cv=none; d=google.com; s=arc-20160816; b=X9e/KxKzhS4I0PrxOdSYQrYQG18S3q/6/fZWIH8JfX/CGODQVv8i4SzQTAEf8V3d81 Joz7S+AdIXs/kNib4uKOm1gGH/s4rUr7Fs9ewg3YC5/weedlW/R0qEXldbQwT+OoaWdb wUww41DhYKxEn12831eLLe/P9z36yDZqjEQTelNAtY/O7RqeeychnDIhKuUhuMOmKyLJ udIX6blpmA6QC8BMwV9RcFmQgtKGyNq5eEWL3M42x0td6yWrL5jFxo6uWsnClq5/Zoc+ rxIoUe5yNSo4zz+cngDm5nuR+vJ6Kos5L26apXWxyCDCl29vtN1NhWsCJzcKc1opDFzg OqaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=OzGuMVjU1wKrCNnnCbyMHbpnV4S8KNsG26lP/nBIXn4=; b=XcJTcxqvey9dYNvzwgi5loY535XvaCgTI0lwGeL2/LEA9GgMWZIVtyTsoSHsYTQB4s 8i1x1bCDcnq53PghXraoM/YEO/GE6+iWNFWSieQk/ffFTNR7e30bI1s0qH1/laBUYVZN zxejRzLc1Fhn3lr5eUeUt/U6bfh3oyQAaWj4DaqjSRGY3zXTGxuyqKdzjNoI91eN4hGf TJVogFtrUl042IfqEO71xPlUvI+RPM2mqNHO0BHvFKAkJTR/GpfCtW8TbmefvMoI5LGQ DQKlwMTsolyq9cA6UWavbVe+MuJWYlcPBUPUbKKo0oq1OS1uoNLcqWyOMPgG83CczsjE Q2yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DlaRCIc4; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id rs19-20020a170907037300b009665a6d2f60si8357263ejb.910.2023.05.30.00.24.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:24:31 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=DlaRCIc4; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 36799383E8EC for ; Tue, 30 May 2023 07:22:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36799383E8EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685431352; bh=OzGuMVjU1wKrCNnnCbyMHbpnV4S8KNsG26lP/nBIXn4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=DlaRCIc4iB4ujgOynLxFRbtSagRG+Q8WtuIBIx7EJLliqA1klUepQYB6t4V2HAwxd weWHAKIFZ42TMaVqoq+3ft7CLJ/uBMy5xmPr4B7ZV07uqI1oacWAxeuH1T5mtt0vVS xmxotDLlnPYMDtpIyOVHXNNI8cNhFj5xGzfO1kOQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 2F90D385588F for ; Tue, 30 May 2023 07:21:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F90D385588F Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f6d7abe934so27088725e9.2 for ; Tue, 30 May 2023 00:21:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685431271; x=1688023271; 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=OzGuMVjU1wKrCNnnCbyMHbpnV4S8KNsG26lP/nBIXn4=; b=E6suIyxWbiBM32v4FO2uNabWFjN+2UJFMQcDUuyha0D2vVv5AOqHHlC96OQnLFXYmd rYoIioZGKFElSKAUSgv+U5uEOc2vUjFJ4iPgPw//4fPdp8PmOFjxp4+K2j8dN7+8CE4f MXC083Z/vaP6bfRLiJic82Dgq6PT+L5NOvtOX0l+ULcXJRyF0EvF6AGSwDtWE6ukAzIw +PYMqFIzJ9HhzuEqNGhD7WLEbKhxjNyaJcg8uITGP5rpVm5GuJU+AF4iL16oiikPxXYp KB2zBa/UEKXUIR1UmspQ7IRZ1hsTX9aED8YYvj/MNMEDU+DQIPwelROI5l13JTP2Cr+Q bdVA== X-Gm-Message-State: AC+VfDwrGsF5+ogYumPcU98byHa3E5VZ+WAwLdaNDBSXqvcehIUhUeod pvTugNBnWD6B6u0WwPqvEGI/l4bYhKvPk6Hz4CYVKg== X-Received: by 2002:a05:600c:22c4:b0:3f0:b1c9:25d4 with SMTP id 4-20020a05600c22c400b003f0b1c925d4mr723514wmg.21.1685431271066; Tue, 30 May 2023 00:21:11 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:7733:a608:a415:6b2a]) by smtp.gmail.com with ESMTPSA id w8-20020a1cf608000000b003f18b942338sm16525870wmc.3.2023.05.30.00.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:21:10 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Make use of Cannot_Be_Superflat flag on N_Range nodes Date: Tue, 30 May 2023 09:21:09 +0200 Message-Id: <20230530072109.2500426-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767302990938459296?= X-GMAIL-MSGID: =?utf-8?q?1767302990938459296?= From: Eric Botcazou gcc/ada/ * gcc-interface/decl.cc (range_cannot_be_superflat): Return true immediately if Cannot_Be_Superflat is set. * gcc-interface/misc.cc (gnat_post_options): Do not override the -Wstringop-overflow setting. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 4 ++++ gcc/ada/gcc-interface/misc.cc | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index ec61593a65b..53a11243590 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -6673,6 +6673,10 @@ range_cannot_be_superflat (Node_Id gnat_range) Node_Id gnat_scalar_range; tree gnu_lb, gnu_hb, gnu_lb_minus_one; + /* This is the easy case. */ + if (Cannot_Be_Superflat (gnat_range)) + return true; + /* If the low bound is not constant, take the worst case by finding an upper bound for its type, repeatedly if need be. */ while (Nkind (gnat_lb) != N_Integer_Literal diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc index b18ca8c7d88..56c7bb9b533 100644 --- a/gcc/ada/gcc-interface/misc.cc +++ b/gcc/ada/gcc-interface/misc.cc @@ -267,9 +267,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED) /* No return type warnings for Ada. */ warn_return_type = 0; - /* No string overflow warnings for Ada. */ - warn_stringop_overflow = 0; - /* No caret by default for Ada. */ if (!OPTION_SET_P (flag_diagnostics_show_caret)) global_dc->show_caret = false;