JDK-4899484 : ia64: RegTest-test java/lang/Math/IeeeRecommendedTests.java fails
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2003
  • CPU: itanium
  • Submitted: 2003-07-31
  • Updated: 2004-03-03
  • Resolved: 2004-02-03
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.
Other
5.0 b37Fixed
Related Reports
Relates :  
Description

Name: erR10175			Date: 07/31/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b12, JDK1.5.0-b11
                  (This is a new Regression test which is absent in previous JDKs)
Testbase       : RegTest-test
Platform[s]    : Windows 2003 Enterprise (Itanium), RedHat Advanced Server 2.1 (Itanium)
                  (I am not able to reproduce the failure on 32-bit platforms)
switch/Mode    : all
Falling tests  : java/lang/Math/IeeeRecommendedTests.java

RegTest-test java/lang/Math/IeeeRecommendedTests.java test fails with JDK1.5.0-b12
on Windows 2003 Enterprise (64-bit).

Test source location:
=====================
/java/re/jdk/1.4.2/promoted/latest/ws/j2se/test/java/lang/Math/IeeeRecommendedTests.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results/tiger/b12/regtest/win32/redhat7.2_gnome_smp_-server_smp_JCC-ITANIUM-02/workDir/test/java/lang/Math/IeeeRecommendedTests.jtr

How to reproduce:
=================
Run the following script (you may need to change it's variables):
--- script start ---
#!/bin/sh

RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir
JT_HOME="h:/java/jct"
JAVA_HOME="h:/java/jdk1.5.0/win32"
TEST_BASE_PATH="h:/java/regtest/test"
TESTWITH=$JAVA_HOME
TESTJAVA=$JAVA_HOME
JTOPTS="-server"
TESTVMOPTS="-server"

export CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.jar;$JT_HOME/jemmy/jemmy.jar"

mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1
cd $WORK_DIR/scratch

$JAVA_HOME/bin/java -cp $CLASSPATH $JTOPTS -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,windir=$windir,PATH=${SHELL%/*},CPAPPEND=$JT_HOME/jemmy/jemmy.jar,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="JCC-ITANIUM-02" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/java/lang/Math/IeeeRecommendedTests.java"
--- script end ---

Test output (jtr part):
=======================
----------System.out:(0/0)----------
----------System.err:(502/48957)----------
Failure for FpUtils.ilogb(float): For input 4.9E-324 expected -1074 got -1023.
Failure for FpUtils.ilogb(float): For input -4.9E-324 expected -1074 got -1023.
Failure for FpUtils.ilogb(float): For input 1.0E-323 expected -1073 got -1023.
Failure for FpUtils.ilogb(float): For input -1.0E-323 expected -1073 got -1023.
Failure for FpUtils.ilogb(float): For input 2.0E-323 expected -1072 got -1023.
Failure for FpUtils.ilogb(float): For input -2.0E-323 expected -1072 got -1023.
Failure for FpUtils.ilogb(float): For input 1.5E-323 expected -1073 got -1023.
Failure for FpUtils.ilogb(float): For input -1.5E-323 expected -1073 got -1023.
Failure for FpUtils.ilogb(float): For input 4.0E-323 expected -1071 got -1023.
Failure for FpUtils.ilogb(float): For input -4.0E-323 expected -1071 got -1023.
Failure for FpUtils.ilogb(float): For input 3.5E-323 expected -1072 got -1023.
Failure for FpUtils.ilogb(float): For input -3.5E-323 expected -1072 got -1023.
Failure for FpUtils.ilogb(float): For input 7.9E-323 expected -1070 got -1023.
Failure for FpUtils.ilogb(float): For input -7.9E-323 expected -1070 got -1023.
Failure for FpUtils.ilogb(float): For input 7.4E-323 expected -1071 got -1023.
Failure for FpUtils.ilogb(float): For input -7.4E-323 expected -1071 got -1023.
Failure for FpUtils.ilogb(float): For input 1.58E-322 expected -1069 got -1023.
Failure for FpUtils.ilogb(float): For input -1.58E-322 expected -1069 got -1023.
Failure for FpUtils.ilogb(float): For input 1.53E-322 expected -1070 got -1023.
Failure for FpUtils.ilogb(float): For input -1.53E-322 expected -1070 got -1023.
Failure for FpUtils.ilogb(float): For input 3.16E-322 expected -1068 got -1023.
...
Failure for FpUtils.scalb(double,int): For input (1.5E-323, 2094)  expected Infinity got 3.3706746278668423E307.
Failure for FpUtils.scalb(double,int): For input (-1.5E-323, 2094)  expected -Infinity got -3.3706746278668423E307.
Failure for FpUtils.scalb(double,int): For input (1.5E-323, 2095)  expected Infinity got 6.741349255733685E307.
Failure for FpUtils.scalb(double,int): For input (-1.5E-323, 2095)  expected -Infinity got -6.741349255733685E307.
Failure for FpUtils.scalb(double,int): For input (1.5E-323, 2096)  expected Infinity got 1.348269851146737E308.
Failure for FpUtils.scalb(double,int): For input (-1.5E-323, 2096)  expected -Infinity got -1.348269851146737E308.
Testing the recommended functions incurred 388 failures.
java.lang.RuntimeException
	at IeeeRecommendedTests.main(IeeeRecommendedTests.java:1804)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:549)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException
result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException

Specific machine info:
======================
Hostname: JCC-ITANIUM-02
OS: Windows 2003 Enterprise

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b37 tiger-beta2 VERIFIED IN: tiger-beta2
14-06-2004

SUGGESTED FIX The AD file was trying to stuff a long value into an 8bit immediate. This was causing bits to be lost. ###@###.### 2004-01-22 *** /home/azeem/public_html/webrev/cmp/src/cpu/ia64/vm/ia64.ad- Tue Jan 27 14:57:20 2004 --- ia64.ad Tue Jan 27 14:57:45 2004 *************** *** 1,6 **** ! // @(#)ia64.ad 1.106 04/01/15 15:45:59 // // Copyright 2000-2002 Sun Microsystems, Inc. All rights reserved. // SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. // --- 1,6 ---- ! // @(#)ia64.ad 1.107 04/01/27 14:57:43 // // Copyright 2000-2002 Sun Microsystems, Inc. All rights reserved. // SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. // *************** *** 5074,5084 **** interface(CONST_INTER); %} // Integer Immediate: 8-bit operand immL8m1() %{ ! predicate(Assembler::is_simm8(n->get_long()-1)); match(ConL); op_cost(5); format %{ %} interface(CONST_INTER); --- 5074,5084 ---- interface(CONST_INTER); %} // Integer Immediate: 8-bit operand immL8m1() %{ ! predicate((-127L <= n->get_long()) && (n->get_long() <= 128L)); match(ConL); op_cost(5); format %{ %} interface(CONST_INTER); *************** *** 11128,11138 **** %} instruct if_cmpL_reg_immL8(cmpOp cmp, gRegL src1, immL8 src2, label labl, pr6_pReg pr) %{ match(If cmp (CmpL src1 src2)); effect(USE cmp, USE src1, USE src2, USE labl, KILL pr); ! predicate( _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::eq || _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::ne || _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::gt || _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::le ); ins_cost(BRANCH_COST + DEFAULT_COST); format %{ "CMP.$cmp PR6,PR0=$src1,$src2\t// long\n\t(PR6) BR $labl" %} ins_encode( emit_cmp_reg_imm( cmp, PR6, PR0, src1, src2, PR0 ), emit_branch( labl, PR6 ) ); ins_pipe(pr_pr_ICMP_gr_imm__BR_pr); --- 11128,11141 ---- %} instruct if_cmpL_reg_immL8(cmpOp cmp, gRegL src1, immL8 src2, label labl, pr6_pReg pr) %{ match(If cmp (CmpL src1 src2)); effect(USE cmp, USE src1, USE src2, USE labl, KILL pr); ! predicate( _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::eq || ! _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::ne || ! _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::gt || ! _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::le ); ins_cost(BRANCH_COST + DEFAULT_COST); format %{ "CMP.$cmp PR6,PR0=$src1,$src2\t// long\n\t(PR6) BR $labl" %} ins_encode( emit_cmp_reg_imm( cmp, PR6, PR0, src1, src2, PR0 ), emit_branch( labl, PR6 ) ); ins_pipe(pr_pr_ICMP_gr_imm__BR_pr); *************** *** 11140,11150 **** // Long branch on less than instruct if_cmpL_reg_immL8m1(cmpOp cmp, gRegL src1, immL8m1 src2, label labl, pr6_pReg pr) %{ match(If cmp (CmpL src1 src2)); effect(USE cmp, USE src1, USE src2, USE labl, KILL pr); ! predicate( _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::lt || _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::ge ); ins_cost(BRANCH_COST + DEFAULT_COST); format %{ "CMP.$cmp PR6,PR0=$src1,$src2\t// long\n\t(PR6) BR $labl" %} ins_encode( emit_cmp_reg_imm( cmp, PR6, PR0, src1, src2, PR0 ), emit_branch( labl, PR6 ) ); ins_pipe(pr_pr_ICMP_gr_imm__BR_pr); --- 11143,11154 ---- // Long branch on less than instruct if_cmpL_reg_immL8m1(cmpOp cmp, gRegL src1, immL8m1 src2, label labl, pr6_pReg pr) %{ match(If cmp (CmpL src1 src2)); effect(USE cmp, USE src1, USE src2, USE labl, KILL pr); ! predicate( _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::lt || ! _kids[0]->_leaf->is_Bool()->_test._test == BoolTest::ge ); ins_cost(BRANCH_COST + DEFAULT_COST); format %{ "CMP.$cmp PR6,PR0=$src1,$src2\t// long\n\t(PR6) BR $labl" %} ins_encode( emit_cmp_reg_imm( cmp, PR6, PR0, src1, src2, PR0 ), emit_branch( labl, PR6 ) ); ins_pipe(pr_pr_ICMP_gr_imm__BR_pr); ###@###.### 2004-01-27
27-01-2004

EVALUATION I've verified the regression tests fail on a recent build on a local itanium machine. All the failures are for double subnormal inputs. The problem is apparently a code generation issue with the Itanium server compiler. I wrote a simple stand-alone test program with some of the failing values. When the short program was run without a vm option or with -Xint, the proper results are calculated. However, the program fails when run with -Xcomp. import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class test { public static void main(String argv[]) { double [] values = { Double.MIN_VALUE, Double.MIN_VALUE*2, Double.MIN_VALUE*3, FpUtils.nextDown(DoubleConsts.MIN_NORMAL), DoubleConsts.MIN_NORMAL, }; for(int i =0; i < values.length; i++) { System.out.println("0x" + Long.toHexString(Double.doubleToRawLongBits(values[i])) + "\t0x" + Long.toHexString(Double.doubleToLongBits(values[i])) + // "\t" + Double.toHexString(values[i]) + "\t" + FpUtils.ilogb(values[i]) ); } } } (The ilogb failures are mislabled as float when they are actualy double input.) Transferring bug to C2. ###@###.### 2003-07-31
31-07-2003