: unassigned at gcc dot gnu.org
Reporter: getchar_gnu at hotmail dot com
Target Milestone: ---
while (i--) can be compiled into `sub ecx, 1 / jnc code` rather than `dec ecx /
cmp ecx, -1 / jne code`.
See https://stackoverflow.com/questions/54278070/ for discussion (I'm asker)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93002
--- Comment #7 from getchar_gnu at hotmail dot com ---
Actually for `while (i--) sink=i;` with knowledge that `i!=0` it's valid to
compile as
.L11:
subl$1, %edi
movl%edi, sink(%rip)
jne .L11
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: getchar_gnu at hotmail dot com
Target Milestone: ---
https://gcc.godbolt.org/z/rM-dZg
-std=c++17 -m64
template
struct bar {
template
bar(B& obj, R(B::*f)(A...)const=B::oper
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90782
--- Comment #6 from getchar_gnu at hotmail dot com ---
https://gcc.godbolt.org/z/qzG9jj
template
struct bar {
template
bar(B& obj, void(B::*f)(A...)const=&B::operator()){}
};
int main() {
const auto f1 = [](){};
b
Assignee: unassigned at gcc dot gnu.org
Reporter: getchar_gnu at hotmail dot com
Target Milestone: ---
Code: https://gcc.godbolt.org/z/99s5fc695
Related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82853
(signed)x%145==0, (unsigned)x%145==0, (unsigned)x%145==1 are all optimized into
form
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103614
--- Comment #1 from getchar_gnu at hotmail dot com ---
Not sure if related, but something like x%13==8 && x>17 && x<146 can also
reduce some code