From: Segher Boessenkool <segher@kernel.crashing.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
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: Tue, 04 Aug 2015 19:29:00 -0000 [thread overview]
Message-ID: <20150804192913.GO11083@gate.crashing.org> (raw)
In-Reply-To: <CAMe9rOq1axEMb34Zw2uudG6+5vjkiXKg7-i_8FRqMHL8DizqEw@mail.gmail.com>
On Tue, Aug 04, 2015 at 11:50:00AM -0700, H.J. Lu wrote:
> >> The motivation of __builtin_stack_top is that frame_address requires a
> >> frame pointer register, which isn't desirable for x86. __builtin_stack_top
> >> doesn't require a frame pointer register.
> >
> > If the target just returns frame_pointer_rtx from INITIAL_FRAME_ADDRESS_RTX,
> > you don't get crtl->accesses_prior_frames set either, and as far as I can
> > see everything works fine? For __builtin_frame_address(0).
> >
> > 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.
> >
>
> expand_builtin_return_addr sets
>
> crtl->accesses_prior_frames = 1;
>
> for __builtin_frame_address, which requires a frame pointer register.
> __builtin_stack_top doesn't set crtl->accesses_prior_frames and frame
> pointer register isn't required.
Not if you have INITIAL_FRAME_ADDRESS_RTX. I don't see why the generic code
cannot just use frame_pointer_rtx (instead of hard_frame_pointer_rtx) for
a count of 0; but making it target-specific is certainly more conservative.
You say i386 doesn't have that target macro defined currently. Yes I know;
so change that? Or change the generic code, but that is much more testing.
Segher
next prev parent reply other threads:[~2015-08-04 19:29 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 [this message]
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
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=20150804192913.GO11083@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=mikestump@comcast.net \
--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).