From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE2F9385840C; Tue, 7 Feb 2023 09:34:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE2F9385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675762470; bh=7qr9t01CINZoUx3ZMQP9e3Qz9yOtGGcpznnRKgTTHZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=W5p74WVeg0U4zJQuJiGViFeQR+KA+a3DWn/92MaglRp9k9qjYPClBXbc+sVhbtKpF EqLz7NxDyoNYI4YqOcaVxgGgMLCtFp4uhdh1oNHnhtTxt9PacZ6tl9VoMIE1yifL2Q Uc86XTz/gBDv5TLwA6VNjU1ESFimxJJ2C5UGav5Y= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106433] [13 Regression] ICE in vect_transform_loops, at tree-vectorizer.cc:1032 Date: Tue, 07 Feb 2023 09:34:28 +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, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D106433 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:cad2412cc84518195fceb2db31e82e6df7e5a2c2 commit r13-5727-gcad2412cc84518195fceb2db31e82e6df7e5a2c2 Author: Jakub Jelinek Date: Tue Feb 7 10:33:54 2023 +0100 cgraph: Handle simd clones in cgraph_node::set_{const,pure}_flag [PR106= 433] The following testcase ICEs, because we determine only in late pure con= st pass that bar is const (the content of the function loses a store to a global var during dse3 and read from it during cddce2) and local-pure-const2 makes it const. The cgraph ordering is that post IPA (in late IPA simd clones are created) bar is processed first, then foo as its caller, then foo.simdclone* and finally bar.simdclone*. Conceptually I think that is the right ordering which allows for static simd clones to be removed. The reason for the ICE is that because bar was marked const, the call to it lost vops before vectorization, and when we in foo.simdclone* try to vectorize the call to bar, we replace it with bar.simdclone* which hasn= 't been marked const and so needs vops, which we don't add. Now, because the simd clones are created from the same IL, just in a lo= op with different argument/return value passing, I think generally if the = base function is determined to be const or pure, the simd clones should be t= oo, unless e.g. the vectorization causes different optimization decisions, = but then still the global memory reads if any shouldn't affect what the function does and global memory stores shouldn't be reachable at runtime. So, the following patch changes set_{const,pure}_flag to mark also simd clones. 2023-02-07 Jakub Jelinek PR tree-optimization/106433 * cgraph.cc (set_const_flag_1): Recurse on simd clones too. (cgraph_node::set_pure_flag): Call set_pure_flag_1 on simd clon= es too. * gcc.c-torture/compile/pr106433.c: New test.=