Hi gcc-patches mailing list,
Torbjörn Svensson via Sourceware Forge 
<[email protected]> has requested that the following 
forgejo pull request
be published on the mailing list.

Created on: 2026-07-19 07:29:43+00:00
Latest update: 2026-07-20 06:30:38+00:00
Changes: 2 changed files, 28 additions, 1 deletions
Head revision: azoff/gcc ref pr/tree-ssa/andnot-2.c commit 
e7c34254410758671d64136a6aaa2a67f9c48b99
Base revision: gcc/gcc ref trunk commit 
6d5d980f76c3057cc90b1343a679e7eea3ad2a50 r17-2530-g6d5d980f76c305
Merge base: 6d5d980f76c3057cc90b1343a679e7eea3ad2a50
Full diff url: https://forge.sourceware.org/gcc/gcc/pulls/193.diff
Discussion:  https://forge.sourceware.org/gcc/gcc/pulls/193
Requested Reviewers:

Tested on top of r17-2366-gcfc5aa4ed975c4.
Reg-tested on arm-none-eabi for 14 different targets without any regression.
Reg-tested on x86_64-linux-gnu with some "regressions". What I mean with 
"regressions" is that there are new fails, but they are all related to `tsan` 
and that these tests are unstable/unpredictable. If I run the reference version 
a few times, I get different results.

Ok for trunk, releases/gcc-16 and releases/gcc-15?

--
Fold `(x == CST) ? x : CST` and `(x != CST) ? CST : x` to `CST` for
integral scalar and vector types. This catches cases where earlier
folding has converted bitwise mask expressions into conditional selects,
including ARM MVE predicate-to-vector mask forms.

        PR tree-optimization/124663

gcc/ChangeLog:

        * match.pd: Fold constant conditional selects.

gcc/testsuite/ChangeLog:

        * g++.dg/tree-ssa/pr124663.C: New test.

Signed-off-by: Torbjörn SVENSSON <[email protected]>


Changed files:
- A: gcc/testsuite/g++.dg/tree-ssa/pr124663.C
- M: gcc/match.pd


Torbjörn SVENSSON (1):
  tree-optimization: Fold constant conditional selects [PR124663]

 gcc/match.pd                             | 16 +++++++++++++++-
 gcc/testsuite/g++.dg/tree-ssa/pr124663.C | 13 +++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr124663.C

-- 
2.54.0

Reply via email to