This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70042] Room for optimization of x+1>y vs x>=y
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Mar 2016 12:25:59 +0000
- Subject: [Bug c/70042] Room for optimization of x+1>y vs x>=y
- Auto-submitted: auto-generated
- References: <bug-70042-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70042
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Well, strlen returns unsigned value (size_t), so unless we take into
consideration some special properties of strlen, the two are not equivalent.
If you replace strlen with an arbitrary function returning size_t, if it
returns ~(size_t) 0, then that is >= 108, but (~(size_t) 0) + 1 < 108.
If you want somehow special strlen, what would it be? Claim that the maximum
possible string length is at most ~(size_t) 0 minus some epsilon, by saying
that you need to leave memory in the VA left for other purposes?