From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB088385773F; Thu, 20 Jul 2023 11:08:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB088385773F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689851289; bh=gJ3EQDiDzI6YbDvJDCAxJ9sgFGN00SLTIILto10uJpI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TDccd9LpIJqRg8UaVKA0BL6Kgq1AkLQiwFkOciFQnN9sbqK5cblfr7zf6J1W1XAno HDrLb+gLY60kLYaAhmfsLeKsBuLuygAAQCot+hB9HtRclJOvLiFKfBh3PDJeHOZZ2l 1caTxBg7qgc3H5oHKbD0uc377KbhS70aeYy5DNQs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap Date: Thu, 20 Jul 2023 11:08:09 +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: build, ice-on-valid-code, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D110742 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #12 from Richard Biener --- So we have those external def nodes for existing vectors in the IL. Obviou= sly we cannot change the layout of those - where can we specify that? I see is_compatible_layout or change_layout_cost. But start_choosing_layouts already assigns layout 0 to it where I thought this would effectively prevent changes? Oddly in forward_pass we first have partition.layout =3D=3D 0 && layout_i = =3D=3D 0 but still do stuff. $38 =3D 0x3d8f690 =3D {{node_begin =3D 0, node_end =3D 1, layout =3D 0, in_= degree =3D 0, out_degree =3D 1}, { node_begin =3D 1, node_end =3D 2, layout =3D 1, in_degree =3D 1, out_de= gree =3D 0}, {node_begin =3D 2,=20 node_end =3D 3, layout =3D 2, in_degree =3D 0, out_degree =3D 0}} later we ask if changing layout from 0 to 1 is OK. I suppose the bug is in get_result_with_layout itself which assumes changing vect_constant_def/vect_external_def is fine and thus pushes the edge permute to the node? I wonder if I fix that say with the following, if I also need to adjust costs somewhere? diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 693621ca990..1d79c77e8ce 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -5198,7 +5198,10 @@ vect_optimize_slp_pass::get_result_with_layout (slp_= tree node, return result; if (SLP_TREE_DEF_TYPE (node) =3D=3D vect_constant_def - || SLP_TREE_DEF_TYPE (node) =3D=3D vect_external_def) + || (SLP_TREE_DEF_TYPE (node) =3D=3D vect_external_def + && (to_layout_i =3D=3D 0 + /* We can't permute vector defs. */ + || SLP_TREE_VEC_DEFS (node).is_empty ()))) { /* If the vector is uniform or unchanged, there's nothing to do. */ if (to_layout_i =3D=3D 0 || vect_slp_tree_uniform_p (node)) I'll also note that we do /* Handle externals and constants optimistically throughout. But treat existing vectors as fixed since we do not handle permuting them. */ unsigned int node_i =3D m_partitioned_nodes[rpo_i]; auto &vertex =3D m_vertices[node_i]; if ((SLP_TREE_DEF_TYPE (vertex.node) =3D=3D vect_external_def && !SLP_TREE_VEC_DEFS (vertex.node).exists ()) || SLP_TREE_DEF_TYPE (vertex.node) =3D=3D vect_constant_def) vertex.partition =3D -1; in create_partitions (). I'm testing the above change now.=