From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71498 invoked by alias); 16 Jun 2017 20:52:39 -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 71465 invoked by uid 89); 16 Jun 2017 20:52:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f181.google.com Received: from mail-qk0-f181.google.com (HELO mail-qk0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 20:52:35 +0000 Received: by mail-qk0-f181.google.com with SMTP id a199so470043qkb.2 for ; Fri, 16 Jun 2017 13:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=LrlQuLGOopaeKzYFy91dD7dxjwDPD3CPFT8KeupepkQ=; b=MjtJA6YN33PdjbA72KTb1K0y19DO+ubmmqlQ188y4O31RMlx+Eo61HI4hW23+byvU8 O/byGq4eCc784b6qfQqwgkwzBgrzG/6dXu9b2jfNgfFWqjADtFbEo9ZRf0xLmGzBa/88 0Ob0tzosNwGME56bzFkUkB5XkmB98CizUfc2rCPj67gaKr62KD/kw0dKu6iqMY9eqkj5 GE33gS72NExLaxE/cCZbSvxOG6iB9PgesaFr/b4JlAVVWQKm8j/LGDpsZFruo0NvsJFO ApOk3hM5qrAOqd42Tnqy3iAmgvypIT2lYr8q03x1uOxnngRfEei2/1NeEaJCglTwAEOu EmAQ== X-Gm-Message-State: AKS2vOyoc0VNuTUx9J2z9CPBx4lBX1Zr+a6vA2KEJY+sPEw55lE5Bu30 dPzG7Dl3Q1h29g== X-Received: by 10.55.203.208 with SMTP id u77mr14252831qkl.95.1497646358743; Fri, 16 Jun 2017 13:52:38 -0700 (PDT) Received: from localhost.localdomain (184-96-144-212.hlrn.qwest.net. [184.96.144.212]) by smtp.gmail.com with ESMTPSA id m4sm3086142qkm.9.2017.06.16.13.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jun 2017 13:52:34 -0700 (PDT) Subject: Re: [PATCH] handle bzero/bcopy in DSE and aliasing (PR 80933, 80934) To: Richard Biener References: <96b534c4-988f-e958-f341-9674a60aeb1e@gmail.com> <656E3329-B549-490D-A87F-7421D424E781@gmail.com> <87936043-98aa-52e5-155b-38ecafca562c@gmail.com> <67a113e7-ee14-8afe-9deb-6c2c26927505@gmail.com> <132d2724-8e3a-bb1b-731f-0c0d1e7883d6@gmail.com> Cc: GCC Patches , Bernhard Reutner-Fischer From: Martin Sebor Message-ID: <5d3255b6-ce77-3255-5a7f-229a9dddfec7@gmail.com> Date: Fri, 16 Jun 2017 20:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01236.txt.bz2 > +static bool > +gimple_fold_builtin_bcmp (gimple_stmt_iterator *gsi) > +{ > > + /* Transform bcmp (a, b, len) into memcmp (a, b, len). */ > + > + gimple *stmt = gsi_stmt (*gsi); > + tree a = gimple_call_arg (stmt, 0); > + tree b = gimple_call_arg (stmt, 1); > + tree len = gimple_call_arg (stmt, 2); > + > + gimple_seq seq = NULL; > + gimple *repl = gimple_build_call (fn, 3, a, b, len); > + gimple_seq_add_stmt_without_update (&seq, repl); > + gsi_replace_with_seq_vops (gsi, seq); > > given they have the same prototype you can do like gimple_fold_builtin_stpcpy: > > gimple_call_set_fndecl (stmt, fn); > fold_stmt (gsi); > > That works even with bcopy -> memmove if you swap arguments. > > Ok with that changes. I made these changes along with those mentioned downthread and committed r249278. Martin