This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/323] optimized code gives strange floating point results
- From: "ich at az2000 dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2009 20:55:05 -0000
- Subject: [Bug rtl-optimization/323] optimized code gives strange floating point results
- References: <bug-323-4315@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #132 from ich at az2000 dot de 2009-07-22 20:54 -------
So that means that this C++ example could crash under certain circumstances
(depending on how far the compiler is optimising here)?
#include <set>
#define third ((double)atoi("1")/atoi("3"))
int main() {
std::set<double> m;
m.insert(third);
m.insert(third);
return (m.find(third) != m.end()) ? 0 : 1;
}
Because this example only works if it is guaranteed that !(third < third &&
third > third), otherwise it would abort.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323