From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18568 invoked by alias); 8 Apr 2003 15:50:34 -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 18542 invoked from network); 8 Apr 2003 15:50:32 -0000 Received: from unknown (HELO d12lmsgate-4.de.ibm.com) (194.196.100.237) by sources.redhat.com with SMTP; 8 Apr 2003 15:50:32 -0000 Received: from d12relay02.de.ibm.com (d12relay02.de.ibm.com [9.165.215.23]) by d12lmsgate-4.de.ibm.com (8.12.9/8.12.8) with ESMTP id h38FoSDI014418 for ; Tue, 8 Apr 2003 17:50:28 +0200 Received: from d12ml028.de.ibm.com (d12ml028_cs0 [9.165.223.24]) by d12relay02.de.ibm.com (8.12.8/NCO/VER6.5) with ESMTP id h38FoTD4130328 for ; Tue, 8 Apr 2003 17:50:29 +0200 Importance: Normal Sensitivity: Subject: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT To: gcc@gcc.gnu.org Message-ID: From: "Ulrich Weigand" Date: Tue, 08 Apr 2003 17:47:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00320.txt.bz2 Hello, the target macro DATA_ALIGNMENT is supposed to be able to override the alignment used for global data variables. We are using this on s390x to make sure all data objects are at least 2-byte aligned. This is not an optimization, but essential for correctness, as we cannot load the address of a label that is not 2-byte aligned. Unfortunately, DATA_ALIGNMENT is simply ignored when outputting a variable that has the DECL_USER_ALIGNMENT flag set. While this does not usually occur with C code unless using source code like char x __attribute__ ((__aligned__(1))); this flag is apparently much more frequently set by the Ada frontend. In fact, this is currently causing bootstrap errors for Ada on s390x because an elaboration check flag variable is not correctly aligned. My question is now, why is DATA_ALIGNMENT ignored in such cases? Is this a bug or a feature? If the latter, what other options does a backend have to absolutely enforce a minimum alignment for global variables? Mit freundlichen Gruessen / Best Regards Ulrich Weigand -- Dr. Ulrich Weigand Linux for S/390 Design & Development IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com