https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114631
Bug ID: 114631
Summary: Inconsistent behavior with infinite loops?
Product: gcc
Version: 13.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kubry at gmx dot com
Target Milestone: ---
Dear GCC developers,
First of all, thanks for your work!
This programs works as it is expected (it never stops):
```
#include <iostream>
int main()
{
double doub;
// This line caused a «warning: comparing floating point with == or != is
unsafe [-Wfloat-equal]»
for (doub = 1.1; doub != 1.5; doub = doub + 0.1)
{
std::cout << doub << " ";
}
// "doubles" are not good enough for this program, the program should not
arrive there
std::cout << "double is ok." << std::endl;
}
```
however, if we remove the `std::cout << doub << " ";` line... the program stops
(!).