From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id 7382B5A4B for ; Thu, 5 Mar 2015 18:34:22 +0100 (CET) Received: by wibhm9 with SMTP id hm9so17009529wib.2 for ; Thu, 05 Mar 2015 09:34:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=Yz1jJ7o0SQu1lkQke9axak2Biaa0l2gqQ4C9AIT7p10=; b=NvCFDyz+W5t4y2Srex7jqCEuz1eXSlZ+5oneMegSJaYNe0WmMnJfTDJXKU6ogk161w p2AfVtMYs2IXO+x9cF3wpAFfZVoXx+iRQ3ffzDa5dGoHiAyuW34S8n0HG6anVjai6Nvv gz+eWgA85qPN1BsykVwpkDz8Mw0YePHprYYFNWGbYZgD6KihwV+We1sQxCyPZT94OBN/ UI/6dLfQ3YSGe0G194ga92qTm3163fNhqjW8/CEBvBepDO5BnYAigsyi1eKr/DkgwQjp dD6YfCGgsK3J/1AypId3vepJLtnQBA3uGxhEbGNJAg07jYHRYumuYP5QaZrYqyjQ0lzl 4FoA== X-Gm-Message-State: ALoCoQlYmqEVi0kyHCbj62Lyn1cV2U7J9JD61cttt+sAAfcXVXH+ukUacR1bgVqmE/tyFNKCIDkw X-Received: by 10.194.120.230 with SMTP id lf6mr20710152wjb.78.1425576862265; Thu, 05 Mar 2015 09:34:22 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id ka1sm11432621wjc.2.2015.03.05.09.34.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 09:34:21 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Thu, 05 Mar 2015 18:33:46 +0100 Message-ID: <1492500.Ex1SnWRXJA@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1425287030-18225-1-git-send-email-zhihong.wang@intel.com> References: <1425287030-18225-1-git-send-email-zhihong.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] A fix to work around strict-aliasing rules breaking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 17:34:22 -0000 2015-03-02 17:03, zhihong.wang@intel.com: > Fixed strict-aliasing rules breaking errors for some GCC version. > > Signed-off-by: Zhihong Wang > --- > .../common/include/arch/x86/rte_memcpy.h | 44 ++++++++++++---------- > 1 file changed, 24 insertions(+), 20 deletions(-) > > diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > index 69a5c6f..f412099 100644 > --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > @@ -195,6 +195,8 @@ rte_mov256blocks(uint8_t *dst, const uint8_t *src, size_t n) > static inline void * > rte_memcpy(void *dst, const void *src, size_t n) > { > + uintptr_t dstu = (uintptr_t)dst; > + uintptr_t srcu = (uintptr_t)src; > void *ret = dst; > int dstofss; > int bits; > @@ -204,22 +206,22 @@ rte_memcpy(void *dst, const void *src, size_t n) > */ > if (n < 16) { > if (n & 0x01) { > - *(uint8_t *)dst = *(const uint8_t *)src; > - src = (const uint8_t *)src + 1; > - dst = (uint8_t *)dst + 1; > + *(uint8_t *)dstu = *(const uint8_t *)srcu; > + srcu = (uintptr_t)((const uint8_t *)srcu + 1); > + dstu = (uintptr_t)((uint8_t *)dstu + 1); [...] Is there another solution? Are we going to acknowledge this fix?