RFR: 8187676: Disable harmless uninitialized warnings for two files
Kim Barrett
kim.barrett at oracle.com
Tue Sep 19 13:55:59 UTC 2017
> On Sep 19, 2017, at 9:37 AM, Erik Helin <erik.helin at oracle.com> wrote:
>
> Hi all,
>
> with gcc 7.1.1 from Fedora 26 on x86-64 there are warnings about the potential usage of maybe uninitialized memory in src/hotspot/cpu/x86/assembler_x86.cpp and in src/hotspot/cpu/x86/interp_masm_x86.cpp.
>
> The problems arises from the class RelocationHolder in src/hotspot/share/code/relocInfo.hpp which has the private fields:
> enum { _relocbuf_size = 5 };
> void* _relocbuf[ _relocbuf_size ];
>
> and the default constructor for RelocationHolder does not initialize the elements of _relocbuf. I _think_ this is an optimization, RelocationHolder is used *a lot* and setting the elements of RelocationHolder::_relocbuf to NULL (or some other value) in the default constructor might result in a performance penalty. Have a look in build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/gensrc/adfiles and you will see that RelocationHolder is used all over the place :)
>
> AFAICS all users of RelocationHolder::_relocbuf take care to not use uninitialized memory, which means that this warning is wrong, so I suggest we disable the warning -Wmaybe-uninitialized for src/hotspot/cpu/x86/assembler_x86.cpp.
Rahul Raghavan is working on a fix for JDK-8160404 that is likely relevant.
I have a patch from him for preliminary review.
More information about the build-dev
mailing list