[Bug tree-optimization/105983] Failure to optimize (b != 0) && (a >= b) as well as the same pattern with binary and

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 14 21:45:56 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105983

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
             Blocks|                            |19987
   Last reconfirmed|                            |2022-06-14
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, the issue is GCC does not even handle:
bool f(unsigned a, unsigned b)
{
    bool t = (b != 0);
    bool t1 = (a >= b);
    return t & t1;
}

I suspect this is a fold-const.cc which has not been moved over to match.pd
yet.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19987
[Bug 19987] [meta-bug] fold missing optimizations in general


More information about the Gcc-bugs mailing list