JDK-8074869 : C2 code generator can replace -0.0f with +0.0f on Linux
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7u76,8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2015-03-10
  • Updated: 2015-11-10
  • Resolved: 2015-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u85Fixed 8u60Fixed 9 b57Fixed
Description
On Linux, the C2 code generator can replace the value -0.0f with +0.0f (and also the value -0.0d with +0.0d). The reason is that in some *.ad files both the value -0.0f and +0.0f is treated as being 0.0 and can therefore be replaced with an immediate +0.0f embedded into an instruction.

For example, in the sparc.ad file, the 'fpclass' function is used to decide if a float node's content is +0.0:

predicate((n->getf() == 0) && (fpclass(n->getf()) == FP_PZERO));

On Solaris, 'fpclass' returns FP_PZERO if the parameter is +0.0f and FP_NZERO if the parameter is -0.0f. On Linux, however, 'fpclass' is not available and therefore 'fpclassify' is used.

'fpclassify' does not distinguish between ��0.0f, it returns FP_ZERO for both +0.0f and -0.0f.

Comments
Excluded from bug escape, since this is a duplicate of JDK-8074699, which was reported before Release of 7u76
01-04-2015