On Mon, Jun 20, 2022 at 2:39 AM Richard Biener <richard.guent...@gmail.com> wrote: > > On Thu, Jun 16, 2022 at 1:38 AM Fangrui Song <mask...@google.com> wrote: > > > > On Wed, Jun 15, 2022 at 2:44 PM H.J. Lu via Gcc-patches > > <gcc-patches@gcc.gnu.org> wrote: > > > > > > On Mon, Jun 13, 2022 at 9:01 AM Richard Biener > > > <richard.guent...@gmail.com> wrote: > > > > > > > > > > > > > > > > > Am 13.06.2022 um 16:36 schrieb H.J. Lu <hjl.to...@gmail.com>: > > > > > > > > > > On Mon, Jun 13, 2022 at 3:11 AM Richard Biener > > > > > <richard.guent...@gmail.com> wrote: > > > > >> > > > > >>> On Tue, Jun 7, 2022 at 9:02 PM H.J. Lu via Gcc-patches > > > > >>> <gcc-patches@gcc.gnu.org> wrote: > > > > >>> > > > > >>> Add -fextra-libc-function=memcmpeq to map > > > > >>> > > > > >>> extern int __memcmpeq (const void *, const void *, size_t); > > > > >>> > > > > >>> which was added to GLIBC 2.35, to __builtin_memcmp_eq. > > > > >> > > > > >> Humm. Can't we instead use the presence of a declaration > > > > >> of __memcmpeq with a GNU standard dialect as this instead of > > > > >> adding a weird -fextra-libc-function= option? Maybe that's even > > > > >> reasonable with a non-GNU dialect standard in effect since > > > > >> __ prefixed names are in the implementation namespace? > > > > > > > > > > But not all source codes include <string.h> and GCC may generate > > > > > memcmp directly. How should we handle these cases? > > > > > > > > Not. Similar as to vectorized math functions. > > > > I think it’s not worth optimizing for this case. > > > > > > Another question. Should we consider any __memcmpeq prototype > > > or just the one in the system header file? > > Any.
Here is the v2 patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596881.html > > An idea from https://reviews.llvm.org/D56593#3586673: -fbuiltin-__memcmpeq > > > > This requires making -fbuiltin-function available, see > > https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html > > ("There is no corresponding -fbuiltin-function option") > > > > I prefer an option over a magic behavior about whether a declaration exists. > > But we already have this behavior for multiple cases. It's also the only > way that in practice __memcmpeq will be used - _nobody_ (but maybe > special crafted SPEC peak runs) will add explicit -fbuiltin-__memcmpeq. > > Richard. Thanks. -- H.J.