aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-06-30 16:56:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2009-06-30 14:56:37 +0000
commit2de58650f962e371b06f00bdefd0b01b5f7e3f6a (patch)
treeb0873a32071a823e01701ec13011a3c5038ec083 /gcc/ipa-pure-const.c
parent46db44ccaea515d561f7a63d0e07ee6ddbc1b869 (diff)
downloadgcc-2de58650f962e371b06f00bdefd0b01b5f7e3f6a.zip
gcc-2de58650f962e371b06f00bdefd0b01b5f7e3f6a.tar.gz
gcc-2de58650f962e371b06f00bdefd0b01b5f7e3f6a.tar.bz2
cfgloopanal.c (check_irred): Move into ...
* cfgloopanal.c (check_irred): Move into ... (mark_irreducible_loops): ... here; return true if ireducible loops was found. * ipa-pure-const.c: Include cfgloop.h and tree-scalar-evolution.h (analyze_function): Try to prove loop finiteness. * cfgloop.h (mark_irreducible_loops): Update prototype. * Makefile.in (ipa-pure-const.o): Add dependency on SCEV and CFGLOOP. From-SVN: r149101
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 35d27a3..8faa00c 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -51,6 +51,8 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "langhooks.h"
#include "target.h"
+#include "cfgloop.h"
+#include "tree-scalar-evolution.h"
static struct pointer_set_t *visited_nodes;
@@ -522,8 +524,33 @@ end:
indication of possible infinite loop side
effect. */
if (mark_dfs_back_edges ())
- l->looping = true;
-
+ {
+ loop_optimizer_init (LOOPS_HAVE_PREHEADERS);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ flow_loops_dump (dump_file, NULL, 0);
+ if (mark_irreducible_loops ())
+ {
+ if (dump_file)
+ fprintf (dump_file, " has irreducible loops\n");
+ l->looping = true;
+ }
+ else
+ {
+ loop_iterator li;
+ struct loop *loop;
+ scev_initialize ();
+ FOR_EACH_LOOP (li, loop, 0)
+ if (!finite_loop_p (loop))
+ {
+ if (dump_file)
+ fprintf (dump_file, " can not prove finiteness of loop %i\n", loop->num);
+ l->looping =true;
+ break;
+ }
+ scev_finalize ();
+ }
+ loop_optimizer_finalize ();
+ }
}
if (TREE_READONLY (decl))