From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98652 invoked by alias); 15 Jun 2015 19:46:10 -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 98642 invoked by uid 89); 15 Jun 2015 19:46:10 -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.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW 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: mail-yk0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kqWSLroA/Mvt7ZGHPnPSzEde7rYs8okv4avOf3AhC1c=; b=TRt/TN+3SfTSh0Y9m/3fDw4iXrsgSncGG9LEYUKSPC0woiFqkuYRMCIanhzkr20J6p w/O21mQQmVruV75CLthIEMnLj6BcFjca/WfbQYpNNk4LLTOwwSa9Q7cmDBi+dhTu9nzQ R3c/TZYMpZPiQTDpWXsgjlvd594YE6NsjnqwGz4MDKWXneoIVms1utPHobj0jK9ViIDd QeKXuIYa8Ni2Hk/btm8D53kOa6XXTvMOWpfF+OyN9TSA00AnTqLyKb4nwRBHMVnT+MoG /6E06MAw42N2vztZU6SIyFADUM2EK9Rz1NPNhl+W+k+6M+c+jS9VbSjq6vP0SGv5JvM6 ZeDQ== X-Gm-Message-State: ALoCoQkNc5QV4448/OtFJFr3xhHZ+nYv5JsismBqOZxAYoAtoJpFbKnNh2eMi2JbSSyw+Q3Z8eDu MIME-Version: 1.0 X-Received: by 10.170.135.5 with SMTP id b5mr29202384ykc.4.1434397567541; Mon, 15 Jun 2015 12:46:07 -0700 (PDT) In-Reply-To: <1434328137.3192.9.camel@surprise> References: <1434054685.12727.205.camel@surprise> <1434328137.3192.9.camel@surprise> Date: Thu, 01 Jan 2015 00:00:00 -0000 Message-ID: Subject: Re: Basic blocks, jump targets and locals From: Dibyendu Majumdar To: David Malcolm Cc: jit@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-q2/txt/msg00070.txt.bz2 On 15 June 2015 at 01:28, David Malcolm wrote: > 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. > I can do that, but maybe I don't need to? If the assignment occurs in a subsequent block and is valid from control flow point of view then it is correct - right? Regards Dibyendu