public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "avi at scylladb dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/104484] -freorder-block-and-partition not splitting into sections with __builin_expect()
Date: Thu, 10 Feb 2022 13:02:09 +0000 [thread overview]
Message-ID: <bug-104484-4-HRENGHsiDE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104484-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104484
--- Comment #2 from Avi Kivity <avi at scylladb dot com> ---
(In reply to Andrew Pinski from comment #1)
> But the assembly output does not make sense to the code you gave either.
Apart from the missing .section directives, I didn't notice anything odd. Maybe
movl/testl could be optimized into cmpl.
Ah, I moved this code from C++ so the function signatures are bad, should be
fun(void). With the signatures adjusted, I get
light:
.LFB2:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
call fun
movl f1(%rip), %edx
testl %edx, %edx
jne .L8
.L6:
addq $8, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 8
jmp fun
.p2align 4,,10
.p2align 3
.L8:
.cfi_restore_state
movl f2(%rip), %eax
testl %eax, %eax
je .L6
call very_heavy
jmp .L6
.cfi_endproc
Which still misses the .section directives and the peephole optimization to
merge movl/testl.
next prev parent reply other threads:[~2022-02-10 13:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 11:22 [Bug tree-optimization/104484] New: " avi at scylladb dot com
2022-02-10 12:01 ` [Bug rtl-optimization/104484] " pinskia at gcc dot gnu.org
2022-02-10 13:02 ` avi at scylladb dot com [this message]
2022-02-10 22:19 ` pinskia at gcc dot gnu.org
2022-02-12 13:22 ` avi at scylladb 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-104484-4-HRENGHsiDE@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).