From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E06C43855587; Fri, 4 Aug 2023 17:58:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E06C43855587 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691171890; bh=v2Xxy3uX3ZpduipYMs9l41unBHddO6GbqnwTD9W2zI8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PNdJTPP93Vq7t4+zkRP4+hjXIdkR6CUDU3/PtpNF0CNeEzYFPyQCDtIcdf653YnZW vnL6fKc1m2hp0MK/RXiqwYHmZjDhE/8HznV+6yVANow5xK8/xrOuj2/19UDgPLDRA8 q6qI/DSwOhza3e56vG1ADv5doF9l3eSwk9rL6HTY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110903] [14 Regression] Dead Code Elimination Regression since r14-1597-g64d90d06d2d Date: Fri, 04 Aug 2023 17:58:10 +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: 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: 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=3D110903 --- Comment #1 from Andrew Pinski --- Note the original testcase has some obvious use of an uninitialized variabl= e. Anyways here is a fixed up testcase which does not have that uninitialized variable and GCC 13 was able to optimize away the call to foo still: ``` void foo(void); static signed char b, c; static short e, f; static int g =3D 41317; static int(a)(int h, int i) { return h + i; } static int(d)(int h, int i) { return i ? h : 0; } short t =3D 10; int main() { { signed char j; short k =3D t; for (; g >=3D 10; g =3D (short)g) { _Bool l =3D 1; int m =3D 0; j =3D 8 * k; k =3D j <=3D 0; f =3D c + 3; for (; c < 2; c =3D f) { signed char n =3D 4073709551615; if (!(((m) >=3D 0) && ((m) <=3D 0))) { __builtin_unreachable(); } if (g) ; else { if ((m =3D k, (b =3D a(d(l, k), e) && n) || l) < k) foo= (); e =3D l =3D 0; } } } } } ```=