public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/110588] New: btl (on x86_64) not always generated
Date: Fri, 07 Jul 2023 10:02:00 +0000	[thread overview]
Message-ID: <bug-110588-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110588
           Summary: btl (on x86_64) not always generated
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-linux-gnu

Take C+ code (since I am too lazy to figure out the types):
```
unsigned char clr1_bb (unsigned char x, int y)
{
  return (x & (1<<y)) == 0;
}


unsigned char clr1_bb1 (unsigned char x, int y)
{
  auto  _1 = (int) x;
 auto _2 = _1 >> y;
 auto _3 = _2 & 1;
 auto _8 = (unsigned char) _3;
auto  _6 = _8 ^ 1;

  return _6;
}

unsigned char clr1_bb2 (unsigned char x, int y)
{
  auto  _1 = (int) x;
 auto _2 = _1 >> y;
 auto _3 = _2 & 1;
auto  _6 = _3 ^ 1;
 auto _8 = (unsigned char) _6;

  return _6;
}
```

Right now clr1_bb and clr1_bb2 produce the btl/setnc but clr1_bb1 does not.

Note I noticed this while working on PR 110539 (I changed my patch to put the
cast after the ^1 rather than before so this is not blocking that patch).

             reply	other threads:[~2023-07-07 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 10:02 pinskia at gcc dot gnu.org [this message]
2023-07-08 21:12 ` [Bug target/110588] " roger at nextmovesoftware dot com
2023-07-09  8:08 ` ubizjak at gmail dot com
2023-07-14 17:22 ` cvs-commit at gcc dot gnu.org
2023-07-23  5:06 ` roger at nextmovesoftware 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-110588-4@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).