From: Alex Henrie <alexhenrie24@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Martin Sebor <msebor@gmail.com>,
Richard Biener <rguenther@suse.de>,
gcc-patches@gcc.gnu.org, msebor@gcc.gnu.org,
Zebediah Figura <z.figura12@gmail.com>
Subject: Re: [PATCH] PR c/86407 - Add option to ignore fndecl attributes on function pointers
Date: Fri, 31 May 2019 05:58:00 -0000 [thread overview]
Message-ID: <CAMMLpeQ8VsFyHrXHRY0t-5K7OCKuqVBjjqZb3AuEyMLL5Sbo4g@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1905310053280.25485@digraph.polyomino.org.uk>
On Thu, May 30, 2019 at 6:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 30 May 2019, Alex Henrie wrote:
>
> > At this point I think I'm convinced that any attribute that applies to
> > a function should also be allowed on a function pointer without any
> > warnings. We can start by turning off the warnings for the "fndecl"
> > attributes and then clean up the other attributes as time goes on.
>
> This is inherently a property of the attribute in question. The issue is
> not whether it applies to function pointers; it's whether it applies to
> function types.
>
> For example, the "section" or "alias" attributes are attributes that apply
> to a declaration, but not a type. Because they apply to variables as well
> as functions, they are meaningful on function pointers - but the meaning
> is *not* the same as applying them to the pointed-to function.
>
> The "flatten" attribute, however, seems only meaningful for functions, not
> variables, not function types and not function pointers.
>
> We should try to work out for each attribute exactly what construct it
> appertains to - which for many but not all function attributes is indeed
> the type of the function rather than the function itself. Then move to
> making such attributes work on types. But for attributes such as
> "flatten" that logically appertain to the declaration not its type, we
> should continue to diagnose them on function pointers or types.
In Wine we need a way to (without warnings) put ms_hook_prologue into
a macro that is applied to functions, function pointers, and function
pointer typedefs. It sounds like you're saying that you will not
accept a patch that silences or splits off warnings about using
ms_hook_prologue with function pointers and function pointer typedefs.
So how do you think Wine's problem should be solved?
It seems to me that any information about the target of a function
pointer, even the flatten attribute or the ms_hook_prologue attribute,
provides information that could be useful for optimizing the code
around the indirect function call. That sounds like a compelling
argument for allowing these attributes in more places without
warnings.
-Alex
next prev parent reply other threads:[~2019-05-31 1:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 3:57 Alex Henrie
2019-05-24 8:01 ` Richard Biener
2019-05-24 15:49 ` Alex Henrie
2019-05-25 6:34 ` Richard Biener
2019-05-25 17:20 ` Alex Henrie
2019-05-27 7:26 ` Richard Biener
2019-05-28 19:41 ` Martin Sebor
2019-05-29 7:16 ` Richard Biener
2019-05-30 8:28 ` Alex Henrie
2019-05-31 1:09 ` Joseph Myers
2019-05-31 5:58 ` Alex Henrie [this message]
2019-05-31 8:23 ` Richard Biener
2019-05-31 20:47 ` Alex Henrie
2019-06-03 8:25 ` Richard Biener
2019-06-03 15:17 ` Joseph Myers
2019-05-24 15:23 ` 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=CAMMLpeQ8VsFyHrXHRY0t-5K7OCKuqVBjjqZb3AuEyMLL5Sbo4g@mail.gmail.com \
--to=alexhenrie24@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=msebor@gcc.gnu.org \
--cc=msebor@gmail.com \
--cc=rguenther@suse.de \
--cc=z.figura12@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).