diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-10-20 13:37:29 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-10-25 19:39:49 -0400 |
commit | cb153222404e2e149aa65a4b3139b09477551203 (patch) | |
tree | d40eda7eabd8e07cf11d793e3db18afbf0d454b8 /gcc/tree-vrp.c | |
parent | 90205f67e465ae7dfcf733c2b2b177ca7ff68da0 (diff) | |
download | gcc-cb153222404e2e149aa65a4b3139b09477551203.zip gcc-cb153222404e2e149aa65a4b3139b09477551203.tar.gz gcc-cb153222404e2e149aa65a4b3139b09477551203.tar.bz2 |
Fold all statements in Ranger VRP.
Until now, ranger VRP has only simplified statements with ranges. This patch
enables us to fold all statements.
gcc/
* tree-vrp.c (rvrp_folder::fold_stmt): If simplification fails, try
to fold anyway.
gcc/testsuite/
* gcc.dg/tree-ssa/vrp98.c: Disable evrp for vrp1 test.
* gcc.dg/tree-ssa/vrp98-1.c: New. Test for folding in evrp.
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index ba7a4ef..a948c52 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-range.h" #include "gimple-range-path.h" #include "value-pointer-equiv.h" +#include "gimple-fold.h" /* Set of SSA names found live during the RPO traversal of the function for still active basic-blocks. */ @@ -4381,7 +4382,9 @@ public: bool fold_stmt (gimple_stmt_iterator *gsi) OVERRIDE { - return m_simplifier.simplify (gsi); + if (m_simplifier.simplify (gsi)) + return true; + return ::fold_stmt (gsi, follow_single_use_edges); } private: |