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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
In the debugger for 'convert_syntax', it fails immediately. The caller is:

1055        case DEFINE_COND_EXEC:
1056          convert_syntax (desc, loc);

(gdb) p debug_rtx(desc)
(define_cond_exec [
        (match_operator 0 ("predicate_operator")
             [
                (match_operand:BI 1 ("nvptx_register_operand") (""))
                (match_operand:BI 2 ("const0_operand") (""))
            ])
    ] ("") ("")
     [])

the check output is:

build/genpreds: Internal error: RTL check: expected elt 2 type 'T', have 's'
(rtx define_cond_exec) in convert_syntax, at gensupport.cc:883

which internally is:

  templ_index = GET_CODE (x) == DEFINE_INSN ? 3 : 2;
  templ = XTMPL (x, templ_index);

The first one gives '2' and then:

#define XTMPL(RTX, N)   (RTL_CHECK1 (RTX, N, 'T').rt_str)

and the error string is:

751  ("RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at
%s:%d",
752   n, c1, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)),

* * *

#define RTL_CHECK1(RTX, N, C1) __extension__                            \
(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N);             \
     const enum rtx_code _code = GET_CODE (_rtx);                       \
     if (_n < 0 || _n >= GET_RTX_LENGTH (_code))                        \
       rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__,           \
                                __FUNCTION__);                          \
     if (GET_RTX_FORMAT (_code)[_n] != C1)                              \
       rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__,        \
                               __FUNCTION__);                           \
     &_rtx->u.fld[_n]; }))

Reply via email to