Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (2h)  netbsd-10 (6d)  netbsd-9 (6d)  netbsd-8 (11d) 

2024-05-23 05:19:44 UTC Now

2024-05-09 12:24:24 UTC MAIN commitmail json YAML

Revert various broken changes to printf %La (hldtoa).

This reverts:

hdtoa.c 1.12 (PR/56247: Greg A. Woods: printf("%La", LDBL_MIN) dumps core)
hdtoa.c 1.11 (fix tyop)
hdtoa.c 1.10 (Via enh at google dot com in tech-userlevel. Fix handling of
    EXT_FRAC{H,L}BITS (although we don't need to since we don't have them).)

The underlying motivation for this change was that when ld128 is
decomposed into 4x32 words, this hldtoa logic is broken.

But we don't decompose ld128 into 4x32 words; we decompose it into
6x64 words.

And the change, which was supposed to be a noop in our case of 2x64
words (or similar for x87 80-bit floating-point), broke it to the
point of causing buffer overruns (PR 56247) which when worked around
led to just incorrect output output (PR 56937).

If we want to make the #ifdefs for 4x32 words work, that's fine, but
we absolutely must have automatic test cases to detect this kind of
regression because %La formatting is extremely important for
diagnosing details of floating-point data since it doesn't involve
rounding in binary formats.  For now I've added some trivial tests;
there is a more extensive test suite inside gdtoa that we need to
wire up before anyone tries any other shenanigans in this code.

PR lib/56937: printf(3) long double %a formatting is broken

(riastradh)