http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50168

--- Comment #4 from Gunther Piez <gpiez at web dot de> 2011-08-23 22:00:31 UTC 
---
On 23.08.2011 19:58, jakub at gcc dot gnu.org wrote:
> While __builtin_c[lt]z* documentation
> says that the result is undefined in that case, I wonder if it would be fine
> even if long l = (int) __builtin_c[lt]z* (x); gave a value that wasn't 
> actually
> sign-extended to 64 bits.

So that software operating on the assumption that the value return by
__builtin_c[lt]z* is always int, even in the undefined case, would break
as soon at it sees a value outside the int range. Which could very well
be the case, AFAIK in the zero case the value of the target register is
just unchanged.

IMHO this is ok, I doubt that such code exists and even if, it is very
broken by design :-)
 Just my 2 cent.

Reply via email to