public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/115693] 8 std::byte std::array comparison potential missed optimization
Date: Fri, 28 Jun 2024 09:54:12 +0000	[thread overview]
Message-ID: <bug-115693-4-CYZJNGkIL2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115693-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115693

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #1)
> So it makes more sense to fix this in the optimization passes, instead of
> ad-hoc hack in libstdc++.

Yes, I agree, although we already have the hack in libstdc++ it just doesn't
work for std::byte:


--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -1232,6 +1232,9 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
       const bool __simple = ((__is_integer<_ValueType1>::__value
 #if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
                              || __is_pointer(_ValueType1)
+#endif
+#if __glibcxx_byte
+                             || __is_same(byte, _ValueType1)
 #endif
                             ) && __memcmpable<_II1, _II2>::__value);
       return std::__equal<__simple>::equal(__first1, __last1, __first2);



> But I'm not sure if there already exists a dup.

The bug reported here is an exact dup of Bug 101485

  parent reply	other threads:[~2024-06-28  9:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28  1:30 [Bug libstdc++/115693] New: " paulhaile3 at gmail dot com
2024-06-28  2:17 ` [Bug tree-optimization/115693] " xry111 at gcc dot gnu.org
2024-06-28  9:54 ` redi at gcc dot gnu.org [this message]
2024-06-28 11:03 ` rguenth at gcc dot gnu.org
2024-06-30 16:24 ` paulhaile3 at gmail dot com
2024-06-30 16:44 ` pinskia at gcc dot gnu.org
2024-07-01  1:14 ` liuhongt at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115693-4-CYZJNGkIL2@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).