From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68016 invoked by alias); 20 Aug 2019 05:46:18 -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 67998 invoked by uid 89); 20 Aug 2019 05:46:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=amonakov@ispras.ru, amonakovisprasru, asking X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Aug 2019 05:46:17 +0000 Received: from [217.89.113.18] ([217.89.113.18]) by web-mail.kundenserver.de (3c-app-1and1-bs05.server.lan [172.19.170.162]) (via HTTP); Tue, 20 Aug 2019 07:46:13 +0200 MIME-Version: 1.0 Message-ID: From: =?UTF-8?Q?=22Markus_Fr=C3=B6schle=22?= To: gcc@gcc.gnu.org Subject: Aw: Re: asking for __attribute__((aligned()) clarification Content-Type: text/plain; charset=UTF-8 Date: Tue, 20 Aug 2019 05:46:00 -0000 In-Reply-To: References: <1E465204-0887-49CB-8472-196EDE7AAE81@comcast.net> <055f71a6-7b20-eb80-6f0a-d7572c34fa47@arm.com> Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00149.txt.bz2 Thank you (and others) for your answers. Now I'm just as smart as before, h= owever. Is it a supported, documented, 'long term' feature we can rely on or not? If yes, I would expect it to be properly documented. If not, never mind. > Gesendet: Montag, 19. August 2019 um 16:08 Uhr > Von: "Alexander Monakov" > An: "Richard Earnshaw (lists)" > Cc: "Paul Koning" , "Markus Fr=C3=B6schle" , gcc@gcc.gnu.org > Betreff: Re: asking for __attribute__((aligned()) clarification > > On Mon, 19 Aug 2019, Richard Earnshaw (lists) wrote: >=20 > > 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. >=20 > I don't think that's true. In GCC-9 the doc for 'aligned' attribute has b= een > significantly revised, and now ends with >=20 > When used as part of a typedef, the aligned attribute can both increase= and > decrease alignment, and specifying the packed attribute generates a war= ning.=20 >=20 > (but I'm sure defacto behavior of accepting and honoring reduced alignmen= t on > a typedef'ed scalar type goes way earlier than gcc-9) >=20 > Alexander >