https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112367
Bug ID: 112367
Summary: wrong rounding of sum of floating-point constants
Product: gcc
Version: 6.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zimmerma+gcc at loria dot fr
Target Milestone: ---
The following code:
#include <stdio.h>
#include <fenv.h>
#pragma STDC FENV_ACCESS ON
int main()
{
fesetround (FE_UPWARD);
float x = 0x1.e90026p+4f + 0x1.fp-21;
printf ("x=%a\n", x);
}
yields on cfarm117 with gcc 6.3.0:
zimmerma@cfarm117:~/core-math$ gcc -frounding-math e.c -lm; ./a.out
x=0x1.e90026p+4
whereas one would expect 0x1.e90028p+4.
I don't have access to an ARM machine with a recent version of gcc.