From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99602 invoked by alias); 16 Nov 2017 10:23:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 99586 invoked by uid 89); 16 Nov 2017 10:23:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=U*moy, 254804, moyadacorecom, Moy 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 ESMTP; Thu, 16 Nov 2017 10:23:47 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3362B1161DE; Thu, 16 Nov 2017 05:23:46 -0500 (EST) 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 5t75oMlIBNZq; Thu, 16 Nov 2017 05:23:46 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 235BE1161D8; Thu, 16 Nov 2017 05:23:46 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4862) id 1F836517; Thu, 16 Nov 2017 05:23:46 -0500 (EST) Date: Thu, 16 Nov 2017 10:24:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Fix more precise mode for parameter Message-ID: <20171116102346.GA48637@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg01297.txt.bz2 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 447 CodePeer analysis of GNAT showed that a parameter was not read and always set on all paths, making it an out rather than an in-out. This was not detected by the compiler, because one path ends up raising an exception, which is not taken into account in the simpler analysis done in GNAT. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-16 Yannick Moy * sem_elab.adb (Include): Fix mode of parameter Curr to out. --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=difs Content-length: 843 Index: sem_elab.adb =================================================================== --- sem_elab.adb (revision 254804) +++ sem_elab.adb (working copy) @@ -4242,7 +4242,7 @@ -- Determine whether list List contains at least one suitable construct -- for inclusion into an early call region. - procedure Include (N : Node_Id; Curr : in out Node_Id); + procedure Include (N : Node_Id; Curr : out Node_Id); pragma Inline (Include); -- Update the Curr and Start pointers to include arbitrary construct N -- in the early call region. This routine raises ECR_Found. @@ -4556,7 +4556,7 @@ -- Include -- ------------- - procedure Include (N : Node_Id; Curr : in out Node_Id) is + procedure Include (N : Node_Id; Curr : out Node_Id) is begin Start := N; --VS++wcV0S1rZb1Fb--