220 38162 <1660351.5grH1viArP@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: memcpy/memset/etc overloads for volatile memory
Date: Wed, 23 May 2018 13:07:57 -0300
Lines: 30
Approved: news@gmane.org
Message-ID: <1660351.5grH1viArP@tjmaciei-mobl1>
References: <CAFdMc-0NAvWrkwzpgEKq4DQj=0vL_0F2s17XyR9MSUNJk5R0sw@mail.gmail.com> <CAFdMc-2o=SKNdmiy_fnnWWJ+3+Zkbh2sKU4pks40hgS3md=MNA@mail.gmail.com> <1802764.OhHZxBL3Cz@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1527091554 3248 195.159.176.226 (23 May 2018 16:05:54 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 23 May 2018 16:05:54 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBYFDS3MAKGQEP6DW7YA@isocpp.org Wed May 23 18:05:50 2018
Return-path: <std-proposals+bncBCB4TK757YBRBYFDS3MAKGQEP6DW7YA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f200.google.com ([209.85.220.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBYFDS3MAKGQEP6DW7YA@isocpp.org>)
	id 1fLWGs-0000kt-Hu
	for gclcip-std-proposals@m.gmane.org; Wed, 23 May 2018 18:05:50 +0200
Original-Received: by mail-qk0-f200.google.com with SMTP id p126-v6sf22950100qkd.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 23 May 2018 09:08:02 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1527091681; cv=pass;
        d=google.com; s=arc-20160816;
        b=s1LGLSdvDYA8eFCZocGLG1Uhs72D0aJ7gy98Q89isziXWtZs+sIHUxAJe/xomJHZFB
         +cKj1bUY7zlaTw71luIbA9bKI2ZHcIT1TNCaninZ/Zw1bFjGggZASLT/TAN9nXDngU1Z
         biBEb/wpnv8Vz2qMgDa/tfCqvLZjpimS5mJZKEWYxdMu0je07DW1SKPsylNY08BOJ9kn
         o9HfzvAOKK2fDkmsRx9bXgpqGTYY7UGrRRXbNc5RiCkfBy9dp4Y4RbSqctuhrDU/4Nvd
         j5WtAWlRI0sBa28sWnCjECiw+2/BxUwWoj+qlI1beditgpnT23n/ClvAlUl0T8uTL6a9
         zxng==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=K4Q26cnEvU9eFwAYnP8jrr/sbN9Ns2SxGxEnqT/J06A=;
        b=qIa6uhCHb0rhxpI/I1yiyNL0TTK9VPNJLGMDy/MhiqqPJHKqmMcBOprLBD/yqq2Wx4
         ctvgd18C0lFVEfMTxQ0o+08xH3dGiSWuw9CafEDPhDJor/k8Hpg5TAOADIpXqjBUUSVa
         6lkEgQ4jm7x95Cof5tkZiRBMeI7U4JRQg1I/80Fd8arufzmXYzNty8yxkBk2L70WR01S
         F/wRLKMEqcxtBNxh6MiDp0wG64zx0kdSakMMfw4Cjh/bVogf9GwJNSQ8K5jSl7E8wvFv
         5nkl2RM6yABbLXmVJHNA/GksfmUvAOhtQvw+aLLjeCXwug5ahYFpmSeYH2eeFyAadc0s
         RO2Q==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=K4Q26cnEvU9eFwAYnP8jrr/sbN9Ns2SxGxEnqT/J06A=;
        b=BA394viU50DoZBADtE7g0wqJ532eZMFo311Eua0P3oiGakSgLRY7ijhT57+imp13R3
         AHGqhhad5OE7Tb4EWv1KX4Ss00QN46gpILukY/UCU4LQpcXPFk1NkI5sTjNj675nKCbS
         CmFRUUeo/9QcJcwR+//VKZfS3rftQKD+OAfym3U931zZTX/xMjh6Pwr+jkmvHgjD+xSn
         fuK/HXTSzkHRtrAigHQUTVL08urBZG46aNr1kSwSseZSvP4d0BpMDroTebKDMfu4JXps
         TnVNce7JvXtVYpwAt86aa5SmMct8dLkhbBfQpgbzW5CHcehrRuyFzHF6AFF2CHgtpd45
         Atdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=K4Q26cnEvU9eFwAYnP8jrr/sbN9Ns2SxGxEnqT/J06A=;
        b=r3irrVdEMCaf1IBet5/3S93cvTagMcwse+1D9EL9W+vtMySs5iFbYt5TIuoBPxqoIS
         aDumzO5lT6NGQh/UcovL+TN2z37GX7gb3uls4XFDC5BmVp3sHJ1Q6ftgGb9sTjQn/f+G
         cUKdNmMRSUxinpVpH3LKgW/1l+QIfot3+ddTWUae0ATYLMGfMXKbk+4726V7pJoe8qcl
         8BaqKZsj8881SlbTxdWa7RcN9/XQmZXk24GXmPwvfBGxGfXK9UnmEkl4H6W2i30J2kvq
         EO4/SOntL5opk2zN2jxXdCfJ6yFHFwl8CDlXJOYwe08BNXOAGIvast/jEdyzXA++ZoSE
         DHiw==
X-Gm-Message-State: ALKqPwdZmDYjrlHMnf0YbDeNrr1W9XoB65queg/VJofR9RjeVYaAlfun
	bzi+743J+e6O9/y/Q0b9ZUHtuA==
X-Google-Smtp-Source: ADUXVKLwo5tkOon9pW8RyV5bu17OBvNJAYf34lWfNMehCgotiQ7c4NG+hmmmruKYvAGeQK+vb5Rodg==
X-Received: by 2002:ac8:70c2:: with SMTP id g2-v6mr1738115qtp.60.1527091681698;
        Wed, 23 May 2018 09:08:01 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a37:6616:: with SMTP id a22-v6ls6574632qkc.13.gmail; Wed, 23
 May 2018 09:08:00 -0700 (PDT)
X-Received: by 2002:a37:1453:: with SMTP id e80-v6mr3085375qkh.117.1527091680798;
        Wed, 23 May 2018 09:08:00 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1527091680; cv=none;
        d=google.com; s=arc-20160816;
        b=QLUW3Oj3aJIMD+OZbePhBgtXCVEfzL3qN3dp5lemdLdrl812Iah3dH2boXjKHuqw+m
         YHVH7+rIYgDR5BG4Y5V8K3+D46G2pXJCy6AUCOmSWsT1mqNHX6nrRFR+eRYjjv2dQvTu
         DI+ekRQLpGPYynVDQHNRcd5NxA8B8NSXT2DKs10Eje1jjensb4ToH8uxK8GsY2rq6gd1
         n+KJkH/505fDUL+VQ+9D4rkrcCpjO1AR7EYTA8WNZgAMTBpvsUSyjvzEm11HApRajve9
         m0eY+nXMzixuznxiGvgfHv46aY2sbxd/TiaAP55BCtyS7VwaVmQU1yYizq2iwmN1qblZ
         BHng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=qYO4hWRm6VD3Ic6sxNqRg5h/c463hMkHYhd0IfFFumA=;
        b=XFfdQYU09/LbetKoG/LtkjdybSkVJNSdmQEqGdZ4kzVAyDcpViStXnFKqe4p3ElOSQ
         pfrrb0VKxJ9AbHzgAMTT6l+UoXX9N725uWuNYYRYdhCNSUyYXhkBgqllSit7taJuob7d
         sGU1xH7BxYtgKYJU0TCcYAOtx2FgePkWWYGPRpmATp+PSeThsmWmtrNkR8BCgakEIAqa
         A/uyuTtNncZQ4jhVTb1WdL35fhZEswMLODpS/Gfy+488oh/nwar8KwdvxqKAMlhv16Tc
         jtq8Uet36VD5HqNoj7tzOzL8cO04vF6SRL+1Fo5xetypovpmznDde6b/BMKNemD1qLls
         XNkg==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from smtp.macieira.info (smtp.macieira.info. [2001:19f0:5:2221::1:3])
        by mx.google.com with ESMTPS id c185-v6si692699qkf.135.2018.05.23.09.08.00
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 23 May 2018 09:08:00 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) client-ip=2001:19f0:5:2221::1:3;
Original-Received: from tjmaciei-mobl1.localnet (189-69-95-251.dsl.telesp.net.br [189.69.95.251])
	by smtp.macieira.info (Postfix) with ESMTPSA id 21AF5EDC3
	for <std-proposals@isocpp.org>; Wed, 23 May 2018 09:07:59 -0700 (PDT)
In-Reply-To: <1802764.OhHZxBL3Cz@tjmaciei-mobl1>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted
 sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:38162
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38162>

On Wednesday, 23 May 2018 13:05:07 -03 Thiago Macieira wrote:
> Sorry, but my point is that to write:
> 
>         for (size_t i = 0; i < n; ++i)
>                 dst[i] = src[i];

By the way, this should be what

    std::copy_n(src, n, dst);

Should generate for volatile chars, but the compilation fails with both libc++ 
and libstdc++, as both try too aggressively to use memmove. Since I don't see 
any requirement in the standard besides src and dst being valid InputIterator 
and OutputIterator respectively, I believe that's a bug in both 
implementations.

Microsoft's compiles. See https://godbolt.org/g/7yMhRy.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/1660351.5grH1viArP%40tjmaciei-mobl1.

.
