[Bug other/42542] g++ -O3 produces incorrect results for less-than operator
------- Comment #1 from hjl dot tools at gmail dot com 2009-12-29 19:41 -------
With -Wall, icc 11.1 complains:
pr42542.cc(10): remark #981: operands are evaluated in unspecified order
return (a < b) ? b : a;
^
detected during instantiation of "_Tp std::accumulate(_InputIterator,
_InputIterator, _Tp, _BinaryOperation) [with _InputIterator=unsigned int *,
_Tp=unsigned int, _BinaryOperation=maximum<unsigned int>]" at line 25
Add "-fno-tree-vectorize" generates the correct result.
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-12-29 19:41:02
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42542
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
Reply to: