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

--- Comment #2 from chenglulu <chenglulu at loongson dot cn> ---
This problem occurred after adding the r14-3511 optimization.

However, during the debugging process, it was discovered that it was due to the
attempt to generate rtx during the combine pass optimization.

(set (reg:DI 124)
    (zero_extend:DI (subreg:QI (umod:SI (reg:DI 122 [ reg ])
                (ior:DI (if_then_else:DI (eq:DI (reg:DI 114)
                            (const_int 0 [0]))
                        (reg:DI 112)
                        (const_int 0 [0]))
                    (reg:DI 118))) 0)))

During the optimization process, the function simplify_context::simplify_subreg
will make the following judgments:

rtx
simplify_context::simplify_subreg (machine_mode outermode, rtx op,
                                   machine_mode innermode, poly_uint64 byte)
{
  /* Little bit of sanity checking.  */
  gcc_assert (innermode != VOIDmode);
  gcc_assert (outermode != VOIDmode);
  gcc_assert (innermode != BLKmode);
  gcc_assert (outermode != BLKmode);

  gcc_assert (GET_MODE (op) == innermode
              || GET_MODE (op) == VOIDmode);
...

op is (reg:DI 122 [ reg ]) but innermode is SI_mode,so wrong.

Reply via email to