[Bug c/103193] New: gcc for x86_64: wrong code generation: ucomiss instead of comiss
pavel.morozkin at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Nov 11 15:19:56 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103193
Bug ID: 103193
Summary: gcc for x86_64: wrong code generation: ucomiss instead
of comiss
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: pavel.morozkin at gmail dot com
Target Milestone: ---
This code:
#pragma STDC FENV_ACCESS ON
float f;
_Bool b;
f = NAN;
b = f >= f; // ucomiss (wrong), comiss (correct)
results in:
ucomiss xmm0, DWORD PTR [rbp-4]
Per IEEE 754-2008 the ">=" is compareSignalingGreaterEqual, which can be
implemented using comiss.
Notes:
1. Yes, the #pragma STDC FENV_ACCESS ON is not yet supported. Just wanted to
point out that under #pragma STDC FENV_ACCESS ON gcc needs to generate comiss
(not ucomiss).
2. Adding volatile to float f; results in generation of comiss (expected).
More information about the Gcc-bugs
mailing list