[PATCH, LIBGCC] Avoid count_leading_zeros with undefined result (PR 78067)

Bernd Schmidt bschmidt@redhat.com
Thu Oct 27 18:04:00 GMT 2016


On 10/27/2016 05:57 PM, Bernd Edlinger wrote:
> In the function below we have if ((UWtype)u == u)
> that actually ensures hi != 0.

Ah, right. So maybe we ought to just add the same case here as well?

   if ((UWtype)u == u)
     return (FSTYPE)(UWtype)u;

That would also make the comment less misleading. The condition should 
ensure that u is positive and representable in UWtype, so this should be 
correct, right?


Bernd



More information about the Gcc-patches mailing list