diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index 17d762be527..fd7b4dc14be 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -35379,9 +35379,10 @@ arm_mve_dlstp_check_dec_counter (loop *loop, rtx_insn* vctp_insn, return NULL; else if (REG_P (condconst)) { - basic_block pre_loop_bb = single_pred (loop_preheader_edge (loop)->src); - if (!pre_loop_bb) + basic_block preheader_b = loop_preheader_edge (loop)->src; + if (!single_pred_p (preheader_b)) return NULL; + basic_block pre_loop_bb = single_pred (preheader_b); rtx initial_compare = NULL_RTX; if (!(prev_nonnote_nondebug_insn_bb (BB_END (pre_loop_bb)) diff --git a/gcc/testsuite/gcc.target/arm/mve/dlstp-loop-form.c b/gcc/testsuite/gcc.target/arm/mve/dlstp-loop-form.c index a1b26873d79..08811cef568 100644 --- a/gcc/testsuite/gcc.target/arm/mve/dlstp-loop-form.c +++ b/gcc/testsuite/gcc.target/arm/mve/dlstp-loop-form.c @@ -25,3 +25,15 @@ void n() { } } +int a; +void g2() { + long b; + while (a) { + char *c; + for (long d = b; d > 0; d -= 4) { + mve_pred16_t e = vctp32q(d); + int32x4_t f; + vstrbq_p_s32(c, f, e); + } + } +}