RFR(M): 8139040: Fix initializations before ShouldNotReachHere()

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Oct 13 06:52:50 UTC 2015

Hi Thomas,

thanks for looking at this!

I added handling of the default case (assert(0)).

Hmm, I’m not clear why get_num says corrupted() in one case,
and in the other returns false.  The code is dead, anyways, so I
rather leave it as is.

I added guarantee(max_prev != NULL).  I think this is better understandable.
Else it looks as if there is a legal case where *max_prev must not be set.

Updated webrev:

Best regards,

From: Thomas Stüfe [mailto:thomas.stuefe at gmail.com]
Sent: Montag, 12. Oktober 2015 16:45
To: Lindenmaier, Goetz
Cc: hotspot-runtime-dev at openjdk.java.net
Subject: Re: RFR(M): 8139040: Fix initializations before ShouldNotReachHere()

Hi Goetz,

More small nitpicks:


handle default case? I dont see callers handling lir_cond_unknown.



maybe the right thing to do would be to handle errors returned by HashTableHexDump::get_num() ?
(but your change is still better than the original)



In PerRegionTable* OtherRegionsTable::delete_region_table():

 617   // Unsplice.
 618   *max_prev = max->collision_list_next();

Should the access to max_prev be guarded against != NULL?


Otherwise the change looks good.

Kind Regards, Thomas

On Mon, Oct 12, 2015 at 11:18 AM, Lindenmaier, Goetz <goetz.lindenmaier at sap.com<mailto:goetz.lindenmaier at sap.com>> wrote:

I now fixed the warnings showing with -Wuninitialized anyways.
The change now enables this flag per default with gcc 4.8.
Older gcc versions detect more issues, as far as I checked all false
positives. Therefore I don't enable the flag for gcc < 4.8.

The warnings reported by this flag depend on the optimization level, it's
most effective in the opt build.

This unveiled some missing initializations in constructors, as in compile.hpp,
and oopMap.hpp that can actually cause wrong behavior.

Complete webrev:
incremental webrev:

Best regards,

From: Lindenmaier, Goetz
Sent: Mittwoch, 7. Oktober 2015 15:22
To: hotspot-runtime-dev at openjdk.java.net<mailto:hotspot-runtime-dev at openjdk.java.net>
Subject: RFR(M): 8139040: Fix initializations before ShouldNotReachHere()


SAP requires us to fix a row of issues in the hotspot coding.  I would like
to share these with openJDK.

This webrev fixes a row of missing intializations, mostly combined with ShouldNotReachHere()
in default cases of switches or the like.

In the debug build, ShouldNotReachHere() can be suppressed, so the uninitialized value actually can cause problems.
In opt builds, not all tools recognize the ShouldNotReachHere properly.

In addition to this I would like to add -Wuninitialized to the warning flags.
This finds most of these issues in the opt build and
would require an additional 70 fixes plus fixes in jvmtiEnter.xsl.
Would it be appreciated to set this flag?

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20151013/17e85a6c/attachment-0001.html>

More information about the hotspot-compiler-dev mailing list