[Bug rtl-optimization/108388] LRA generates RTL that violates constraints

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 24 21:14:52 GMT 2023


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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:265a749f290f7c6adc9a3aaa9c585b498a8a38ea

commit r13-5332-g265a749f290f7c6adc9a3aaa9c585b498a8a38ea
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Tue Jan 24 16:10:59 2023 -0500

    LRA: Always do elimination and only for hard register to check insn
constraints

    LRA does elimination but not always checks insn constraints in this case.
    This results in LRA failure for PDP11 target whose addition is only 2-op
insn.
    The same might happen for other analogous targets.  The patch fixes this
problem.

            PR rtl-optimization/108388

    gcc/ChangeLog:

            * lra-constraints.cc (get_hard_regno): Remove final_p arg.  Always
            do elimination but only for hard register.
            (operands_match_p, uses_hard_regs_p, process_alt_operands): Adjust
            calls of get_hard_regno.

    gcc/testsuite/ChangeLog:

            * gcc.target/pdp11/pdp11.exp: New.
            * gcc.target/pdp11/pr108388.c: New.


More information about the Gcc-bugs mailing list