[PATCH] math: Fix float conversion regressions with gcc-12 [BZ #28713]
Paul Zimmermann
Paul.Zimmermann@inria.fr
Mon Jan 3 10:24:00 GMT 2022
Dear Szabolcs,
> > +# define M_PI_2f 1.57079632679489661923f /* pi/2 */
> >
> > - __real__ res = (FLOAT) M_MLIT (M_PI_2) - __real__ y;
> > + __real__ res = M_MLIT (M_PI_2) - __real__ y;
> >
> > I wonder why your patch never uses M_PI_2f. Should it be M_PI_2f above?
>
> this is template code under math/ and M_MLIT (M_PI_2) should
> expand to M_PI_2f when it is used for the float variant.
>
> see the change in
> sysdeps/generic/math-type-macros-float.h
ok.
While looking at that patch, in math/math.h, I thought new constants should
be declared as hexadecimal values?
+# define M_Ef 2.7182818284590452354f /* e */
Otherwise this patch seems good to me.
Paul
More information about the Libc-alpha
mailing list