From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1182 invoked by alias); 15 Oct 2009 19:43:42 -0000 Received: (qmail 1173 invoked by uid 22791); 15 Oct 2009 19:43:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Oct 2009 19:43:37 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9FJhZAj021018; Thu, 15 Oct 2009 15:43:35 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9FJhYc6026638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Oct 2009 15:43:35 -0400 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.2/8.14.2/Submit) id n9FJhY1K028398; Thu, 15 Oct 2009 21:43:34 +0200 Date: Thu, 15 Oct 2009 19:48:00 -0000 From: Jakub Jelinek To: "H.J. Lu" Cc: Uros Bizjak , gcc-patches@gcc.gnu.org Subject: Re: PATCH: PR target/40838: gcc shouldn't assume that the stack is aligned Message-ID: <20091015194334.GM14664@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <20090806214216.GA14439@lucon.org> <20091015154823.GA15787@lucon.org> <4AD76CBA.7030204@gmail.com> <6dc9ffc80910151211u470c386eg30f74f6dd6f728bc@mail.gmail.com> <4AD777A0.7050300@gmail.com> <6dc9ffc80910151232t20f3fbbfw97b063a0ab33c5ce@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6dc9ffc80910151232t20f3fbbfw97b063a0ab33c5ce@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes 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: 2009-10/txt/msg01010.txt.bz2 On Thu, Oct 15, 2009 at 12:32:12PM -0700, H.J. Lu wrote: > > Then we should do realignment the other way around: instead of using > > -mstackrealing for all the code (including where it has no effect), let's > > use -mstackrealign to activate realignment functionality that is introduced > > by your patch. > > That defeats the whole purpose of my patch, which automatically > realigns the stack when there is a hard alignment requirement. If it > isn't turned on by default, it is not very useful. > > > IOW, lightweight -mstackrealign, firing up only when there is the > > possibility of unaligned access in the code it precedes. > > > > That is what my patch does, but turned it on by default. I agree with Uros, I have nothing against a lightweight -mstackrealign, but forcing this upon everybody just because a few people insist on compiling code with -mpreferred-stack-boundary=2 is IMHO a very bad idea and I object against it. -mpreferred-stack-boundary=2 is fine for the kernel where you basically define your own ABI, like many other ABI changing options, and for people who know what they are doing and bear the consequences (e.g. that they need to -mstackrealign when calling outside code), but we shouldn't penalize because of that rare option all the code by default. At least not on Linux. Jakub