From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7BE4D384A492; Fri, 6 Sep 2024 10:12:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BE4D384A492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1725617539; bh=xpdmiEVGPzzSEku8megTrN0tuyewAsgMZcB098Bxg5A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uCYjeF1RoIQpOZcM4zsaPci4ly6GL9ECEias2oeR7WMb9nkJBonKGSqY/85GiZ8qI N+Ri3w+z04kNfQFZcxkenT2IxJYqrc/jliUK/3Bn1/69Mkx3iGGUU57IFlxqfr7iy/ kIOoORaf1YxIQcqlRQhfmsEPgI5zpW5XS6XI8Cn4= From: "ktkachov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/116569] [15 Regression] ICE in to_constant, at poly-int.h:592 Date: Fri, 06 Sep 2024 10:12:18 +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: 15.0 X-Bugzilla-Keywords: aarch64-sve, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ktkachov at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jschmitz at gcc dot gnu.org X-Bugzilla-Target-Milestone: 15.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=3D116569 ktkachov at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #11 from ktkachov at gcc dot gnu.org --- (In reply to Andrew Pinski from comment #9) > (In reply to Andrew Pinski from comment #8) > > (In reply to Jennifer Schmitz from comment #7) > > > Thanks for the quick reply. I tried > > >=20 > > > (simplify > > > (minus (convert1? @0) (convert2? (mult:c (trunc_div @@0 @@1) @1))) > > > (if (INTEGRAL_TYPE_P (type) > > > || (VECTOR_INTEGER_TYPE_P (type) > > > && optimize_vectors_before_lowering_p ())) > > > (convert (trunc_mod @0 @1)))) > > >=20 > > > and the result is that the test case still ICEs, but fold-minus-1.c p= asses. > >=20 > > Try: > > INTEGRAL_TYPE_P (type) > > || (VECTOR_INTEGER_TYPE_P (type) > > && (optimize_vectors_before_lowering_p () > > || target_supports_op_p (type, TRUNC_MOD_EXPR, optab_vector))) >=20 > Oh wait the problem is this is before lowering but SVE vectors can't be > lowered. >=20 > I think maybe the lowering pass should handle the case where: > !target_supports_op_p (type, TRUNC_MOD_EXPR, optab_vector) && > target_supports_op_p (type, TRUNC_DIV_EXPR, optab_vector) && > target_supports_op_p (type, MULT_EXPR, optab_vector) && target_supports_o= p_p > (type, MINUS_EXPR, optab_vector) >=20 > And expand TRUNC_MOD_EXPR there. >=20 > I am thinking about adding a similar thing for MIN/MAX too. I don't think we have other lowering of SVE ops in the veclower, is that something we want to start doing now?=