Hi, Loop niter computes inaccurate bound information for different loops. This patch is to improve it by using loop initial condition in determine_value_range. Generally, loop niter is computed by subtracting start var from end var in loop exit condition. Moreover, loop bound is computed using value range information of both start and end variables. Basic idea of this patch is to check if loop initial condition implies more range information for both start/end variables. If yes, we refine range information and use that to compute loop bound. With this improvement, more accurate loop bound information is computed for test cases added by this patch. Is it OK? Thanks, bin 2015-07-28 Bin Cheng * tree-ssa-loop-niter.c (refine_value_range_using_guard): New. (determine_value_range): Call refine_value_range_using_guard for each loop initial condition to improve value range. gcc/testsuite/ChangeLog 2015-07-28 Bin Cheng * gcc.dg/tree-ssa/loop-bound-1.c: New test. * gcc.dg/tree-ssa/loop-bound-3.c: New test. * gcc.dg/tree-ssa/loop-bound-5.c: New test.