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

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

https://gcc.gnu.org/g:5010a2ca3f503b039bb25bac2fd0e32e032b2de5

commit r17-3686-g5010a2ca3f503b039bb25bac2fd0e32e032b2de5
Author: Hans-Peter Nilsson <[email protected]>
Date:   Thu Aug 27 07:22:57 2026 +0200

    CRIS: Simplify btst pattern slightly

    The fix for PR rtl-optimization/126276 changed the mode of the result
    of the post-split zero_extract for the *btst pattern from SImode to
    that of the incoming (SImode, HImode, QImode) and required a slightly
    more complex "btst" pattern.  That's not necessary: the zero_extract
    is inherently zero-extending, so it's correct to only generate a
    SImode result for the zero_extract in the define_insn_and_split split
    insns, even if the incoming operand 0 is any of (SImode, HImode,
    QImode).  So, the *btst pattern can be slightly less complex.

    The comment removed in that commit at some time became stale, as well
    as in the wrong place (post cc0 it should have been moved to the
    recognizing parts of the generating define_insn_and_split:s).

            * config/cris/cris.md ("*btst<mode>): Simplify; iterate only over
            ZnNNZSET and compare only to a zero_extract result of SImode.
            Just add sanity checks for the mode of operand 0 in the condition.
            ("*cbranch<mode>4_btstrq1_<CC>", "*cbranch<mode>4_btstqb0_<CC>"):
            Generate a zero_extract in SImode.

Reply via email to