summaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 14:56:37 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 14:56:37 +0000
commitc9263b6ae9ed89de1d863122015ac3d304e24ec3 (patch)
treeb0873a32071a823e01701ec13011a3c5038ec083 /gcc/ipa-pure-const.c
parent2bda5ce3fb27776ec40d1912bdce9b6d377a9b6f (diff)
downloadgcc-c9263b6ae9ed89de1d863122015ac3d304e24ec3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149101 138bc75d-0d04-0410-961f-82ee72b054a4
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 35d27a33696..8faa00c3b0e 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))