A program optimization method for converting program source code written in a
programming
language into machine language includes steps of: analyzing a target program and
detecting an exception generative instruction, which may generate an exception,
and exception generation detection instructions, which brunches a process to an
exception process when an exception occurrence condition is detected and an exception
has occurred. The method also includes steps of dividing the exception generation
detection instructions into first instructions, for the detection of exception
occurrence conditions, and into second instructions, for branching processes to
the exception process when the exception occurrence conditions are detected; and
establishing dependencies among program instructions, so that when one of the exception
occurrence conditions is detected the process is shifted from a first instruction
to a second instruction, and so that when none of the exception occurrence conditions
are detected, the process is shifted from a first instruction to an exception generative instruction.