[PATCH] PR libgcc/83112, Fix warnings on libgcc float128-ifunc.c

Segher Boessenkool segher@kernel.crashing.org
Tue Dec 12 17:05:00 GMT 2017


On Mon, Dec 11, 2017 at 03:57:51PM -0500, Michael Meissner wrote:
> > > +extern KCtype __divkc3 (KFtype, KFtype, KFtype, KFtype);
> > > +
> > >  KCtype
> > >  __divkc3 (KFtype a, KFtype b, KFtype c, KFtype d)
> > >  {
> > 
> > How does this warn?  -Wmissing-declarations?  Should this declaration be
> > in a header then?
> 
> The compiler creates the call to __mulkc3 and __divkc3, and internally it has
> the appropriate prototype like it does for all built-in functions (in this
> case, returning an _Float128 _Complex type, and taking 4 _Float128 arguments).
> 
> So before adding ifunc support, we never noticed it didn't have a prototype,
> because the compiler already has a prototype.

I still don't get it.  A function definition is also a declaration.

Something very non-intuitive is happening?

What does the patch change here?

> With ifunc support, we now need to create two separate functions, __mulkc3_sw
> and __mulkc3_hw, and make __multkc3 the ifunc resolver.
> 
> So there really isn't an include file that is appropriate to put the
> definitions in.  I could change it to use the soft-fp includes (including
> quadmath-float128.h) if desired.
> 
> Did you want me to do that?

I don't see the point in adding a second declaration right before the
existing declaration (the function definition).  I'm fine with what file
it is in.

> > A code comment explaining why you do a declaration for exactly the same
> > thing as there is two lines later would help; otherwise people will try
> > to delete it again :-)


Segher



More information about the Gcc-patches mailing list