From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26140 invoked by alias); 17 Apr 2003 10:50:39 -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 26128 invoked from network); 17 Apr 2003 10:50:37 -0000 Received: from unknown (HELO vlsi1.ultra.nyu.edu) (128.122.140.213) by sources.redhat.com with SMTP; 17 Apr 2003 10:50:37 -0000 Received: by vlsi1.ultra.nyu.edu (4.1/1.34) id AA05389; Thu, 17 Apr 03 06:54:51 EDT Date: Thu, 17 Apr 2003 11:56:00 -0000 From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner) Message-Id: <10304171054.AA05389@vlsi1.ultra.nyu.edu> To: aoliva@redhat.com Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org X-SW-Source: 2003-04/txt/msg00824.txt.bz2 Well... You can always compare DECL_USER_ALIGN with TYPE_USER_ALIGN, if you care strongly about that. No, you can't. You can't distinguish between the cases where the alignment is specified for the type and not the object and the case where it is specified for both. But the point that whether the alignment came from a decl-specific attribute or from the type shouldn't make a difference. Why not? They are two *very* different things with different semantics. But why should the common case be more difficult and error-prone? Which is "the common case"? Specifying the alignment of either in C is very rare since it is a GNU extension. Specifying alignment in Ada is much more common and there the most common case is specifying it for types and not for objects. Do you have any situation in mind in which it is actually important to tell whether a decl-specific user-requested alignment came from the variable declaration or from its type? Sure. It's required to properly implement these specifications for Ada, where the semantics of the two cases are completely different.