diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2012-10-31 21:37:10 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2012-10-31 21:37:10 +0000 |
commit | 03b06a83441cac588cf04f494915ffd3868a9bed (patch) | |
tree | 457138650afbcc0d91ef7e60a9f2ca4718a4b83d /gcc/testsuite/gcc.dg | |
parent | e212c7f56c62dc492e7d2af6d55636d19229d114 (diff) | |
download | gcc-03b06a83441cac588cf04f494915ffd3868a9bed.zip gcc-03b06a83441cac588cf04f494915ffd3868a9bed.tar.gz gcc-03b06a83441cac588cf04f494915ffd3868a9bed.tar.bz2 |
re PR tree-optimization/55018 (CDDCE pass is too aggressive sometimes with infinite loops and with some functions)
gcc/
PR tree-optimization/55018
* basic-block.h (dfs_find_deadend): New prototype.
* cfganal.c (dfs_find_deadend): No longer static. Use bitmap
instead of sbitmap for visited.
(flow_dfs_compute_reverse_execute): Use dfs_find_deadend here, too.
* dominance.c (calc_dfs_tree): If saw_unconnected,
traverse from dfs_find_deadend of unconnected b
instead of b directly.
testsuite/
PR tree-optimization/55018
* gcc.dg/torture/pr55018.c: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r193047
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr55018.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr55018.c b/gcc/testsuite/gcc.dg/torture/pr55018.c new file mode 100644 index 0000000..f9f34bc --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr55018.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/55018 */ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-optimized" } */ + +void +foo (int x) +{ + unsigned int a = 0; + int b = 3; + if (x) + b = 0; +lab: + if (x) + goto lab; + a++; + if (b != 2) + __builtin_printf ("%u", a); + goto lab; +} + +/* { dg-final { scan-tree-dump "printf" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |