From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31256 invoked by alias); 11 Jul 2014 13:42:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31071 invoked by uid 89); 11 Jul 2014 13:42:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Jul 2014 13:42:13 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6BDg8Jh013664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jul 2014 09:42:10 -0400 Received: from tucnak.zalov.cz (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6BDg5gw031141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 11 Jul 2014 09:42:07 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.8/8.14.7) with ESMTP id s6BDg3uj005511; Fri, 11 Jul 2014 15:42:03 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.8/8.14.8/Submit) id s6BDg1wK005510; Fri, 11 Jul 2014 15:42:01 +0200 Date: Fri, 11 Jul 2014 13:42:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts Message-ID: <20140711134201.GW31640@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <539A0E6B.3080905@redhat.com> <20140627115658.GB31640@tucnak.redhat.com> <20140710151259.GL31640@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00817.txt.bz2 On Fri, Jul 11, 2014 at 03:36:15PM +0200, Richard Biener wrote: > *************** c_strlen (tree src, int only_value) > *** 606,612 **** > > /* If the offset is known to be out of bounds, warn, and call strlen at > runtime. */ > ! if (offset < 0 || offset > max) > { > /* Suppress multiple warnings for propagated constant strings. */ > if (! TREE_NO_WARNING (src)) > --- 610,617 ---- > > /* If the offset is known to be out of bounds, warn, and call strlen at > runtime. */ > ! if (only_value != 2 > ! && (offset < 0 || offset > max)) > { > /* Suppress multiple warnings for propagated constant strings. */ > if (! TREE_NO_WARNING (src)) This looks wrong. I'd say you only want to disable the warning for only_value != 2, but still return NULL_TREE, otherwise the strlen call will be out of bounds in the compiler. So move only_value != 2 down to the second if ? Jakub