From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12438 invoked by alias); 6 Oct 2003 23:27:11 -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 12431 invoked from network); 6 Oct 2003 23:27:10 -0000 Received: from unknown (HELO localhost.localdomain) (67.161.44.241) by sources.redhat.com with SMTP; 6 Oct 2003 23:27:10 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h96NR1MI001978; Mon, 6 Oct 2003 16:27:08 -0700 Subject: Re: RTL From: Jim Wilson To: "Sruthy C.N" Cc: gcc@gcc.gnu.org In-Reply-To: <1035.210.212.228.78.1064923803.webmail@ebox.nitc.ac.in> References: <2734.210.212.228.78.1064463025.webmail@ebox.nitc.ac.in> <3F727452.5090402@specifixinc.com> <1035.210.212.228.78.1064923803.webmail@ebox.nitc.ac.in> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 06 Oct 2003 23:27:00 -0000 Message-Id: <1065482828.1009.94.camel@leaf.tuliptree.org> Mime-Version: 1.0 X-SW-Source: 2003-10/txt/msg00187.txt.bz2 On Tue, 2003-09-30 at 05:10, Sruthy C.N wrote: > you told that stack is 16 byte aligned for the MMX/SSE/SSE2 > instructions..I can see that the structure and array declarations are > also 16 byte aligned..is this also for the same purpose?.. This isn't specific enough. Are you looking at compiler output or compiler source code? If you are looking at compiler output, then you might be seeing various effects that may or may not be guaranteed. You might be getting 16-byte alignment by accident. Using something like __alignof() will give much more accurate answers than looking at assembly code. Also, alignment depends on the structure/array type declarations, but since you haven't given me an example, I can't be sure what you are seeing. Providing a testcase is often the best way to ask a question. I can't emphasize that enough. The following testcase for instance clearly shows that a structure with one char has only 1 byte alignment. struct foo { char c; }; int main (void) { struct foo bar; struct foo baz; printf ("%d\n", __alignof (bar)); printf ("%p\n", &bar); printf ("%d\n", __alignof (baz)); printf ("%p\n", &baz); return 0; } > In the RTl file all the strings will be replaced by some *.LC0 *.LC1 > etc..where exactly is this strings stored? how you are accessing it? These are constant pool references. Accesses to the constant pool are target dependent. The compiler collects string constants and other constant data items that are too large to be instruction immediates, eliminates duplicates, and then emits them into a read only data section. Many parts of this are target dependent. Constant pool entries are preceded by a label which is used for loading the constant into registers, or copying it to some other part of memory. If you look at the assembly output instead of the RTL, you can see the constant pool items. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com