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 12:29:00 -0000	[thread overview]
Message-ID: <CAMe9rOrHUnJJx68qKUe0gsVVwYXNALmCR6-4UVV_V3df4KO3_A@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOoMzgkguZ+zY24Jytpr9HnoXvu5BUP3c7K-34Gmm2SDLg@mail.gmail.com>

On Tue, Aug 4, 2015 at 1:50 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Aug 4, 2015 at 1:45 PM, Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
>> 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?
>>
>
> 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?

Thanks.

-- 
H.J.

  reply	other threads:[~2015-08-19 12:23 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 [this message]
2015-08-19 12:57                       ` Segher Boessenkool
2015-08-19 13:03                         ` H.J. Lu
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=CAMe9rOrHUnJJx68qKUe0gsVVwYXNALmCR6-4UVV_V3df4KO3_A@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).