From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 503513858C52; Fri, 21 Apr 2023 18:55:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 503513858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682103349; bh=rSotimJrNHUayiL5FwC+dV7lp9fo1wt7XYeGrdrjeQ4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QZuDB4Tsdp5d1I0aS8q/+Imrcq7J56eC0gfoapAFyEUlig9e6YRwKV9/wBj1m9KfK EKOV/ZsZhHAIIlixNgLL8SfPciIlWt+j+Kt7bkYuFJKDce11Ivf1XL4otv2DorqR/q nY0p1Uq9AoFjEvzGon4oqT+hQtXAI/J2YGsgKs0w= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109546] [13/14 Regression] Missed Dead Code Elimination when using __builtin_unreachable since r13-3596-ge7310e24b1c0ca Date: Fri, 21 Apr 2023 18:55: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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com 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: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D109546 --- Comment #3 from Andrew Macleod --- Patch in testing. when deciding to fold condition of builtin_unreachable, VRP is failing to recognize that given=20 if (ptr =3D=3D &x) __builtin_unreachable () &x is not a representable range, and thus should not be eliminated early ev= en though it satisfies the other criteria. it just sees it as a symbolic value =3D=3D CONSTANT and thinks its smart e= nough when it isn't.=