From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11679 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Documentation of memcpy and undefined behavior in memset Date: Thu, 6 Jul 2017 20:02:12 +0300 (MSK) Message-ID: References: <0F9B48AD-C5B3-44B6-8D82-0985CF8604A0@trust-in-soft.com> <20170706162353.GC1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1499360556 10544 195.159.176.226 (6 Jul 2017 17:02:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2017 17:02:36 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: musl@lists.openwall.com Original-X-From: musl-return-11692-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 06 19:02:27 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dTAAc-0002K5-Qu for gllmg-musl@m.gmane.org; Thu, 06 Jul 2017 19:02:26 +0200 Original-Received: (qmail 9899 invoked by uid 550); 6 Jul 2017 17:02:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 9875 invoked from network); 6 Jul 2017 17:02:29 -0000 In-Reply-To: <20170706162353.GC1627@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11679 Archived-At: On Thu, 6 Jul 2017, Rich Felker wrote: > FWIW, I think GCC may do aggressive optimization based on the > assumption that memcpy implies the pointer points to an object (of > size at least 1) The compiler can deduce that the pointer is non-null (and that's fine), but otherwise I don't see what possible optimizations could take place. Did you have something specific in mind? Alexander