From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 14 13:01:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A85106566B for ; Fri, 14 Jan 2011 13:01:44 +0000 (UTC) (envelope-from peter.blok@bsd4all.org) Received: from relay20.prolocation.net (relay20.prolocation.net [IPv6:2a00:d00:ff:133:94:228:133:110]) by mx1.freebsd.org (Postfix) with ESMTP id 8EA908FC1B for ; Fri, 14 Jan 2011 13:01:43 +0000 (UTC) Received: from cust-95-128-94-66.breedbanddelft.nl ([95.128.94.66] helo=mail.bsd4all.org) by relay20.prolocation.net with esmtp (Exim 4.69) (envelope-from ) id 1PdjHi-0001ox-4F; Fri, 14 Jan 2011 14:01:42 +0100 Received: from mailgw (mailgw [192.168.10.12]) by mail.bsd4all.org (Postfix) with ESMTP id 807AA11571; Fri, 14 Jan 2011 14:01:39 +0100 (CET) X-Virus-Scanned: amavisd-new at bsd4all.org Received: from mail.bsd4all.org ([192.168.10.1]) by mailgw (fwgw.homebrew.bsd4all.org [192.168.10.12]) (amavisd-new, port 10024) with ESMTP id 8siTp1iE2hu6; Fri, 14 Jan 2011 14:01:27 +0100 (CET) Received: from bsd4all.org (adexlinge10 [192.168.10.16]) by mail.bsd4all.org (Postfix) with ESMTP id CDB3E114EB; Fri, 14 Jan 2011 14:01:27 +0100 (CET) Received: from 128.222.37.58 ([128.222.37.58]) by adexlinge10.LINGE10.local ([192.168.10.16]) with Microsoft Exchange Server HTTP-DAV ; Fri, 14 Jan 2011 12:58:32 +0000 User-Agent: Microsoft-Entourage/12.26.0.100708 Date: Fri, 14 Jan 2011 13:52:29 +0100 From: Peter Blok To: Ryan Stone Message-ID: Thread-Topic: What does the FreeBSD/i386 ABI say about stack alignment? Thread-Index: Acuz5EMUecEd65HQTvKkId6y6WxJegABaOnM In-Reply-To: Mime-version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: What does the FreeBSD/i386 ABI say about stack alignment? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 13:01:44 -0000 Hi Ryan, Well I think gcc should not generate movdqa if it cannot guarantee the area it is working on is aligned. If the stack is not aligned, it should generat= e =AD probably less efficient =AD code that works. What is this area, if it is not a local variable allocated somewhere? Is it some sort of stack probing? Is alloca used? Are variable length arrays used= ? Peter On 1/14/11 13:11 PM, "Ryan Stone" wrote: > On Fri, Jan 14, 2011 at 3:52 AM, Peter Blok wrot= e: >> > Hi, >> > >> > I=B9m probably missing something but if you require a stack variable to = be >> > aligned why not use a type attribute like __attribute__ ((aligned (8))= ) >> > >> > Peter >=20 > In my case I had no stack variable that required alignment. gcc > issued some movdqa instructions in order to initialize a memory region > on the stack to all-zeros. >=20