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

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Oct 20 07:24:33 UTC 2015


Hi David, 

yes, I assume the compiler optimizes it.
If the compiler issues a warning, it has all information it needs to 
optimize it.  So I'm sure gcc does so.  I don't know about the solaris
compiler, though.

Other locations in that file also initialize at the declaration
(e.g., c1_LIRAssembler_x86.cpp:3917).
I fixed these two anyways:
http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.05/

Best regards,
  Goetz.


> -----Original Message-----
> From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-
> bounces at openjdk.java.net] On Behalf Of David Holmes
> Sent: Dienstag, 20. Oktober 2015 02:46
> To: hotspot-runtime-dev at openjdk.java.net
> Subject: Re: RFR(M): 8139040: Fix initializations before
> ShouldNotReachHere()
> 
> Hi Goetz,
> 
> src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
> 
> I'd prefer to see the missing initialization added to the default of the
> switch:
> 
> !   Assembler::Condition acond = Assembler::equal, ncond =
> Assembler::notEqual;
>      switch (condition) {
> 
> otherwise we're just wasting instructions (or assuming the compiler will
> optimize it away).
> 
> Same with:
> 
> 3189   Address::ScaleFactor scale = Address::no_scale;
> 
> More generally if something is complaining about an uninitialized
> variable on a ShouldNotReachHere/fatal path then put the initialization
> in that path, not the common code that will cause it to be unnecessarily
> executed.
> 
> Cheers,
> David


More information about the hotspot-runtime-dev mailing list