public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107053] New: ones bits is not tracked and popcount is not tracked
@ 2022-09-27 15:24 pinskia at gcc dot gnu.org
  2022-09-27 15:24 ` [Bug tree-optimization/107053] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-27 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107053
           Summary: ones bits is not tracked and popcount is not tracked
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
void link_failure();
void f(int a)
{
    a |= 0x300;
    int b =  __builtin_popcount(a);
    if (b < 3)
        link_failure();
}
```
The if statement should be optimized away.
The reason is after the |, at least 3 bits are set in a.

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

end of thread, other threads:[~2023-07-12 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 15:24 [Bug tree-optimization/107053] New: ones bits is not tracked and popcount is not tracked pinskia at gcc dot gnu.org
2022-09-27 15:24 ` [Bug tree-optimization/107053] " pinskia at gcc dot gnu.org
2022-09-27 15:33 ` aldyh at gcc dot gnu.org
2022-09-27 15:40 ` pinskia at gcc dot gnu.org
2022-09-28  6:28 ` aldyh at gcc dot gnu.org
2023-07-12 21:16 ` cvs-commit at gcc dot gnu.org
2023-07-12 21:18 ` aldyh at gcc dot gnu.org
2023-07-12 21:56 ` 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).