From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32511 invoked by alias); 31 Jul 2008 01:05:51 -0000 Received: (qmail 31171 invoked by uid 48); 31 Jul 2008 01:04:31 -0000 Date: Thu, 31 Jul 2008 01:05:00 -0000 Message-ID: <20080731010431.31170.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/16660] attribute((aligned)) doesn't work for variables on the stack for greater than required alignement In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hjl dot tools at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg02266.txt.bz2 ------- Comment #14 from hjl dot tools at gmail dot com 2008-07-31 01:04 ------- (In reply to comment #0) > Running the program below compiled with "-mpreferred-stack-boundary=2" > gets a "segmentation fault" because the variable "tmp" > is not properly aligned on a 16-byte boundary (required for > movaps), violating the aligned(16) request in the attribute. > > void f() > { > unsigned long tmp[4] __attribute__((aligned(16))); > asm("movaps %%xmm0, (%0)" : : "r" (tmp) : "memory"); > } > > int main() > { > f(); > } This should work with gcc 4.4 revision 138335. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16660