[Bug tree-optimization/96897] Failure to optimize sub+not involving constant to add

gabravier at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 2 15:28:38 GMT 2020


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

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Failure to optimize         |Failure to optimize sub+not
                   |not+not+dec+and+not to      |involving constant to add
                   |add+or                      |

--- Comment #2 from Gabriel Ravier <gabravier at gmail dot com> ---
Better test case (I'd assume) :

int f(int x)
{
    return ~(constant - x);
}

which should be optimizable to `x + ~constant`.


More information about the Gcc-bugs mailing list