From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A8333858D20; Mon, 12 Jun 2023 13:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A8333858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686576035; bh=qmCyx3TBQOSi/Cs77ndxuFW4eiHy0UC0DYAcSADCBtc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ud3h5mmYCx+s/UDKy/+L+dKMAlL8ZPoXVLfZSmORO9fHMd/5LAG/iYP8El95Wpium eITx9s+oHnL4CPiBaOnfputGoZVrDUPIIROcdVldpB+sXgVizpzAaFjtF6K6beHDdk 2QzwtUwqGeIqnNaiEdAFLPXeciXREKGlNA5qvfes= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110221] With AVX512 fully masking gfortran.dg/pr68146.f ICEs Date: Mon, 12 Jun 2023 13:20:34 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: --- 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=3D110221 --- Comment #1 from Richard Biener --- So sth along the PR108979 patch doesn't help: diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 61e508fcb6c..be963aea16f 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -3365,6 +3365,7 @@ vectorizable_call (vec_info *vinfo, if (internal_fn_p (cfn)) mask_opno =3D internal_fn_mask_index (as_internal_fn (cfn)); + bool is_invariant =3D true; for (i =3D 0; i < nargs; i++) { if ((int) i =3D=3D mask_opno) @@ -3383,6 +3384,8 @@ vectorizable_call (vec_info *vinfo, "use not simple.\n"); return false; } + if (dt[i] !=3D vect_external_def && dt[i] !=3D vect_constant_def) + is_invariant =3D false; /* We can only handle calls with arguments of the same type. */ if (rhs_type @@ -3607,7 +3610,8 @@ vectorizable_call (vec_info *vinfo, scalar_dest =3D gimple_call_lhs (stmt); vec_dest =3D vect_create_destination_var (scalar_dest, vectype_out); - bool masked_loop_p =3D loop_vinfo && LOOP_VINFO_FULLY_MASKED_P (loop_vin= fo); + bool masked_loop_p + =3D !is_invariant && loop_vinfo && LOOP_VINFO_FULLY_MASKED_P (loop_vin= fo); unsigned int vect_nargs =3D nargs; if (masked_loop_p && reduc_idx >=3D 0) {=