lkml.org 
[lkml]   [2008]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Building Kernel with -O0
> > I think a few more cases crept in where it was common to write
> > build time asserts as
> >
> > if (some condition the compiler evaluates at runtime)
> ^^^^^^^
> buildtime

Thank for the correction.

>
> > __error_condition_xyz_is_false();
> >
> > and this obviously relies on the optimizer to build. But these
> > are all slowly moving over the BUILD_BUG_ON() which also doesn't
> > rely on the optimizer, so it's also obsolete.
> >...
>
> The reason why it works for Keith at all seems to be that even with -O0
> gcc already does this kind of optimizations.

What I mean is global optimization over the whole function, like
constant propagation. That is required for some of the more complex
macros like the *_user() ones.

Some expression evaluation is required by the C standard (e.g.
otherwise you couldn't generally declare global arrays with expressions)
While that's technically not required in the body of the function
outside declarations the compiler does it normally. But only inside
a statement.

-Andi


\
 
 \ /
  Last update: 2008-09-09 22:05    [W:0.082 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site