This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: HUGE_VAL should be Infinity -- Yet another solution


>   > ieee floating point will fail the hugeval test.  Since I don't think
>   > compiler tests should fail when there is nothing wrong with the compiler,
>   > I will try to come up with a test fix.
> Another option (if fixing hugeval.c is a pain) is to move hugeval.c into the
> ieee directory which makes it clearer that it depends on ieee754 arithmetic.

The enclosed patch changes the hugeval and mzero FAILs under hpux 9.X/10.X
to XFAILs except for the one '-fssa' compilation FAIL.  I think this is
a better solution than hacking hugeval.c  The previous hugeval.c patch
should be destroyed.

The patch has been tested under hpux 10.20.  With my compare patch and
this one, here is the summary for the ieee tests:

FAIL: ./gcc.c-torture/execute/ieee/fp-cmp-3.c compilation,  -O3 -fssa

                === gcc Summary for unix ===

# of expected passes            191
# of unexpected failures        1
# of expected failures          13
# of unresolved testcases       1

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-10-18  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* hugeval.x: New.  Execution is expected to fail under hpux 9.X
	and 10.X because HUGE_VAL is DBL_MAX instead of +Infinity.
	* mzero2.x: Execution is expected to fail except at -O0 on hppa
	targets because negation of +0. yields +0.  -0. is expected.

--- gcc.c-torture/execute/ieee/hugeval.x.orig	Wed Oct 18 13:51:17 2000
+++ gcc.c-torture/execute/ieee/hugeval.x	Wed Oct 18 15:01:21 2000
@@ -0,0 +1,10 @@
+# This test fails under hpux 9.X and 10.X because HUGE_VAL is DBL_MAX
+# instead of +Infinity.
+
+global target_triplet
+if { [istarget "hppa*-*-hpux9*"] || [istarget "hppa*-*-hpux10*"] } {
+      set torture_execute_xfail "$target_triplet"
+}
+
+return 0
+
--- gcc.c-torture/execute/ieee/mzero2.x.orig	Sat Sep  4 11:09:14 1999
+++ gcc.c-torture/execute/ieee/mzero2.x	Wed Oct 18 16:35:27 2000
@@ -1,6 +1,22 @@
 # freebsd sets up the fpu with a different precision control which causes
 # this test to "fail".
 if { [istarget "i?86-*-freebsd*"] } {
-	set torture_execute_xfail "i?86-*-freebsd*"
+    set torture_execute_xfail "i?86-*-freebsd*"
+}
+
+# This test fails on hppa hardware in the evaluation of -1.00 * pzero at
+# all but -O0 because the multiply is converted to a negation.  Floating point
+# negation is implemented as a subtract from zero rather than a xor of the
+# sign bit on parisc machines.  As a result, -(+0.) = +0.  The expected
+# IEEE754 result is -0.
+if { [istarget "hppa*-*-*"] } {
+    set torture_eval_before_execute {
+        set compiler_conditional_xfail_data {
+            "hppa fp negation violates ieee754 standard" \
+            "hppa*-*-*" \
+            { "-O1" "-O2" "-O3*" "-Os" } \
+            { "" }
+        }
+    }
 }
 return 0

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]