Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8135252

IdealLoopTree::dump_head() prints negative trip count

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • b84

        IdealLoopTree::dump_head() used by -XX:TraceLoopOpts prints a negative trip count if CountedLoopNode::profile_trip_cnt() is large:

        compute_profile_trip_cnt lp: 1676 cnt: 2147483648.000000
        Loop: N1676/N1546 limit_check predicated counted [0,100),+8 (-2147483648 iters)

        We should not cast float to int:

        diff -r 979c4f71a3c8 src/share/vm/opto/loopnode.cpp
        --- a/src/share/vm/opto/loopnode.cpp Mon Aug 31 17:20:08 2015 +0200
        +++ b/src/share/vm/opto/loopnode.cpp Wed Sep 09 13:07:17 2015 +0200
        @@ -1901,7 +1901,7 @@
             if (stride_con > 0) tty->print("+");
             tty->print("%d", stride_con);
         
        - tty->print(" (%d iters) ", (int)cl->profile_trip_cnt());
        + tty->print(" (%0.f iters) ", cl->profile_trip_cnt());
         
             if (cl->is_pre_loop ()) tty->print(" pre" );
             if (cl->is_main_loop()) tty->print(" main");

              thartmann Tobias Hartmann
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: