From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36709 invoked by alias); 19 Aug 2019 14:08:54 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 36701 invoked by uid 89); 19 Aug 2019 14:08:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:MSK, H*i:sk:055f71a, H*f:sk:055f71a, H*F:D*ru X-HELO: smtp.ispras.ru Received: from bran.ispras.ru (HELO smtp.ispras.ru) (83.149.199.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Aug 2019 14:08:52 +0000 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id 257B2203C1; Mon, 19 Aug 2019 17:08:48 +0300 (MSK) Date: Mon, 19 Aug 2019 14:08:00 -0000 From: Alexander Monakov To: "Richard Earnshaw (lists)" cc: Paul Koning , =?ISO-8859-15?Q?Markus_Fr=F6schle?= , gcc@gcc.gnu.org Subject: Re: asking for __attribute__((aligned()) clarification In-Reply-To: <055f71a6-7b20-eb80-6f0a-d7572c34fa47@arm.com> Message-ID: References: <1E465204-0887-49CB-8472-196EDE7AAE81@comcast.net> <055f71a6-7b20-eb80-6f0a-d7572c34fa47@arm.com> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2019-08/txt/msg00138.txt.bz2 On Mon, 19 Aug 2019, Richard Earnshaw (lists) wrote: > Correct, but note that you can only pack structs and unions, not basic types. > there is no way of under-aligning a basic type except by wrapping it in a > struct. I don't think that's true. In GCC-9 the doc for 'aligned' attribute has been significantly revised, and now ends with When used as part of a typedef, the aligned attribute can both increase and decrease alignment, and specifying the packed attribute generates a warning. (but I'm sure defacto behavior of accepting and honoring reduced alignment on a typedef'ed scalar type goes way earlier than gcc-9) Alexander