2017-12-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81889
	* tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness): Use
	range info from the non-wrapping IV instead of just the range
	of the type.

	* gfortran.dg/pr81889.f90: New testcase.
	* gcc.dg/tree-ssa/pr64183.c: Adjust.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255573 138bc75d-0d04-0410-961f-82ee72b054a4
5 files changed