From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58388 invoked by alias); 4 Aug 2015 20:45:17 -0000 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 Received: (qmail 58379 invoked by uid 89); 4 Aug 2015 20:45:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 04 Aug 2015 20:45:14 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t74Kj7pi012887; Tue, 4 Aug 2015 15:45:07 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t74Kj6eQ012886; Tue, 4 Aug 2015 15:45:06 -0500 Date: Tue, 04 Aug 2015 20:45:00 -0000 From: Segher Boessenkool To: "H.J. Lu" Cc: Mike Stump , GCC Patches , Uros Bizjak Subject: Re: [PATCH] Add __builtin_stack_top Message-ID: <20150804204506.GP11083@gate.crashing.org> References: <9652D8E5-C3B2-4C88-BC34-4591962D42D1@comcast.net> <20150804174332.GN11083@gate.crashing.org> <20150804192913.GO11083@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00220.txt.bz2 On Tue, Aug 04, 2015 at 01:00:32PM -0700, H.J. Lu wrote: > There is another issue with x86, maybe other targets. You > can't get the real stack top when stack is realigned and > -maccumulate-outgoing-args isn't used since ix86_expand_prologue > will create and return another stack frame for > __builtin_frame_address and __builtin_return_address. > It will be wrong for __builtin_stack_top, which should > return the real stack address. That's why I asked: > >> > You might have a reason why you want the entry stack address instead of the > >> > frame address, but you didn't really explain I think? Or I missed it. What would a C program do with this, that it cannot do with the frame address, that would be useful and cannot be much better done in straight assembler? Do you actually want to expose the argument pointer, maybe? Segher