public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110199] New: [12/13/14 Regression] Missing VRP transformation with MIN_EXPR and known relation
@ 2023-06-09 22:28 pinskia at gcc dot gnu.org
  2023-06-09 22:28 ` [Bug tree-optimization/110199] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-09 22:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110199
           Summary: [12/13/14 Regression] Missing VRP transformation with
                    MIN_EXPR and known relation
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int test(int a, int b)
{
    if (a <= b)
        return a < b ? a : b;
    return 0;
}
```
This used to be optimized in GCC 11 and before via EVRP:

pushing new range for b_3(D): int [a_2(D), +INF]  EQUIVALENCES: { b_3(D) } (1
elements)
evrp visiting stmt _5 = MIN_EXPR <a_2(D), b_3(D)>;

extract_range_from_stmt visiting:
_5 = MIN_EXPR <a_2(D), b_3(D)>;
Intersecting
  int VARYING
and
  int VARYING
to
  int VARYING
Folding statement: _5 = MIN_EXPR <a_2(D), b_3(D)>;
Folded into: _5 = a_2(D);


But in GCC 12 and above it is missed:
Folding statement: _5 = MIN_EXPR <a_2(D), b_3(D)>;
 folding with relation a_2(D) <= b_3(D)
Not folded

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

end of thread, other threads:[~2024-03-10 18:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09 22:28 [Bug tree-optimization/110199] New: [12/13/14 Regression] Missing VRP transformation with MIN_EXPR and known relation pinskia at gcc dot gnu.org
2023-06-09 22:28 ` [Bug tree-optimization/110199] " pinskia at gcc dot gnu.org
2023-06-09 22:29 ` pinskia at gcc dot gnu.org
2023-06-12  8:11 ` rguenth at gcc dot gnu.org
2023-08-11 23:57 ` pinskia at gcc dot gnu.org
2023-12-12 21:59 ` amacleod at redhat dot com
2024-03-06 16:13 ` jakub at gcc dot gnu.org
2024-03-06 16:47 ` amacleod at redhat dot com
2024-03-07 13:34 ` law at gcc dot gnu.org
2024-03-10 18:05 ` cvs-commit 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).