From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 641E1385DC06; Tue, 14 Apr 2020 21:20:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 641E1385DC06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586899205; bh=eV1HB5XjdcWYth/fADiAuIXrqCkwGCFCBf+B6jXsS6I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xX34I6ifC2cEtz6LkcFO+/ryBRElH4ZXJK/ty93hnyGm26PMTFpQi4op8r8wwK85M pvIh6kjn/BtjXPTJM2l5TxRBlKqTgNMPj0H3PQ4P02/rUXy+ak9QtYoE/Az40Z+QFx l6wj2pH1FWloml/aJGK7Axur1kxU0NRG+jtRjiXk= From: "peter at cordes dot ca" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/39942] Nonoptimal code - leaveq; xchg %ax,%ax; retq Date: Tue, 14 Apr 2020 21:20:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.3.2 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: minor X-Bugzilla-Who: peter at cordes dot ca 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: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 21:20:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D39942 Peter Cordes changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |peter at cordes dot ca --- Comment #53 from Peter Cordes --- I think we can close this as fixed at some point. The last activity on this bug was some patches that sound like they were supposed to fix, and the MCV= Es from comments I tested no longer has a problem. GCC9.3 -O3 -march=3Dcore2 -fomit-frame-pointer only uses a `.p2align` to al= ign the top of the loop, not between leave and ret or between cmp/jcc. void wait_for_enter() { volatile int foo =3D 0; // to get a LEAVE instruction emitted at all int u =3D getchar(); while (!u) u =3D getchar()-13; } https://godbolt.org/z/RvxzZv (Note that Godbolt normally filters .p2align so you have to either compile = to binary or not filter directives in the asm source. Otherwise you'll never = see NOPs except in the unusual case where GCC actually emits a nop mnemonic.)=