Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-18 Thread Richard Biener
On Thu, Jan 18, 2018 at 3:07 PM, Richard Earnshaw (lists) wrote: > On 18/01/18 12:44, Richard Biener wrote: >> On Wed, Jan 17, 2018 at 3:55 PM, Richard Earnshaw >> wrote: >>> >>> This patch adds generic support for the new builtin >>> __builtin_speculation_safe_load. It provides the overloading

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-18 Thread Richard Earnshaw (lists)
On 18/01/18 12:44, Richard Biener wrote: > On Wed, Jan 17, 2018 at 3:55 PM, Richard Earnshaw > wrote: >> >> This patch adds generic support for the new builtin >> __builtin_speculation_safe_load. It provides the overloading of the >> different access sizes and a default fall-back expansion for ta

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-18 Thread Richard Biener
On Thu, Jan 18, 2018 at 1:44 PM, Richard Biener wrote: > On Wed, Jan 17, 2018 at 3:55 PM, Richard Earnshaw > wrote: >> >> This patch adds generic support for the new builtin >> __builtin_speculation_safe_load. It provides the overloading of the >> different access sizes and a default fall-back e

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-18 Thread Richard Biener
On Wed, Jan 17, 2018 at 3:55 PM, Richard Earnshaw wrote: > > This patch adds generic support for the new builtin > __builtin_speculation_safe_load. It provides the overloading of the > different access sizes and a default fall-back expansion for targets > that do not support a mechanism for inhib

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-17 Thread Bernd Edlinger
Hi, + return targetm.speculation_safe_load (mode, target, mem, lower, upper, + cmpptr, true); So portable programming will use this builtin when available, but for the majority of the targets the default will be wrong, For instance why should a PDP port be t

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-17 Thread Jakub Jelinek
On Wed, Jan 17, 2018 at 05:17:29PM +, Joseph Myers wrote: > On Wed, 17 Jan 2018, Richard Earnshaw wrote: > > > + if (TREE_CODE (type) == ARRAY_TYPE) > > +{ > > + /* Force array-to-pointer decay for c++. */ > > + gcc_assert (c_dialect_cxx ()); > > What's the basis for the asser

Re: [PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-17 Thread Joseph Myers
On Wed, 17 Jan 2018, Richard Earnshaw wrote: > + if (TREE_CODE (type) == ARRAY_TYPE) > +{ > + /* Force array-to-pointer decay for c++. */ > + gcc_assert (c_dialect_cxx ()); What's the basis for the assertion? Why can't you have a pointer-to-array passed in C? -- Joseph S. Myer

[PATCH 1/3] [builtins] Generic support for __builtin_speculation_safe_load()

2018-01-17 Thread Richard Earnshaw
This patch adds generic support for the new builtin __builtin_speculation_safe_load. It provides the overloading of the different access sizes and a default fall-back expansion for targets that do not support a mechanism for inhibiting speculation. * builtin-types.def (BT_FN_I1_CONST_VPT