This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] i386: Define __HAVE_INDIRECT_RETURN_ATTRIBUTE__
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Florian Weimer <fweimer at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Thu, 19 Jul 2018 13:33:22 +0200
- Subject: Re: [PATCH] i386: Define __HAVE_INDIRECT_RETURN_ATTRIBUTE__
- References: <20180718153329.GA13951@intel.com> <CAFiYyc2pP-xWxLaPxF-c_RXViUehoKqWdbj8ObxgBHoJaND_Xw@mail.gmail.com> <20180719112126.GA5520@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jul 19, 2018 at 04:21:26AM -0700, H.J. Lu wrote:
> The new indirect_return attribute is intended to mark swapcontext in
> <ucontext.h>. This patch defines __HAVE_INDIRECT_RETURN_ATTRIBUTE__
> so that it can be used checked before using indirect_return attribute
> in <ucontext.h>. It works when the indirect_return attribute is
> backported to GCC 8.
>
> OK for trunk?
No. Use
#ifdef __has_attribute
#if __has_attribute (indirect_return)
...
#endif
#endif
instead, like for any other attribute. Predefined macros aren't zero cost.
Jakub