From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83A703858004; Tue, 16 Nov 2021 17:16:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83A703858004 From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103278] New: [12 Regression] Recent change to cddce inhibits switch optimization Date: Tue, 16 Nov 2021 17:16:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 16 Nov 2021 17:16:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103278 Bug ID: 103278 Summary: [12 Regression] Recent change to cddce inhibits switch optimization Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: law at gcc dot gnu.org Target Milestone: --- On iq2000-elf this change: commit 045206450386bcd774db3bde0c696828402361c6 Author: Richard Biener Date: Fri Nov 12 10:21:22 2021 +0100 tree-optimization/102880 - improve CD-DCE [ ... ] Is inhibiting switch optimization for tree-ssa/if-to-switch-3.c from conver= ting an if statement into a switch statement: /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-iftoswitch-optimized" } */ int IsMySuperRandomChar(int aChar) { return aChar =3D=3D 0x0009 || aChar =3D=3D 0x000A || aChar =3D=3D 0x000C || aChar =3D=3D 0x000D || aChar =3D=3D 0x0020 || aChar =3D=3D 0x0030; } /* { dg-final { scan-tree-dump "Condition chain with \[^\n\r]\* BBs transfo= rmed into a switch statement." "iftoswitch" } } */ After today's cd-dce change we no longer turn that into a switch: Before: ;; Canonical GIMPLE case clusters: 9-10 12 13 32 48 ;; JT can be built: JT(values:6 comparisons:10 range:40 density: 25.00%):9-= 48 j.c:8:26: optimized: Condition chain with 3 BBs transformed into a switch statement. After: ;; Canonical GIMPLE case clusters: 9-10 12-13 32 48=