public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.vnet.ibm.com>
To: 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: [PATCH] PR libgcc/83112, Fix warnings on libgcc float128-ifunc.c
Date: Mon, 27 Nov 2017 19:57:00 -0000	[thread overview]
Message-ID: <20171127192131.GA15914@ibm-tiger.the-meissners.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]

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?

2017-11-27  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR libgcc/83112
	* config/rs6000/float128-ifunc.c (__addkf3_resolve): Use the
	correct type for all ifunc resolvers to silence -Wattribute-alias
	warnings.
	(__subkf3_resolve): Likewise.
	(__mulkf3_resolve): Likewise.
	(__divkf3_resolve): Likewise.
	(__negkf2_resolve): Likewise.
	(__eqkf2_resolve): Likewise.
	(__nekf2_resolve): Likewise.
	(__gekf2_resolve): Likewise.
	(__gtkf2_resolve): Likewise.
	(__lekf2_resolve): Likewise.
	(__ltkf2_resolve): Likewise.
	(__unordkf2_resolve): Likewise.
	(__extendsfkf2_resolve): Likewise.
	(__extenddfkf2_resolve): Likewise.
	(__trunckfsf2_resolve): Likewise.
	(__trunckfdf2_resolve): Likewise.
	(__fixkfsi_resolve): Likewise.
	(__fixkfdi_resolve): Likewise.
	(__fixunskfsi_resolve): Likewise.
	(__fixunskfdi_resolve): Likewise.
	(__floatsikf_resolve): Likewise.
	(__floatdikf_resolve): Likewise.
	(__floatunsikf_resolve): Likewise.
	(__floatundikf_resolve): Likewise.
	(__extendkftf2_resolve): Likewise.
	(__trunctfkf2_resolve): Likewise.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797

[-- Attachment #2: pr83112.patch01b --]
[-- Type: text/plain, Size: 8616 bytes --]

Index: libgcc/config/rs6000/float128-ifunc.c
===================================================================
--- libgcc/config/rs6000/float128-ifunc.c	(revision 255033)
+++ libgcc/config/rs6000/float128-ifunc.c	(working copy)
@@ -54,190 +54,208 @@
    128-bit integer types and 128-bit IEEE floating point, or vice versa.  So
    use the emulator functions for these conversions.  */
 
-static void *__addkf3_resolve (void);
-static void *__subkf3_resolve (void);
-static void *__mulkf3_resolve (void);
-static void *__divkf3_resolve (void);
-static void *__negkf2_resolve (void);
-static void *__eqkf2_resolve (void);
-static void *__nekf2_resolve (void);
-static void *__gekf2_resolve (void);
-static void *__gtkf2_resolve (void);
-static void *__lekf2_resolve (void);
-static void *__ltkf2_resolve (void);
-static void *__unordkf2_resolve (void);
-static void *__extendsfkf2_resolve (void);
-static void *__extenddfkf2_resolve (void);
-static void *__trunckfsf2_resolve (void);
-static void *__trunckfdf2_resolve (void);
-static void *__fixkfsi_resolve (void);
-static void *__fixkfdi_resolve (void);
-static void *__fixunskfsi_resolve (void);
-static void *__fixunskfdi_resolve (void);
-static void *__floatsikf_resolve (void);
-static void *__floatdikf_resolve (void);
-static void *__floatunsikf_resolve (void);
-static void *__floatundikf_resolve (void);
-static void *__extendkftf2_resolve (void);
-static void *__trunctfkf2_resolve (void);
+typedef TFtype (f128_func_f128_t)(TFtype);
+typedef TFtype (f128_func_f128_f128_t)(TFtype, TFtype);
+typedef CMPtype (cmp_func_f128_f128_t)(TFtype, TFtype); 
+typedef TFtype (f128_func_float_t)(float);
+typedef TFtype (f128_func_double_t)(double);
+typedef float (float_func_f128_t)(TFtype);
+typedef double (double_func_f128_t)(TFtype);
+typedef SItype_ppc (si_func_f128_t)(TFtype);
+typedef DItype_ppc (di_func_f128_t)(TFtype);
+typedef USItype_ppc (usi_func_f128_t)(TFtype);
+typedef UDItype_ppc (udi_func_f128_t)(TFtype);
+typedef TFtype (f128_func_si_t)(SItype_ppc);
+typedef TFtype (f128_func_di_t)(DItype_ppc);
+typedef TFtype (f128_func_usi_t)(USItype_ppc);
+typedef TFtype (f128_func_udi_t)(UDItype_ppc);
+typedef IBM128_TYPE (ibm_func_f128_t)(TFtype);
+typedef TFtype (f128_func_ibm_t)(IBM128_TYPE);
+
+static f128_func_f128_f128_t *__addkf3_resolve (void);
+static f128_func_f128_f128_t *__subkf3_resolve (void);
+static f128_func_f128_f128_t *__mulkf3_resolve (void);
+static f128_func_f128_f128_t *__divkf3_resolve (void);
+static f128_func_f128_t *__negkf2_resolve (void);
+static cmp_func_f128_f128_t *__eqkf2_resolve (void);
+static cmp_func_f128_f128_t *__nekf2_resolve (void);
+static cmp_func_f128_f128_t *__gekf2_resolve (void);
+static cmp_func_f128_f128_t *__gtkf2_resolve (void);
+static cmp_func_f128_f128_t *__lekf2_resolve (void);
+static cmp_func_f128_f128_t *__ltkf2_resolve (void);
+static cmp_func_f128_f128_t *__unordkf2_resolve (void);
+static f128_func_float_t *__extendsfkf2_resolve (void);
+static f128_func_double_t *__extenddfkf2_resolve (void);
+static float_func_f128_t *__trunckfsf2_resolve (void);
+static double_func_f128_t *__trunckfdf2_resolve (void);
+static si_func_f128_t *__fixkfsi_resolve (void);
+static di_func_f128_t *__fixkfdi_resolve (void);
+static usi_func_f128_t *__fixunskfsi_resolve (void);
+static udi_func_f128_t *__fixunskfdi_resolve (void);
+static f128_func_si_t *__floatsikf_resolve (void);
+static f128_func_di_t *__floatdikf_resolve (void);
+static f128_func_usi_t *__floatunsikf_resolve (void);
+static f128_func_udi_t *__floatundikf_resolve (void);
+static ibm_func_f128_t *__extendkftf2_resolve (void);
+static f128_func_ibm_t *__trunctfkf2_resolve (void);
 
-static void *
+static f128_func_f128_f128_t *
 __addkf3_resolve (void)
 {
-  return (void *) SW_OR_HW (__addkf3_sw, __addkf3_hw);
+  return SW_OR_HW (__addkf3_sw, __addkf3_hw);
 }
 
-static void *
+static f128_func_f128_f128_t *
 __subkf3_resolve (void)
 {
-  return (void *) SW_OR_HW (__subkf3_sw, __subkf3_hw);
+  return SW_OR_HW (__subkf3_sw, __subkf3_hw);
 }
 
-static void *
+static f128_func_f128_f128_t *
 __mulkf3_resolve (void)
 {
-  return (void *) SW_OR_HW (__mulkf3_sw, __mulkf3_hw);
+  return SW_OR_HW (__mulkf3_sw, __mulkf3_hw);
 }
 
-static void *
+static f128_func_f128_f128_t *
 __divkf3_resolve (void)
 {
-  return (void *) SW_OR_HW (__divkf3_sw, __divkf3_hw);
+  return SW_OR_HW (__divkf3_sw, __divkf3_hw);
 }
 
-static void *
+static f128_func_f128_t *
 __negkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__negkf2_sw, __negkf2_hw);
+  return SW_OR_HW (__negkf2_sw, __negkf2_hw);
 }
 
-static void *
+static f128_func_si_t *
 __floatsikf_resolve (void)
 {
-  return (void *) SW_OR_HW (__floatsikf_sw, __floatsikf_hw);
+  return SW_OR_HW (__floatsikf_sw, __floatsikf_hw);
 }
 
-static void *
+static f128_func_di_t *
 __floatdikf_resolve (void)
 {
-  return (void *) SW_OR_HW (__floatdikf_sw, __floatdikf_hw);
+  return SW_OR_HW (__floatdikf_sw, __floatdikf_hw);
 }
 
-static void *
+static f128_func_usi_t *
 __floatunsikf_resolve (void)
 {
-  return (void *) SW_OR_HW (__floatunsikf_sw, __floatunsikf_hw);
+  return SW_OR_HW (__floatunsikf_sw, __floatunsikf_hw);
 }
 
-static void *
+static f128_func_udi_t *
 __floatundikf_resolve (void)
 {
-  return (void *) SW_OR_HW (__floatundikf_sw, __floatundikf_hw);
+  return SW_OR_HW (__floatundikf_sw, __floatundikf_hw);
 }
 
-static void *
+static si_func_f128_t *
 __fixkfsi_resolve (void)
 {
-  return (void *) SW_OR_HW (__fixkfsi_sw, __fixkfsi_hw);
+  return SW_OR_HW (__fixkfsi_sw, __fixkfsi_hw);
 }
 
-static void *
+static di_func_f128_t *
 __fixkfdi_resolve (void)
 {
-  return (void *) SW_OR_HW (__fixkfdi_sw, __fixkfdi_hw);
+  return SW_OR_HW (__fixkfdi_sw, __fixkfdi_hw);
 }
 
-static void *
+static usi_func_f128_t *
 __fixunskfsi_resolve (void)
 {
-  return (void *) SW_OR_HW (__fixunskfsi_sw, __fixunskfsi_hw);
+  return SW_OR_HW (__fixunskfsi_sw, __fixunskfsi_hw);
 }
 
-static void *
+static udi_func_f128_t *
 __fixunskfdi_resolve (void)
 {
-  return (void *) SW_OR_HW (__fixunskfdi_sw, __fixunskfdi_hw);
+  return SW_OR_HW (__fixunskfdi_sw, __fixunskfdi_hw);
 }
 
-static void *
+static f128_func_float_t *
 __extendsfkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__extendsfkf2_sw, __extendsfkf2_hw);
+  return SW_OR_HW (__extendsfkf2_sw, __extendsfkf2_hw);
 }
 
-static void *
+static f128_func_double_t *
 __extenddfkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__extenddfkf2_sw, __extenddfkf2_hw);
+  return SW_OR_HW (__extenddfkf2_sw, __extenddfkf2_hw);
 }
 
-static void *
+static float_func_f128_t *
 __trunckfsf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__trunckfsf2_sw, __trunckfsf2_hw);
+  return SW_OR_HW (__trunckfsf2_sw, __trunckfsf2_hw);
 }
 
-static void *
+static double_func_f128_t *
 __trunckfdf2_resolve (void)
 {
   return (void *) SW_OR_HW (__trunckfdf2_sw, __trunckfdf2_hw);
 }
 
-static void *
+static ibm_func_f128_t *
 __extendkftf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__extendkftf2_sw, __extendkftf2_hw);
+  return SW_OR_HW (__extendkftf2_sw, __extendkftf2_hw);
 }
 
-static void *
+static f128_func_ibm_t *
 __trunctfkf2_resolve (void)
 {
   return (void *) SW_OR_HW (__trunctfkf2_sw, __trunctfkf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __eqkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
+  return SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __gekf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__gekf2_sw, __gekf2_hw);
+  return SW_OR_HW (__gekf2_sw, __gekf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __lekf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__lekf2_sw, __lekf2_hw);
+  return SW_OR_HW (__lekf2_sw, __lekf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __unordkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__unordkf2_sw, __unordkf2_hw);
+  return SW_OR_HW (__unordkf2_sw, __unordkf2_hw);
 }
 
 /* Resolve __nekf2, __gtkf2, __ltkf2 like __eqkf2, __gekf2, and __lekf2, since
    the functions return the same values.  */
 
-static void *
+static cmp_func_f128_f128_t *
 __nekf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
+  return SW_OR_HW (__eqkf2_sw, __eqkf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __gtkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__gekf2_sw, __gekf2_hw);
+  return SW_OR_HW (__gekf2_sw, __gekf2_hw);
 }
 
-static void *
+static cmp_func_f128_f128_t *
 __ltkf2_resolve (void)
 {
-  return (void *) SW_OR_HW (__lekf2_sw, __lekf2_hw);
+  return SW_OR_HW (__lekf2_sw, __lekf2_hw);
 }
 
 

             reply	other threads:[~2017-11-27 19:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 19:57 Michael Meissner [this message]
2017-11-27 22:55 ` Martin Sebor
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=20171127192131.GA15914@ibm-tiger.the-meissners.org \
    --to=meissner@linux.vnet.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).