From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17720 invoked by alias); 15 Jun 2015 00:36:29 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 17636 invoked by uid 89); 15 Jun 2015 00:36:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Message-ID: <1434328137.3192.9.camel@surprise> Subject: Re: Basic blocks, jump targets and locals From: David Malcolm To: Dibyendu Majumdar Cc: jit@gcc.gnu.org Date: Thu, 01 Jan 2015 00:00:00 -0000 In-Reply-To: References: <1434054685.12727.205.camel@surprise> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-SW-Source: 2015-q2/txt/msg00060.txt.bz2 On Sat, 2015-06-13 at 21:25 +0100, Dibyendu Majumdar wrote: > On 11 June 2015 at 21:31, David Malcolm wrote: > > Local variables in libgccjit are local to a *function*; there's no > > association between them and blocks. Blocks in libgccjit relate to > > control flow, not to scope. > > > > Note that any initialization of a local variable has to be done > > explicitly, by adding an assignment statement. Typically that > > assignment statement would be added to the initial block, as in the > > example above (so I suppose that's an association of sorts between > > locals and the entry block). > > > > Can an assignment statement be added to a block that is already terminated? No; you'll get an error like: adding to terminated block: entry (already terminated by: goto foo) So you may want to wait until you've added all the initializations before adding the jump from the entry block to the block for the first bytecode.