public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Michael Meissner <meissner@linux.vnet.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Subject: Re: [PATCH] PR libgcc/83112, Fix warnings on libgcc float128-ifunc.c
Date: Mon, 27 Nov 2017 22:55:00 -0000	[thread overview]
Message-ID: <aabb7e7e-4678-f4a4-9240-6587438a0aeb@gmail.com> (raw)
In-Reply-To: <20171127192131.GA15914@ibm-tiger.the-meissners.org>

On 11/27/2017 12:21 PM, Michael Meissner wrote:
> The new -Wattribute-alias option now issues warnings for old-style ifunc
> declarations that coerce the pointer to the function to void *.  The
> float128-ifunc.c module in libgcc/config/rs6000 now gets a lot of warnings of
> the form:
>
> ../float128-ifunc.c:109:1: warning: ‘ifunc’ resolver for ‘__negkf2’ should
> return ‘TFtype (*)(TFtype) {aka _Float128 (*)(_Float128)}’ [-Wattribute-alias]
>
> This patch fixes these warnings.  I have done a full bootstrap build and test
> suite run.  I have verified that the ifunc handler works correctly, using
> software emulation on a power8 and the hardware instructions on power9.  Can I
> check this into the trunk?

Just as a side note, a convenient way to deal with this is to use
typeof to deduce the return type of the resolver from the type of
the function it returns.  I would expect something like
the following untested change to do it and make the typedefs
unnecessary:

   -static void *
   +static __typeof__ (__addkf3_sw) *
    __addkf3_resolve (void)
    {
   -  return (void *) SW_OR_HW (__addkf3_sw, __addkf3_hw);
   +  return SW_OR_HW (__addkf3_sw, __addkf3_hw);
    }

Martin

  reply	other threads:[~2017-11-27 22:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 19:57 Michael Meissner
2017-11-27 22:55 ` Martin Sebor [this message]
2017-11-28  0:55   ` Michael Meissner
2017-11-30  5:08     ` Segher Boessenkool
2017-11-30 21:52       ` Michael Meissner
2017-12-01  5:40         ` Michael Meissner
2017-12-01 23:54           ` Segher Boessenkool
2017-12-11 20:58             ` Michael Meissner
2017-12-12 17:05               ` Segher Boessenkool
2017-12-12 17:18                 ` Andreas Schwab
2017-12-12 21:56                 ` Michael Meissner
2017-12-13 20:57                   ` Segher Boessenkool

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=aabb7e7e-4678-f4a4-9240-6587438a0aeb@gmail.com \
    --to=msebor@gmail.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=meissner@linux.vnet.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.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).