"Jie Zhang" <[EMAIL PROTECTED]> writes: > But now gcc seems to optimize it away. For the following function: > > $ cat t.c > #include <limits.h> > void foo (int rc) > { > int x = rc / INT_MAX; > x = 4 / x; > }
I believe we still keep division by zero in general. In your example it gets optimized away because it is dead code. Nothing uses x. Ian