From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 965B53858C60; Sat, 1 Jul 2023 20:51:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965B53858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688244709; bh=bOXRVICJR6nOGH3q3s0oNpCIraoavTRcALLgih5i+u0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qWaD0Ch5GmI/PItGhPXwWg2wF3k6kun/wiR1r3uV0Ig1Qzad5KmW8JAWGSS3j3LdR dfYKbZ2XMnfT4/g5DPaqBtyyngKYYeHuFcHC8oIcO8kKjOezAU2YMhYBs0S70oNC8r DGnQun+9Eb0YKn8aXThzy9vrsvTIJ8Yo2ACPvAoU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110450] [14 Regression] Dead Code Elimination Regression at -O2 since r14-261-g0ef3756adf0 Date: Sat, 01 Jul 2023 20:51:49 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110450 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2023-07-01 --- Comment #1 from Andrew Pinski --- In VRP: trunk: ``` Folding statement: _11 =3D _9 % 11; Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Matching expression match.pd:1991, gimple-match-5.cc:23 Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Matching expression match.pd:1948, gimple-match-7.cc:20 Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Applying pattern match.pd:5319, gimple-match-8.cc:2688 Applying pattern match.pd:6000, gimple-match-10.cc:587 Applying pattern match.pd:2102, gimple-match-1.cc:6289 Applying pattern match.pd:6000, gimple-match-10.cc:587 Applying pattern match.pd:5284, gimple-match-4.cc:1099 Applying pattern match.pd:1378, gimple-match-3.cc:7680 Applying pattern match.pd:4720, gimple-match-1.cc:16033 gimple_simplified to _14 =3D a.1_2 <=3D 0; _15 =3D (int) _14; _11 =3D _15 << 3; Global Exported: _11 =3D [irange] int [0, 0][8, 8] NONZERO 0x8 Folded into: _11 =3D _15 << 3; ``` And the relationship between _5 and _11 is completely lost. while in GCC 13: ``` Folding statement: _11 =3D _9 % 11; Global Exported: _11 =3D [irange] int [0, 0][8, 8] NONZERO 0x8 Folded into: _11 =3D _9; ``` And then we remove the __builtin_unreachable even though we infer that _5 w= ould be 0 and therefore _11 would never be 8 .=