From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2893 invoked by alias); 31 Jul 2007 03:46:28 -0000 Received: (qmail 2885 invoked by uid 22791); 31 Jul 2007 03:46:28 -0000 X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Jul 2007 03:46:25 +0000 Received: from localhost (kampanus.ms.mff.cuni.cz [195.113.18.107]) by nikam.ms.mff.cuni.cz (Postfix) with ESMTP id A4B105B8BA; Tue, 31 Jul 2007 05:46:22 +0200 (CEST) Received: by localhost (Postfix, from userid 16202) id 9B944AF57F; Tue, 31 Jul 2007 05:46:22 +0200 (CEST) Date: Tue, 31 Jul 2007 05:03:00 -0000 From: Jan Hubicka To: Andi Kleen Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: Allow preferred-stack-boundary of 3 for x86-64 Message-ID: <20070731034622.GB20007@kam.mff.cuni.cz> References: <20070723230503.GA10270@kam.mff.cuni.cz> <200707280007.54813.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200707280007.54813.ak@suse.de> User-Agent: Mutt/1.5.9i Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02157.txt.bz2 > > I tested the patch now and I get a ICE while compiling the x86_64 linux kernel > with -mpreferred-stack-boundary=3 and 070727 SVN checkout + patch > > /home/lsrc/quilt/linux/init/do_mounts.c: In function 'change_floppy': > /home/lsrc/quilt/linux/init/do_mounts.c:390: internal compiler error: in ix86_compute_frame_layout, at config/i386/i386.c:5745 Hi, this patch should fix it, I will commit it after testing on x86_64-linux. Honza * i386.c (setup_incoming_varargs_64): Tolerate 64bit preferred stack boundary. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 127065) +++ config/i386/i386.c (working copy) @@ -4656,7 +4656,14 @@ setup_incoming_varargs_64 (CUMULATIVE_AR /* Indicate to allocate space on the stack for varargs save area. */ ix86_save_varrargs_registers = 1; - cfun->stack_alignment_needed = 128; + /* We need 16-byte stack alignment to save SSE registers. If user + asked for lower preferred_stack_boundary, lets just hope that he knows + what he is doing and won't varargs SSE values. + + We also may end up assuming that only 64bit values are stored in SSE + register let some floating point program work. */ + if (ix86_preferred_stack_boundary >= 128) + cfun->stack_alignment_needed = 128; save_area = frame_pointer_rtx; set = get_varargs_alias_set ();