From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113944 invoked by alias); 6 Aug 2018 18:47:07 -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 113924 invoked by uid 89); 6 Aug 2018 18:47:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE,SPF_HELO_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=H*c:alternative, H*c:HHHHHHHH, H*c:HHHH X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Aug 2018 18:47:04 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w76IhgrS032428; Mon, 6 Aug 2018 18:47:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=corp-2018-07-02; bh=AeISFMM6cRvuVRv47ZCdHnROahzzAQkuVLC+wAyONSU=; b=bDOYhFaXoKlESA4/c48ijPsDpScZCA8n1f8Lh7S2CfwEuNQk+Eyb3dXI5x22a5b0W6Jk Fpjrp9uSiuaOJ6Bvq9MSRcmQCTOFE4wCouTo0sMh5fmC6/7P/mtcI8QrkMqJ/dsts5Hb hHOoffNAaQl+fG8VMzNQka/95uwWuZBlSGANP7Jrmbl6S2tGtYoX5omuABjvySxbNAux lA+zvKp/iu5wDzgna4eq8rB+NPdnumAffd5eLkjKmKDYYkRCXLq6Eql466eWoNQFKsxd IhaaK6XgXQsPbk1CSBYP1tbe8LJfFo2H4md/YbgnH5KREc/H2nm3EC/+VOtUzuU2eoFK 7Q== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2kn4spp5v1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 Aug 2018 18:47:02 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w76Il1KZ026620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Aug 2018 18:47:02 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w76Il1EP021209; Mon, 6 Aug 2018 18:47:01 GMT Received: from dhcp-10-159-234-106.vpn.oracle.com (/10.159.234.106) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 06 Aug 2018 11:47:00 -0700 From: Qing Zhao Message-Id: <01D315FB-6BE6-4944-8CAD-90EFDD970CBB@oracle.com> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os Date: Mon, 06 Aug 2018 18:47:00 -0000 In-Reply-To: Cc: gcc Patches To: Christophe Lyon References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00441.txt.bz2 thanks for reporting this issue. I will take a look. Qing > On Jul 30, 2018, at 8:45 AM, Christophe Lyon = wrote: >=20 > On Wed, 25 Jul 2018 at 19:08, Qing Zhao > wrote: >>=20 >> Hi, >>=20 >> As Wilco suggested, the new added strcmp/strncmp inlining should be only= enabled with O2 and above. >>=20 >> this is the simple patch for this change. >>=20 >> tested on both X86 and aarch64. >>=20 >> Okay for thunk? >>=20 >> Qing >>=20 >> gcc/ChangeLog: >>=20 >> +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. >> + >>=20 >> gcc/testsuite/ChangeLog: >>=20 >> +2018-07-25 Qing Zhao >> + >> + * gcc.dg/strcmpopt_5.c: Change to O2 to enable the transformatio= n. >> + * gcc.dg/strcmpopt_6.c: Likewise. >> + >>=20 >=20 > Hi, >=20 > After this change, I've noticed that: > FAIL: gcc.dg/strcmpopt_6.c scan-rtl-dump-times expand "__builtin_memcmp" 6 > on arm-none-linux-gnueabi > --with-mode thumb > --with-cpu cortex-a9 > and forcing -march=3Darmv5t via RUNTESTFLAGS >=20 > The log says: > gcc.dg/strcmpopt_6.c: pattern found 4 times > FAIL: gcc.dg/strcmpopt_6.c scan-rtl-dump-times expand "__builtin_memcmp" 6 >=20 > Christophe