From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129717 invoked by alias); 21 Sep 2016 18:57:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 129698 invoked by uid 89); 21 Sep 2016 18:57:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:770 X-HELO: zimbra.cs.ucla.edu Subject: Re: [PATCH] libio: Add small optimization on fmemopen To: Florian Weimer , Adhemerval Zanella , libc-alpha@sourceware.org References: <1474466758-26544-1-git-send-email-adhemerval.zanella@linaro.org> <2afbe144-bb78-b657-002a-361fb3220269@cs.ucla.edu> <03eb21f7-6979-62eb-0fe8-34ea35b0c7d6@linaro.org> <708fc89d-fbb9-cb20-9ee6-079013baf63b@redhat.com> From: Paul Eggert Message-ID: <6beed9ba-f675-4860-9070-76b7afa31654@cs.ucla.edu> Date: Wed, 21 Sep 2016 18:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-09/txt/msg00413.txt.bz2 On 09/21/2016 11:47 AM, Florian Weimer wrote: > We don't know the nature of the GCC issue, so we cannot work around it > reliably. The most likely explanation is that Address Sanitizer does > not account for a valid GCC optimization. That's not the sense that I get from looking at Bug 66661. GCC is assuming it can do an aligned word load of the trailing bytes of a flexible array member in a properly-aligned structure. This assumption is something we can easily work around reliably, e.g., with the patch I suggested. Although the followups to Bug 66661 suggest that there may be further problems with overaligned structures, the code here is not using _Alignas so these further problems are not an issue here.