This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 01/11] Add __builtin_speculation_safe_value
- From: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- To: Ian Lance Taylor <iant at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Richard Biener <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>, Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 1 Aug 2018 09:48:50 +0100
- Subject: Re: [PATCH 01/11] Add __builtin_speculation_safe_value
- References: <1531154299-28349-1-git-send-email-Richard.Earnshaw@arm.com> <1532684275-13041-1-git-send-email-Richard.Earnshaw@arm.com> <1532684275-13041-2-git-send-email-Richard.Earnshaw@arm.com> <alpine.LSU.2.20.1807301516200.16707@zhemvz.fhfr.qr> <CAMe9rOo_ZjepspzTiXDGgT=BRMiu1W=Rhauoi-4Q-=ODy6V=gw@mail.gmail.com> <CAKOQZ8zNS_Tu8GFpqmh=U8Jzeiur+qXC_yBFHefjcZXAz-0hbQ@mail.gmail.com>
On 31/07/18 21:51, Ian Lance Taylor via gcc-patches wrote:
> On Tue, Jul 31, 2018 at 12:25 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Jul 30, 2018 at 6:16 AM, Richard Biener <rguenther@suse.de> wrote:
>>> On Fri, 27 Jul 2018, Richard Earnshaw wrote:
>>>
>>>>
>>>> This patch defines a new intrinsic function
>>>> __builtin_speculation_safe_value. A generic default implementation is
>>>> defined which will attempt to use the backend pattern
>>>> "speculation_safe_barrier". If this pattern is not defined, or if it
>>>> is not available, then the compiler will emit a warning, but
>>>> compilation will continue.
>>>>
>>>> Note that the test spec-barrier-1.c will currently fail on all
>>>> targets. This is deliberate, the failure will go away when
>>>> appropriate action is taken for each target backend.
>>>
>>> OK.
>>>
>>> Thanks,
>>> Richard.
>>>
>>>> gcc:
>>>> * builtin-types.def (BT_FN_PTR_PTR_VAR): New function type.
>>>> (BT_FN_I1_I1_VAR, BT_FN_I2_I2_VAR, BT_FN_I4_I4_VAR): Likewise.
>>>> (BT_FN_I8_I8_VAR, BT_FN_I16_I16_VAR): Likewise.
>>>> * builtin-attrs.def (ATTR_NOVOPS_NOTHROW_LEAF_LIST): New attribute
>>>> list.
>>>> * builtins.def (BUILT_IN_SPECULATION_SAFE_VALUE_N): New builtin.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_PTR): New internal builtin.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_1): Likewise.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_2): Likewise.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_4): Likewise.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_8): Likewise.
>>>> (BUILT_IN_SPECULATION_SAFE_VALUE_16): Likewise.
>>>> * builtins.c (expand_speculation_safe_value): New function.
>>>> (expand_builtin): Call it.
>>>> * doc/cpp.texi: Document predefine __HAVE_SPECULATION_SAFE_VALUE.
>>>> * doc/extend.texi: Document __builtin_speculation_safe_value.
>>>> * doc/md.texi: Document "speculation_barrier" pattern.
>>>> * doc/tm.texi.in: Pull in TARGET_SPECULATION_SAFE_VALUE and
>>>> TARGET_HAVE_SPECULATION_SAFE_VALUE.
>>>> * doc/tm.texi: Regenerated.
>>>> * target.def (have_speculation_safe_value, speculation_safe_value): New
>>>> hooks.
>>>> * targhooks.c (default_have_speculation_safe_value): New function.
>>>> (default_speculation_safe_value): New function.
>>>> * targhooks.h (default_have_speculation_safe_value): Add prototype.
>>>> (default_speculation_safe_value): Add prototype.
>>>>
>>
>> I got
>>
>> ../../src-trunk/gcc/targhooks.c: In function ‘bool
>> default_have_speculation_safe_value(bool)’:
>> ../../src-trunk/gcc/targhooks.c:2319:43: error: unused parameter
>> ‘active’ [-Werror=unused-parameter]
>> default_have_speculation_safe_value (bool active)
>> ~~~~~^~~~~~
>
>
> Me too.
>
> Committed this patch as obvious.
>
Thanks.
Sorry about that, I did run a full bootstrap on x86, but I had the x86
mitigation patch applied, so it didn't trip this.
R.
> Ian
>
>
> 2018-07-31 Ian Lance Taylor <iant@golang.org>
>
> * targhooks.c (default_have_speculation_safe_value): Add
> ATTRIBUTE_UNUSED.
>