From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 033F43850429; Tue, 26 Jan 2021 09:18:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 033F43850429 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/98834] [10/11 Regression] Code path incorrectly determined to be unreachable Date: Tue, 26 Jan 2021 09:18:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on keywords cc everconfirmed component target_milestone priority bug_status 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, 26 Jan 2021 09:18:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98834 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-01-26 Keywords| |needs-bisection, wrong-code CC| |jamborm at gcc dot gnu.org, | |marxin at gcc dot gnu.org Ever confirmed|0 |1 Component|tree-optimization |ipa Target Milestone|--- |10.3 Priority|P3 |P2 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- Confirmed, the __builtin_unreachable is introduced by inlining: Considering _S_multiplies.isra/23 with 12 size to be inlined into int main()/13 in t.C:54 Estimated badness is -inf, frequency 1.00. Badness calculation for int main()/13 -> _S_multiplies.isra/23 size growth -2, time 2.000000 unspec 10.000000 IPA hints: declared_in= line big_speedup -inf: Growth -2 <=3D 0 Adjusted by hints -inf Accounting size:2.00, time:2.00 on predicate exec:(true) Introduced new external node (void __builtin_unreachable()/24). Processing frequency _S_multiplies.isra/23 Called by int main()/13 that is executed once Accounting size:-4.00, time:-13.00 on predicate exec:(true) t.C:54:62: optimized: Inlined _S_multiplies.isra/23 into int main()/13 whi= ch now has time 8.000000 and size 9, net change of -14. which points to IPA SRA. VRP then simplifies __builtin_constant_p seen as _12 =3D __builtin_constant_p (__xx_11); if (_12 !=3D 0) goto ; [100.00%] else goto ; [0.00%] [count: 0]: __builtin_unreachable (); [local count: 1073741824]: MEM [(struct _Tuple *)&D.2557] =3D 0; and uses conservatively false but that runs into __builtin_unreachable () .= .. The IPA inline transform ends us with _12 =3D __builtin_constant_p (__xx_11); if (_12 !=3D 0) goto ; [100.00%] else goto ; [0.00%] [count: 0]: _13 =3D _16(D); __builtin_unreachable (); [local count: 1073741824]: # SR.30_15 =3D PHI <__y_10(2)> which eventually shows the reason (the unused argument?)=