public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Martin Sebor <msebor@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] add g_nonstandard_bool attribute for GIMPLE FE use
Date: Tue, 5 Jan 2021 13:52:16 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2101051343240.17979@zhemvz.fhfr.qr> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2012162203190.254435@digraph.polyomino.org.uk>

On Wed, 16 Dec 2020, Joseph Myers wrote:

> On Sun, 13 Dec 2020, Martin Sebor via Gcc-patches wrote:
> 
> > "nonstandard" isn't a very descriptive name.  The leading g_ prefix
> > also looks a little too terse (is that supposed to stand dor GIMPLE?).
> > I would suggest choosing a better name, say, bool_precision.  Since
> 
> Indeed, g_ suggests the GLib API to me, so a name not involving g_ or 
> "nonstandard" seems better.
> 
> The principle of a GIMPLE-front-end-specific attribute for this sort of 
> thing seems reasonable to me.

OK, does "integral_precision" sound better?  (supposed to cover
INTEGRAL_TYPE_P types)  Or would "precision" be preferred (I used
g_ to not conflict with possible future C attributes).  Note that
GCCs "nonstandard boolean types" are signed as opposed to
bool which is unsigned so

typedef _Bool bool1 __attribute__((precision(1)));

would maybe result in a surprising result.  One alternative
would be to make the attribute have the signedness specified as well
(C doesn't accept 'unsigned _Bool' or 'signed _Bool') or
simply name the attribute "signed_bool_precision".  I guess the bool case
is really special compared to the desire to eventually allow
declaring of a 3 bit precision signed/unsigned integer type.

Allowing 'signed _Bool' with -fgimple might be another option
of course.

Thanks,
Richard.

  reply	other threads:[~2021-01-05 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  9:02 Richard Biener
2020-12-13 17:35 ` Jeff Law
2020-12-13 23:59 ` Martin Sebor
2020-12-16 22:04   ` Joseph Myers
2021-01-05 12:52     ` Richard Biener [this message]
2021-01-05 18:54       ` Joseph Myers
2021-01-06  9:21         ` Richard Biener

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=nycvar.YFH.7.76.2101051343240.17979@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=msebor@gmail.com \
    /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).