From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89066 invoked by alias); 6 Sep 2016 15:16:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 89053 invoked by uid 89); 6 Sep 2016 15:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Sep 2016 15:16:11 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bhI6b-0007i4-DU from joseph_myers@mentor.com ; Tue, 06 Sep 2016 08:16:09 -0700 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 6 Sep 2016 16:16:06 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1bhI6T-0005x9-SP; Tue, 06 Sep 2016 15:16:02 +0000 Date: Tue, 06 Sep 2016 15:20:00 -0000 From: Joseph Myers To: Florian Weimer CC: , Subject: Re: Make max_align_t respect _Float128 [version 2] In-Reply-To: <3bb7530e-fff4-6030-a87e-1654d55d1e45@redhat.com> Message-ID: References: <3bb7530e-fff4-6030-a87e-1654d55d1e45@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-09/txt/msg00313.txt.bz2 On Tue, 6 Sep 2016, Florian Weimer wrote: > So that's what ties the two things together. I still don't like what's > implied in PR66661, that all object sizes have to be multiples of the > fundamental alignment. I don't think there's any such requirement in the case of flexible array members; if you use malloc to allocate a structure with a flexible array member, you can access as many trailing array elements as would fit within the allocated size, whether or not that size is a multiple of either the alignment of the structure, or the alignment of max_align_t. > > Well, that's a conformance bug in the implementation as a whole. The > > nonconforming modes in question are still useful and it's useful for GCC > > to support such mallocs. > > PR66661 shows that GCC does not want to support such mallocs (or even glibc's > malloc). GCC is supposed to support all mallocs that produce results aligned to at least MALLOC_ABI_ALIGNMENT (which may be smaller than the alignment of max_align_t). -- Joseph S. Myers joseph@codesourcery.com