[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 13:11:45 UTC 2014


I just noticed that the 'DoubleIntConv' union is useful for other fixes 
as well (for example JDK-8040121).

Can I add it to share/vm/utilities/globalDefinitions.hpp or is there a 
better place?

Thanks,
Tobias

On 23.07.2014 13:12, Tobias Hartmann wrote:
> 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/d714715a/attachment.html>


More information about the hotspot-compiler-dev mailing list