http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49820

--- Comment #10 from Agner Fog <agner at agner dot org> 2011-07-25 07:43:58 UTC 
---
I still think that a compiler should be predictable and consistent. It is
inconsistent that  a+5<a = false  produces a warning, while  abs(a)<0 = false
does not. Both expressions could be intended overflow checks.

Besides, some compilers produce a warning when a branch condition is always
true or always false. That is sound behavior because it is likely to be a bug.
gcc does not produce a warning when optimizing away something like  if (2+2 !=
4)

Reply via email to