From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 2D0BD385737B for ; Mon, 26 Sep 2022 09:14:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0BD385737B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x329.google.com with SMTP id o5so4041350wms.1 for ; Mon, 26 Sep 2022 02:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Zy4u/eDXTKwzhWSGnx+LY2iLlqGFKrIyTWu+pdyOQdw=; b=OmbGUvZId9jmc3LaHZ/esOOc0vYDMsBNTvQaYUg4oSWsFWKbBHHHJzAD+g7VOXIk/0 4/Rzml7ViUMsFGPFiclD4KA/1Z7Ujhnnd43JJ5nTzbH4CNrG+hieAPXmKQ63OomOJD76 Sw5YurxI67al/W/ILU7NNLOPkqvzp1BqtqtKHR7jAEP9KEamsfRKz2+uLdXmvtLQxSMT 5DWqKzHbVIfRYZbV3mILaqLsYGu7isk+bvNy5CVkZxsKlEfCZLQzfE2CGEyDmI0rjB01 Pgs/DXSgyLH+8PS7jmDlG0mMkrxdEaocnzngLA6bEHdw4sKkM7GeAKs2HrYXrArIU5Tu nXFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Zy4u/eDXTKwzhWSGnx+LY2iLlqGFKrIyTWu+pdyOQdw=; b=sJtgjIO0ThvH3OxsGFEvl3lMvQEoGyM6hrXO8og3pZGnTx/eHuj3wOedgFuoQW2K9v 5GH4hW19b23pltEto4kVpKgL1ckb20ZkCzFLdaAaeVhtbbv8I3kD3lKUnBp/0f4I1Zhp pTSWw4Xqrg8yp7JIwEstwsv5Ok4E3XZNaplIq8U0p31TZTDD9g87vkXicr9vB0wlhZkU suBMmB9LdHK3gvZLOmgP0VGYDB3tznkKoqmLLhd23jOwcYZi6/4HRbpFk4zNVX7up+fX rjk6s9S1NtMucabFZQ7Jvby8cAGbMjMQMlD6ktEyXPX35RCTw9wtoECQeIwRcf/gh5ml G/4A== X-Gm-Message-State: ACrzQf1w/hoZWySykxrUJfFpT8avHMsELk9yNSqdxC+kjgWeWAOBNN21 OOcRblmNHBJocp/mMxbJv98FRU4D7Yeg8w== X-Google-Smtp-Source: AMsMyM6AuClohVeJC+yGXnvdTf4WR39UswoP1I6BSaIRxGia1ldbQ8x+j1Zaf91rxdNyUE+s+csYgA== X-Received: by 2002:a05:600c:2949:b0:3b4:85b2:c1d7 with SMTP id n9-20020a05600c294900b003b485b2c1d7mr21150097wmd.183.1664183696831; Mon, 26 Sep 2022 02:14:56 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id p4-20020a1c5444000000b003a5c7a942edsm10557262wmi.28.2022.09.26.02.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:14:56 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITED] ada: Only reject volatile ghost objects when SPARK_Mode is On Date: Mon, 26 Sep 2022 11:14:53 +0200 Message-Id: <20220926091453.273010-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 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 List-Id: From: Piotr Trojanek SPARK rule that forbids ghost volatile objects is only affecting proof and not generation of object code. It is now only applied where SPARK_Mode is On. This flexibility is needed to compile code automatically instrumented by GNATcoverage. gcc/ada/ * contracts.adb (Analyze_Object_Contract): Check SPARK_Mode before applying SPARK rule. --- gcc/ada/contracts.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 34db67a8cab..dd573d374c6 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -1207,7 +1207,7 @@ package body Contracts is -- A Ghost object cannot be effectively volatile (SPARK RM 6.9(7) and -- SPARK RM 6.9(19)). - elsif Is_Effectively_Volatile (Obj_Id) then + elsif SPARK_Mode = On and then Is_Effectively_Volatile (Obj_Id) then Error_Msg_N ("ghost object & cannot be volatile", Obj_Id); -- A Ghost object cannot be imported or exported (SPARK RM 6.9(7)). -- 2.25.1