public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114853] New: Inefficient code with a bunch of bitwise checks
@ 2024-04-25 13:05 gh228df at gmail dot com
  2024-04-25 13:40 ` [Bug tree-optimization/114853] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gh228df at gmail dot com @ 2024-04-25 13:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114853
           Summary: Inefficient code with a bunch of bitwise checks
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gh228df at gmail dot com
  Target Milestone: ---

Here is a compiler explorer link https://godbolt.org/z/WccxhnTfK, the first
function is 'inefficient' while the second function does the same while having
1/2 assembly lines of the first function and will probably run faster in some
cases. The problem is that the compiler doesnt generate negated constant once
in the start but rather keeps generating it over and over again before every
check which is very inefficient

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-25 17:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 13:05 [Bug c++/114853] New: Inefficient code with a bunch of bitwise checks gh228df at gmail dot com
2024-04-25 13:40 ` [Bug tree-optimization/114853] " rguenth at gcc dot gnu.org
2024-04-25 15:42 ` pinskia at gcc dot gnu.org
2024-04-25 15:48 ` pinskia at gcc dot gnu.org
2024-04-25 17:47 ` [Bug middle-end/114853] " pinskia at gcc dot gnu.org

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).