This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add __builtin_stack_top to x86 backend
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Mon, 3 Aug 2015 10:31:17 +0200
- Subject: Re: [PATCH] Add __builtin_stack_top to x86 backend
- Authentication-results: sourceware.org; auth=none
- References: <20150721214539 dot GA19891 at intel dot com> <20150730184107 dot GA4325 at intel dot com>
On Thu, Jul 30, 2015 at 8:41 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> On Tue, Jul 21, 2015 at 02:45:39PM -0700, H.J. Lu wrote:
>> When __builtin_frame_address is used to retrieve the address of the
>> function stack frame, the frame pointer is always kept, which wastes one
>> register and 2 instructions. For x86-32, one less register means
>> significant negative impact on performance. This patch adds a new
>> builtin function, __builtin_ia32_stack_top, to x86 backend. It
>> returns the stack address when the function is called.
>>
>> Any comments, feedbacks?
>>
>
> Although this function is generic, but implementation is target
> specific. I submitted a generic patch:
>
> https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01859.html
>
> So far there are no interests from other backends. Here is a patch
> to implement __builtin_stack_top in x86 backend. We can update x86
> backedn after it is added to middle-end. OK for trunk?
I think that the discussion about generic implementation should come
to some conclusion first. From the discussion, here was no resolution
on which way to go.
Uros.