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

David Holmes david.holmes at oracle.com
Tue Oct 20 07:56:28 UTC 2015


On 20/10/2015 5:24 PM, Lindenmaier, Goetz wrote:

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., c1LIRAssemblerx86.cpp:3917). I fixed these two anyways: http://cr.openjdk.java.net/~goetz/webrevs/8139040-init/webrev.05/

:) Thanks. Good catch on the unused shiftamount too.

David

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/c1LIRAssemblerx86.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::noscale; 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