[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2024-08-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 --- Comment #6 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > (In reply to Andrew Pinski from comment #3) > > Note we also don't optimize: > > > > inline int sign1(int x) > > { > > return (x < 0 ? -1 : 0) | (x > 0 ? 1 :

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2023-08-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > As for the original issue: > x.0_5 = (unsigned int) x_2(D); > _6 = -x.0_5; > _7 = _6 >> 31; > _8 = (int) _7; > > We have a pattern for basically this: >

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2023-08-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 Andrew Pinski changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2023-05-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 --- Comment #3 from Andrew Pinski --- Note we also don't optimize: inline int sign1(int x) { return (x < 0 ? -1 : 0) | (x > 0 ? 1 : 0); } bool f1(int x) { return sign1(x) < 1; } To be just `x <= 0`

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2021-04-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2021-04-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement

[Bug tree-optimization/94893] Sign function not getting optimized to simple compare

2020-09-04 Thread gabravier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893 Gabriel Ravier changed: What|Removed |Added Target|x86_64-*-* | Blocks|