Re: Structure vs purism ?

Richard B. Johnson (root@chaos.analogic.com)
Wed, 20 Jan 1999 21:58:53 -0500 (EST)


On Wed, 20 Jan 1999, Dave Jones. wrote:

> goto instructions instead of a simple break, assembler
> instructions instead of C code and many other inelegancies.
>
>
> rgrep goto *
>
> Just under 1000 goto's. Some of which are trivial. Goto's to one-liners,
> which are easily tidied. Other files are real snakes-nests. Following the
> trail of goto's as they double back on themselves is no fun for the brain,
> even less so for a CPU, as modern features such as branch prediction are
> misused. (Remember the branch prediction tables are a set size, and can
> only store results of a few jumps).
>

I would 'suggest' that before you post another "statement" like this,
you compile your favorite kernel snippet with the `-S` option and look
at the generated code.

Then 'tidy' up something so it looks good to 'humans' and do the same
thing again. You will then learn why there are strange constructs and,
as you say, a 1000 gotos.

The processor sees the generated code. It does not see the 'C' source.
When you follow the main instruction path, you will note a minimum of
changes in program-flow. This is why there are some many gotos. Also
you will often see code that doesn't seem to make any sense. Look at
the assembly and you will find that there was a very good reason for
it.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.131 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
Wisdom : It's not a Y2K problem. It's a Y2Day problem.

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