public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Jeff Law <law@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [WIP PATCH] add object access attributes (PR 83859)
Date: Mon, 18 Nov 2019 09:00:00 -0000	[thread overview]
Message-ID: <CAFiYyc27bNPPdra5aqsvdN3nctLARn9fYnkUQF4f7ekQ=T5hwg@mail.gmail.com> (raw)
In-Reply-To: <3b148654-b12c-1e7c-32d2-78df9d6c70e7@gmail.com>

On Fri, Nov 15, 2019 at 10:28 PM Martin Sebor <msebor@gmail.com> wrote:
>
> Thanks for the suggestion.  I will do that for GCC 11.  I take
> Richard's point that the attributes' semantics need to be clearly
> and carefully specified before they're put to use for optimization.

Before they are exposed to users please.  It doesn't help if we
specify the same attribute for optimization later when uses are out
in the wild "guessing" at what the possible interpretation is.

Maybe we can name your attributes maybe_readonly and friends
to clearly indicate that this is only a guess by the user so at most
usable for diagnostics but never for optimization.

Since we have quite costly attribute lookup I also prefer something
that translates to less attributes - how about
__attribute__((diag_argspec(1, readonly), diag_argspec(2, writeonly)))
to indicate argument 1 is maybe readonly, 2 is writeonly?  We can
then merge this into a single diag_arspec attribute instance we can
lookup.

> >
> > I don't see anything terribly concerning.  Looking forward to the final
> > iteration here.
>
> Attached is a subset of the original patch that just adds the three
> attributes and uses them to do buffer overflow checking.  I have
> also enhanced the detection of invalid arguments (null pointers,
> negative sizes).
>
> Retested on x86_64-linux.
>
> Martin

  reply	other threads:[~2019-11-18  8:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 19:52 Martin Sebor
2019-09-30  7:37 ` Richard Biener
2019-09-30 15:41   ` Martin Sebor
2019-09-30 21:34 ` Joseph Myers
2019-10-01  2:36   ` Martin Sebor
2019-10-17 16:44 ` [PING] " Martin Sebor
2019-10-24 14:42   ` [PING 2] " Martin Sebor
2019-10-27 17:37 ` Jeff Law
2019-10-28 10:18   ` Richard Biener
2019-11-15 21:41   ` Martin Sebor
2019-11-18  9:00     ` Richard Biener [this message]
2019-11-18 16:46       ` Martin Sebor
2019-11-19  8:57         ` Richard Biener
2019-11-21 17:12           ` [PATCH v3] " Martin Sebor
2019-11-21 22:40             ` Jeff Law
2019-11-22  1:12               ` Martin Sebor
2019-11-23  1:10                 ` [PATCH] Fix attribute access issues Jakub Jelinek
2019-11-23 10:04                   ` Richard Biener
2019-11-25  2:24                   ` Martin Sebor

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='CAFiYyc27bNPPdra5aqsvdN3nctLARn9fYnkUQF4f7ekQ=T5hwg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.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).