From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93935 invoked by alias); 1 Aug 2018 11:28:11 -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 93919 invoked by uid 89); 1 Aug 2018 11:28:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:713, HContent-Transfer-Encoding:8bit X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Aug 2018 11:28:08 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BE5CBAD87; Wed, 1 Aug 2018 11:28:06 +0000 (UTC) Subject: Re: [PATCH] Add malloc predictor (PR middle-end/83023). To: gcc-patches@gcc.gnu.org, Marc Glisse Cc: Jan Hubicka , Nathan Sidwell References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Wed, 01 Aug 2018 11:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00046.txt.bz2 On 07/27/2018 02:38 PM, Marc Glisse wrote: > On Fri, 27 Jul 2018, Martin Liška wrote: > >> So answer is yes, the builtin can be then removed. > > Good, thanks. While looking at how widely it is going to apply, I noticed that the default, throwing operator new has attribute malloc and everything, but the non-throwing variant declared in doesn't, so it won't benefit from the new predictor. I don't know if there is a good reason for this disparity... > Well in case somebody uses operator new: int* p1 = new int; if (p1) delete p1; we optimize out that to if (true), even when one has used defined operator new. Thus it's probably OK. Martin