Commit 9a4dbf91 by Martin Liska Committed by Martin Liska

Fix compile-time hog in MPX boundary checking (PR target/84988).

2018-03-21  Martin Liska  <mliska@suse.cz>

	PR target/84988
	* tree-chkp.c (CHKP_ARRAY_MAX_CHECK_STEPS): Define a new macro.
	(chkp_find_bound_slots_1): Limit number of iterations.

From-SVN: r258704
parent 1bdbef09
2018-03-21 Martin Liska <mliska@suse.cz>
PR target/84988
* tree-chkp.c (CHKP_ARRAY_MAX_CHECK_STEPS): Define a new macro.
(chkp_find_bound_slots_1): Limit number of iterations.
2018-03-20 David H. Gutteridge <dhgutteridge@sympatico.ca>
PR target/84838
......
......@@ -1688,6 +1688,10 @@ chkp_find_bounds_for_elem (tree elem, tree *all_bounds,
}
}
/* Maximum number of elements to check in an array. */
#define CHKP_ARRAY_MAX_CHECK_STEPS 4096
/* Fill HAVE_BOUND output bitmap with information about
bounds requred for object of type TYPE.
......@@ -1733,7 +1737,9 @@ chkp_find_bound_slots_1 (const_tree type, bitmap have_bound,
|| integer_minus_onep (maxval))
return;
for (cur = 0; cur <= TREE_INT_CST_LOW (maxval); cur++)
for (cur = 0;
cur <= MIN (CHKP_ARRAY_MAX_CHECK_STEPS, TREE_INT_CST_LOW (maxval));
cur++)
chkp_find_bound_slots_1 (etype, have_bound, offs + cur * esize);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment