RFR [XS] 8041658: Use of -fdevirtualize on macroAssembler_x86.o (via -O2) with gcc 4.9.0 creates broken VM
David Chase
david.r.chase at oracle.com
Thu Apr 24 18:52:04 UTC 2014
Could you do a placement new into that array of void*?
I can't even remember the syntax, but I recall the semantics.
David
On 2014-04-24, at 12:41 PM, Andrew Haley <aph at redhat.com> wrote:
> 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