[Bug tree-optimization/126745] New: a/b -> 1 if it is known that `a==b` in VRP without DOM

"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=126745

            Bug ID: 126745
           Summary: a/b -> 1 if it is known that `a==b` in VRP without DOM
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: easyhack, missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 126010
  Target Milestone: ---

Take:
```
int f(int a, int b)
{
    if (a != b) __builtin_unreachable();
    return a/b;
}
```

This only is optimized in dom. If we are going to remove dom, then it is best
if the ranger optimizes it.


We need a op1_op2_relation_effect for the division operators.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126010
[Bug 126010] [meta-bug] Remove DOM
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.