[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |14.0
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 Aldy Hernandez changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Aldy Hernandez --- fixed in trunk
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 --- Comment #4 from CVS Commits --- The master branch has been updated by Aldy Hernandez : https://gcc.gnu.org/g:137fb7077f7711e2e09ee8f82650fe7d93de6a4d commit r14-2479-g137fb7077f7711e2e09ee8f82650fe7d93de6a4d Author: Aldy Hernandez Date: Fri Jun 30 20:40:02 2023 +0200 [range-op] Take known set bits into account in popcount [PR107053] This patch teaches popcount about known set bits which are now available in the irange. PR tree-optimization/107053 gcc/ChangeLog: * gimple-range-op.cc (cfn_popcount): Use known set bits. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr107053.c: New test.
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 Aldy Hernandez changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=107043 CC||amacleod at redhat dot com --- Comment #3 from Aldy Hernandez --- This is a variant of PR107043 which I discuss in comment #3. We can't get this because we don't track the or-mask, the known 1-bits.
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 --- Comment #2 from Andrew Pinski --- Note the correct testcase is: void link_failure(); void f(int a) { a |= 0x300; int b = __builtin_popcount(a); if (b < 2) link_failure(); } --- CUT --- the range of b should be 2..31 (assuming int is 32bits). With this change clang is able to optimize it. For the original testcase I think it can be folded to: void link_failure(); void f(int a) { int a1 &= ~0x300; if (a1 != 0) link_failure(); } but that might be worse unless popcount can be removed. (If I did this correctly).
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 Aldy Hernandez changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed||2022-09-27
[Bug tree-optimization/107053] ones bits is not tracked and popcount is not tracked
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107053 --- Comment #1 from Andrew Pinski --- This testcase is not optimized by clang/llvm.