From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9784 invoked by alias); 30 Jan 2009 16:13:06 -0000 Received: (qmail 9679 invoked by uid 48); 30 Jan 2009 16:12:55 -0000 Date: Fri, 30 Jan 2009 16:13:00 -0000 Message-ID: <20090130161255.9678.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/38986] comparing lengths of 2 strings reads through both strings completely In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "esigra at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-01/txt/msg03371.txt.bz2 ------- Comment #2 from esigra at gmail dot com 2009-01-30 16:12 ------- GCC already understands the semantics of strlen. If one of the operands to "<" is a constant and the other is strlen, it is optimized (such as "strlen(str) >= 1). It just seems like the case with strlen on both sides is missing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38986