From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 778673858C53; Sun, 23 Apr 2023 18:58:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 778673858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682276282; bh=1cgmIeYK+BaPon0qnItRGuqNV4NzSM53s+PyhKZ+HkY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ivEQBrgLo28vrJMUrweUTTHySDy7rR72Ar9QVAkGKIw1wClokDLT6+cSjIIM4yIDt V//MlN5iLr8GDCcJZTViNtDHJ0O+QkYssnl3OG5vkiI7LuJaIPHYZARFCaaINtAaCD kf5GQoNCtCF5U3pcyQNH9cDFLcHew1jGM1Ypx6YA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/109601] Useless branch not eliminated when writing to a union Date: Sun, 23 Apr 2023 18:58:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.2.1 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: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status everconfirmed 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=3D109601 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-04-23 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski --- x86 duplicated the simple return but never unduplicates it: (jump_insn 27 12 28 3 (simple_return) 1030 {simple_return_internal} (nil) -> simple_return) ... (jump_insn 32 31 33 4 (simple_return) "/app/example.cpp":29:1 -1 (nil) -> simple_return) But simple_return was only added in GCC 4.7.0 (r0-111280-g268987713c7105c69= 1) So something else changed. There is also a missed optimization earlier because jump2 is way late to be optimizing this case. Also this is just an issue with return so it might not be as important as m= ost people think (the other missed optimization earlier is though).=