public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106164] New: (a > b) & (a >= b) does not get optimized until reassoc1
@ 2022-07-01 22:39 pinskia at gcc dot gnu.org
  2022-07-01 23:45 ` [Bug tree-optimization/106164] " pinskia at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-01 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106164
           Summary: (a > b) & (a >= b) does not get optimized until
                    reassoc1
           Product: gcc
           Version: 12.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
            Blocks: 105903
  Target Milestone: ---

Take:
```
_Bool f(int a, int b)
{
  _Bool c = a > b;
  _Bool d = a >= b;
  return c & d;
}
```
This does not get optimized until reassoc1.
While:
```
_Bool f(int a, int b)
{
  return (a > b) & (a >= b);
}
```
Gets optimized during folding (not by match though), I have not looked into
what does it though.

I noticed this while working on PR 105903 as there is not a reassoc pass after
phiopt4 so nothing optimizes.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105903
[Bug 105903] Missed optimization for __synth3way

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

end of thread, other threads:[~2023-11-05  6:10 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 22:39 [Bug tree-optimization/106164] New: (a > b) & (a >= b) does not get optimized until reassoc1 pinskia at gcc dot gnu.org
2022-07-01 23:45 ` [Bug tree-optimization/106164] " pinskia at gcc dot gnu.org
2022-07-02  4:22 ` pinskia at gcc dot gnu.org
2022-07-02  4:23 ` pinskia at gcc dot gnu.org
2022-07-02  5:12 ` pinskia at gcc dot gnu.org
2022-07-04  6:38 ` rguenth at gcc dot gnu.org
2023-07-29 23:53 ` pinskia at gcc dot gnu.org
2023-07-30  3:00 ` pinskia at gcc dot gnu.org
2023-07-30  3:47 ` pinskia at gcc dot gnu.org
2023-07-30  5:09 ` pinskia at gcc dot gnu.org
2023-07-31  5:37 ` pinskia at gcc dot gnu.org
2023-07-31  7:08 ` rguenther at suse dot de
2023-07-31 17:12 ` cvs-commit at gcc dot gnu.org
2023-07-31 17:12 ` cvs-commit at gcc dot gnu.org
2023-09-14  0:09 ` pinskia at gcc dot gnu.org
2023-09-14  0:38 ` pinskia at gcc dot gnu.org
2023-09-14  5:34 ` pinskia at gcc dot gnu.org
2023-09-14 14:30 ` cvs-commit at gcc dot gnu.org
2023-09-14 14:36 ` pinskia at gcc dot gnu.org
2023-09-19  0:36 ` pinskia at gcc dot gnu.org
2023-09-19  2:46 ` pinskia at gcc dot gnu.org
2023-09-20 22:41 ` pinskia at gcc dot gnu.org
2023-09-26 15:01 ` cvs-commit at gcc dot gnu.org
2023-11-05  6:08 ` pinskia at gcc dot gnu.org
2023-11-05  6:10 ` 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).