From 2b70237da2204245f558b9cf27129632cfe1aeec Mon Sep 17 00:00:00 2001 From: riastradh Date: Sun, 5 May 2024 23:08:53 +0000 Subject: [PATCH] tests/lib/libm/t_fe_round.c: Work around likely ia64 bug in gcc. --- doc/HACKS | 13 ++++++++++++- tests/lib/libm/t_fe_round.c | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/HACKS b/doc/HACKS index 6351a6f8a3a6..d329fcaadc34 100644 --- a/doc/HACKS +++ b/doc/HACKS @@ -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 diff --git a/tests/lib/libm/t_fe_round.c b/tests/lib/libm/t_fe_round.c index 4fd4f8d84ccd..08633189fedf 100644 --- a/tests/lib/libm/t_fe_round.c +++ b/tests/lib/libm/t_fe_round.c @@ -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