From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 78A933858CDA; Mon, 14 Aug 2023 08:03:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78A933858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692000231; bh=+TP1qxa2oyUjsFm6P9FrVtOgUlNoz0rGXre1zFwOxlo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HrPTRJ7XVjHLrbmNxJhOA+CT3JSjMpIUoC0b221NZ4kJIiEnrVUM8AeqIQejQjFyB hNdg8ARPEIMoGmoLIOX25war2v6NIt393Mm1RVGbSztpccZam7OZOg6olIo0qVai8V D5s+nawB5vBW6hVkphwvMu8DEqVs5B+JDjcQCjz0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111003] [14 Regression] Dead Code Elimination Regression at -O3 since r14-2161-g237e83e2158 Date: Mon, 14 Aug 2023 08:03:50 +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: 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: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D111003 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC|rguenther at suse dot de |rguenth at gcc dot = gnu.org --- Comment #2 from Richard Biener --- So the only additional hoisting is in LIM4 Moving statement _60 =3D _13 ^ iftmp.9_18; (cost 1) out of loop 1. Moving statement _62 =3D _60 =3D=3D 10; (cost 21) out of loop 1. @@ -239,6 +279,8 @@ goto ; [100.00%] [local count: 477815112]: + _60 =3D _13 ^ iftmp.9_18; + _62 =3D _60 =3D=3D 10; [local count: 4343774241]: _9 =3D a (); @@ -296,8 +338,6 @@ goto ; [100.00%] [local count: 14585209535]: - _60 =3D _13 ^ iftmp.9_18; - _62 =3D _60 =3D=3D 10; [local count: 35145083376]: # prephitmp_63 =3D PHI <0(73), _62(14), 0(74)> and -fdisable-tree-lim4 restores the missed optimization. The difference is then in CCP4 which is able to remove the call to foo() when not hoisting the compare. When not hoisting the global range of _60 is stricter: - # RANGE [irange] unsigned int [0, 511] MASK 0x1c7 VALUE 0x0 - _60 =3D _13 ^ iftmp.9_18; + # RANGE [irange] unsigned int [0, 16383] MASK 0x3fff VALUE 0x0 + _60 =3D _13 ^ iftmp.9_18;=