To save and restore the contents of registers efficiently and enhance the
execution efficiency of compilation. For a predetermined variable in an
executable program, a determination is made whether or not the variable
lives across invoking of a predetermined function, and if so, the kind of
invoking of the function is determined. The variable is allocated to any
of volatile registers, non-volatile registers, and semi-volatile
registers, based on this determination. Also, it is determined to which
register the variable living across invoking of the function is
allocated, based on an execution frequency of the function when the
executable program is run.