From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E3EC3858D39; Wed, 1 Feb 2023 07:29:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E3EC3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675236572; bh=oDi7S232rLIAO0zjDqn625YI5r9HuzFGW67W/lZVj/Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xfDYozh/HLsgvIAYGiup1NicGW4YjfuHr0pAo8urK13egAaSK2QNH53AheZXgK55I Xsi/0tHEyjvA+9GCSNnGidnT6qWoO2uJHedW83QiIovej6k5zwuDw+QoE5zQ7AL4xN +mCGHDAI+HzZRAqAtBULXdb51+KJ0S0U+iskkFuY= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108601] [13 Regression] vector peeling ICEs with VLA in gcc_r in SPEC2017 since g:c13223b790bbc5e4a3f5605e057eac59b61b2c85 Date: Wed, 01 Feb 2023 07:29:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108601 --- Comment #10 from Hongtao.liu --- (In reply to Hongtao.liu from comment #9) > > ---- > >=20 > > decode_options() { > > int flag =3D 1; > > for (; flag <=3D 1 << 21; flag <<=3D 1) > > ; > > } Normally when vf is not constant, it will be prevented by vectorizable_nonlinear_inductions, but for this case, it failed going into if (STMT_VINFO_RELEVANT_P (stmt_info)) { need_to_vectorize =3D true; if (STMT_VINFO_DEF_TYPE (stmt_info) =3D=3D vect_induction_def && ! PURE_SLP_STMT (stmt_info)) ok =3D vectorizable_induction (loop_vinfo, stmt_info, NULL, NULL, &cost_vec); since the iv is never used outside of the loop, and will be dce later, so vectorizer doesn't bother checking if it's vectorizable. It's true but hit gcc_assert in vect_peel_nonlinear_iv_init when vf is not constant. One solution is ignoring the nonlinear iv peeling if it's !STMT_VINFO_RELEVANT_P (stmt_info) just like the upper code, the other solution is returning false earlier in the vect_can_peel_nonlinear_iv_p when vf is not known.=