Re: Linux kernel, possible useless continue



Ulrich Eckhardt <doomster@xxxxxxxx> writes:

[...]

for(...)
if(x)
continue;
for(..; .. && !x; ..)
..

The only difference is the initialisation statement in the inner loop, and
for the case we're talking about this small difference doesn't make a
difference overall, in particular not when it is compiled with a
halfway-decent optimiser.

As I understood the original question, it was about code semantics and
not about hypothetical, accidental properties of unknown machine code
generated by a random compiler for an arbitrary architecture. And
wasn't "established theory" that one should rather not code to the
idiosynkrasies of some translation or execution environment, but
instead try to express the intent of the code clearly and leave 'the
gory details' exactly to the compiler?
.



Relevant Pages

  • Re: Linux kernel, possible useless continue
    ... The only difference is the initialisation statement in the inner ... The compiler that is able to digest Linux is not so random ... ... I'm not sure what you are implying with this. ...
    (comp.os.linux.development.system)
  • Re: Linux kernel, possible useless continue
    ... The only difference is the initialisation statement in the inner ... As I understood the original question, it was about code semantics and ... accidental properties of unknown machine code ... The compiler that is able to digest Linux is not so random ... ...
    (comp.os.linux.development.system)
  • Re: rotation problem again
    ... > will be slower than the STL code. ... Second, even where the inner loop is, you haven't identified where the real ... unknown and can cost as little as 0, or as much as about 200 clocks (i.e., we ... > the sort of thing that will be a wash given a decent compiler. ...
    (comp.programming)
  • Re: Need Help: compiling old Fortran program
    ... I wish to point out that I met a great deal of IBM Fortran code in the ... So assuming the compiler compiles this, does the GOTO cycle the inner loop, ...
    (comp.lang.fortran)
  • Re: code optimization
    ... > void myrotate(int dim, pixel *src, pixel *dst) ... the compiler that the two ranges don't overlap. ... Hmm, not much that can be done here. ... to the row in the inner loop in order not to redo this computation for ...
    (comp.lang.c)