Module Name:    src
Committed By:   riastradh
Date:           Sun May  5 23:08:53 UTC 2024

Modified Files:
        src/doc: HACKS
        src/tests/lib/libm: t_fe_round.c

Log Message:
tests/lib/libm/t_fe_round.c: Work around likely ia64 bug in gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/doc/HACKS
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libm/t_fe_round.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.242 src/doc/HACKS:1.243
--- src/doc/HACKS:1.242	Thu Apr  4 23:53:05 2024
+++ src/doc/HACKS	Sun May  5 23:08:53 2024
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.242 2024/04/04 23:53:05 christos Exp $
+# $NetBSD: HACKS,v 1.243 2024/05/05 23:08:53 riastradh Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -1124,3 +1124,14 @@ descr
 	Some files create dwarf info that our ctfmerge can't handle.
 	We downgrade dwarf generation to version 3 which works.
 kcah
+
+hack	ia64: work around feclearexcept/fetestexcept compiler bug
+cdate	Sun May  5 23:06:10 UTC 2024
+who	riastradh
+file	tests/lib/libm/t_fe_round.c
+descr
+	Without judiciously placed __insn_barrier, we get:
+	/tmp//ccJayu9g.s:2793: Warning: Use of 'mov.m' violates RAW dependency 'AR[FPSR].sf0.flags' (impliedf)
+	/tmp//ccJayu9g.s:2793: Warning: Only the first path encountering the conflict is reported
+	/tmp//ccJayu9g.s:2757: Warning: This is the location of the conflicting usage
+kcah

Index: src/tests/lib/libm/t_fe_round.c
diff -u src/tests/lib/libm/t_fe_round.c:1.16 src/tests/lib/libm/t_fe_round.c:1.17
--- src/tests/lib/libm/t_fe_round.c:1.16	Fri May  3 21:40:51 2024
+++ src/tests/lib/libm/t_fe_round.c	Sun May  5 23:08:53 2024
@@ -195,6 +195,19 @@ ATF_TC_BODY(fe_nearbyint_rint, tc)
 			 */
 			fesetround(values[i].round_mode);
 
+#ifdef __ia64__
+/*
+ * Without this barrier, we get:
+ *
+ * /tmp//ccJayu9g.s:2793: Warning: Use of 'mov.m' violates RAW dependency 'AR[FPSR].sf0.flags' (impliedf)
+ * /tmp//ccJayu9g.s:2793: Warning: Only the first path encountering the conflict is reported
+ * /tmp//ccJayu9g.s:2757: Warning: This is the location of the conflicting usage
+ *
+ * (If you fix this, remove the entry from doc/HACKS.)
+ */
+			__insn_barrier();
+#endif
+
 			/*
 			 * Clear sticky floating-point exception bits
 			 * so we can verify whether the FE_INEXACT

Reply via email to