From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29522 invoked by alias); 29 Mar 2016 18:54:14 -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 29509 invoked by uid 89); 29 Mar 2016 18:54:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HTo:U*msebor 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; Tue, 29 Mar 2016 18:54:12 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id DE82C80E42; Tue, 29 Mar 2016 18:54:10 +0000 (UTC) Received: from [10.10.116.31] (ovpn-116-31.rdu2.redhat.com [10.10.116.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2TIs9cl020793; Tue, 29 Mar 2016 14:54:10 -0400 Subject: Re: [PATCH] c++/67376 Comparison with pointer to past-the-end, of array fails inside constant expression To: Martin Sebor , Jeff Law , Gcc Patch List References: <56E72C33.8000301@gmail.com> <56E9B9C3.5000908@redhat.com> <56EB1ECA.90800@gmail.com> <56EC3500.4030701@redhat.com> <56F03567.8040306@redhat.com> <56F07137.1050400@redhat.com> <56F19456.3030900@redhat.com> <56F1A494.1060407@gmail.com> <56F2EC3C.5000606@redhat.com> <56F9AA63.4090201@gmail.com> Cc: Marek Polacek , Jakub Jelinek From: Jason Merrill Message-ID: <56FACF51.5000407@redhat.com> Date: Tue, 29 Mar 2016 19:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F9AA63.4090201@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-03/txt/msg01550.txt.bz2 On 03/28/2016 06:04 PM, Martin Sebor wrote: > + && compare_tree_int (arg1, 0) == 0) This can be integer_zerop. > + case GE_EXPR: > + case EQ_EXPR: > + case LE_EXPR: > + return boolean_false_node; > + case GT_EXPR: > + case LT_EXPR: > + case NE_EXPR: > + return boolean_true_node; EQ and NE make sense, but I would expect both > and >= to be true, < and <= to be false. Are we confident that arr[0] won't make it here as POINTER_PLUS_EXPR or some such? Jason