Assigns suitable registers to a plurality of variables. A compiler
converts a source program into instructions for a processor having: a
simultaneously used variable acquisition section which obtains, with
respect to each of a plurality of variables used in the source program,
some of the other variables used simultaneously with the variable; an
allocation sequence generation section which generates a plurality of
allocation sequences between the plurality of variables to allocate each
variable to one of the plurality of registers different from those to
which some of the other variables used simultaneously with the variable
are allocated; an allocation priority acquisition section which obtains
allocation priorities indicating to which one of the plurality of
registers each variable is allocated with priority; and a register
allocation section which allocates the variables to registers in
accordance with an allocation sequence selected on the basis of the
allocation priorities.