Re: gcc 3.0.2/kernel details (-O issue)

devik (devik@cdi.cz)
Thu, 20 Dec 2001 11:30:21 +0100 (CET)


> Well, you certainly won't get errors, because compiler optimizations
> shouldn't change expected syntax.

not always true, inb() doesn't compile without -O for example.

> -O2 is the standard optimization level for the kernel; everything is
> compiled via it. When developers test their code, nuances that the
> optimization introduce are accepted. Removing the optimization may
> break those expectations. Thus the kernel requires it.

I'm quite comfortable with the requirement, only I can't imagine
code which depends on -O and -O2 difference. Inline assembly is
handled by compiler so it should not break things ..
Maybe externaly linked assembly code ? But optimization level should
not change register usage in calling convention ..
Please can you give me example which kind of code breaks those
expectations ?

Thanks, Martin

-
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/