JDK-7172843 : C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-30
  • Updated: 2013-06-26
  • Resolved: 2012-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Description
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2012-May/007756.html

Kris Mok wrote:

Hi all,

Could I have a couple of review for this patch, please:
https://gist.github.com/2829978#file_c1_fix_printable_bci.patch

I hit the "assert(has_printable_bci()) failed: _printable_bci should have
been
set" assertion when I was doing some experiment on C1, and needed to use
-XX:+PrintCanonicalization for verification. It turns out that this flag is
pretty broken, that quite a few places didn't set printable_bci
appropriately.

This patch tries to fix the missing printable_bcis.
The link also includes a simple example before and after applying this
patch.

c1_Instructions.hpp:
Added set_printable_bci() to Local and Phi's constructor.
A "Local" instruction models an incoming argument, which gets its value
before
method entry, so I'm setting all Local's printable_bci to -1.
A reasonable printable_bci for a "Phi" instruction is the same as the start
bci
of the basic block to which it belongs. I had to use a weird cast to get
rid of
a "invalid use of incomplete type 'struct BlockBegin' error from GCC.

c1_Canonicalizer.cpp:
Added a default x->set_printable_bci(bci()) to
Canonicalizer::set_canonical().
There are quite a few place in Canonicalizer that doesn't specify the
printable_bci for the newly created substitution instruction. It's
reasonable
to just set that to the "current" bci, which is the bci of the instruction
to
be substituted.
Also adjusted the order of a set_bci() call in Canonicalizer::do_If, so that
the new code above could pick up the modified bci in set_canonical().

Regards,
Kris

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/c8289830e172
29-06-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/c8289830e172
31-05-2012

EVALUATION Yes
30-05-2012