From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102741 invoked by alias); 18 Dec 2018 07:12:27 -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 102720 invoked by uid 89); 18 Dec 2018 07:12:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=PS, p.s, P.S, UD:P.S X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-wr1-f42.google.com Received: from mail-wr1-f42.google.com (HELO mail-wr1-f42.google.com) (209.85.221.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 07:12:23 +0000 Received: by mail-wr1-f42.google.com with SMTP id r10so14701856wrs.10 for ; Mon, 17 Dec 2018 23:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=hCrRJ0IIIe4r0xynxbQGvDh7o8v91WWeZmzT39RJCmo=; b=UGYN/Rg8kzQxe9dYcJA+6OAsVdNCfN8jqU5SsZx+ZEt3YGawr4LxZ8poUicbDpKmNp /anbq8+SFdJVq0HKk/TunJC7N01wruprz6bdvNS65p34yuE+Je6HCrT3/L03LF4DvCui YI0oMdpexFa9VMddvGxz5GwpBZSE8HrDuWhacpwwwcyWIFUK59BA9YLubMBpRJYnCK/L wqU674dPWHF+Zh4qavHPzvK/uQ4s7VjyLFXClMpGL7+UvUYsY0JyfZKTMNBOG6d3H8Ua nlwGzmnKn+Xsm1qxu9qv68dStBJ987tdNSjXNlX6uk5wR3aYhiG0IubnlZ0YOwddvpCi QtZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-transfer-encoding:content-language; bh=hCrRJ0IIIe4r0xynxbQGvDh7o8v91WWeZmzT39RJCmo=; b=t2N/A5tSJ742h/cfdq1gjMy7GtVtfCMPQMiGFf1mLLzo+FB09p4RmKQG6vpDxaadIM 6q0v9SbWPOuCrZkCB673z/rqmcxbZY7xCmxH6K4hMV5qJ/Rejto1adE4Hb+v4UZ5qjsY 2rLajLVB5UdVN+H6gtd41L3Tlrvyufv/3AzWbx6GMTx5jdz4cl5S0AXiCfjnTg9domQP XLvxVm09op63DdjPc5/L3YPhhOfgi62t2hmdfpIX0nVOhvfLRXtZWGY4/ZSETsDGLEmb LwSIbz5dtLUeXiE3paWbLKNXOSX1a991IOmjAg/eNbEYuL0pFesxPhYhCiDeASFxWdzW z6UQ== X-Gm-Message-State: AA+aEWai7RynB019Bg+mSCqVKFBJnixxCL/KnWCqGl/x3AjC8mTZsRi5 zpKTM8xk0X/LZ7MeN3nl9NW6JaP+ X-Google-Smtp-Source: AFSGD/X+gohKfnsJhCFznokRy2xK5NBdXaLpu9Fs0n/DM4WBG+7KD9oZh070DWZbtyt7iaQNYfcq8g== X-Received: by 2002:adf:90e5:: with SMTP id i92mr12598442wri.210.1545117140886; Mon, 17 Dec 2018 23:12:20 -0800 (PST) Received: from [137.250.162.5] (grothendieck.math.uni-augsburg.de. [137.250.162.5]) by smtp.googlemail.com with ESMTPSA id x8sm3346978wmd.45.2018.12.17.23.12.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 23:12:20 -0800 (PST) To: jit@gcc.gnu.org From: =?UTF-8?Q?Marc_Nieper-Wi=c3=9fkirchen?= Subject: Re: alloca and labels as values Message-ID: <9bf4ad79-88dd-cac9-babf-c83d59acf7c5@nieper-wisskirchen.de> Date: Mon, 01 Jan 2018 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00004.txt.bz2 > > Is `alloca' currently possible with libgccjit? I haven't found > > anything > > about it in the documentation. If it isn't possible at the moment, > > I'd > > love to see it added to libgccjit very soon. (One use case would be > > a > > compiler like the Chicken Scheme compiler that employs Cheney-on-the- > > MTA > > where the youngest heap generation is allocated on the stack.) > > I haven't tested this, but I believe you ought to be able to access it > via the "__builtin_alloca" builtin, via something like: > > > gcc_jit_function *fn_alloca >   = gcc_jit_context_get_builtin_function (ctxt, "__builtin_alloca"); > > > gcc_jit_rvalue *call = >         gcc_jit_context_new_call (ctxt, >                                   loc, >                                   fn_alloc_a, >                                   1, &size_t_arg); > >  gcc_jit_block_add_assignment (block, loc, >                                dst_lvalue, >                                call); > > ...or something like that. That was helpful; thank you very much. I overlooked the procedure `gcc_jit_context_get_builtin_function' in the documentation. Is there a way to determine which builtins are supported by a specific version of the library or would I have to add a few scripts to my project's `configure.ac ' myself? -- Marc P.S.: Another thing I wasn't able to find so far was how to declare variables as thread local (i.e. GCC's __thread or C11's thread_local).