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 via email to