public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	GCC Development <gcc@gcc.gnu.org>
Subject: Re: [RFC] Adding a new attribute to function param to mark it as constant
Date: Thu, 5 Aug 2021 10:06:49 -0500	[thread overview]
Message-ID: <20210805150649.GO1583@gate.crashing.org> (raw)
In-Reply-To: <CAAgBjM=Sb8DLe0LDxx=O7+jYVgi7HNaDiJ7dfkQ479VNs-6UEQ@mail.gmail.com>

On Thu, Aug 05, 2021 at 02:31:02PM +0530, Prathamesh Kulkarni wrote:
> On Wed, 4 Aug 2021 at 18:30, Richard Earnshaw
> <Richard.Earnshaw@foss.arm.com> wrote:
> > We don't want to have to resort to macros.  Not least because at some
> > point we want to replace the content of arm_neon.h with a single #pragma
> > directive to remove all the parsing of the header that's needed.  What's
> > more, if we had a suitable pragma we'd stand a fighting chance of being
> > able to extend support to other languages as well that don't use the
> > pre-processor, such as Fortran or Ada (not that that is on the cards
> > right now).
> Hi,
> IIUC, a more general issue here, is that the intrinsics require
> special type-checking of arguments, beyond what is dictated by the
> Standard.
> An argument needing to be an ICE could be seen as one instance.
> 
> So perhaps, should there be some mechanism to tell the FE to let the
> target do additional checking for a particular function call, say by

An integer constant expression can be checked by the frontend itself, it
does not depend on optimisation etc.  That is the beauty of it: it is a)
more local, and b) a more reliable / less surprising thing to use.

But it *is* less powerful than "it is a constant integer after a travel
through the bowels of the compiler".  Which of course is less reliable
and more surprising (think what happens if you use -O0 or -O1 or -Og or
-Os or any -fno- etc.)  So it will be a lot more maintenance work
(answering PRs about it is only the start).


Segher

  reply	other threads:[~2021-08-05 15:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 10:53 Prathamesh Kulkarni
2021-07-23 17:59 ` Andrew Pinski
2021-07-26  9:04   ` Prathamesh Kulkarni
2021-07-27  8:19     ` Richard Biener
2021-08-03 10:11       ` Prathamesh Kulkarni
2021-08-03 10:13         ` Prathamesh Kulkarni
2021-08-03 17:44         ` Martin Sebor
2021-08-04  9:46           ` Richard Earnshaw
2021-08-06  0:06             ` Martin Sebor
2021-08-06 10:51               ` Richard Earnshaw
2021-08-06 20:39                 ` Martin Sebor
2021-08-12  8:32                   ` Prathamesh Kulkarni
2021-08-13 17:14                     ` Martin Sebor
2021-08-18  6:52                       ` Prathamesh Kulkarni
2021-08-18 14:40                         ` Martin Sebor
2021-08-19  8:10                           ` Prathamesh Kulkarni
2021-08-03 21:55 ` Segher Boessenkool
2021-08-04  9:50   ` Prathamesh Kulkarni
2021-08-04 10:17     ` Segher Boessenkool
2021-08-04 11:50       ` Prathamesh Kulkarni
2021-08-04 12:46         ` Segher Boessenkool
2021-08-04 13:00           ` Richard Earnshaw
2021-08-04 13:40             ` Segher Boessenkool
2021-08-04 14:27               ` Richard Earnshaw
2021-08-04 16:16                 ` Segher Boessenkool
2021-08-04 17:08                   ` Florian Weimer
2021-08-04 17:59                     ` Segher Boessenkool
2021-08-05  9:32                       ` Richard Earnshaw
2021-08-05  9:01             ` Prathamesh Kulkarni
2021-08-05 15:06               ` Segher Boessenkool [this message]
2021-08-06 20:10 Martin Uecker

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=20210805150649.GO1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=prathamesh.kulkarni@linaro.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).