diff options
author | Richard Guenther <rguenther@suse.de> | 2008-08-20 16:01:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-08-20 16:01:59 +0000 |
commit | 73019a428f45b47ebae03a759afd7f3501c165db (patch) | |
tree | 419cd5f1c04c0deebf41c1385131c1fc52352584 /gcc/testsuite/gcc.dg/tree-ssa/pr21829.c | |
parent | e2104f59c475b30f600bdd812904a508a2d15721 (diff) | |
download | gcc-73019a428f45b47ebae03a759afd7f3501c165db.zip gcc-73019a428f45b47ebae03a759afd7f3501c165db.tar.gz gcc-73019a428f45b47ebae03a759afd7f3501c165db.tar.bz2 |
tree-vrp.c (op_with_constant_singleton_value_range): New function.
2008-08-20 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (op_with_constant_singleton_value_range): New function.
(extract_range_from_binary_expr): Fall back to constant propagation.
(extract_range_from_unary_expr): Likewise.
* gcc.dg/tree-ssa/pr21829.c: Scan optimized and cddce2 dumps
instead of phicprop2. Make sure all is fine after cddce2,
add an XFAILed scan for merging the two remaining ifs.
From-SVN: r139326
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr21829.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr21829.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c index 2f7078c..6b5c4bb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-phicprop-details" } */ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-cddce2" } */ int test(int v) { @@ -16,6 +16,33 @@ int test(int v) return x; } -/* { dg-final { scan-tree-dump-times "Original statement:.*% 2\[ \t\n]*Updated statement.*=1" 0 "phicprop2" } } */ -/* { dg-final { cleanup-tree-dump "phicprop\[1-2\]" } } */ +/* This should be optimized to + if (v <= 0) goto <L1>; else goto <L3>; + + <L1>:; + + # x_1 = PHI <0(3), 1(1)>; + <L3>:; + return x_1; + + retaining only a single conditional. This doesn't work as nobody + combines the two tests + + if (v < 0) goto <bb 4>; else goto <bb 3>; + + <bb 3>: + + if (v <= 0) goto <bb 4>; else goto <bb 5>; + + this late in the game. tree-ssa-ifcombine.c would do it if we would + unroll the loop during early loop unrolling though. + + For now vrp2 does all the needed folding and threading and cddce2 + provides a nice IL to scan. */ + +/* { dg-final { scan-tree-dump-times "if " 1 "optimized" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "if " 2 "cddce2" } } */ +/* { dg-final { scan-tree-dump "x_. = PHI <0\\\(.\\\), 1\\\(.\\\)>" "cddce2" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |