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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:e2eb9da5546b5e2fccb86586cda3beee8f69f5c9

commit r16-1572-ge2eb9da5546b5e2fccb86586cda3beee8f69f5c9
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Jun 19 08:57:27 2025 +0200

    dfp: Further decimal_real_to_integer fixes [PR120631]

    Unfortunately, the following further testcase shows that there aren't
    problems only with very large precisions and large exponents, but pretty
    much anything larger than 64-bits.  After all, before _BitInt support dfp
    didn't even have {,unsigned }__int128 <-> _Decimal{32,64,128,64x} support,
    and the testcase again shows some of the conversions yielding zeros.
    While the pr120631.c test worked even without the earlier patch.

    So, this patch assumes 64-bit precision at most is ok and for anything
    larger it just uses exponent 0 and multiplies afterwards.

    2025-06-19  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/120631
            * dfp.cc (decimal_real_to_integer): Use result multiplication not
just
            when precision > 128 and dn.exponent > 19, but when precision > 64
            and dn.exponent > 0.

            * gcc.dg/dfp/bitint-10.c: New test.
            * gcc.dg/dfp/pr120631.c: New test.

Reply via email to