GCC 12 miscompiles libm

Joseph Myers joseph@codesourcery.com
Thu Dec 30 22:28:25 GMT 2021


On Wed, 29 Dec 2021, Szabolcs Nagy via Libc-alpha wrote:

> > > i did not analysed these in detail but at least some of
> > > them are because of code like
> > >
> > >   (FLOAT) M_MLIT (M_*)
> > 
> > Replace it with AS_FLOAT_CONSTANT?
> 
> M_* in math.h has M_*f32 variants that may be more reliable.
> i'm fine with AS_FLOAT_CONSTANT too since math.h macros are
> under glibc control.

I think it would be better to define proper M_*f constants in math.h 
(conditional on __USE_GNU), and then redefine M_MLIT in 
math-type-macros-float.h accordingly to use those (and remove the (FLOAT) 
casts on M_MLIT calls).

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list