public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96930] New: Failure to optimize out 64-bit arithmetic when it can't happen with division transformed into right shift
@ 2020-09-03 20:47 gabravier at gmail dot com
  2020-09-04  6:41 ` [Bug tree-optimization/96930] Failure to optimize out arithmetic with bigger size when it can't matter " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gabravier at gmail dot com @ 2020-09-03 20:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96930
           Summary: Failure to optimize out 64-bit arithmetic when it
                    can't happen with division transformed into right
                    shift
           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: ---

unsigned f(unsigned a, unsigned b)
{
    return a / (unsigned long long)(1U << b);
}

This can be optimized to `return a >> b;`. This transformation is done by LLVM,
but not by GCC.

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

end of thread, other threads:[~2023-02-18  2:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 20:47 [Bug tree-optimization/96930] New: Failure to optimize out 64-bit arithmetic when it can't happen with division transformed into right shift gabravier at gmail dot com
2020-09-04  6:41 ` [Bug tree-optimization/96930] Failure to optimize out arithmetic with bigger size when it can't matter " rguenth at gcc dot gnu.org
2021-01-02 10:04 ` jakub at gcc dot gnu.org
2021-01-02 10:53 ` jakub at gcc dot gnu.org
2021-01-03 10:24 ` gabravier at gmail dot com
2021-01-03 10:52 ` jakub at gcc dot gnu.org
2021-01-03 12:06 ` gabravier at gmail dot com
2021-01-03 14:17 ` jakub at gcc dot gnu.org
2021-01-03 22:51 ` jakub at gcc dot gnu.org
2021-01-04 13:31 ` jakub at gcc dot gnu.org
2021-01-05 15:34 ` cvs-commit at gcc dot gnu.org
2023-02-18  2:09 ` gabravier at gmail dot com

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