1. A compiling method for causing a computer to operate as a compiler apparatus that optimizes exception handling in a target program as a program to be compiled, comprising: detecting, from exception handlers that catch exceptions thrown in said target program, a multiple-catching exception handler catching a plurality of different exceptions and rethrowing the caught exceptions; selecting a set of exceptions that are to be shifted to common processing through rethrow of the exceptions from among said plurality of exceptions caught; throwing a clone exception handler catching the set of exceptions selected by said step of selecting; shifting the set of exceptions to said common processing; said common processing includes catching exceptions that are thrown while processing a function that has been called with a function call outside said function call; said multiple-catching exception handler catches exceptions inside said function call; and said selecting selects said set of exceptions further on condition that depth of nesting of function call from said common processing down to said multiple-catching exception handler is more than a predetermined number.