public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joshua Saxby <joshua.a.saxby@gmail.com>
To: jit@gcc.gnu.org
Subject: Symbol name character restrictions
Date: Mon, 10 Apr 2023 15:39:45 +0100	[thread overview]
Message-ID: <CALPFi8OQRDoafBh4GiS9Pw0-nqUqJB3Ggd0eu7PUXvOub88T0A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

Dear All,

I noticed that currently libgccjit restricts symbol names for generated
functions (and I assume all other symbols) to match the rules for C symbol
names, that is, alphanumeric and underscores.

From the source for gcc_jit_context_new_function() (
https://github.com/gcc-mirror/gcc/blob/725bcdeec60771cb9ee387978716028b64ea1b7f/gcc/jit/libgccjit.cc#L1173-L1177
):

  /* The assembler can only handle certain names, so for now, enforce
     C's rules for identifiers upon the name, using ISALPHA and ISALNUM
     from safe-ctype.h to ignore the current locale.
     Eventually we'll need some way to interact with e.g. C++ name
     mangling.  */

I've seen some suggestions elsewhere that some assemblers can handle
symbols with wider varieties of symbols than these, I have struggled to
find any documentation of the exact restrictions on symbol-naming in the
assembler itself (I could assume it's identical to C symbol naming rules,
but I like to be sure), any pointers to where I could find such a
specification? Also, any plans to follow up on the hinted extension toward
the end of that comment, RE C++ name mangling?

Best Regards,

*J.S.*



*My PGP Public Key Identity*

pub   4096R/*B7A947E4* 2016-11-16 [expires: 2025-12-31]
      Key fingerprint = *E2C4 514F F0FA 52D1 896A  B1D6 3D42 BFD9 B7A9 47E4*
uid       Joshua Saxby <joshua.a.saxby+UMvLnvbsOxBHaeiCHvbdunpz@gmail.com>
uid                   Joshua Saxby (saxbophone) <joshua.a.saxby@gmail.com>
sub   4096R/0A445946 2016-11-16 [expires: 2025-12-31]

             reply	other threads:[~2023-04-10 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 14:39 Joshua Saxby [this message]
2023-04-10 14:43 ` Marc Nieper-Wißkirchen
2023-04-10 14:51   ` Joshua Saxby
2023-04-13 15:14     ` Joshua Saxby

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=CALPFi8OQRDoafBh4GiS9Pw0-nqUqJB3Ggd0eu7PUXvOub88T0A@mail.gmail.com \
    --to=joshua.a.saxby@gmail.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).