RFR: 8266773: Release VM is broken with GCC 9 after JDK-8214237

Leo Korinth lkorinth at openjdk.java.net
Mon May 10 13:29:59 UTC 2021


On Mon, 10 May 2021 08:48:03 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp line 334:
>> 
>>> 332:   for (uint i = 0; i < phase->MaxThreadWorkItems; i++) {
>>> 333:     WorkerDataArray<size_t>* work_items = phase->thread_work_items(i);
>>> 334:     if (work_items != NULL && indent(indent_level + 1) != NULL) {
>> 
>> No, don't do this.  `indent` never returns NULL.  It asserts the given argument is in bounds.  The warning is a (gcc9-specific?) false positive, similar to JDK-8235819.
>
>> No, don't do this. `indent` never returns NULL. It asserts the given argument is in bounds. The warning is a (gcc9-specific?) false positive, similar to JDK-8235819.
> 
> Thanks @kimbarrett for your review.
> 
> Yes, I agree that this seems to be false positive with gcc 9.
> 
> Fastdebug build wouldn't fail due to the existence of the assert.
> But release vm would fail since there is no such an assert.
> 
> So any suggestions?
> Thanks.

Maybe instead use something like:
`out->print("%*s%s", 2 * indent_level, "", "indented*s");`
or:
`out->print("%*c%s", 2 * indent_level, ' ', "indented*c");`

And get rid of the "Indents" string array and associated functions.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3941



More information about the hotspot-gc-dev mailing list