From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19469 invoked by alias); 16 Jun 2010 14:36:47 -0000 Received: (qmail 19399 invoked by uid 48); 16 Jun 2010 14:36:30 -0000 Date: Wed, 16 Jun 2010 14:36:00 -0000 Message-ID: <20100616143630.19398.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/44542] expand_one_stack_var_at may set DECL_ALIGN to a too high value 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: 2010-06/txt/msg01714.txt.bz2 ------- Comment #14 from hjl dot tools at gmail dot com 2010-06-16 14:36 ------- The code in question is offset -= frame_phase; align = offset & -offset; align *= BITS_PER_UNIT; if (align == 0) align = STACK_BOUNDARY; else if (align > MAX_SUPPORTED_STACK_ALIGNMENT) align = MAX_SUPPORTED_STACK_ALIGNMENT; offset is computed from align = get_decl_align_unit (SSAVAR (var)); offset = alloc_stack_frame_space (size, align); If you compute alignment from offset again, you will get a number >= requested alignment. That is when we allocate 8byte aligned at 8byte from stack, we may get offset 8, 16, 24, 32, 40, 48, 56, 64, ... depending on how much we have allocated on stack. As for MAX_SUPPORTED_STACK_ALIGNMENT, I doubt we will hit it since it is a huge number. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44542