* tree-scalar-evolution.c (iv_can_overflow_p): export.
* tree-scalar-evolution.h (iv_can_overflow_p): Declare.
* tree-ssa-loop-ivopts.c (alloc_iv): Use it.
From-SVN: r238088
+2016-07-07 Jan Hubicka <jh@suse.cz>
+
+ * tree-scalar-evolution.c (iv_can_overflow_p): export.
+ * tree-scalar-evolution.h (iv_can_overflow_p): Declare.
+ * tree-ssa-loop-ivopts.c (alloc_iv): Use it.
+
2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com>
PR ipa/71624
use this test even for derived IVs not computed every iteration or
hypotetical IVs to be inserted into code. */
-static bool
+bool
iv_can_overflow_p (struct loop *loop, tree type, tree base, tree step)
{
widest_int nit;
extern bool expression_expensive_p (tree);
extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *,
bool);
+extern bool iv_can_overflow_p (struct loop *, tree, tree, tree);
extern tree compute_overall_effect_of_inner_loop (struct loop *, tree);
/* Returns the basic block preceding LOOP, or the CFG entry block when
iv->biv_p = false;
iv->nonlin_use = NULL;
iv->ssa_name = NULL_TREE;
+ if (!no_overflow
+ && !iv_can_overflow_p (data->current_loop, TREE_TYPE (base),
+ base, step))
+ no_overflow = true;
iv->no_overflow = no_overflow;
iv->have_address_use = false;