From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id D2CD03858C27 for ; Mon, 12 Dec 2022 13:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2CD03858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 942661FEA3; Mon, 12 Dec 2022 13:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1670852266; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bNwZHGjw00l+txdav0Il3w8QAuWnmOd8WdJ6EnYzm4Y=; b=rNYdTAj3EsypTecNOfKkI1orW0G/MTahSJoLvj6Ww3K9SUaRrfjPWU69aNpx4aVqRrqInP Y2/DcAKjfBopVo+PUVElzSuCXhT1IxB92vz8lnI9S2I80hFkTFMpAEy9KOwmhX5l98O3r2 Ly5biL6Ilm8/OkjmiWBKqW3z4RitpP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1670852266; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bNwZHGjw00l+txdav0Il3w8QAuWnmOd8WdJ6EnYzm4Y=; b=/GhzhBJF6DX9+NBWKv1nVHC+AfMxkZpKcddDKOi7QduQTmu8oADTWeKuRgArPIR8tHF6k1 lVrMtO5VUcxFYlDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7F67313456; Mon, 12 Dec 2022 13:37:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id H0wKHqoul2NSJgAAMHmgww (envelope-from ); Mon, 12 Dec 2022 13:37:46 +0000 Message-ID: <8f9d61cf-14a5-4099-e2b6-7c8cac47a28b@suse.cz> Date: Mon, 12 Dec 2022 14:37:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: Missing optimization: mempcpy(3) vs memcpy(3) Content-Language: en-US To: Alejandro Colomar , gcc@gcc.gnu.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/9/22 18:11, Alejandro Colomar via Gcc wrote: > I expect the compiler to be knowledgeable enough to call whatever is fastest, whatever it is, but be consistent in both cases.  However, here are the results: Hi. Note the glibc implementation of mempcpy typically uses (calls) memcpy, thus I don't see any problem with the code snippets you provided. Cheers, Martin