public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/100802] New: VRP fails to fold comparison with known value orders
@ 2021-05-27 14:56 fxue at os dot amperecomputing.com
  2021-11-05 21:40 ` [Bug tree-optimization/100802] VRP fails to fold comparison using " amacleod at redhat dot com
  2021-11-16  1:49 ` fxue at os dot amperecomputing.com
  0 siblings, 2 replies; 3+ messages in thread
From: fxue at os dot amperecomputing.com @ 2021-05-27 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100802
           Summary: VRP fails to fold comparison with known value orders
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxue at os dot amperecomputing.com
  Target Milestone: ---

In the case below, it is obvious that we have value orders as i < a <= b inside
loop. So "if (i >= b)" could be optimized away, but VRP fails to do that.


int f1();
int f2();

int foo (unsigned a, unsigned b)
{
   if (a <= b)
    {
       for (unsigned i = 0; i < a; i++)
         {
            f1 ();

            if (i >= b)
              f2 ();
         }

    }

  return 0;
}

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

* [Bug tree-optimization/100802] VRP fails to fold comparison using known value orders
  2021-05-27 14:56 [Bug tree-optimization/100802] New: VRP fails to fold comparison with known value orders fxue at os dot amperecomputing.com
@ 2021-11-05 21:40 ` amacleod at redhat dot com
  2021-11-16  1:49 ` fxue at os dot amperecomputing.com
  1 sibling, 0 replies; 3+ messages in thread
From: amacleod at redhat dot com @ 2021-11-05 21:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Macleod <amacleod at redhat dot com> ---
This was fixed by the relation oracle a while ago.

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

* [Bug tree-optimization/100802] VRP fails to fold comparison using known value orders
  2021-05-27 14:56 [Bug tree-optimization/100802] New: VRP fails to fold comparison with known value orders fxue at os dot amperecomputing.com
  2021-11-05 21:40 ` [Bug tree-optimization/100802] VRP fails to fold comparison using " amacleod at redhat dot com
@ 2021-11-16  1:49 ` fxue at os dot amperecomputing.com
  1 sibling, 0 replies; 3+ messages in thread
From: fxue at os dot amperecomputing.com @ 2021-11-16  1:49 UTC (permalink / raw)
  To: gcc-bugs

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

Feng Xue <fxue at os dot amperecomputing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #2 from Feng Xue <fxue at os dot amperecomputing.com> ---
Verified.

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

end of thread, other threads:[~2021-11-16  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 14:56 [Bug tree-optimization/100802] New: VRP fails to fold comparison with known value orders fxue at os dot amperecomputing.com
2021-11-05 21:40 ` [Bug tree-optimization/100802] VRP fails to fold comparison using " amacleod at redhat dot com
2021-11-16  1:49 ` fxue at os dot amperecomputing.com

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