https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123987
Bug ID: 123987
Summary: isinfl isinff incorrectly for x86 and arm64
Product: gcc
Version: 14.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: 314575546 at qq dot com
Target Milestone: ---
Hi, in x86 and aarch64, isinfl/ininff is incorrect.
code:
#include <float.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
int main()
{
long double ld = -LDBL_MAX;
ld *= 2;
printf("%Lf, %d\n",ld, isinfl(ld));
float f = -DBL_MAX;
f *= 2;
printf("%f, %d\n",f, isinff(f));
return 0;
}
https://godbolt.org/z/bv5h49xPM
As expected, the result should be:
isinfl:-inf, -1
isinff:-inf, -1
Run result:
isinfl:-inf, 1
isinff:-inf, 1