From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33656 invoked by alias); 22 Sep 2016 07:24:28 -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 33603 invoked by uid 89); 22 Sep 2016 07:24:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=inequality, apparent, lingering, wide_int 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 ESMTP; Thu, 22 Sep 2016 07:24:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7544C8553C; Thu, 22 Sep 2016 07:24:15 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-43.brq.redhat.com [10.40.204.43]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8M7OD4P002800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Sep 2016 03:24:15 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u8M7OCIS005857; Thu, 22 Sep 2016 09:24:13 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u8M7OBbn005856; Thu, 22 Sep 2016 09:24:11 +0200 Date: Thu, 22 Sep 2016 07:40:00 -0000 From: Jakub Jelinek To: Martin Sebor Cc: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix various minor gimple-ssa-sprintf.c issues Message-ID: <20160922072411.GF7282@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160921150954.GC7282@tucnak.redhat.com> <7f35dddc-af39-1329-cca6-33a88955a469@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f35dddc-af39-1329-cca6-33a88955a469@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg01487.txt.bz2 On Wed, Sep 21, 2016 at 06:38:54PM -0600, Martin Sebor wrote: > On 09/21/2016 09:09 AM, Jakub Jelinek wrote: > >When looking at PR77676, I've noticed various small formatting etc. > >issues, like not using is_gimple_* APIs where we have them, not using > >gimple_call_builtin_p/gimple_call_fndecl (this one actually can show up, > >if e.g. uses the builtin with incorrect arguments (fewer, different > >types etc.)), one pasto, 2 spaces in comments instead of 1 in the middle > >of sentences. And, lastly 0 < var is very unusual ordering of the > >comparison operands, while we have a couple of such cases in the sources, > >usually it is when using 0 < var && var <= someotherconst, while > >var > 0 is used hundred times more often. > > Thanks for correcting the uses of the gimple APIs! I appreciate > your fixing the various typos as well, but I see no value in > changing the order of operands in inequality expressions or in > moving code around for no apparent reason. However, I won't The moving of code around is in just one spot, and it has a reason - consistency. After the move, each non-_chk builtin is followed by its _chk counterpart, before that the order has been random. Another possible ordering that makes sense is putting all the non-_chk builtins first and then in the same order all their _chk counterparts. The reason why I wrote the patch has been that when skimming the code I've noticed the missing is_* calls, then when looking for that issue discovered something different etc. The var > 0 vs. 0 < var is just something that caught my eye when looking around, I don't feel too strongly about it, it just looked weird and unexpected. There are > 50 optimize > 0 preexisting checks elsewhere, and even far more just optimize, but none 0 < optimize. > What I would be even more grateful for is a review of the error > prone parts like those that caused the bootstrap failure. I.e., > any lingering assumptions about integer sizes between the host I must say I'm surprised you do all your computations in HOST_WIDE_INT, rather than say in wide_int, then you could just compare against TYPE_{MIN,MAX}_VALUE (TYPE_DOMAIN (integer_type_node)) instead of inventing a function for that. As for the warn_* vs. flag_* stuff, it just looked that the warn_* is tested in lots of functions invoked even for the return length folding, so it is much harder to prove whether it works properly or not. Jakub