public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc@nieper-wisskirchen.de>
To: David Malcolm <dmalcolm@redhat.com>
Cc: jit@gcc.gnu.org
Subject: Re: alloca and labels as values
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <CAEYrNrTjvxpZpmEprV=z=NFz-vJqRV9zDiZEBV0bdhMtS0Pvwg@mail.gmail.com> (raw)
In-Reply-To: <1545141762.4619.244.camel@redhat.com>

Am Di., 18. Dez. 2018 um 15:02 Uhr schrieb David Malcolm <dmalcolm@redhat.com>:

[...]

> On Tue, 2018-12-18 at 08:12 +0100, Marc Nieper-Wißkirchen wrote:
> > > > Is `alloca' currently  possible with libgccjit? I haven't found

[...]

> >  > I haven't tested this, but I believe you ought to be able to
> > access it
> >  > via the "__builtin_alloca" builtin, via something like:

[...]

> > 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?
>
> I think you'd need a configure check.

[...]

Having thought about it once more I think the configure check I asked
about makes no sense. Configure can tell me the available builtins of
the host compiler but nothing about the available builtins of the
target system that eventually runs libgccjit (if we don't want to give
up the option of cross-compiling).

What we need, I think, is that <libgccjit.h> exports a number of
macros that define the

Thus we need that libgccjit's header defines a number of macros that
define the capabilities of the GCC embedded in libgccjit.so.

Concretely, source code that uses libgccjit can test the feature macro
__GNUC__. This, however, returns the GCC version of the build system.
What is missing is another macro like GCC_JIT_GNUC that is defined in
<libgccjit.h> and returns the GCC version of the libgccjit library.

It may also be worth to reflect some macros from
https://gcc.gnu.org/onlinedocs/gccint/Target-Macros.html as
GCC_JIT_XXX macros in <libgccjit.h>.

-- Marc

  reply	other threads:[~2019-01-12 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  0:00 Marc Nieper-Wißkirchen
2018-01-01  0:00 ` David Malcolm
2019-01-01  0:00   ` Marc Nieper-Wißkirchen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-01  0:00 Marc Nieper-Wißkirchen
2018-01-01  0:00 ` David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEYrNrTjvxpZpmEprV=z=NFz-vJqRV9zDiZEBV0bdhMtS0Pvwg@mail.gmail.com' \
    --to=marc@nieper-wisskirchen.de \
    --cc=dmalcolm@redhat.com \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).