diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-07-14 15:52:21 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-07-14 13:52:21 +0000 |
commit | 21bcd7bedde07878098db00fc4042a85939077a2 (patch) | |
tree | c64e3b6ecc0d7508eecfd453d8dd19500d078863 /gcc/tree-ssa-loop-niter.c | |
parent | 91f35b7f975ae3c36d2719ca15b33421c356fcb1 (diff) | |
download | gcc-21bcd7bedde07878098db00fc4042a85939077a2.zip gcc-21bcd7bedde07878098db00fc4042a85939077a2.tar.gz gcc-21bcd7bedde07878098db00fc4042a85939077a2.tar.bz2 |
gimple.h (stmt_can_terminate_bb_p): New function.
* gimple.h (stmt_can_terminate_bb_p): New function.
* tree-cfg.c (need_fake_edge_p): Rename to ...
(stmt_can_terminate_bb_p): ... this; return true if stmt can
throw external; handle const and pure calls.
* tree-ssa-loop-niter.c (loop_only_exit_p): Use it.
From-SVN: r238336
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 732e06a..182753c 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2159,7 +2159,6 @@ loop_only_exit_p (const struct loop *loop, const_edge exit) basic_block *body; gimple_stmt_iterator bsi; unsigned i; - gimple *call; if (exit != single_exit (loop)) return false; @@ -2168,17 +2167,8 @@ loop_only_exit_p (const struct loop *loop, const_edge exit) for (i = 0; i < loop->num_nodes; i++) { for (bsi = gsi_start_bb (body[i]); !gsi_end_p (bsi); gsi_next (&bsi)) - { - call = gsi_stmt (bsi); - if (gimple_code (call) != GIMPLE_CALL) - continue; - - if (gimple_has_side_effects (call)) - { - free (body); - return false; - } - } + if (stmt_can_terminate_bb_p (gsi_stmt (bsi))) + return true; } free (body); |