From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33540 invoked by alias); 28 Sep 2016 19:48:12 -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 33431 invoked by uid 89); 28 Sep 2016 19:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=12497, 1249,7, 1308, late 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; Wed, 28 Sep 2016 19:47:54 +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 426F88E684 for ; Wed, 28 Sep 2016 19:47:53 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8SJlp6Q027755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Sep 2016 15:47:52 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u8SJln8S026891; Wed, 28 Sep 2016 21:47:50 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u8SJlmXl026890; Wed, 28 Sep 2016 21:47:48 +0200 Date: Wed, 28 Sep 2016 20:19:00 -0000 From: Jakub Jelinek To: Bernd Schmidt Cc: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: Patch ping Message-ID: <20160928194748.GL7282@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160928192450.GJ7282@tucnak.redhat.com> <788754ad-a27a-d64c-d1f2-a1f29de9805b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <788754ad-a27a-d64c-d1f2-a1f29de9805b@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg02195.txt.bz2 On Wed, Sep 28, 2016 at 09:28:14PM +0200, Bernd Schmidt wrote: > On 09/28/2016 09:24 PM, Jakub Jelinek wrote: > >I'd like to ping the > > > >http://gcc.gnu.org/ml/gcc-patches/2016-09/msg01436.html > > > >patch, containing various fixes for gimple-ssa-sprintf.c. > >If the 0 < var to var > 0 changes are deemed too controversial, I can > >separate them from the other changes. > > I'd like to see them separated because they are obvious and good, so please > install them first. And here are the 0 < var to var > 0 changes. Thoughts on those? 2016-09-28 Jakub Jelinek * gimple-ssa-sprintf.c (pass_sprintf_length::gate): Use x > 0 instead of 0 < x. (format_floating, format_string, format_directive, get_destination_size, pass_sprintf_length::handle_gimple_call): Likewise. --- gcc/gimple-ssa-sprintf.c.jj 2016-09-21 08:54:15.000000000 +0200 +++ gcc/gimple-ssa-sprintf.c 2016-09-21 15:09:02.209261013 +0200 @@ -130,8 +130,8 @@ pass_sprintf_length::gate (function *) not optimizing and the pass is being invoked early, or when optimizing and the pass is being invoked during optimization (i.e., "late"). */ - return ((0 < warn_format_length || flag_printf_return_value) - && (0 < optimize) == fold_return_value); + return ((warn_format_length > 0 || flag_printf_return_value) + && (optimize > 0) == fold_return_value); } /* The result of a call to a formatted function. */ @@ -1188,7 +1188,7 @@ format_floating (const conversion_spec & case 'a': { /* The minimum output is "0x.p+0". */ - res.range.min = 6 + (0 < prec ? prec : 0); + res.range.min = 6 + (prec > 0 ? prec : 0); /* Compute the maximum just once. */ static const int a_max[] = { @@ -1249,7 +1249,7 @@ format_floating (const conversion_spec & gcc_unreachable (); } - if (0 < width) + if (width > 0) { if (res.range.min < (unsigned)width) res.range.min = width; @@ -1440,7 +1440,7 @@ get_string_length (tree str) static fmtresult format_string (const conversion_spec &spec, tree arg) { - unsigned width = spec.have_width && 0 < spec.width ? spec.width : 0; + unsigned width = spec.have_width && spec.width > 0 ? spec.width : 0; int prec = spec.have_precision ? spec.precision : -1; if (spec.star_width) @@ -1756,7 +1756,7 @@ format_directive (const pass_sprintf_len } else { - if (!res->warned && 0 < fmtres.range.min && navail < fmtres.range.min) + if (!res->warned && fmtres.range.min > 0 && navail < fmtres.range.min) { const char* fmtstr = (info.bounded @@ -2332,7 +2332,7 @@ get_destination_size (tree dest) a member array as opposed to the whole enclosing object), otherwise use type-zero object size to determine the size of the enclosing object (the function fails without optimization in this type). */ - int ost = 0 < optimize; + int ost = optimize > 0; unsigned HOST_WIDE_INT size; if (compute_builtin_object_size (dest, ost, &size)) return size; @@ -2648,7 +2640,8 @@ pass_sprintf_length::handle_gimple_call attempt to substitute the computed result for the return value of the call. Avoid this optimization when -frounding-math is in effect and the format string contains a floating point directive. */ - if (0 < optimize && flag_printf_return_value + if (optimize > 0 + && flag_printf_return_value && (!flag_rounding_math || !res.floating)) try_substitute_return_value (gsi, info, res); } Jakub