Wed, 24 Jul 2019 21:43:36 +0200
8228405: Incorrect format strings in PhaseIdealLoop::rc_predicate
Reviewed-by: andrew, phh
src/share/vm/opto/loopPredicate.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/loopPredicate.cpp Mon Aug 07 12:19:17 2017 +0200 1.2 +++ b/src/share/vm/opto/loopPredicate.cpp Wed Jul 24 21:43:36 2019 +0200 1.3 @@ -611,7 +611,11 @@ 1.4 const TypeInt* idx_type = TypeInt::INT; 1.5 if ((stride > 0) == (scale > 0) == upper) { 1.6 if (TraceLoopPredicate) { 1.7 - predString->print(limit->is_Con() ? "(%d " : "(limit ", con_limit); 1.8 + if (limit->is_Con()) { 1.9 + predString->print("(%d ", con_limit); 1.10 + } else { 1.11 + predString->print("(limit "); 1.12 + } 1.13 predString->print("- %d) ", stride); 1.14 } 1.15 // Check if (limit - stride) may overflow 1.16 @@ -639,7 +643,11 @@ 1.17 register_new_node(max_idx_expr, ctrl); 1.18 } else { 1.19 if (TraceLoopPredicate) { 1.20 - predString->print(init->is_Con() ? "%d " : "init ", con_init); 1.21 + if (init->is_Con()) { 1.22 + predString->print("%d ", con_init); 1.23 + } else { 1.24 + predString->print("init "); 1.25 + } 1.26 } 1.27 idx_type = _igvn.type(init)->isa_int(); 1.28 max_idx_expr = init; 1.29 @@ -675,7 +683,11 @@ 1.30 1.31 if (offset && (!offset->is_Con() || con_offset != 0)){ 1.32 if (TraceLoopPredicate) { 1.33 - predString->print(offset->is_Con() ? "+ %d " : "+ offset", con_offset); 1.34 + if (offset->is_Con()) { 1.35 + predString->print("+ %d ", con_offset); 1.36 + } else { 1.37 + predString->print("+ offset"); 1.38 + } 1.39 } 1.40 // Check if (max_idx_expr + offset) may overflow 1.41 const TypeInt* offset_type = _igvn.type(offset)->isa_int();