From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B09CD3861800; Tue, 17 Nov 2020 07:12:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B09CD3861800 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/97856] Missed optimization: repeated call Date: Tue, 17 Nov 2020 07:12:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords version component everconfirmed cc bug_status cf_reconfirmed_on 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: Tue, 17 Nov 2020 07:12:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97856 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Version|unknown |11.0 Component|tree-optimization |rtl-optimization Ever confirmed|0 |1 CC| |hubicka at gcc dot gnu.org Status|UNCONFIRMED |NEW Last reconfirmed| |2020-11-17 --- Comment #1 from Richard Biener --- Confirmed. basic-block reordering decides to duplicate the block: Redirecting fallthru edge 7->8 to 9 Duplicated bb 8 (created bb 9) Final order: 2 3 4 8 5 6 7 9 Reordered sequence: 2 bb 2 3 bb 3 4 bb 4 5 bb 8 6 bb 5 7 bb 6 8 bb 7 9 duplicate of 8 since we decide to put the default: handling on the fallthru edge of the condition chain we duplicate it to the tail as well. IIRC expansion always does it this way and BB reorder simply avoids one jump. With -Os we flip the last jump and avoid the duplication.=