public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-110724-4-2g412nPn8V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110724-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110724

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
We perform jump target alignment to optimize frontend (instruction decoding).
The reporter is correct that if the jump target only contains an unconditional
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 <duff+0x45>
  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).

  parent reply	other threads:[~2023-07-19  6:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 17:11 [Bug rtl-optimization/110724] New: " javier.martinez.bugzilla at gmail dot com
2023-07-18 17:38 ` [Bug middle-end/110724] " pinskia at gcc dot gnu.org
2023-07-18 17:48 ` pinskia at gcc dot gnu.org
2023-07-18 19:07 ` javier.martinez.bugzilla at gmail dot com
2023-07-18 20:00 ` [Bug target/110724] " pinskia at gcc dot gnu.org
2023-07-18 20:02 ` pinskia at gcc dot gnu.org
2023-07-19  6:46 ` rguenth at gcc dot gnu.org [this message]
2023-07-19  8:26 ` javier.martinez.bugzilla at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110724-4-2g412nPn8V@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).