From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E45B93858C00; Fri, 15 Sep 2023 19:51:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E45B93858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694807468; bh=GoMAfoogwyBJ3cq7zvCW6QM+9FRnnys4dzSD8FZ/Pno=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HFv2DUMdmAw3B5rNc6Ns81MqnGEhrOpuPmppQvJTq9OFXnvIE1oDf7WAXLBmrDlyd EA20TFC0FVnPej1Bl/H2TJTRVsl+z/67IU1SBUTfqbNdi0oslv7Og2rSXuEiUMo74w kvMyeFqIYw21yr/a7qp6TNYqdc6MMQWLzjsfGee4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110131] [12/13/14 Regression] Missed Dead Code Elimination when using __builtin_unreachable since r12-6924-gc2b610e7c6c Date: Fri, 15 Sep 2023 19:51:08 +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: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D110131 --- Comment #10 from Andrew Pinski --- (In reply to Andrew Pinski from comment #8) > With https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629128.html= we > get: > _34 =3D (int) _13; > _30 =3D (unsigned int) _13; > _22 =3D _30 =3D=3D 4294967295; > _35 =3D _22 ? _34 : 0; Maybe: (simplify (cond (eq (convert1?@4 @0) INTEGER_CST@1) (convert2? @0) INTEGER_CST@3) (if (type is a nop_conversion type from @1) (cond! @4 (convert @1) @3))) This should give: _30 =3D (unsigned int) _13; _22 =3D _30 =3D=3D 4294967295; _35 =3D _22 ? -1 : 0; if (_35 !=3D 5) _35 will -(convert)_22 really. Anyways VRP will notice that _35 can't be 5 and optimize it out.=