public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/109147] New: Missing IPA-VRP for return values
@ 2023-03-15 17:01 jakub at gcc dot gnu.org
  2023-03-15 17:03 ` [Bug testsuite/109147] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-15 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109147
           Summary: Missing IPA-VRP for return values
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: david.spickett at linaro dot org, unassigned at gcc dot gnu.org
        Depends on: 109146
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #109146 +++

I guess we should turn this primarily into an enhancement request to optimize
this.
I believe that is a request for return value ranges in IPA-VRP.

So a testcase could be:
__attribute__((noinline)) static int
foo (int a, int b)
{
  return a == b;
}

int
bar (int a, int b)
{
  return foo (a, b) != 0;
}

__attribute__((noinline)) static int
baz (int a)
{
  if (a > 10 || a < -10)
    return 0;
  return a;
}

int
qux (int a)
{
  return baz (a) == 42;
}

where if we determine that foo always returns [0, 1] and baz [-10, 10], then we
can
optimize that return ret != 0; into return ret; and ret == 42 into 0.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109146
[Bug 109146] Tail call prevention in frame-address.c is not correct

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

* [Bug testsuite/109147] Missing IPA-VRP for return values
  2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
@ 2023-03-15 17:03 ` pinskia at gcc dot gnu.org
  2023-03-15 17:07 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-15 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Isn't this a dup of bug 81323 ?

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

* [Bug testsuite/109147] Missing IPA-VRP for return values
  2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
  2023-03-15 17:03 ` [Bug testsuite/109147] " pinskia at gcc dot gnu.org
@ 2023-03-15 17:07 ` jakub at gcc dot gnu.org
  2023-03-15 17:16 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-15 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 81313 ***

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

* [Bug testsuite/109147] Missing IPA-VRP for return values
  2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
  2023-03-15 17:03 ` [Bug testsuite/109147] " pinskia at gcc dot gnu.org
  2023-03-15 17:07 ` jakub at gcc dot gnu.org
@ 2023-03-15 17:16 ` jakub at gcc dot gnu.org
  2023-03-15 17:16 ` jakub at gcc dot gnu.org
  2023-12-06 18:59 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-15 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
         Resolution|DUPLICATE                   |---
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2023-03-15

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
.

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

* [Bug testsuite/109147] Missing IPA-VRP for return values
  2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-03-15 17:16 ` jakub at gcc dot gnu.org
@ 2023-03-15 17:16 ` jakub at gcc dot gnu.org
  2023-12-06 18:59 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-15 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
.

*** This bug has been marked as a duplicate of bug 81323 ***

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

* [Bug testsuite/109147] Missing IPA-VRP for return values
  2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-03-15 17:16 ` jakub at gcc dot gnu.org
@ 2023-12-06 18:59 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-06 18:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109147
Bug 109147 depends on bug 109146, which changed state.

Bug 109146 Summary: Tail call prevention in frame-address.c is not correct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109146

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

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

end of thread, other threads:[~2023-12-06 18:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 17:01 [Bug testsuite/109147] New: Missing IPA-VRP for return values jakub at gcc dot gnu.org
2023-03-15 17:03 ` [Bug testsuite/109147] " pinskia at gcc dot gnu.org
2023-03-15 17:07 ` jakub at gcc dot gnu.org
2023-03-15 17:16 ` jakub at gcc dot gnu.org
2023-03-15 17:16 ` jakub at gcc dot gnu.org
2023-12-06 18:59 ` 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).