Re: 2.5.8-dj1 : arch/i386/kernel/smpboot.c error

From: Adam Kropelin (akropel1@rochester.rr.com)
Date: Wed Apr 17 2002 - 16:49:13 EST


Rick Stevens wrote:
> Adam Kropelin wrote:
>> Indeed. The optimization step that (presumably) removes the body
>> of the if() must happen after the body has been fully evaluated.
>> Makes sense, I guess, now that I think about it...
>
> Right. If the first condition of a logical AND statement is false,
> the remainder need not be evaluated at all. Hence, the entire if
> statement can (and perhaps should) be eliminated by the compiler,
> since the condition is false.
>
> I didn't see what the actual message from the compiler was, but it
> was probably just a warning.

Thanks for the help, but it was an error, not a warning.

It is caused by invalid code inside the body of the if(). The question
is not what is causing the error but why the compiler is evaluating the
body at all, given that the conditional is always false.

Apparently the body is evaluated prior to the optimizer getting a
chance to nullify the whole construct.

--Adam

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 23 2002 - 22:00:19 EST