[Bug middle-end/122715] Missed optimization of IFN_AVG_FLOOR (x, x) --> x

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122715

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <[email protected]>:

https://gcc.gnu.org/g:3b126071b10e5b12e7694f7a237f746e8db6d82c

commit r17-2670-g3b126071b10e5b12e7694f7a237f746e8db6d82c
Author: Odysseas Georgoudis <[email protected]>
Date:   Thu Jul 23 08:46:24 2026 -0600

    middle-end: Fold averages with equal operands [PR122715]

    IFN_AVG_FLOOR (x, x) and IFN_AVG_CEIL (x, x) both
    produce x.  Fold these cases in match.pd.

            PR middle-end/122715

    gcc/ChangeLog:

            * match.pd: Fold IFN_AVG_FLOOR and IFN_AVG_CEIL with equal
            operands.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr122715.c: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.