public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Mike Stump <mikestump@comcast.net>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
		Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] Add __builtin_stack_top
Date: Wed, 19 Aug 2015 13:03:00 -0000	[thread overview]
Message-ID: <CAMe9rOrymZ3N_2HTd87C-LfoHYeZ_P7myMCL9ZvikE+uU19eRg@mail.gmail.com> (raw)
In-Reply-To: <20150819125145.GC8652@gate.crashing.org>

On Wed, Aug 19, 2015 at 5:51 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On Wed, Aug 19, 2015 at 05:23:41AM -0700, H.J. Lu wrote:
>> >>> >> > 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?
>> >
>> > Yes, we want to use the argument pointer as shown in testcases
>> > included in my patch.
>>
>> Where do we stand on this?  We need the hard stack address at
>> function entry for x86 without using frame pointer.   I added
>> __builtin_stack_top since __builtin_frame_address can't give
>> us what we want.  Should __builtin_stack_top be added to
>> middle-end or x86 backend?
>
> Sorry for not following up; I thought my suggestion was obvious.
>
> Can you do a __builtin_argument_pointer instead?  That should work
> for all targets, afaics?

To me, stack top is easier to understand and argument pointer isn't
very clear.  Does argument pointer exist when there is no argument?

But I can live with it.  I will update my patch.

Thanks.

-- 
H.J.

  reply	other threads:[~2015-08-19 13:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 12:31 H.J. Lu
2015-08-04 15:42 ` Mike Stump
2015-08-04 15:44   ` H.J. Lu
2015-08-04 17:18     ` Mike Stump
2015-08-04 17:28       ` H.J. Lu
2015-08-04 17:43         ` Segher Boessenkool
2015-08-04 18:50           ` H.J. Lu
2015-08-04 18:51             ` H.J. Lu
2015-08-04 19:29             ` Segher Boessenkool
2015-08-04 20:00               ` H.J. Lu
2015-08-04 20:45                 ` Segher Boessenkool
2015-08-04 20:50                   ` H.J. Lu
2015-08-19 12:29                     ` H.J. Lu
2015-08-19 12:57                       ` Segher Boessenkool
2015-08-19 13:03                         ` H.J. Lu [this message]
2015-08-19 15:31                           ` H.J. Lu
2015-08-19 17:08                             ` Segher Boessenkool
2015-08-19 17:11                               ` H.J. Lu
2015-08-19 17:53                                 ` Segher Boessenkool
2015-08-19 19:13                                   ` H.J. Lu
2015-08-19 22:06                                     ` H.J. Lu
2015-08-19 22:18                                       ` Segher Boessenkool
2015-08-19 22:35                                         ` H.J. Lu
2015-08-19 22:55                                           ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOrymZ3N_2HTd87C-LfoHYeZ_P7myMCL9ZvikE+uU19eRg@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=segher@kernel.crashing.org \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).