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

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Oct 12 09:18:37 UTC 2015


Hi,

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:
http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.02/
incremental webrev:
http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.02-incremental/

Best regards,
  Goetz.


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

Hi,

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.
http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.00/

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,
  Goetz.





More information about the hotspot-runtime-dev mailing list