RFR : [XS] 8209942: [epsilon] range function for EpsilonTLABElasticity causes compiler warning

2018-09-05 Thread Baesken, Matthias
Hello,  when compilingjdk/jdk   on Windows,  (with VS2017 update level 15.8 
and not disabling warnings as errors )
I came across  this  warning   leading to build error :

C:/jdk-just-clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): 
error C2220: warning treated as error - no 'object' file generated
C:/jdk-just-clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): 
warning C4305: 'argument': truncation from 'const intx' to 'double'

Would have been helpful  to have a compiler flag set  that really   ***shows  
the code***  leading to the warning/error  (because it comes from heavy macro 
expansion).


The following  CR   ,   Reported by 
ralf.schmel...@sap.com  , fixes the issue  :

The flag -XX:EpsilonTLABElasticity (epsilon_globals.hpp, line 77) expects a 
double value, but uses max_intx in the allowed range.
This leads to a truncation warning in the Windows build. If the value should 
only be guaranteed to be >= 1, then DBL_MAX should have been used instead.


Webrev/bug :

http://cr.openjdk.java.net/~mbaesken/webrevs/8209942/

https://bugs.openjdk.java.net/browse/JDK-8209942


Please review .




Thanks, Matthias


Re: RFR : [XS] 8209942: [epsilon] range function for EpsilonTLABElasticity causes compiler warning

2018-09-05 Thread Erik Joelsson




On 2018-09-05 04:03, Baesken, Matthias wrote:

Hello,  when compilingjdk/jdk   on Windows,  (with VS2017 update level 15.8 
and not disabling warnings as errors )
I came across  this  warning   leading to build error :

C:/jdk-just-clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): 
error C2220: warning treated as error - no 'object' file generated
C:/jdk-just-clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): 
warning C4305: 'argument': truncation from 'const intx' to 'double'

Would have been helpful  to have a compiler flag set  that really   ***shows  
the code***  leading to the warning/error  (because it comes from heavy macro 
expansion).


Do you know of such a flag? If so we certain would like to add it.

/Erik



Re: RFR : [XS] 8209942: [epsilon] range function for EpsilonTLABElasticity causes compiler warning

2018-09-06 Thread Baesken, Matthias
Hi Erik,   looks like gcc7  and  current clang   already  print  the macro  and 
show it  plus the position of  the error / warning   in it .

See   https://clang.llvm.org/diagnostics.html   Automatic Macro Expansion   
 for an example .

With Visual Studio I could not  find  anything similar ,   I asked our local 
Visual Studio experts for help,  maybe I overlooked something .
  
Best regards, Matthias


> --
> 
> Message: 4
> Date: Wed, 5 Sep 2018 09:57:06 -0700
> From: Erik Joelsson 
> To: "Baesken, Matthias" ,
>   "'hotspot-...@openjdk.java.net'"  d...@openjdk.java.net>,
>   "'build-dev@openjdk.java.net'" 
> Cc: "Simonis, Volker" 
> Subject: Re: RFR : [XS] 8209942: [epsilon] range function for
>   EpsilonTLABElasticity causes compiler warning
> Message-ID: 
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> 
> 
> On 2018-09-05 04:03, Baesken, Matthias wrote:
> > Hello,  when compilingjdk/jdk   on Windows,  (with VS2017 update level
> 15.8 and not disabling warnings as errors )
> > I came across  this  warning   leading to build error :
> >
> > C:/jdk-just-
> clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): error
> C2220: warning treated as error - no 'object' file generated
> > C:/jdk-just-
> clone/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp(341): warning
> C4305: 'argument': truncation from 'const intx' to 'double'
> >
> > Would have been helpful  to have a compiler flag set  that really   ***shows
> the code***  leading to the warning/error  (because it comes from heavy
> macro expansion).
> >
> Do you know of such a flag? If so we certain would like to add it.
> 
> /Erik
> 
>