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
Thu Apr 24 16:41:05 UTC 2014
On 04/24/2014 05:21 PM, Volker Simonis wrote:
> And I'm not quite sure how to fix this in HotSpot.
>
> I first thought I could solve this with an anonymous union like:
>
> union {
> void* _relocbuf[ _relocbuf_size ];
> Relocation _reloc;
> }
> Relocation* reloc() const { return &_reloc; }
>
> but unfortunately I can't put a Relocation into a union because it is
> not a POD (at least not with C++98).
>
> Any other ideas how we could fool GCC 4.9?
>
> I more and more think this should be fixed in GCC because I can
> imagine this will also break other code.
Only code that is not legal C++, and GCC developers have historically
been very reluctant to support that. So, it might not happen.
AFAICS there is no C++98 way to embed a non-POD object in an object in this
way. It could be done via a pointer, but that wastes some space.
Andrew.
More information about the hotspot-dev
mailing list