RFR [XS] 8041658: Use of -fdevirtualize on macroAssembler_x86.o (via -O2) with gcc 4.9.0 creates broken VM

Andrew Haley aph at redhat.com
Fri Apr 25 10:46:09 UTC 2014

On 04/24/2014 04:10 PM, Volker Simonis wrote:
> Wow, that was fast!

Haha, I cheated!  I debugged GCC and put a breakpoint on the point
where the call site was marked unreachable.

   g++ -fdump-tree-all -fdump-ipa-all ...

gets you a lot of dump files.  I looked in these files to see where it
all went wrong.

If you look at embed.cpp.043i.whole-program generated when compiling
the example I posted to the GCC list
<http://gcc.gnu.org/ml/gcc/2014-04/msg00236/embed-test.tar> you'll see

  _2 = MEM[(struct EmbeddedObject *)&o]._vptr.EmbeddedObject;
  _3 = *_2;
  _5 = _4(D);
  __builtin_unreachable (&o.buffer);

and with no-devirtualize:

  _2 = MEM[(struct EmbeddedObject *)&o]._vptr.EmbeddedObject;
  _3 = *_2;
  _5 = OBJ_TYPE_REF(_3;(struct EmbeddedObject)&o.buffer->0) (&o.buffer);


More information about the hotspot-dev mailing list