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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Stefan Schulze Frielinghaus
<stefa...@gcc.gnu.org>:

https://gcc.gnu.org/g:94f896c7c6c0329077271487219e345bcdcec6ab

commit r16-2502-g94f896c7c6c0329077271487219e345bcdcec6ab
Author: Stefan Schulze Frielinghaus <stefa...@gcc.gnu.org>
Date:   Fri Jul 25 11:04:38 2025 +0200

    Determine CONSTRAINT_LEN at run-time [PR121214]

    Tests gcc.dg/asm-hard-reg-error-{4,5}.c ICE on sparc*-sun-solaris2.11
    since in tm-preds.h we end up with

      #define CONSTRAINT_LEN(c_,s_) 1

    and, therefore, do not parse hard register constraints correctly.
    Hard register constraints are non-single character constraints and
    require insn_constraint_len() in order to determine the length.

    In write_tm_preds_h() from genpreds.cc, previously variable
    constraint_max_namelen was used in order to decide whether we have
    single or non-single character constraints.  The distinction shouldn't
    be done anymore and we always must call into insn_constraint_len().

    While being on it, remove guard constraint_max_namelen>0 since we always
    have some constraints coming from common.md.  This leaves
    constraint_max_namelen without users so remove it.

    gcc/ChangeLog:

            PR middle-end/121214
            * genpreds.cc (constraint_max_namelen): Delete.
            (write_tm_preds_h): Always write insn_constraint_len() and
            define CONSTRAINT_LEN to it, i.e., remove guard
            constraint_max_namelen>1.  Remove outer guard
            constraint_max_namelen>0 and re-indent.
            (write_insn_preds_c): Remove guard
            constraint_max_namelen>0 and re-indent.

Reply via email to