Patent ID: 8104026

Claim:
A compiler computer apparatus comprising: a processor; a compiler converts a source program into instructions for the processor; a simultaneously used variable acquisition section which obtains, with respect to each of a plurality variables used in the source program, one or more other variables used simultaneously with the each of the plurality variables; an allocation sequence generation section which generates a plurality of allocation sequences between the each of plurality variables to allocate the each of the plurality variables to one of the plurality registers different from registers to which said one or more other variables used simultaneously with said each of the plurality variables are allocated; an allocation priority acquisition section which obtains allocation priorities indicating to which one register from the plurality registers the each of plurality variables is allocated with priority; a register allocation section which allocates the plurality variables to the plurality registers in accordance with one of the allocation sequences selected on basis of the allocation priorities; a register allocation possibility determination section which generates new variables by dividing at least one of the plurality variables into at least two variables if determined that the at least one of the plurality variables cannot be allocated to a registers different from the registers to which said one or more other variables used simultaneously with the each of the plurality of variables are allocated; and an allocation execution section which selects a simultaneously allocation candidate variable from simultaneously allocation candidate variables, one of allocation candidate variables having a maximum of difference between the highest allocation priority and the lowest allocation priority in the allocation priorities with respect to registers not assigned as simultaneously used variable, and assigns the selected simultaneously allocation candidate variable to a register that has the highest allocation priority.