From patchwork Mon Sep 9 09:23:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Zolotukhin X-Patchwork-Id: 273533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 86AFF2C0206 for ; Mon, 9 Sep 2013 19:24:08 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=NP+9fSswSEsKkkr3F EzQ0GVbUrnoYs/GoaLMjCk4lHjXS8XjgySTuzPemFOvjM8Vtmb/E5pgFxzhKPBTc JEXDgbqhLoPazijQB6TIiqzEPGQzHLKjlEUFgZoAjr/L5fBD8X6Suakn0Ik02Jr/ 8H2n1U0WpRUGGPPK7H1I0g1vW4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=dVIdwzrik16ysryW1hnP59J kBc8=; b=LRkRulQCM0sQ0Kwt8l23ooZhr74yzgaTfB20k4/tK8MIJNYW2ScF9fi OUALgsxNPzjjBr9UnSCUvPSqU5NjqntkMrWxz3+B3Vns3EeWxaIqaZbw599+pLTi ikZ8RCyWNCckpStszy/CdGxeicTc4BdQmgoNrrgswM4c4J9id4U8= Received: (qmail 12336 invoked by alias); 9 Sep 2013 09:24:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 12315 invoked by uid 89); 9 Sep 2013 09:24:01 -0000 Received: from mail-pd0-f182.google.com (HELO mail-pd0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 09 Sep 2013 09:24:01 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED, AWL, BAYES_00, FREEMAIL_FROM autolearn=ham version=3.3.2 X-HELO: mail-pd0-f182.google.com Received: by mail-pd0-f182.google.com with SMTP id r10so5978642pdi.27 for ; Mon, 09 Sep 2013 02:23:59 -0700 (PDT) X-Received: by 10.68.253.67 with SMTP id zy3mr2364190pbc.137.1378718639192; Mon, 09 Sep 2013 02:23:59 -0700 (PDT) Received: from msticlxl57.ims.intel.com ([192.55.54.42]) by mx.google.com with ESMTPSA id bb1sm15113434pbc.10.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 02:23:58 -0700 (PDT) Date: Mon, 9 Sep 2013 13:23:29 +0400 From: "Michael V. Zolotukhin" To: Jakub Jelinek Cc: Jan Hubicka , "H.J. Lu" , Eric Botcazou , Kirill Yukhin , GCC Patches , Ond??ej B?lka , Uros Bizjak Subject: Re: [PATCH, x86] Use vector moves in memmove expanding Message-ID: <20130909092329.GE53568@msticlxl57.ims.intel.com> References: <20130909072317.GA53568@msticlxl57.ims.intel.com> <20130909072434.GA21984@kam.mff.cuni.cz> <20130909074205.GB53568@msticlxl57.ims.intel.com> <20130909074643.GC1817@tucnak.redhat.com> <20130909075249.GC53568@msticlxl57.ims.intel.com> <20130909075902.GD1817@tucnak.redhat.com> <20130909090912.GD53568@msticlxl57.ims.intel.com> <20130909091318.GE1817@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130909091318.GE1817@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes > Please don't introduce new *.x files, for tests where you need something > like that just stick it into gcc.dg/torture/ instead and use normal dg stuff > in there. Thanks, fixed. Ok to commit? Changelog: gcc: 2013-09-09 Michael Zolotukhin * config/i386/i386.c (ix86_expand_movmem): Fix epilogue generation. gcc/testsuite: 2013-09-09 Michael Zolotukhin * gcc.dg/torture/memcpy-1.c: New test. Michael > Jakub diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a8d70bc..50e9fa9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -23329,7 +23329,7 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, if (count_exp != const0_rtx && epilogue_size_needed > 1) expand_movmem_epilogue (dst, src, destreg, srcreg, count_exp, - size_needed); + epilogue_size_needed); if (jump_around_label) emit_label (jump_around_label); return true; diff --git a/gcc/testsuite/gcc.dg/torture/memcpy-1.c b/gcc/testsuite/gcc.dg/torture/memcpy-1.c new file mode 100644 index 0000000..f8e8974 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/memcpy-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-additional-options "-march=pentiumpro" { target ia32 } } */ +/* { dg-additional-options "-minline-all-stringops" { target { i?86-*-* x86_64-*-* } } } */ + +static void __attribute__((noinline, noclone)) +my_memcpy (char *dest, const char *src, int n) +{ + __builtin_memcpy (dest, src, n); +} + +int +main (void) +{ + char a1[4], a2[4]; + __builtin_memset (a1, 'a', 4); + __builtin_memset (a2, 'b', 4); + my_memcpy (a2, a1, 4); + if (a2[0] != 'a') + __builtin_abort (); + return 0; +} +