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 :
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:
>
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
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`
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893
Andrew Pinski changed:
What|Removed |Added
Ever confirmed|0 |1
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94893
Gabriel Ravier changed:
What|Removed |Added
Target|x86_64-*-* |
Blocks|