From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 671F03858C33; Wed, 19 Jul 2023 06:46:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 671F03858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689749201; bh=+iSJKqYCGyHCfNGqtrue3kHxze2VItQOYT2bSsrjib4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A4SPdAsXaDEOapFzsuL11FZNDCtvSvG/Y8LdpCi0tIIMi60SkQcTNuVfpIWF4rvq8 TwC/DMOpigtF8b6MOuGr+81jBnMzhk60ihnITaXw/s2oQ3jMgMWMhNCfN2fj8qT9dC jgpETrZKQqxcKsKU3RAy8CvunsyL3jj5eXIOvg+o= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110724] Unnecessary alignment on branch to unconditional branch targets Date: Wed, 19 Jul 2023 06:46:40 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: bug_status 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110724 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW CC| |hubicka at gcc dot gnu.org --- Comment #6 from Richard Biener --- We perform jump target alignment to optimize frontend (instruction decoding= ). The reporter is correct that if the jump target only contains an unconditio= nal control transfer elsewhere such alignment is moot unless this jump itself crosses an instruction fetch boundary. a0: 89 50 fc mov %edx,-0x4(%rax) a3: 8b 11 mov (%rcx),%edx a5: 48 83 c1 04 add $0x4,%rcx a9: 89 10 mov %edx,(%rax) ab: 48 83 c0 04 add $0x4,%rax af: eb 94 jmp 45 b1: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) b8: c3 ret b9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) c0: 48 89 cf mov %rcx,%rdi so that doesn't seem to be the case here (in fact since 'ret' is a single byte it never crosses a fetch boundary but other uncond jumps might).=