public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110405] New: missing nonzerobits on branch
@ 2023-06-25 18:53 pinskia at gcc dot gnu.org
2023-06-25 18:53 ` [Bug tree-optimization/110405] " pinskia at gcc dot gnu.org
2023-11-12 21:55 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-25 18:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110405
Bug ID: 110405
Summary: missing nonzerobits on branch
Product: gcc
Version: 14.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 h(unsigned long);
void
f (unsigned long i)
{
if ((i & 7) == 6)
if(i & 1)
h(0);
}
```
The call to h should be optimized away as we know on the branch (a&1) == 0 as
we know the nonzerobits of i is ~1 .
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/110405] missing nonzerobits on branch
2023-06-25 18:53 [Bug tree-optimization/110405] New: missing nonzerobits on branch pinskia at gcc dot gnu.org
@ 2023-06-25 18:53 ` pinskia at gcc dot gnu.org
2023-11-12 21:55 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-25 18:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110405
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=87104
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I forgot to mention I found this while looking into PR 87104 ...
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/110405] missing nonzerobits on branch
2023-06-25 18:53 [Bug tree-optimization/110405] New: missing nonzerobits on branch pinskia at gcc dot gnu.org
2023-06-25 18:53 ` [Bug tree-optimization/110405] " pinskia at gcc dot gnu.org
@ 2023-11-12 21:55 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-12 21:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110405
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-11-12
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Another testcase:
```
void h(unsigned long);
void
f (unsigned long i)
{
if ((i & 7) != 6) __builtin_unreachable();
if(i & 1)
h(0);
}
```
Note LLVM is able to optimize both cases.
Note for the above testcase we get for the range:
# RANGE [irange] long unsigned int [6, 18446744073709551614]
Notice how the value/mask is not there even though we should be able to get it
from the IR.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-12 21:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-25 18:53 [Bug tree-optimization/110405] New: missing nonzerobits on branch pinskia at gcc dot gnu.org
2023-06-25 18:53 ` [Bug tree-optimization/110405] " pinskia at gcc dot gnu.org
2023-11-12 21:55 ` 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).