https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82775
Bug ID: 82775
Summary: int += float different from int = int + float on Intel
x87
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: tydeman at tybor dot com
Target Milestone: ---
/*
* 3 different answers from 4 "same" expressions for Intel x87 (not sse2).
* 55555580 55555556 55555581 55555581
* CFLAGS="-H -std=gnu11 -O0 -march=native -mfpmath=387 -mieee-fp -fno-builtin
-frounding-math -ffloat-store -fexcess-precision=standard -fsignaling-nans"
*/
#include <stdio.h>
int main(void){
int i1 = 0x55555555;
int i2 = 0x55555555;
int i3 = 0x55555555;
int i4 = 0x55555555;
float one = 1.f;
i1 += one;
i2 += 1.f;
i3 = i3 + one;
i4 = i4 + 1.f;
(void)printf("%x %x %x %x\n", i1, i2, i3, i4);
return 0;
}