From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2819 invoked by alias); 26 Jul 2018 08:26:51 -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 2804 invoked by uid 89); 26 Jul 2018 08:26:50 -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= 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; Thu, 26 Jul 2018 08:26:49 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 79787ACC6; Thu, 26 Jul 2018 08:26:46 +0000 (UTC) Date: Thu, 26 Jul 2018 08:26:00 -0000 From: Richard Biener To: Qing Zhao cc: gcc Patches , jakub Jelinek , jeff Law , Wilco Dijkstra Subject: Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-07/txt/msg01586.txt.bz2 On Wed, 25 Jul 2018, Qing Zhao wrote: > Hi, > > As Wilco suggested, the new added strcmp/strncmp inlining should be only enabled with O2 and above. > > this is the simple patch for this change. > > tested on both X86 and aarch64. > > Okay for thunk? You should simply use if (optimize_insn_for_size_p ()) return NULL_RTX; to be properly profile-aware. OK with that change. Richard. > Qing > > gcc/ChangeLog: > > +2018-07-25 Qing Zhao > + > + * builtins.c (inline_expand_builtin_string_cmp): Disable inlining > + when optimization level is lower than 2 or optimize for size. > + > > gcc/testsuite/ChangeLog: > > +2018-07-25 Qing Zhao > + > + * gcc.dg/strcmpopt_5.c: Change to O2 to enable the transformation. > + * gcc.dg/strcmpopt_6.c: Likewise. > + > > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)