# HG changeset patch # User sgehwolf # Date 1430335428 25200 # Node ID 35b153c2678348b05383a954d3560a5b6ad2dae5 # Parent 3904e33db5b3192d528e2c7f762311e26f514e4c 8078666: JVM fastdebug build compiled with GCC 5 asserts with "widen increases" Summary: do the math on the unsigned type where overflows are well defined Reviewed-by: kvn, aph diff -r 3904e33db5b3 -r 35b153c26783 src/share/vm/opto/type.cpp --- a/src/share/vm/opto/type.cpp Thu Jun 18 18:09:19 2015 +0200 +++ b/src/share/vm/opto/type.cpp Wed Apr 29 12:23:48 2015 -0700 @@ -1182,11 +1182,11 @@ // Certain normalizations keep us sane when comparing types. // The 'SMALLINT' covers constants and also CC and its relatives. if (lo <= hi) { - if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin; - if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT + if (((juint)hi - lo) <= SMALLINT) w = Type::WidenMin; + if (((juint)hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT } else { - if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin; - if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT + if (((juint)lo - hi) <= SMALLINT) w = Type::WidenMin; + if (((juint)lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT } return w; } @@ -1440,11 +1440,11 @@ // Certain normalizations keep us sane when comparing types. // The 'SMALLINT' covers constants. if (lo <= hi) { - if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin; - if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG + if (((julong)hi - lo) <= SMALLINT) w = Type::WidenMin; + if (((julong)hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG } else { - if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin; - if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG + if (((julong)lo - hi) <= SMALLINT) w = Type::WidenMin; + if (((julong)lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG } return w; }