public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98907] New: Failure to optimize abs pattern
@ 2021-02-01  7:48 gabravier at gmail dot com
  2021-02-02  7:56 ` [Bug tree-optimization/98907] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gabravier at gmail dot com @ 2021-02-01  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98907
           Summary: Failure to optimize abs pattern
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int32_t f(int32_t x)
{
    return ((x >> 31) | 1) * x;
}

This can be optimized into `return __builtin_abs(x);` (where sizeof(int) ==
sizeof(int32_t)). This transformation is done by LLVM, but not GCC.

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

end of thread, other threads:[~2023-09-04  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  7:48 [Bug tree-optimization/98907] New: Failure to optimize abs pattern gabravier at gmail dot com
2021-02-02  7:56 ` [Bug tree-optimization/98907] " rguenth at gcc dot gnu.org
2021-07-25  5:50 ` pinskia at gcc dot gnu.org
2023-09-04  9:10 ` 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).