From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30637 invoked by alias); 12 Oct 2016 08:30:53 -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 30104 invoked by uid 89); 12 Oct 2016 08:30:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Direct X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Oct 2016 08:30:41 +0000 Received: by mail-wm0-f48.google.com with SMTP id b201so17311015wmb.0 for ; Wed, 12 Oct 2016 01:30:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Gjqq7Lv28EZcx9/fq2hbHlz9GABMF4Nu/NVtZ33cJlM=; b=VYXVwc/a8x16eOLOsPyd9HiwCKjjZ92yhtteyHCyCRhMeBsL/WSmmckMK0/2ySm+ge h9V0TBmoyXCL1N+ddIC79VdqUZfDqRZH16x06iCorNPkcml20NynDrS3QanapMP5aQOd +F0EfyQXefTsGYfWSgu6HURO10LW5jY1Yl2g1zMwDGaF8JtB7WpYpot45g3jNsmrOkDD tQERg0oFiHKd4fX1HPREgwvQCLywxpR/eu6NvSpUD1OCT9A62OisiphvTmrYL3cOtZWU pIzzOlqf7ido6hGOaZXnYBHAzW9GQu5cn3gtWpJ27nA7QVGtIdKcqOzM0/+HHF3Hd37x eIgA== X-Gm-Message-State: AA6/9RnkqtFT21YIf8INtZSLLVdvxdcaRMUr5oPhczS6FMhOV3w0bR/LssoBHRyVmJwbs58cLXhG1KYFtVvbcw== X-Received: by 10.194.81.133 with SMTP id a5mr8707437wjy.86.1476261039805; Wed, 12 Oct 2016 01:30:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.155.146 with HTTP; Wed, 12 Oct 2016 01:30:39 -0700 (PDT) In-Reply-To: <6b92b283-4f71-6fd9-ec27-ad5a9a29b383@suse.cz> References: <678ff58e-4aa3-6145-f56b-780bf618338c@suse.cz> <6b92b283-4f71-6fd9-ec27-ad5a9a29b383@suse.cz> From: Richard Biener Date: Wed, 12 Oct 2016 08:30:00 -0000 Message-ID: Subject: Re: [PATCH] Fold __builtin_str{n}{case}cmp functions (version 3) To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00820.txt.bz2 On Tue, Oct 11, 2016 at 11:33 AM, Martin Li=C5=A1ka wrote: > Changes from the previous version: > > 1) Handle BUILT_IN_STRNCMP with length =3D=3D -1. > 2) Direct gimple stmts creation and usage gsi_replace_with_seq_vops. > (hope using of replace_call_with_value is fine if replacing with a cst?) yes > 3) lhs =3D=3D NULL cases are handled (Or is it fine to replace with a nop= in general? > Can change a semantic as it may touch a memory.) > 4) CFN_BUILT_IN_STRNCMP can handle strncmp (x, y, 0). > 5) Handling of CFN_BUILT_IN_STRNCASECMP is added. > > Testing of the whole series has been running. gimple_load_first_char needs a comment. + tree var =3D gimple_load_first_char (loc, str1, &stmts); + if (lhs) + stmt =3D gimple_build_assign (lhs, NOP_EXPR, var); + else + stmt =3D gimple_build_nop (); I think you don't need the nop() as you have at least one stmt from the load. Likewise for the other cases below. Otherwise this patch looks ok now. Richard. > Martin