Commit 36d2d101 by Bernd Edlinger Committed by Jeff Law

tree-ssa-dse.c (compute_trims): Avoid folding away undefined behaviour.

	* tree-ssa-dse.c (compute_trims): Avoid folding away undefined
	behaviour.

From-SVN: r263793
parent f73a5316
2018-08-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
* tree-ssa-dse.c (compute_trims): Avoid folding away undefined
behaviour.
2018-08-22 Martin Sebor <msebor@redhat.com>
PR middle-end/87052
......
......@@ -248,6 +248,13 @@ compute_trims (ao_ref *ref, sbitmap live, int *trim_head, int *trim_tail,
residual handling in mem* and str* functions is usually
reasonably efficient. */
*trim_tail = last_orig - last_live;
/* But don't trim away out of bounds accesses, as this defeats
proper warnings. */
if (*trim_tail
&& compare_tree_int (TYPE_SIZE_UNIT (TREE_TYPE (ref->base)),
last_orig) <= 0)
*trim_tail = 0;
}
else
*trim_tail = 0;
......
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