public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/109483] Unoptimal uncprop with assembler flag output
Date: Wed, 12 Apr 2023 14:40:47 +0000	[thread overview]
Message-ID: <bug-109483-4-ITOl68Go0Z@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109483-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #2)

> Note that clang seems to propagate the constant equivalence which we
> instead un-propagate.  With -fdisable-tree-uncprop1 you'll get the
> expected code:
> 
> foo:
> .LFB0:
>         .cfi_startproc
>         cmpl    $-1, %edi
>         je      .L8
> .L2:
>         movl    $1, %eax
>         ret
>         .p2align 4,,10
>         .p2align 3
> .L8:
>         xorl    %eax, %eax
> #APP
> # 6 "t.c" 1
>         int3
> # 0 "" 2
> #NO_APP
>         je      .L2
>         ret

Even the above is not optimal. I'd expect:

...
.L8:
#APP
# 6 "t.c" 1
        int3
# 0 "" 2
#NO_APP
        je      .L2
        xorl    %eax, %eax
        ret

  parent reply	other threads:[~2023-04-12 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  8:54 [Bug rtl-optimization/109483] New: Unoptimal jump threading " ubizjak at gmail dot com
2023-04-12  8:59 ` [Bug middle-end/109483] " pinskia at gcc dot gnu.org
2023-04-12 10:47 ` [Bug tree-optimization/109483] Unoptimal uncprop " rguenth at gcc dot gnu.org
2023-04-12 10:48 ` rguenth at gcc dot gnu.org
2023-04-12 14:40 ` ubizjak at gmail dot com [this message]
2023-04-12 19:43 ` pinskia 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-109483-4-ITOl68Go0Z@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).