From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D87853858D34; Wed, 21 Feb 2024 07:00:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D87853858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708498800; bh=pmUtWlIqTllsqUQC8HcXh4a+vqBOOXrucDyoFrhU7Gs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gL/Xbih3ie0r7LDX9tV7nKKeHMONYRvqNBsxuS0DLZwal6ON4/sXJ6Eu2JbHddjwE K92jGKOWFUgEHYhdQkKGa2VYnRXfevFRPAmQ9ZO1Ko/B3mofoyGb0F/O+bOX3csI2e TCMDR2ocCOV4kZbmiEh9hdfR06j954T8nExcO9Rc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102705] [12/13/14 Regression] Dead Code Elimination Regression at -O3 since r12-2637-g145bc41dae7c7bfa093d61e77346f98e6a595a0e Date: Wed, 21 Feb 2024 07:00:00 +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: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 12.4 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=3D102705 --- Comment #6 from Andrew Pinski --- Hmm: iftmp.0_10 =3D (char) _2; _4 =3D iftmp.0_10 ^ 1; _18 =3D (int) _4; We have this pattern: /* In GIMPLE, getting rid of 2 conversions for one new results in smaller IL. */ (simplify (convert (bitop:cs@2 (nop_convert:s @0) @1)) (if (GIMPLE && TREE_CODE (@1) !=3D INTEGER_CST && tree_nop_conversion_p (type, TREE_TYPE (@2)) && types_match (type, @0) && !POINTER_TYPE_P (TREE_TYPE (@0)) && TREE_CODE (TREE_TYPE (@0)) !=3D OFFSET_TYPE) (bitop @0 (convert @1))))) Except here @1 is CST and the we don't exactly have a nop_conversion, thoug= h it is a "nop" due to the nonzero-bitranges to be less than the inner type. Maybe we could expand or create a new pattern for this ...=