From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C90603858C5E; Tue, 21 Mar 2023 10:28:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C90603858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679394519; bh=ld3ZjLblXjrQgeW8DycJgWg92Rlqfgz9t9Q6Jjk1Sx8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BkdajQQw75tD+OqfyYKRXJbxAZ38uZaRIqlzSqhtG4TxIteNXU/ktBrq+6f6EQDbT +Vhx3ZVggL+TF0xprLj7o2LvvfyrsBmlGnacAaoNDQ6gBguRwPP1BccN/bLFs+LhKq LF/LhDAVeGnrj2Htc70tB7tARHOKs6NyULy6cZ0w= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109176] [13 Regression] internal compiler error: in to_constant, at poly-int.h:504 Date: Tue, 21 Mar 2023 10:28:39 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 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=3D109176 --- Comment #8 from Jakub Jelinek --- (In reply to Richard Biener from comment #7) > --- a/gcc/tree-vect-generic.cc > +++ b/gcc/tree-vect-generic.cc > @@ -1040,6 +1040,10 @@ expand_vector_condition (gimple_stmt_iterator *gsi, > bitmap dce_ssa_names) > tree_code code =3D TREE_CODE (a); > gassign *assign =3D NULL; >=20=20 > + if (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (a)) > + && expand_vec_cond_expr_p (type, TREE_TYPE (a), ERROR_MARK)) > + return true; > + > if (code =3D=3D SSA_NAME) > { > assign =3D dyn_cast (SSA_NAME_DEF_STMT (a)); Ok, the above LGTM. > @@ -1053,14 +1057,14 @@ expand_vector_condition (gimple_stmt_iterator *gs= i, > bitmap dce_ssa_names) > comp_inner_type =3D TREE_TYPE (TREE_TYPE (a1)); > comp_width =3D vector_element_bits_tree (TREE_TYPE (a1)); > } > - } >=20=20 > - if (expand_vec_cond_expr_p (type, TREE_TYPE (a1), code) > - || (integer_all_onesp (b) && integer_zerop (c) > - && expand_vec_cmp_expr_p (type, TREE_TYPE (a1), code))) > - { > - gcc_assert (TREE_CODE (a) =3D=3D SSA_NAME || TREE_CODE (a) =3D=3D = VECTOR_CST); > - return true; > + if (expand_vec_cond_expr_p (type, TREE_TYPE (a1), code) > + || (integer_all_onesp (b) && integer_zerop (c) > + && expand_vec_cmp_expr_p (type, TREE_TYPE (a1), code))) > + { > + gcc_assert (TREE_CODE (a) =3D=3D SSA_NAME || TREE_CODE (a) =3D= =3D > VECTOR_CST); > + return true; > + } > } >=20=20 > /* Handle vector boolean types with bitmasks. If there is a comparison Is the second hunk because the verifier now requires that first argument of VEC_COND_EXPR is always is_gimple_val and so it will be never tcc_compariso= n? I don't understand the assert after the change though, this is in code guar= ded with code =3D=3D SSA_NAME, so TREE_CODE (a) =3D=3D SSA_NAME is always true. If TREE_CODE (a) =3D=3D VECTOR_CST, then it could return true without lower= ing only in the first hunk. Are you going to test the patch (with the assert removed?)? Not really sure about the testcase, perhaps the #c6 one in gcc.target/aarch64/sve/pr109176.c with /* PR tree-optimization/109176 */ /* { dg-do compile } */ /* { dg-options "-O2 -march=3Darmv8.2-a+sve" } */ at the start added? Or #pragma GCC aarch64 "arm_sve.h" line replaced with #include as well?=