From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30071 invoked by alias); 16 Jun 2010 06:56:22 -0000 Received: (qmail 29958 invoked by uid 48); 16 Jun 2010 06:55:59 -0000 Date: Wed, 16 Jun 2010 06:56:00 -0000 Message-ID: <20100616065559.29957.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: "jakub at gcc dot gnu dot org" 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/msg01670.txt.bz2 ------- Comment #13 from jakub at gcc dot gnu dot org 2010-06-16 06:55 ------- This looks wrong. The code in expand_one_stack_var_at (before dynamic stack realignment) made perfect sense, if we gave a bigger alignment to some variable (e.g. automatic array), it is useful to tell the expanders that we did. And if it got a smaller than requested alignment, similarly it is better to tell that to the expanders (the latter happens when the requested alignment is larger than what can be supported for automatic vars). >>From the offset we don't know absolute alignment, unless we know how aligned is virtual_stack_vars_rtx. We should know that without dynamic stack realignment, for dynamic stack realignment all we need to ensure is that the computed alignment isn't larger than the one we are going to use. E.g. replacing MAX_SUPPORTED_STACK_ALIGNMENT with crtl->max_used_stack_slot_alignment (or crtl->stack_alignment_needed). Or say MAX (crtl->max_used_stack_slot_alignment, PREFERRED_STACK_BOUNDARY) or MAX (crtl->stack_alignment_needed, PREFERRED_STACK_BOUNDARY)? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44542