From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB915385DC0B; Thu, 23 Apr 2020 13:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB915385DC0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587646927; bh=ZrjFnnl4OMSDY9QLyJngB9+SoE66MjUVt/1TsnvFUSM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w/SzhrDBJXguni5X0wt9+0z93TEsrBMnR56Dz+p2sQhA9IZRC/9zV6sTuN3+6IFnM vdMT00MHlfSLsSR21gzhdUVzLu9cNr4+YqBZUeAAjuX18fNyLMu/RRGjLoOihRgHj/ fDioYi+2JzW5le7k1rPClJIQF8MDb84WPOOiZO5c= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94727] [10 Regression] GCC produces incorrect code with -O3 since r10-5071-g02d895504cc59be0 Date: Thu, 23 Apr 2020 13:02:07 +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: 10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 13:02:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94727 --- Comment #7 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #6) > (In reply to rsandifo@gcc.gnu.org from comment #5) > >=20 > > However, we then defer to vect_get_slp_defs to get the actual operands. > > The expected vector type is not part of this interface. >=20 > Ah yeah - sth on my list to fix (not making the type part of that API > but assigning vector types to SLP nodes). I even have partly completed > "hacks" to do that. When we have (and use!) vector types on all SLP > nodes we can also get rid of the mismatch code. Sounds great! The fewer decisions we make on the fly the better... > > I'm going to try: > >=20 > > diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c > > index 7f3a9fb5fb3..88a1e2c51d2 100644 > > --- a/gcc/tree-vect-stmts.c > > +++ b/gcc/tree-vect-stmts.c > > @@ -10566,8 +10566,11 @@ vectorizable_comparison (stmt_vec_info stmt_in= fo, > > gimple_stmt_iterator *gsi, > > /* Invariant comparison. */ > > if (!vectype) > > { > > - vectype =3D get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1), > > - slp_node); > > + if (VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (rhs1))) > > + vectype =3D mask_type; > > + else > > + vectype =3D get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1= ), > > + slp_node); > > if (!vectype || maybe_ne (TYPE_VECTOR_SUBPARTS (vectype), nunits= )) > > return false; > > } > >=20 > > which does at least fix the testcase. >=20 > LGTM. Thanks. aarch64-linux-gnu and x86_64-linux-gnu bootstrapped passed, now trying an SVE test run. Will commit if that passes too.=