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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Dimitar Dimitrov <dimi...@gcc.gnu.org>:

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

commit r16-2362-ge42799be2bb2966487c27897294426a03a99f56d
Author: Dimitar Dimitrov <dimi...@dinux.eu>
Date:   Fri Jul 18 23:45:50 2025 +0300

    pru: Use signed HOST_WIDE_INT for handling ctable addresses

    The ctable base address for SBCO/LBCO load/store patterns was
    incorrectly stored as unsigned integer.  That prevented matching
    addresses with bit 31 set, because const_int RTL expression is expected
    to be sign-extended.

    Fix by using sign-extended 32-bit values for ctable base addresses.

            PR target/121124

    gcc/ChangeLog:

            * config/pru/pru-pragma.cc (pru_pragma_ctable_entry): Handle the
            ctable base address as signed 32-bit value, and sign-extend to
            HOST_WIDE_INT.
            * config/pru/pru-protos.h (struct pru_ctable_entry): Store the
            ctable base address as signed.
            (pru_get_ctable_exact_base_index): Pass base address as signed.
            (pru_get_ctable_base_index): Ditto.
            (pru_get_ctable_base_offset): Ditto.
            * config/pru/pru.cc (pru_get_ctable_exact_base_index): Ditto.
            (pru_get_ctable_base_index): Ditto.
            (pru_get_ctable_base_offset): Ditto.
            (pru_print_operand_address): Ditto.

    gcc/testsuite/ChangeLog:

            * gcc.target/pru/pragma-ctable_entry-2.c: New test.

Reply via email to