compilation-context-lines is a variable defined in `compile.el'.
Its value is

Display this many lines of leading context before the current message.
If nil and the left fringe is displayed, don't scroll the
compilation output window; an arrow in the left fringe points to
the current message. If nil and there is no left fringe, the message
displays at the top of the window; there is no arrow.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 22.1 of Emacs.