From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78892 invoked by alias); 16 Apr 2019 11:39:55 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 78873 invoked by uid 89); 16 Apr 2019 11:39:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=peculiar 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; Tue, 16 Apr 2019 11:39:54 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F37805AFE3; Tue, 16 Apr 2019 11:39:52 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.40.205.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98AC15C1B4; Tue, 16 Apr 2019 11:39:52 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x3GBdots030035; Tue, 16 Apr 2019 13:39:50 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x3GBdlHo030034; Tue, 16 Apr 2019 13:39:47 +0200 Date: Tue, 16 Apr 2019 11:39:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Michael Matz , Martin =?utf-8?B?TGnFoWth?= , GCC Development , Jan Hubicka , Martin Jambor Subject: Re: GCC 8 vs. GCC 9 speed and size comparison Message-ID: <20190416113946.GC21066@tucnak> Reply-To: Jakub Jelinek References: <6f547f38-1751-c003-b5ae-52dae776d39a@suse.cz> <65289853-0db4-4645-74b4-869443addf1a@suse.cz> <20190415133326.GT21066@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00166.txt.bz2 On Tue, Apr 16, 2019 at 01:25:38PM +0200, Richard Biener wrote: > So for the parser it's small differences that accumulate, for example > a lot more comptype calls via null_ptr_cst_p (via char_type_p) via the new > conversion_null_warnings which is called even without any warning option. > > Possible speedup to null_ptr_cst_p is to avoid the expensive char_type_p > (called 50000 times in GCC 9 vs. only 2000 times in GCC 8): If we do this (looks like a good idea to me), perhaps we should do also following (first part just doing what you've done in yet another spot, moving the less expensive checks first, because null_node_p strips location wrappers etc.) and the second not to call conversion_null_warnings at all if we don't want to warn (though, admittedly while warn_zero_as_null_pointer_constant defaults to 0, warn_conversion_null defaults to 1). --- gcc/cp/call.c 2019-04-12 21:47:06.301924378 +0200 +++ gcc/cp/call.c 2019-04-16 13:35:59.779977641 +0200 @@ -6844,8 +6844,9 @@ static void conversion_null_warnings (tree totype, tree expr, tree fn, int argnum) { /* Issue warnings about peculiar, but valid, uses of NULL. */ - if (null_node_p (expr) && TREE_CODE (totype) != BOOLEAN_TYPE - && ARITHMETIC_TYPE_P (totype)) + if (TREE_CODE (totype) != BOOLEAN_TYPE + && ARITHMETIC_TYPE_P (totype) + && null_node_p (expr)) { location_t loc = get_location_for_expr_unwinding_for_system_header (expr); if (fn) @@ -7059,7 +7060,9 @@ convert_like_real (conversion *convs, tr return cp_convert (totype, expr, complain); } - if (issue_conversion_warnings && (complain & tf_warning)) + if (issue_conversion_warnings + && (complain & tf_warning) + && (warn_conversion_null || warn_zero_as_null_pointer_constant)) conversion_null_warnings (totype, expr, fn, argnum); switch (convs->kind) Jakub