diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-04-18 06:10:45 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-04-18 06:10:45 +0000 |
commit | 0d21c2a2fe90663ddb7bbfa346107a0706a705c1 (patch) | |
tree | b2c04268556badfb5c3d2e0861a24fa807938af7 /gcc/testsuite | |
parent | 0ec7a4d1ee0d222e200bbb9a8cb691a4247a98e9 (diff) | |
download | gcc-0d21c2a2fe90663ddb7bbfa346107a0706a705c1.zip gcc-0d21c2a2fe90663ddb7bbfa346107a0706a705c1.tar.gz gcc-0d21c2a2fe90663ddb7bbfa346107a0706a705c1.tar.bz2 |
re PR tree-optimization/21001 (VRP is weak when the tested variable in a COND_EXPR is used only in the COND_EXPR.)
gcc/
PR tree-optimization/21001
* tree-optimize.c (init_tree_optimization_passes): Move the
first pass_forwprop immediately before pass_vrp.
testsuite/
PR tree-optimization/21001
* gcc.dg/tree-ssa/pr21001.c: New.
From-SVN: r98309
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr21001.c | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b683caf..b4e22d5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-18 Kazu Hirata <kazu@cs.umass.edu> + + PR tree-optimization/21001 + * gcc.dg/tree-ssa/pr21001.c: New. + 2005-04-17 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/21075 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c new file mode 100644 index 0000000..c274cd3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c @@ -0,0 +1,20 @@ +/* PR tree-optimization/21001 + VRP did not insert ASSERT_EXPRs when the variable tested in a + COND_EXPR is a single-use variable. By propagating the definition + of the single-use variable into the COND_EXPR, we can get useful + range infomation out of the conditional. */ + +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp-details" } */ + +int +foo (int a) +{ + int b = a != 0; + if (b) + if (a != 0) + return 1; + return 0; +} + +/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp"} } */ |