[9] RFR(S): 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp

Tobias Hartmann tobias.hartmann at oracle.com
Wed Jul 23 11:12:49 UTC 2014


Hi,

please review the following patch for JDK- 8049043 (Parfait warning).

Bug: https://bugs.openjdk.java.net/browse/JDK-8049043
Webrev: http://cr.openjdk.java.net/~thartmann/8049043/webrev.01/

Problem:
Parfait issues 6 warnings " Load variable through a pointer of an 
incompatible type" because of the __HI(x) and __LO(x) macros used in 
copysignA and scalbnA (share/vm/runtime/sharedRuntimeMath.hpp) to cast 
between double* and int*.

Solution:
A union 'DoubleIntConv' is used to access the high and low 32 bits of a 
double.
The '# pragma warning( disable: 4748 )' in sharedRuntimeTrans.cpp is 
necessary because otherwise the VS compiler fails with the following 
warning: "/GS can not protect parameters and local variables from local 
buffer overrun because optimizations are disabled in function". There 
exists a bug to fix this [1].

Testing:
JPRT, Parfait (all 6 warnings removed)

Thanks,
Tobias

[1] https://bugs.openjdk.java.net/browse/JDK-8046696
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140723/4145a1f9/attachment.html>


More information about the hotspot-compiler-dev mailing list