[Bug rtl-optimization/126914] [17 regressions] noce_try_shifted_store_flag pessimizes "if (c) x = x OP 2^n" on targets with cheap conditional moves

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126914

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |17.0
           Keywords|                            |missed-optimization

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
I noticed a similar issue on aarch64 but I had not had a chance to figure which
one is better.

Note the gimple level in some cases will produce a similar result here. So this
is a big odd.

If we did:
```
long f(int a, long b)
{
  long t = (a ? 8 : 0);
  b |= t;
  return b;
}
long f2(int a, long b)
{
  if (a)
    b |= 8;
  return b;
}
```

For GCC 16, GCC would produce different code gen while for the trunk it is the
same.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.