src/share/vm/c1/c1_LIRGenerator.cpp

changeset 9843
a6f289d66efe
parent 9842
4df47a343601
child 9852
70aa912cebe5
child 9896
1b8c45b8216a
     1.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Feb 27 05:40:59 2020 +0000
     1.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Feb 27 05:58:53 2020 +0000
     1.3 @@ -539,11 +539,11 @@
     1.4  
     1.5      case Bytecodes::_imul:
     1.6        {
     1.7 -        bool    did_strength_reduce = false;
     1.8 +        bool did_strength_reduce = false;
     1.9  
    1.10          if (right->is_constant()) {
    1.11 -          int c = right->as_jint();
    1.12 -          if (is_power_of_2(c)) {
    1.13 +          jint c = right->as_jint();
    1.14 +          if (c > 0 && is_power_of_2(c)) {
    1.15              // do not need tmp here
    1.16              __ shift_left(left_op, exact_log2(c), result_op);
    1.17              did_strength_reduce = true;

mercurial