Optimiser bug in GCC 4.0.4
June 16th, 2006 tonyg
Q: When is (i != 0) equivalent to
((i >= 0) && ((i >= -1073741824) && (i < 1073741824)))
?
A: When GCC 4.0.4’s -O, -O1, -O2 or -O3 is used on it.
See GCC bug 28042. Particularly interesting is that removing the redundant set of parentheses around the second && avoids the optimiser bug.
Entry Filed under: Technology
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed