]> git.ipfire.org Git - thirdparty/gcc.git/commit
match.pd: (A | (convert?)(A != 0)) EQ|NE 0 -> A EQ|NE 0 [PR114969]
authorDaniel Barboza <daniel.barboza@oss.qualcomm.com>
Fri, 23 Jan 2026 16:10:30 +0000 (13:10 -0300)
committerDaniel Barboza <daniel.barboza@oss.qualcomm.com>
Fri, 6 Feb 2026 17:21:22 +0000 (14:21 -0300)
commit7b2e9d01d325f091ab7615985f413dda78415fec
treeaa9704ee9b7e6426ebc30b649705a87957069ca5
parentec0dd91900abaf3b3efd8cd1cec54904d6bd28c6
match.pd: (A | (convert?)(A != 0)) EQ|NE 0 -> A EQ|NE 0 [PR114969]

The NE variant is a gimple pattern that comes from the following C++
code:

bool result = (std::max(
                  (unsigned long long) 0, (unsigned long long) var_0))
               | ( var_0 ?  1 : 0);

PR tree-optimization/114969

gcc/ChangeLog:

* match.pd (`(A | (convert?)(A != 0)) EQ|NE 0`): New pattern.

gcc/testsuite/ChangeLog:

* g++.dg/pr114969.C: New test.
gcc/match.pd
gcc/testsuite/g++.dg/pr114969.C [new file with mode: 0644]