public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "socketpair at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug regression/107767] GCC has some problems in optimizer of trivial case
Date: Sun, 20 Nov 2022 13:02:32 +0000	[thread overview]
Message-ID: <bug-107767-4-O3vhi4wnRO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107767-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Коренберг Марк <socketpair at gmail dot com> ---
See assembler output for firewall2(). It's not -Os optimized (compare to
firewall(), which is ok)


```
firewall:
        movw    64(%rdi), %ax
        cmpb    $17, (%rdi)
        sete    %cl
        leal    -15(%rax), %edx
        testw   $-9, %dx
        movb    $1, %dl
        sete    %sil
        cmpw    $47, %ax
        ja      .L2
        movabsq $-180319906955279, %rdx
        btq     %rax, %rdx
        setc    %dl
.L2:
        movl    %edx, %eax
        xorl    $1, %eax
        orl     %esi, %eax
        andl    %ecx, %eax
        movzbl  %al, %eax
        ret
firewall2:
        movw    64(%rdi), %ax
        xorl    %edx, %edx
        decl    %eax
        cmpw    $46, %ax
        ja      .L5
        movzwl  %ax, %eax
        movsbl  CSWTCH.2(%rax), %edx
.L5:
        movl    %edx, %eax
        ret
CSWTCH.2:
        .byte   1
        .byte   1
        .byte   1
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   1
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   1
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   0
        .byte   1
        .byte   0
        .byte   0
        .byte   1
        .byte   0
        .byte   1
```

  reply	other threads:[~2022-11-20 13:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 13:00 [Bug regression/107767] New: " socketpair at gmail dot com
2022-11-20 13:02 ` socketpair at gmail dot com [this message]
2022-11-21  8:46 ` [Bug regression/107767] " marxin at gcc dot gnu.org
2022-11-21 10:33 ` socketpair at gmail dot com
2022-11-21 15:57 ` [Bug tree-optimization/107767] [13 Regression] " pinskia at gcc dot gnu.org
2022-12-02 14:27 ` [Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better marxin at gcc dot gnu.org
2022-12-02 14:54 ` socketpair at gmail dot com
2022-12-02 15:00 ` marxin at gcc dot gnu.org
2022-12-02 15:07 ` marxin at gcc dot gnu.org
2022-12-02 15:15 ` socketpair at gmail dot com
2022-12-02 15:17 ` jakub at gcc dot gnu.org
2022-12-02 15:27 ` rguenth at gcc dot gnu.org
2022-12-02 15:31 ` jakub at gcc dot gnu.org
2022-12-02 15:44 ` jakub at gcc dot gnu.org
2022-12-05 14:49 ` marxin at gcc dot gnu.org
2022-12-21  9:46 ` rguenth at gcc dot gnu.org
2022-12-23 14:05 ` marxin at gcc dot gnu.org
2023-01-04 14:26 ` jakub at gcc dot gnu.org
2023-01-06 12:36 ` marxin at gcc dot gnu.org
2023-01-09 10:02 ` rguenth at gcc dot gnu.org
2023-01-11 12:14 ` cvs-commit at gcc dot gnu.org
2023-01-11 12:14 ` rguenth at gcc dot gnu.org

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-107767-4-O3vhi4wnRO@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).