From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28713 invoked by alias); 19 Aug 2015 22:11:16 -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 28703 invoked by uid 89); 19 Aug 2015 22:11:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 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; Wed, 19 Aug 2015 22:11:15 +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 t7JMAUow027481; Wed, 19 Aug 2015 17:10:30 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t7JMATYI027476; Wed, 19 Aug 2015 17:10:29 -0500 Date: Wed, 19 Aug 2015 22:18: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: <20150819221029.GB26407@gate.crashing.org> References: <20150819125145.GC8652@gate.crashing.org> <20150819165854.GB32473@gate.crashing.org> <20150819174805.GC32473@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/msg01145.txt.bz2 On Wed, Aug 19, 2015 at 02:53:47PM -0700, H.J. Lu wrote: > How about this > > @deftypefn {Built-in Function} {void *} __builtin_argument_pointer (void) > This function is similar to @code{__builtin_frame_address} with an > argument of 0, but it returns the address of the incoming arguments to > the current function rather than the address of its frame. Unlike > @code{__builtin_frame_address}, the frame pointer register isn't > required. That last line isn't true, if your port uses INITIAL_FRAME_POINTER_RTX. Maybe it shouldn't be true otherwise either (but currently a hard frame pointer is forced, indeed). Have we gone full circle now? ;-) > The exact definition of this address depends upon the processor and the > calling convention. Usually some arguments are passed in registers and > the rest on the stack, and this builtin returns the address of the > first argument which would be passed on the stack. > @end deftypefn Segher