From patchwork Thu Oct 17 10:32:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 284149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9DCA2C00EF for ; Thu, 17 Oct 2013 21:32:35 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ua1N7US2dlkg6rmZxP6kqiqAYN4uhcWDr7kqSCrYW2kv7bmLDi 7bKxTzQ8yK8Z7/3zHpps2nVsRfcXI2X+8PJ/HzJ5BYgFb/GNmoUeFipj6rybdC9+ eEyOFg9XBPx0JEDxtcB3KJgva6fA9Mc448fSYVV2hGT0scaoGyZ+/+HAM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=0i89IQH/TUfXkLimnkDnYQI2eVM=; b=Gt4HxgnXSJEhumrn39tJ cpZiFAE+FVehctS69iCRWCDziVv1KYJ0g3G7sL9CGq7MXDiaDHFrtW4PJK+cB55T KE3Nb4KlR4ajVb/kfPxAQO02YkpmjIaHkibHBERLsM2P2s21yh1m1+QiPaHAtEed fBC6SaskqyIR1k8rePSOfqI= Received: (qmail 11348 invoked by alias); 17 Oct 2013 10:32:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11339 invoked by uid 89); 17 Oct 2013 10:32:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 17 Oct 2013 10:32:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 818B611675B; Thu, 17 Oct 2013 06:32:48 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dorhJTPQQTB2; Thu, 17 Oct 2013 06:32:48 -0400 (EDT) Received: from kwai.gnat.com (unknown [IPv6:2620:20:4000:0:a6ba:dbff:fe26:1f63]) by rock.gnat.com (Postfix) with ESMTP id 707C9116734; Thu, 17 Oct 2013 06:32:48 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 31A4C3FB31; Thu, 17 Oct 2013 06:32:25 -0400 (EDT) Date: Thu, 17 Oct 2013 06:32:25 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Fix generation of references for SPARK formal verification Message-ID: <20131017103225.GA1920@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) The generation of references for SPARK formal verification was missing some write references through renamings. This is now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-10-17 Yannick Moy * sem_ch8.adb (Find_Direct_Name): Keep track of assignments for renamings in SPARK mode. Index: sem_ch8.adb =================================================================== --- sem_ch8.adb (revision 203568) +++ sem_ch8.adb (working copy) @@ -5073,9 +5073,14 @@ -- Entity is unambiguous, indicate that it is referenced here -- For a renaming of an object, always generate simple reference, - -- we don't try to keep track of assignments in this case. + -- we don't try to keep track of assignments in this case, except + -- in SPARK mode where renamings are traversed for generating + -- local effects of subprograms. - if Is_Object (E) and then Present (Renamed_Object (E)) then + if Is_Object (E) + and then Present (Renamed_Object (E)) + and then not SPARK_Mode + then Generate_Reference (E, N); -- If the renamed entity is a private protected component,