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