7110586: C2 generates incorrect results

Exact limit of empty loop calculated incorrectly.

Reviewed-by: iveresov, never
This commit is contained in:
Vladimir Kozlov 2011-11-10 20:17:05 -08:00
parent 3de3451b3a
commit 157ba53d27
2 changed files with 132 additions and 1 deletions

View file

@ -715,7 +715,6 @@ Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) {
long limit_con = cl->limit()->get_int();
julong trip_cnt = cl->trip_count();
long final_con = init_con + trip_cnt*stride_con;
final_con -= stride_con;
int final_int = (int)final_con;
// The final value should be in integer range since the loop
// is counted and the limit was checked for overflow.