[Bug middle-end/114347] wrong constant folding when casting __bf16 to int

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 20 06:19:17 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114347

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Paul Eggert from comment #10)
> (In reply to Jakub Jelinek from comment #6)
> > You can use -fexcess-precision=16 if you don't want treating _Float16 and
> > __bf16 as having excess precision.  With excess precision, I think the above
> > behavior is correct.
> 
> So the constant 257.0bf16 has a value that the type __bf16 cannot represent?
> Although the C standard allows this sort of thing, it doesn't sound wise.

This is also true for similar case for 32bit x86 (without using SSE) and
constants ending in f or other floating point constants. Just folks hit it
there as much as that is not used as much either.


More information about the Gcc-bugs mailing list