[llvm-bugs] [Bug 28833] strlen (s) == 0 not folded when return type is casted to unsigned
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Aug 3 13:32:35 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=28833
David Majnemer <david.majnemer at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |david.majnemer at gmail.com
Resolution|--- |INVALID
--- Comment #1 from David Majnemer <david.majnemer at gmail.com> ---
It is not correct to transform ((unsigned)__builtin_strlen(s)) == 0 into *s ==
0.
The unsigned cast is masking out the high half of the strlen result.
For example, if __builtin_strlen comes out to 1ULL << 32 then
(unsigned)__builtin_strlen is zero but *s isn't 0.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160803/9fc10bc7/attachment.html>
More information about the llvm-bugs
mailing list