From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D3B703858408; Sat, 11 Sep 2021 07:04:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3B703858408 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/79201] missed optimization: sinking doesn't handle calls, swap PRE and sinking Date: Sat, 11 Sep 2021 07:04:24 +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: 7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status bug_severity resolution 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: Sat, 11 Sep 2021 07:04:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D79201 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |NEW Severity|normal |enhancement Resolution|FIXED |--- --- Comment #6 from Andrew Pinski --- So this is actually still broken in the sense if we turn off dominator optimizations (-fno-tree-dominator-opts), the problem with PRE and sink interaction comes into play still. The improvement came in via r8-2694 which in fact added -fno-tree-dominator-opts to gcc.dg/tree-ssa/ssa-sink-16.c . Note DOM actually does the sinking rather than the rotating of the loop. here is a testcase where DOM does not mess with the loop but we should stil= l be able to sink the function out and do when adding -fno-tree-pre: int f(int n, int t) { int i,j=3D0; if (t >=3D31 || t < 0) return 100; for (i =3D 0; i < t; i++) { j =3D __builtin_ffs(i); } return j; }=