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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jeff Law <l...@gcc.gnu.org>:

https://gcc.gnu.org/g:c1535f242f703d3142bef1ca7c31d1ee17633696

commit r14-11371-gc1535f242f703d3142bef1ca7c31d1ee17633696
Author: Jeff Law <j...@ventanamicro.com>
Date:   Sun Dec 29 08:27:30 2024 -0700

    [PR target/116720] Fix test for valid mempair operands

    So this BZ is a case where we incorrectly indicated that the operand array
was
    suitable for the t-head load/store pair instructions.

    In particular there's a test which checks alignment, but that happens
*before*
    we know if the operands are going to be reversed.  So the routine reported
the
    operands are suitable.

    At a later point the operands have been reversed into the proper order and
we
    realize the alignment test should have failed, resulting in the
unrecognized
    insn.

    This fixes the code by moving the reversal check earlier and actually
swapping
    the local variables with the operands.  That in turn allows for simpler
testing
    of alignments, ordering, etc.

    I've tested this on rv32 and rv64 in my tester.  I don't offhand know if
the
    patch from Filip that's been causing headaches for the RISC-V port has been
    reverted/fixed.  So there's a nonzero chance the pre-commit CI tester will
    fail.  I'll keep an eye on it and act appropriately.

            PR target/116720
    gcc/
            * config/riscv/thead.cc (th_mempair_operands_p): Test for
            aligned memory after swapping operands.  Simplify test for
            first memory access as well.

    gcc/testsuite/
            * gcc.target/riscv/pr116720.c: New test.

    (cherry picked from commit 0b06abe027a78681d29a5e91daa74bf8dba39826)

Reply via email to