From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2826 invoked by alias); 21 Apr 2003 21:41:30 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2814 invoked from network); 21 Apr 2003 21:41:29 -0000 Received: from unknown (HELO nile.gnat.com) (205.232.38.5) by sources.redhat.com with SMTP; 21 Apr 2003 21:41:29 -0000 Received: by nile.gnat.com (Postfix, from userid 338) id C4585F28D2; Mon, 21 Apr 2003 17:41:29 -0400 (EDT) To: aoliva@redhat.com, kenner@vlsi1.ultra.nyu.edu Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Message-Id: <20030421214129.C4585F28D2@nile.gnat.com> Date: Tue, 22 Apr 2003 00:15:00 -0000 From: dewar@gnat.com (Robert Dewar) X-SW-Source: 2003-04/txt/msg01020.txt.bz2 > And the reason is as I said: you specify alignment for a type both for > interface and efficiency reasons, but for an object only for the latter. Not quite. consider type R is array (Natural range <>) of Character; for R'Alignment use 1; X : R (1 .. 100); pragma Import (C, X); now for the above, the generated code can only assume an alignment of 1. But we might want to do Y : R (1 .. 1000); for Y'Alignment use 8; pragma Export (C, Y); in a case where the C code expects an alignment for the object of 8 for correct operation. So even for objects, specifying an alignment different from that for the type may be appropriately needed for functional correctness.