This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, LIBGCC] Avoid count_leading_zeros with undefined result (PR 78067)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ian Lance Taylor <ian at airs dot com>
- Date: Thu, 27 Oct 2016 20:23:52 +0000
- Subject: Re: [PATCH, LIBGCC] Avoid count_leading_zeros with undefined result (PR 78067)
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR0701MB21698B2BB65F953F78D09E02E4AA0@HE1PR0701MB2169.eurprd07.prod.outlook.com>
On Thu, 27 Oct 2016, Bernd Edlinger wrote:
> Hi,
>
> by code reading I became aware that libgcc can call count_leading_zeros
> in certain cases which can give undefined results. This happens on
> signed int128 -> float or double conversions, when the int128 is in the range
> INT64_MAX+1 to UINT64_MAX.
I'd expect testcases added to the testsuite that exercise this case at
runtime, if not already present.
--
Joseph S. Myers
joseph@codesourcery.com