From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C8D223858C39; Fri, 24 Nov 2023 19:52:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8D223858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700855554; bh=zHbPuEqAUDbiV+oPa0JIC9ElGPZLn1GGQ6ppe+uN5Z4=; h=From:To:Subject:Date:From; b=mL8HuM3efxyigSQRjP1ElDUDct8CrXbYmjr1x10na1JyY7tUqFqFLMVd4npfyc0Qq kMuscpPnhztAz9SczFKDuD2w16AgE+YDwmCzIv93fNvgMD+7+v8y8WuPfxjRIJ+E2+ WPX6yhGhgKEk0t54FxyWFqpz6osHPWDaQgyh4pns= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112706] New: missed simplification in FRE Date: Fri, 24 Nov 2023 19:52:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D112706 Bug ID: 112706 Summary: missed simplification in FRE Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- Compiling the following testcase (simplified from repeated std::vector::push_back expansion): int *ptr; void link_error (); void test () { int *ptr1 =3D ptr + 10; int *ptr2 =3D ptr + 20; if (ptr1 =3D=3D ptr2) link_error (); } with gcc -O2 t.C -fdump-tree-all-details one can check that link_error is optimized away really late: jh@ryzen4:/tmp> grep link_error a-t.C* .... a-t.C.106t.cunrolli: link_error (); a-t.C.107t.backprop: link_error (); a-t.C.108t.phiprop: link_error (); a-t.C.109t.forwprop2:link_error (); this is too late for some optimization to catch up (in the case of std::vec= tor we end up missing DSE since the transform is delayed to forwprop3) I think this is something value numbering should catch.=