public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110637] New: (type)(zeroonep !=/== 0) should be optimized as (type)zeroonep/zeroonep^1 earlier than vrp
@ 2023-07-12  7:25 pinskia at gcc dot gnu.org
  2023-07-12  7:26 ` [Bug tree-optimization/110637] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-12  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110637
           Summary: (type)(zeroonep !=/== 0) should be optimized as
                    (type)zeroonep/zeroonep^1 earlier than vrp
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int f(int t)
{
 t &= 1;
 return t != 0;
}
```
Currently this only gets optimized at -O2 (due to VRP) to:
  _4 = t_1(D) & 1;
  return _4;

Likewise for:
```
int g(int t)
{
 t &= 1;
 return t == 0;
}
```

This was originally how I was going to solve PR 110539 but when we should
optimize to those gets in the way of other optimizations so I decided to fix PR
110539 a different way.

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

end of thread, other threads:[~2023-12-11 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  7:25 [Bug tree-optimization/110637] New: (type)(zeroonep !=/== 0) should be optimized as (type)zeroonep/zeroonep^1 earlier than vrp pinskia at gcc dot gnu.org
2023-07-12  7:26 ` [Bug tree-optimization/110637] " pinskia at gcc dot gnu.org
2023-07-12  8:06 ` rguenth at gcc dot gnu.org
2023-12-11 15:56 ` cvs-commit at gcc dot gnu.org
2023-12-11 15:58 ` pinskia at gcc dot gnu.org

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