https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112578
Bug ID: 112578
Summary: LoongArch: Wrong code -with -mlsx
-fno-fp-int-builtin-inexact
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: xry111 at gcc dot gnu.org
Target Milestone: ---
$ cat t.c
#include <assert.h>
#include <fenv.h>
float f[4] = { 11.4, 5.14, 19.19, 8.10 };
int main()
{
for (int i = 0; i < 4; i++)
f[i] = __builtin_floorf (f[i]);
assert (!fetestexcept (FE_INEXACT));
}
$ cc t.c -O2 -lm -fno-fp-int-builtin-inexact -mlsx
$ ./a.out
a.out: t.c:11: main: Assertion `!fetestexcept (FE_INEXACT)' failed.
Aborted (core dumped)