public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110588] New: btl (on x86_64) not always generated
@ 2023-07-07 10:02 pinskia at gcc dot gnu.org
  2023-07-08 21:12 ` [Bug target/110588] " roger at nextmovesoftware dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-07 10:02 UTC (permalink / raw)
  To: gcc-bugs

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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-23  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 10:02 [Bug target/110588] New: btl (on x86_64) not always generated pinskia at gcc dot gnu.org
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

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).